Hi,
I am new to embedded programming. I was looking at an example in S32 DS with name 'hello'. I am using S32K144_100 EVB.
Can anyone explain
a). The meaning of (1<<PTC12) or ~(1<<PTC12) i.e. 1<<PTXn, where 'X' denotes port and 'n' denotes pin number.
b). Is it okay to first declare a pin as input/output and then configure it as GPIO.
e.g.
PTC->PDDR &= ~(1<<PTC12); /* Port C12: Data Direction= input (default) */
PORTC->PCR[12] = 0x00000110; /* Port C12: MUX = GPIO, input filter enabled */
Thanks.
Shashank anand
Hi,
You can start with EVB schematic - to find out where are for example LEDs connected
https://www.nxp.com/downloads/en/schematics/S32K144EVB-SCH.pdf
For more details about peripherals, registers and so on you can look into reference manual:
https://www.nxp.com/docs/en/reference-manual/S32K-RM.pdf
Good starting point for bitwise operations is for example here - Tutorial : Embedded programming basics in C - bitwise operations
Jiri