AIROC™ BTSDK v4.9 - Documentation | ||||
Define functions to access general purpose I/O (GPIO) ports. More...
Data Structures | |
struct | GpioRegistration |
Typedefs | |
typedef struct GpioRegistration | GpioRegistration |
Enumerations | |
enum | { GPIO_NUM_PORTS = GPIO_NUMBER_OF_PORTS, GPIO_MAX_NUM_PINS_PER_PORT = GPIO_MAX_PINS_PER_PORT, GPIO_NUM_PINS = GPIO_NUMBER_OF_PINS } |
Defines a GPIO driver class. More... | |
enum | { GPIO_PIN_P0 = 0, GPIO_PIN_P1, GPIO_PIN_P2, GPIO_PIN_P3, GPIO_PIN_P4, GPIO_PIN_P5, GPIO_PIN_P6, GPIO_PIN_P7, GPIO_PIN_P8, GPIO_PIN_P9, GPIO_PIN_P10, GPIO_PIN_P11, GPIO_PIN_P12, GPIO_PIN_P13, GPIO_PIN_P14, GPIO_PIN_P15, GPIO_PIN_P16, GPIO_PIN_P17, GPIO_PIN_P18, GPIO_PIN_P19, GPIO_PIN_P20, GPIO_PIN_P21, GPIO_PIN_P22, GPIO_PIN_P23, GPIO_PIN_P24, GPIO_PIN_P25, GPIO_PIN_P26, GPIO_PIN_P27, GPIO_PIN_P28, GPIO_PIN_P29, GPIO_PIN_P30, GPIO_PIN_P31, GPIO_PIN_P32, GPIO_PIN_P33, GPIO_PIN_P34, GPIO_PIN_P35, GPIO_PIN_P36, GPIO_PIN_P37, GPIO_PIN_P38, GPIO_PIN_P39 } |
GPIO Logical pin numbers. | |
enum | { GPIO_EDGE_TRIGGER_MASK = 0x0001, GPIO_EDGE_TRIGGER = 0x0001, GPIO_LEVEL_TRIGGER = 0x0000, GPIO_TRIGGER_POLARITY_MASK = 0x0002, GPIO_TRIGGER_NEG = 0x0002, GPIO_DUAL_EDGE_TRIGGER_MASK = 0x0004, GPIO_EDGE_TRIGGER_BOTH = 0x0004, GPIO_EDGE_TRIGGER_SINGLE = 0x0000, GPIO_INTERRUPT_ENABLE_MASK = 0x0008, GPIO_INTERRUPT_ENABLE = 0x0008, GPIO_INTERRUPT_DISABLE = 0x0000, GPIO_EN_INT_MASK = GPIO_EDGE_TRIGGER_MASK | GPIO_TRIGGER_POLARITY_MASK | GPIO_DUAL_EDGE_TRIGGER_MASK | GPIO_INTERRUPT_ENABLE_MASK, GPIO_EN_INT_LEVEL_HIGH = GPIO_INTERRUPT_ENABLE | GPIO_LEVEL_TRIGGER, GPIO_EN_INT_LEVEL_LOW = GPIO_INTERRUPT_ENABLE | GPIO_LEVEL_TRIGGER | GPIO_TRIGGER_NEG, GPIO_EN_INT_RISING_EDGE = GPIO_INTERRUPT_ENABLE | GPIO_EDGE_TRIGGER, GPIO_EN_INT_FALLING_EDGE = GPIO_INTERRUPT_ENABLE | GPIO_EDGE_TRIGGER | GPIO_TRIGGER_NEG, GPIO_EN_INT_BOTH_EDGE = GPIO_INTERRUPT_ENABLE | GPIO_EDGE_TRIGGER | GPIO_EDGE_TRIGGER_BOTH, GPIO_INPUT_ENABLE = 0x0000, GPIO_OUTPUT_DISABLE = 0x0000, GPIO_OUTPUT_ENABLE = 0x4000, GPIO_KS_OUTPUT_ENABLE = 0x0010, GPIO_OUTPUT_FN_SEL_MASK = 0x0030, GPIO_OUTPUT_FN_SEL_SHIFT = 4, GPIO_GLOBAL_INPUT_ENABLE = 0x0000, GPIO_GLOBAL_INPUT_DISABLE = 0x0040, GPIO_PULL_UP_DOWN_NONE = 0x0000, GPIO_PULL_UP = 0x0400, GPIO_PULL_DOWN = 0x0200, GPIO_INPUT_DISABLE = 0x0600, GPIO_DRIVE_SEL_MASK = 0x0800, GPIO_DRIVE_SEL_LOWEST = 0x0000, GPIO_DRIVE_SEL_MIDDLE_0 = 0x0000, GPIO_DRIVE_SEL_MIDDLE_1 = 0x0800, GPIO_DRIVE_SEL_HIGHEST = 0x0800, GPIO_HYSTERESIS_MASK = 0x2000, GPIO_HYSTERESIS_ON = 0x2000, GPIO_HYSTERESIS_OFF = 0x0000 } |
The following enum defines the constant values for the GPIO driver. More... | |
enum | tGPIO_PIN_OUTPUT_CONFIG { GPIO_PIN_OUTPUT_LOW, GPIO_PIN_OUTPUT_HIGH } |
Pin output config. | |
enum | tGPIO_PIN_INPUT_VALUE { GPIO_PIN_INPUT_LOW, GPIO_PIN_INPUT_HIGH } |
Pin input values. | |
Functions | |
void | gpio_init (void) |
void | gpio_configurePin (BYTE port, BYTE pin, UINT16 config, BYTE outputVal) |
ConfigurePin maps a GPIO pin to a config value. | |
void | gpio_configurePinWithSingleBytePortPinNum (BYTE gpio, UINT16 config, BYTE outputVal) |
void | gpio_configureAll (void) |
Configures all GPIO pins according to the values from the configuration record. | |
UINT16 | gpio_getPinConfig (BYTE port, BYTE pin) |
Retrieve the configuration of the specified pin. | |
void | gpio_setPinOutput (BYTE port, BYTE pin, BYTE val) |
Set pin output for a specific pin. | |
void | gpio_lhlInterrupt (void) |
void | gpio_registerForInterrupt (UINT16 masks[], void(*userfn)(void *, UINT8), void *userdata) |
BOOL32 | gpio_validatePortPin (BYTE port, BYTE pin) |
BYTE | gpio_getPinOutput (BYTE port, BYTE pin) |
Get the programmed output value of a pin. More... | |
BYTE | gpio_getPinInput (BYTE port, BYTE pin) |
Read the current value at a pin. More... | |
BYTE | gpio_getPinInterruptStatus (BYTE port, BYTE pin) |
Get the interrupt status of a pin. | |
void | gpio_clearPinInterruptStatus (BYTE port, BYTE pin) |
Clear the interrupt status of a pin. | |
UINT16 | gpio_getPortOutput (BYTE port) |
Get the programmed output value of a port. More... | |
void | gpio_setPortOutput (BYTE port, UINT16 val) |
Set the output value of a port. More... | |
UINT16 | gpio_getPortInput (BYTE port) |
Read the current value at a port. More... | |
UINT16 | gpio_getPortInterruptStatus (BYTE port) |
Get the interrupt status of a port. More... | |
void | gpio_clearPortInterruptStatus (BYTE port, UINT16 mask) |
Clear the interrupt status of multiple bits in a port. More... | |
void | gpio_configurePortPins (BYTE port, BYTE startPin, BYTE endPin, UINT16 Config, BYTE outputVal) |
void | gpio_inputDisableAll (void) |
Define functions to access general purpose I/O (GPIO) ports.