GPIODirModeSet
函数名 | GPIODirModeSet |
---|---|
原函数 | void GPIODirModeSet(unsigned int baseAdd, unsigned int pinNumber, unsigned int pinDir) |
功能 | configures the direction of a pin as input or output. |
参数 | baseAdd:The memory address of the GPIO instance being used. pinNumber:The serial number of the GPIO pin. pinDir:The direction to be set for the pin.This can take the values: GPIO_DIR_INPUT, for configuring the pin as input. GPIO_DIR_OUTPUT, for configuring the pin as output. |
返回值 | None |
备注 | Here we write to the DIRn register. Writing a logic 1 configures the pin as input and writing logic 0 as output. By default, all the pins are set as input pins. |
GPIODirModeGet
函数名 | GPIODirModeGet |
---|---|
原函数 | unsigned int GPIODirModeGet(unsigned int baseAdd, unsigned int pinNumber) |
功能 | gets the direction of a pin which has been configured as an input or an output pin. |
参数 | baseAdd:The memory address of the GPIO instance being used. pinNumber:The serial number of the GPIO pin. |
返回值 | pinDir:The direction to be set for the pin.This can take the values: GPIO_DIR_INPUT, for configuring the pin as input. GPIO_DIR_OUTPUT, for configuring the pin as output. |
备注 |
GPIOPinWrite
函数名 | GPIOPinWrite |
---|---|
原函数 | GPIOPinWrite(unsigned int baseAdd, unsigned int pinNumber, unsigned int bitValue) |
功能 | writes a logic 1 or a logic 0 to the specified pin. |
参数 | baseAdd:The memory address of the GPIO instance being used. pinNumber:The serial number of the GPIO pin. bitValue This signifies whether to write a logic 0 or logic 1 to the specified pin.This variable can take any of the following two value: GPIO_PIN_LOW, which indicates to clear(logic 0) the bit. GPIO_PIN_HIGH, which indicates to set(logic 1) the bit. |
返回值 | none |
备注 |
GPIOPinRead
函数名 | GPIOPinRead |
---|---|
原函数 | int GPIOPinRead(unsigned int baseAdd, unsigned int pinNumber) |
功能 | reads the value(logic level) of an input or an output pin. |
参数 | baseAdd:The memory address of the GPIO instance being used. pinNumber:The serial number of the GPIO pin. |
返回值 | This signifies whether to write a logic 0 or logic 1 to the specified pin.This variable can take any of the following two value: GPIO_PIN_LOW, which indicates to clear(logic 0) the bit. GPIO_PIN_HIGH, which indicates to set(logic 1) the bit. |
备注 | Configuring the trigger level type for generating interrupts is not enough for the GPIO module to generate interrupts. The user should also enable the interrupt generation capability for the bank to which the pin belongs to. Use the function GPIOBankIntEnable() to do the same. |
GPIOIntTypeSet
函数名 | GPIOIntTypeSet |
---|---|
原函数 | void GPIOIntTypeSet(unsigned int baseAdd, unsigned int pinNumber, unsigned int intType) |
功能 | configures the trigger level type for which an interrupt is required to occur. |
参数 | baseAdd:The memory address of the GPIO instance being used. pinNumber:The serial number of the GPIO pin. intType:This specifies the trigger level type. This can take one of the following four values: GPIO_INT_TYPE_NOEDGE, to not generate any interrupts. GPIO_INT_TYPE_FALLEDGE, to generate an interrupt on the falling edge of a signal on that pin. GPIO_INT_TYPE_RISEDGE, to generate an interrupt on the rising edge of a signal on that pin. GPIO_INT_TYPE_BOTHEDGE, to generate interrupts on both rising and falling edges of a signal on that pin. |
返回值 | none |
备注 | Configuring the trigger level type for generating interrupts is not enough for the GPIO module to generate interrupts. The user should also enable the interrupt generation capability for the bank to which the pin belongs to. Use the function GPIOBankIntEnable() to do the same. |
GPIOIntTypeGet
函数名 | GPIOIntTypeGet |
---|---|
原函数 | unsigned int GPIOIntTypeGet(unsigned int baseAdd, unsigned int pinNumber) |
功能 | reads the trigger level type being set for interrupts to be generated. |
参数 | baseAdd:The memory address of the GPIO instance being used. pinNumber:The serial number of the GPIO pin. |
返回值 | This returns a value which indicates the type of trigger level type being set. One of the following values is returned: GPIO_INT_TYPE_NOEDGE, to not generate any interrupts. GPIO_INT_TYPE_FALLEDGE, to generate an interrupt on the falling edge of a signal on that pin. GPIO_INT_TYPE_RISEDGE, to generate an interrupt on the rising edge of a signal on that pin. GPIO_INT_TYPE_BOTHEDGE, to generate interrupts on both rising and falling edges of a signal on that pin. |
备注 |
GPIOPinIntStatus
函数名 | GPIOPinIntStatus |
---|---|
原函数 | unsigned int GPIOPinIntStatus(unsigned int baseAdd, unsigned int pinNumber) |
功能 | determines the status of interrupt on a specified pin. |
参数 | baseAdd:The memory address of the GPIO instance being used. pinNumber:The serial number of the GPIO pin. |
返回值 | This returns a value which expresses the status of an interrupt raised over the specified pin. GPIO_INT_NOPEND, if no interrupts are left to be serviced. GPIO_INT_PEND, if the interrupt raised over that pin is yet to be cleared and serviced. |
备注 |
GPIOPinIntClear
函数名 | GPIOPinIntClear |
---|---|
原函数 | void GPIOPinIntClear(unsigned int baseAdd, unsigned int pinNumber) |
功能 | clears the interrupt status of the pin being accessed. |
参数 | baseAdd:The memory address of the GPIO instance being used. pinNumber:The serial number of the GPIO pin. |
返回值 | none |
备注 |
GPIOBankIntEnable
函数名 | GPIOBankIntEnable |
---|---|
原函数 | void GPIOBankIntEnable(unsigned int baseAdd, unsigned int bankNumber) |
功能 | enables the interrupt generation capability for the bank of GPIO pins specified. |
参数 | baseAdd:The memory address of the GPIO instance being used. bankNumber:This is the bank for whose pins interrupt generation capability needs to be enabled. |
返回值 | none |
备注 |
GPIOBankIntDisable
函数名 | GPIOBankIntDisable |
---|---|
原函数 | void GPIOBankIntDisable(unsigned int baseAdd, unsigned int bankNumber) |
功能 | disables the interrupt generation capability for the bank of GPIO pins specified. |
参数 | baseAdd:The memory address of the GPIO instance being used. bankNumber:This is the bank for whose pins interrupt generation capability needs to be disabled. |
返回值 | none |
备注 |
GPIOBankPinsWrite
函数名 | GPIOBankPinsWrite |
---|---|
原函数 | void GPIOBankPinsWrite(unsigned int baseAdd, unsigned int bankNumber, unsigned int setPins, unsigned int clrPins) |
功能 | is used to collectively set and collectively clear the specified bits. |
参数 | baseAdd:The memory address of the GPIO instance being used. bankNumber:This is the bank for whose pins interrupt generation capability needs to be modified. setPins:The bit-mask of the pins whose values have to be set. This could be the bitwise OR of the following macros: GPIO_BANK_PIN_n where n >= 0 and n <= 15. clrPins:The bit-mask of the pins whose values have to be cleared. This could be the bitwise OR of the following macros: GPIO_BANK_PIN_n where n >= 0 and n <= 15. |
返回值 | none |
备注 |