S32DS general query

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

S32DS general query

1,242 次查看
shashankanand
Contributor I

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

标签 (1)
标记 (2)
0 项奖励
回复
1 回复

1,056 次查看
jiri_kral
NXP Employee
NXP Employee

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