我感觉是一个意思,都是选择外设的功能。但是Table 4-3. GPIO Pad Configuration Examples中GPIOAPSEL都可以不用设置。怎么理解?
kuntay:
回复 Forrest:
好久不见forrest,我把GPIOAPSEL的设置去掉可以了
我感觉是一个意思,都是选择外设的功能。但是Table 4-3. GPIO Pad Configuration Examples中GPIOAPSEL都可以不用设置。怎么理解?
Forrest:
回复 kuntay:
什么叫做“把GPIOAPSEL的设置去掉可以了”?
下面是GPIO.H的节选。bit 7 to bit 4代表Alternate port ,为一时说明该功能需要把GPIOAPSEL置一。
//*****************************************************************************
// Values that can be passed to GPIOPinConfigure as the ulPinConfig parameter.
// ulPinConfig := bit 31 to bit 24 -> not used
// bit 23 to bit 16 -> base address of GPIO port
// bit 15 to bit 8 -> shift factor for PMCx absolute value
// (given by bits 15-8)
// bit 7 to bit 4 -> Alternate port select register value
// (this register or alternate port vs
// primary port is introduced in F28M35x)
// bit 3 to bit 0 -> PMCx value of GPIOPCTL register value
//*****************************************************************************
// GPIO pin A0
#define GPIO_PA0_U0RX 0x00000001
#define GPIO_PA0_I2C1SCL 0x00000008
#define GPIO_PA0_U1RX 0x00000009
// GPIO pin A1
#define GPIO_PA1_U0TX 0x00000401
#define GPIO_PA1_I2C1SDA 0x00000408
#define GPIO_PA1_U1TX 0x00000409
#define GPIO_PA1_SSI1FSS 0x0000041f
// GPIO pin A2
#define GPIO_PA2_SSI0CLK 0x00000801
#define GPIO_PA2_MIITXD2 0x00000803
#define GPIO_PA2_U1CTS 0x0000081e