RTEMS
5.1
|
RTEMS GPIO API definition. More...
Go to the source code of this file.
Data Structures | |
struct | rtems_gpio_specific_data |
Object containing relevant information for assigning a BSP specific function to a pin. More... | |
struct | rtems_gpio_interrupt_configuration |
Object containing configuration information regarding interrupts. More... | |
struct | rtems_gpio_pin_conf |
Object containing configuration information to request/update a GPIO pin. More... | |
struct | rtems_gpio_multiple_pin_select |
Object containing configuration information to assign GPIO functions to multiple pins at the same time. To be used by BSP code only. More... | |
struct | rtems_gpio_group_definition |
Object containing configuration information to request a GPIO pin group. More... | |
Macros | |
#define | GPIO_LAST_BANK_PINS BSP_GPIO_PIN_COUNT % BSP_GPIO_PINS_PER_BANK |
#define | GPIO_BANK_COUNT BSP_GPIO_PIN_COUNT / BSP_GPIO_PINS_PER_BANK |
#define | GPIO_LAST_BANK_PINS BSP_GPIO_PINS_PER_BANK |
#define | GPIO_SELECT_BANK_COUNT BSP_GPIO_PINS_PER_BANK / BSP_GPIO_PINS_PER_SELECT_BANK |
#define | INTERRUPT_SERVER_PRIORITY 1 |
#define | INTERRUPT_SERVER_STACK_SIZE 2 * RTEMS_MINIMUM_STACK_SIZE |
#define | INTERRUPT_SERVER_MODES RTEMS_TIMESLICE | RTEMS_PREEMPT |
#define | INTERRUPT_SERVER_ATTRIBUTES RTEMS_DEFAULT_ATTRIBUTES |
#define | GPIO_INPUT_ERROR ~0 |
GPIO data structures | |
enum | rtems_gpio_pull_mode { PULL_UP = 1, PULL_DOWN, NO_PULL_RESISTOR } |
The set of possible configurations for a GPIO pull-up resistor. More... | |
enum | rtems_gpio_function { DIGITAL_INPUT = 0, DIGITAL_OUTPUT, BSP_SPECIFIC, NOT_USED } |
The set of possible functions a pin can have. More... | |
enum | rtems_gpio_interrupt { FALLING_EDGE = 0, RISING_EDGE, LOW_LEVEL, HIGH_LEVEL, BOTH_EDGES, BOTH_LEVELS, NONE } |
The set of possible interrupts a GPIO pin can generate. More... | |
enum | rtems_gpio_irq_state { IRQ_HANDLED, IRQ_NONE } |
The set of possible handled states an user-defined interrupt handler can return. More... | |
enum | rtems_gpio_handler_flag { SHARED_HANDLER, UNIQUE_HANDLER } |
The set of flags to specify an user-defined interrupt handler uniqueness on a GPIO pin. More... | |
typedef struct rtems_gpio_group | rtems_gpio_group |
Opaque type for a GPIO pin group. | |
gpio Usage | |
rtems_status_code | rtems_gpio_initialize (void) |
Initializes the GPIO API. More... | |
rtems_gpio_group * | rtems_gpio_create_pin_group (void) |
Instantiates a GPIO pin group. To define the group. More... | |
rtems_status_code | rtems_gpio_define_pin_group (const rtems_gpio_group_definition *group_definition, rtems_gpio_group *group) |
rtems_status_code | rtems_gpio_write_group (uint32_t data, rtems_gpio_group *group) |
Writes a value to the group's digital outputs. The pins order is as defined in the group definition. More... | |
uint32_t | rtems_gpio_read_group (rtems_gpio_group *group) |
Reads the value/level of the group's digital inputs. The pins order is as defined in the group definition. More... | |
rtems_status_code | rtems_gpio_group_bsp_specific_operation (rtems_gpio_group *group, void *arg) |
Performs a BSP specific operation on a group of pins. The pins order is as defined in the group definition. More... | |
rtems_status_code | rtems_gpio_request_configuration (const rtems_gpio_pin_conf *conf) |
Requests a GPIO pin configuration. More... | |
rtems_status_code | rtems_gpio_update_configuration (const rtems_gpio_pin_conf *conf) |
Updates the current configuration of a GPIO pin . More... | |
rtems_status_code | rtems_gpio_multi_set (uint32_t *pin_numbers, uint32_t pin_count) |
Sets multiple output GPIO pins with the logical high. More... | |
rtems_status_code | rtems_gpio_multi_clear (uint32_t *pin_numbers, uint32_t pin_count) |
Sets multiple output GPIO pins with the logical low. More... | |
uint32_t | rtems_gpio_multi_read (uint32_t *pin_numbers, uint32_t pin_count) |
Returns the value (level) of multiple GPIO input pins. More... | |
rtems_status_code | rtems_gpio_set (uint32_t pin_number) |
Sets an output GPIO pin with the logical high. More... | |
rtems_status_code | rtems_gpio_clear (uint32_t pin_number) |
Sets an output GPIO pin with the logical low. More... | |
int | rtems_gpio_get_value (uint32_t pin_number) |
Returns the value (level) of a GPIO input pin. More... | |
rtems_status_code | rtems_gpio_multi_select (const rtems_gpio_pin_conf *pins, uint8_t pin_count) |
rtems_status_code | rtems_gpio_request_pin (uint32_t pin_number, rtems_gpio_function function, bool output_enable, bool logic_invert, void *bsp_specific) |
rtems_status_code | rtems_gpio_resistor_mode (uint32_t pin_number, rtems_gpio_pull_mode mode) |
Configures a single GPIO pin pull resistor. More... | |
rtems_status_code | rtems_gpio_release_pin (uint32_t pin_number) |
Releases a GPIO pin, making it available to be used again. More... | |
rtems_status_code | rtems_gpio_release_configuration (const rtems_gpio_pin_conf *conf) |
Releases a GPIO pin, making it available to be used again. More... | |
rtems_status_code | rtems_gpio_release_multiple_pins (const rtems_gpio_pin_conf *pins, uint32_t pin_count) |
rtems_status_code | rtems_gpio_release_pin_group (rtems_gpio_group *group) |
Releases a GPIO pin group, making the pins used available to be repurposed. More... | |
rtems_status_code | rtems_gpio_debounce_switch (uint32_t pin_number, int ticks) |
Attaches a debouncing function to a given pin/switch. Debouncing is done by requiring a certain number of clock ticks to pass between interrupts. Any interrupt fired too close to the last will be ignored as it is probably the result of an involuntary switch/button bounce after being released. More... | |
rtems_status_code | rtems_gpio_interrupt_handler_install (uint32_t pin_number, rtems_gpio_irq_state(*handler)(void *arg), void *arg) |
Connects a new user-defined interrupt handler to a given pin. More... | |
rtems_status_code | rtems_gpio_enable_interrupt (uint32_t pin_number, rtems_gpio_interrupt interrupt, rtems_gpio_handler_flag flag, bool threaded_handling, rtems_gpio_irq_state(*handler)(void *arg), void *arg) |
rtems_status_code | rtems_gpio_interrupt_handler_remove (uint32_t pin_number, rtems_gpio_irq_state(*handler)(void *arg), void *arg) |
Disconnects an user-defined interrupt handler from the given pin. If in the end there are no more user-defined handlers connected to the pin, interrupts are disabled on the given pin. More... | |
rtems_status_code | rtems_gpio_disable_interrupt (uint32_t pin_number) |
Stops interrupts from being generated on a given GPIO pin and removes the corresponding handler. More... | |
rtems_status_code | rtems_gpio_bsp_multi_set (uint32_t bank, uint32_t bitmask) |
Sets multiple output GPIO pins with the logical high. This must be implemented by each BSP. More... | |
rtems_status_code | rtems_gpio_bsp_multi_clear (uint32_t bank, uint32_t bitmask) |
Sets multiple output GPIO pins with the logical low. This must be implemented by each BSP. More... | |
uint32_t | rtems_gpio_bsp_multi_read (uint32_t bank, uint32_t bitmask) |
Returns the value (level) of multiple GPIO input pins. This must be implemented by each BSP. More... | |
rtems_status_code | rtems_gpio_bsp_specific_group_operation (uint32_t bank, uint32_t *pins, uint32_t pin_count, void *arg) |
rtems_status_code | rtems_gpio_bsp_multi_select (rtems_gpio_multiple_pin_select *pins, uint32_t pin_count, uint32_t select_bank) |
rtems_status_code | rtems_gpio_bsp_set (uint32_t bank, uint32_t pin) |
Sets an output GPIO pin with the logical high. This must be implemented by each BSP. More... | |
rtems_status_code | rtems_gpio_bsp_clear (uint32_t bank, uint32_t pin) |
Sets an output GPIO pin with the logical low. This must be implemented by each BSP. More... | |
uint32_t | rtems_gpio_bsp_get_value (uint32_t bank, uint32_t pin) |
Returns the value (level) of a GPIO input pin. This must be implemented by each BSP. More... | |
rtems_status_code | rtems_gpio_bsp_select_input (uint32_t bank, uint32_t pin, void *bsp_specific) |
Assigns the digital input function to the given pin. This must be implemented by each BSP. More... | |
rtems_status_code | rtems_gpio_bsp_select_output (uint32_t bank, uint32_t pin, void *bsp_specific) |
Assigns the digital output function to the given pin. This must be implemented by each BSP. More... | |
rtems_status_code | rtems_gpio_bsp_select_specific_io (uint32_t bank, uint32_t pin, uint32_t function, void *pin_data) |
Assigns a BSP specific function to the given pin. This must be implemented by each BSP. More... | |
rtems_status_code | rtems_gpio_bsp_set_resistor_mode (uint32_t bank, uint32_t pin, rtems_gpio_pull_mode mode) |
Configures a single GPIO pin pull resistor. This must be implemented by each BSP. More... | |
uint32_t | rtems_gpio_bsp_interrupt_line (rtems_vector_number vector) |
Reads and returns a vector/bank interrupt event line. The bitmask should indicate with a 1 if the corresponding pin as a pending interrupt, or 0 if otherwise. The function should clear the interrupt event line before returning. This must be implemented by each BSP. More... | |
rtems_vector_number | rtems_gpio_bsp_get_vector (uint32_t bank) |
Calculates a vector number for a given GPIO bank. This must be implemented by each BSP. More... | |
rtems_status_code | rtems_gpio_bsp_enable_interrupt (uint32_t bank, uint32_t pin, rtems_gpio_interrupt interrupt) |
Enables interrupts to be generated on a given GPIO pin. This must be implemented by each BSP. More... | |
rtems_status_code | rtems_gpio_bsp_disable_interrupt (uint32_t bank, uint32_t pin, rtems_gpio_interrupt interrupt) |
Stops interrupts from being generated on a given GPIO pin. This must be implemented by each BSP. More... | |
RTEMS GPIO API definition.
enum rtems_gpio_function |
The set of possible functions a pin can have.
Enumerated type to define a pin function.
The set of flags to specify an user-defined interrupt handler uniqueness on a GPIO pin.
Enumerated type to define an interrupt handler shared flag.
enum rtems_gpio_interrupt |
The set of possible interrupts a GPIO pin can generate.
Enumerated type to define a GPIO pin interrupt.
enum rtems_gpio_irq_state |
The set of possible handled states an user-defined interrupt handler can return.
Enumerated type to define an interrupt handler handled state.
enum rtems_gpio_pull_mode |
The set of possible configurations for a GPIO pull-up resistor.
Enumerated type to define the possible pull-up resistor configurations for a GPIO pin.
rtems_status_code rtems_gpio_bsp_clear | ( | uint32_t | bank, |
uint32_t | pin | ||
) |
Sets an output GPIO pin with the logical low. This must be implemented by each BSP.
[in] | bank | GPIO bank number. |
[in] | pin | GPIO pin number within the given bank. |
RTEMS_SUCCESSFUL | Pin was cleared successfully. |
RTEMS_UNSATISFIED | Could not clear the given pin. |
rtems_status_code rtems_gpio_bsp_disable_interrupt | ( | uint32_t | bank, |
uint32_t | pin, | ||
rtems_gpio_interrupt | interrupt | ||
) |
Stops interrupts from being generated on a given GPIO pin. This must be implemented by each BSP.
[in] | bank | GPIO bank number. |
[in] | pin | GPIO pin number within the given bank. |
[in] | active_interrupt | Interrupt type currently active on this pin. |
RTEMS_SUCCESSFUL | Interrupt successfully disabled for this pin. |
RTEMS_UNSATISFIED | Could not disable interrupts on this pin. |
rtems_status_code rtems_gpio_bsp_enable_interrupt | ( | uint32_t | bank, |
uint32_t | pin, | ||
rtems_gpio_interrupt | interrupt | ||
) |
Enables interrupts to be generated on a given GPIO pin. This must be implemented by each BSP.
[in] | bank | GPIO bank number. |
[in] | pin | GPIO pin number within the given bank. |
[in] | interrupt | Type of interrupt to enable for the pin. |
RTEMS_SUCCESSFUL | Interrupt successfully enabled for this pin. |
RTEMS_UNSATISFIED | Could not enable the interrupt on the pin. |
uint32_t rtems_gpio_bsp_get_value | ( | uint32_t | bank, |
uint32_t | pin | ||
) |
Returns the value (level) of a GPIO input pin. This must be implemented by each BSP.
[in] | bank | GPIO bank number. |
[in] | pin | GPIO pin number within the given bank. |
The | function must return 0 if the pin level is a logical low, or non zero if it has a logical high. |
GPIO_INPUT_ERROR | Could not read the pin level. |
rtems_vector_number rtems_gpio_bsp_get_vector | ( | uint32_t | bank | ) |
Calculates a vector number for a given GPIO bank. This must be implemented by each BSP.
[in] | bank | GPIO bank number. |
The | corresponding rtems_vector_number. |
uint32_t rtems_gpio_bsp_interrupt_line | ( | rtems_vector_number | vector | ) |
Reads and returns a vector/bank interrupt event line. The bitmask should indicate with a 1 if the corresponding pin as a pending interrupt, or 0 if otherwise. The function should clear the interrupt event line before returning. This must be implemented by each BSP.
[in] | vector | GPIO vector/bank. |
Bitmask | (max 32-bit) representing a GPIO bank, where a bit set indicates an active interrupt on that pin. |
rtems_status_code rtems_gpio_bsp_multi_clear | ( | uint32_t | bank, |
uint32_t | bitmask | ||
) |
Sets multiple output GPIO pins with the logical low. This must be implemented by each BSP.
[in] | bank | GPIO bank number. |
[in] | bitmask | Bitmask of GPIO pins to clear in the given bank. |
RTEMS_SUCCESSFUL | All pins were cleared successfully. |
RTEMS_UNSATISFIED | Could not clear at least one of the pins. |
uint32_t rtems_gpio_bsp_multi_read | ( | uint32_t | bank, |
uint32_t | bitmask | ||
) |
Returns the value (level) of multiple GPIO input pins. This must be implemented by each BSP.
[in] | bank | GPIO bank number. |
[in] | bitmask | Bitmask of GPIO pins to read in the given bank. |
The | function must return a bitmask with the values of the corresponding pins. 0 for logical low and 1 for logical high. |
GPIO_INPUT_ERROR | Could not read at least one pin level. |
rtems_status_code rtems_gpio_bsp_multi_set | ( | uint32_t | bank, |
uint32_t | bitmask | ||
) |
Sets multiple output GPIO pins with the logical high. This must be implemented by each BSP.
[in] | bank | GPIO bank number. |
[in] | bitmask | Bitmask of GPIO pins to set in the given bank. |
RTEMS_SUCCESSFUL | All pins were set successfully. |
RTEMS_UNSATISFIED | Could not set at least one of the pins. |
rtems_status_code rtems_gpio_bsp_select_input | ( | uint32_t | bank, |
uint32_t | pin, | ||
void * | bsp_specific | ||
) |
Assigns the digital input function to the given pin. This must be implemented by each BSP.
[in] | bank | GPIO bank number. |
[in] | pin | GPIO pin number within the given bank. |
[in] | bsp_specific | Pointer to a BSP defined structure with BSP-specific data. |
RTEMS_SUCCESSFUL | Function was assigned successfully. |
RTEMS_UNSATISFIED | Could not assign the function to the pin. |
rtems_status_code rtems_gpio_bsp_select_output | ( | uint32_t | bank, |
uint32_t | pin, | ||
void * | bsp_specific | ||
) |
Assigns the digital output function to the given pin. This must be implemented by each BSP.
[in] | bank | GPIO bank number. |
[in] | pin | GPIO pin number within the given bank. |
[in] | bsp_specific | Pointer to a BSP defined structure with BSP-specific data. |
RTEMS_SUCCESSFUL | Function was assigned successfully. |
RTEMS_UNSATISFIED | Could not assign the function to the pin. |
rtems_status_code rtems_gpio_bsp_select_specific_io | ( | uint32_t | bank, |
uint32_t | pin, | ||
uint32_t | function, | ||
void * | pin_data | ||
) |
Assigns a BSP specific function to the given pin. This must be implemented by each BSP.
[in] | bank | GPIO bank number. |
[in] | pin | GPIO pin number within the given bank. |
[in] | function | BSP defined GPIO function. |
[in] | pin_data | Pointer to a BSP defined structure with BSP-specific data. |
RTEMS_SUCCESSFUL | Function was assigned successfully. |
RTEMS_UNSATISFIED | Could not assign the function to the pin. |
rtems_status_code rtems_gpio_bsp_set | ( | uint32_t | bank, |
uint32_t | pin | ||
) |
Sets an output GPIO pin with the logical high. This must be implemented by each BSP.
[in] | bank | GPIO bank number. |
[in] | pin | GPIO pin number within the given bank. |
RTEMS_SUCCESSFUL | Pin was set successfully. |
RTEMS_UNSATISFIED | Could not set the given pin. |
rtems_status_code rtems_gpio_bsp_set_resistor_mode | ( | uint32_t | bank, |
uint32_t | pin, | ||
rtems_gpio_pull_mode | mode | ||
) |
Configures a single GPIO pin pull resistor. This must be implemented by each BSP.
[in] | bank | GPIO bank number. |
[in] | pin | GPIO pin number within the given bank. |
[in] | mode | The pull resistor mode. |
RTEMS_SUCCESSFUL | Pull resistor successfully configured. |
RTEMS_UNSATISFIED | Could not set the pull mode. |
rtems_status_code rtems_gpio_clear | ( | uint32_t | pin_number | ) |
Sets an output GPIO pin with the logical low.
[in] | pin_number | GPIO pin number. |
RTEMS_SUCCESSFUL | Pin was cleared successfully. |
RTEMS_INVALID_ID | Pin number is invalid. |
RTEMS_NOT_CONFIGURED | The received pin is not configured as a digital output. |
RTEMS_UNSATISFIED | Could not clear the GPIO pin. |
rtems_gpio_group* rtems_gpio_create_pin_group | ( | void | ) |
Instantiates a GPIO pin group. To define the group.
rtems_gpio_group | pointer. |
rtems_status_code rtems_gpio_debounce_switch | ( | uint32_t | pin_number, |
int | ticks | ||
) |
Attaches a debouncing function to a given pin/switch. Debouncing is done by requiring a certain number of clock ticks to pass between interrupts. Any interrupt fired too close to the last will be ignored as it is probably the result of an involuntary switch/button bounce after being released.
[in] | pin_number | GPIO pin number. |
[in] | ticks | Minimum number of clock ticks that must pass between interrupts so it can be considered a legitimate interrupt. |
RTEMS_SUCCESSFUL | Debounce function successfully attached to the pin. |
RTEMS_INVALID_ID | Pin number is invalid. |
RTEMS_NOT_CONFIGURED | The current pin is not configured as a digital input, hence it can not be connected to a switch, or interrupts are not enabled for this pin. |
rtems_status_code rtems_gpio_disable_interrupt | ( | uint32_t | pin_number | ) |
Stops interrupts from being generated on a given GPIO pin and removes the corresponding handler.
[in] | pin_number | GPIO pin number. |
RTEMS_SUCCESSFUL | Interrupt successfully disabled for this pin. |
RTEMS_INVALID_ID | Pin number is invalid. |
RTEMS_NOT_CONFIGURED | Pin has no active interrupts. |
RTEMS_UNSATISFIED | Could not remove the current interrupt handler, could not recognize the current active interrupt on this pin or could not disable interrupts on this pin. |
int rtems_gpio_get_value | ( | uint32_t | pin_number | ) |
Returns the value (level) of a GPIO input pin.
[in] | pin_number | GPIO pin number. |
The | function returns 0 or 1 depending on the pin current logical value. |
-1 | Pin number is invalid, or not a digital input pin. |
rtems_status_code rtems_gpio_group_bsp_specific_operation | ( | rtems_gpio_group * | group, |
void * | arg | ||
) |
Performs a BSP specific operation on a group of pins. The pins order is as defined in the group definition.
[in] | group | Reference to the group. |
[in] | arg | Pointer to a BSP defined structure with BSP-specific data. This field is handled by the BSP. |
RTEMS_SUCCESSFUL | Operation completed with success. |
RTEMS_NOT_DEFINED | Group has no BSP specific pins, or the BSP does not support BSP specific operations for groups. |
RTEMS_UNSATISFIED | Could not operate on at least one of the pins. |
rtems_status_code rtems_gpio_initialize | ( | void | ) |
Initializes the GPIO API.
RTEMS_SUCCESSFUL | API successfully initialized. |
* |
rtems_status_code rtems_gpio_interrupt_handler_install | ( | uint32_t | pin_number, |
rtems_gpio_irq_state(*)(void *arg) | handler, | ||
void * | arg | ||
) |
Connects a new user-defined interrupt handler to a given pin.
[in] | pin_number | GPIO pin number. |
[in] | handler | Pointer to a function that will be called every time the enabled interrupt for the given pin is generated. This function must return information about its handled/unhandled state. |
[in] | arg | Void pointer to the arguments of the user-defined handler. |
RTEMS_SUCCESSFUL | Handler successfully connected to this pin. |
RTEMS_NO_MEMORY | Could not connect more user-defined handlers to the given pin. |
RTEMS_NOT_CONFIGURED | The given pin has no interrupt configured. |
RTEMS_INVALID_ID | Pin number is invalid. |
RTEMS_TOO_MANY | The pin's current handler is set as unique. |
RTEMS_RESOURCE_IN_USE | The current user-defined handler for this pin is unique. |
rtems_status_code rtems_gpio_interrupt_handler_remove | ( | uint32_t | pin_number, |
rtems_gpio_irq_state(*)(void *arg) | handler, | ||
void * | arg | ||
) |
Disconnects an user-defined interrupt handler from the given pin. If in the end there are no more user-defined handlers connected to the pin, interrupts are disabled on the given pin.
[in] | pin_number | GPIO pin number. |
[in] | handler | Pointer to the user-defined handler |
[in] | arg | Void pointer to the arguments of the user-defined handler. |
RTEMS_SUCCESSFUL | Handler successfully disconnected from this pin. |
RTEMS_INVALID_ID | Pin number is invalid. |
RTEMS_NOT_CONFIGURED | Pin has no active interrupts. |
* |
rtems_status_code rtems_gpio_multi_clear | ( | uint32_t * | pin_numbers, |
uint32_t | pin_count | ||
) |
Sets multiple output GPIO pins with the logical low.
[in] | pin_numbers | Array with the GPIO pin numbers to clear. |
[in] | count | Number of GPIO pins to clear. |
RTEMS_SUCCESSFUL | All pins were cleared successfully. |
RTEMS_INVALID_ID | At least one pin number is invalid. |
RTEMS_NOT_CONFIGURED | At least one of the received pins is not configured as a digital output. |
RTEMS_UNSATISFIED | Could not clear the GPIO pins. |
uint32_t rtems_gpio_multi_read | ( | uint32_t * | pin_numbers, |
uint32_t | pin_count | ||
) |
Returns the value (level) of multiple GPIO input pins.
[in] | pin_numbers | Array with the GPIO pin numbers to read. |
[in] | count | Number of GPIO pins to read. |
Bitmask | with the values of the corresponding pins. 0 for logical low and 1 for logical high. |
GPIO_INPUT_ERROR | Could not read at least one pin level. |
rtems_status_code rtems_gpio_multi_set | ( | uint32_t * | pin_numbers, |
uint32_t | pin_count | ||
) |
Sets multiple output GPIO pins with the logical high.
[in] | pin_numbers | Array with the GPIO pin numbers to set. |
[in] | count | Number of GPIO pins to set. |
RTEMS_SUCCESSFUL | All pins were set successfully. |
RTEMS_INVALID_ID | At least one pin number is invalid. |
RTEMS_NOT_CONFIGURED | At least one of the received pins is not configured as a digital output. |
RTEMS_UNSATISFIED | Could not set the GPIO pins. |
uint32_t rtems_gpio_read_group | ( | rtems_gpio_group * | group | ) |
Reads the value/level of the group's digital inputs. The pins order is as defined in the group definition.
[in] | group | Reference to the group. |
The | function returns a 32-bit bitmask with the group's input pins current logical values. |
GPIO_INPUT_ERROR | Group has no input pins. |
rtems_status_code rtems_gpio_release_configuration | ( | const rtems_gpio_pin_conf * | conf | ) |
Releases a GPIO pin, making it available to be used again.
[in] | conf | GPIO pin configuration to be released. |
RTEMS_SUCCESSFUL | Pin successfully disabled. |
RTEMS_UNSATISFIED | Pin configuration is NULL. |
* |
rtems_status_code rtems_gpio_release_pin | ( | uint32_t | pin_number | ) |
Releases a GPIO pin, making it available to be used again.
[in] | pin_number | GPIO pin number. |
RTEMS_SUCCESSFUL | Pin successfully disabled. |
RTEMS_INVALID_ID | Pin number is invalid. |
* | Could not disable an active interrupt on this pin, |
rtems_status_code rtems_gpio_release_pin_group | ( | rtems_gpio_group * | group | ) |
Releases a GPIO pin group, making the pins used available to be repurposed.
[in] | conf | GPIO pin configuration to be released. |
RTEMS_SUCCESSFUL | Pins successfully disabled. |
* |
rtems_status_code rtems_gpio_request_configuration | ( | const rtems_gpio_pin_conf * | conf | ) |
Requests a GPIO pin configuration.
[in] | conf | rtems_gpio_pin_conf structure filled with the pin information and desired configurations. |
RTEMS_SUCCESSFUL | Pin was configured successfully. |
RTEMS_UNSATISFIED | Could not satisfy the given configuration. |
rtems_status_code rtems_gpio_resistor_mode | ( | uint32_t | pin_number, |
rtems_gpio_pull_mode | mode | ||
) |
Configures a single GPIO pin pull resistor.
[in] | pin_number | GPIO pin number. |
[in] | mode | The pull resistor mode. |
RTEMS_SUCCESSFUL | Pull resistor successfully configured. |
RTEMS_INVALID_ID | Pin number is invalid. |
RTEMS_UNSATISFIED | Could not set the pull mode. |
rtems_status_code rtems_gpio_set | ( | uint32_t | pin_number | ) |
Sets an output GPIO pin with the logical high.
[in] | pin_number | GPIO pin number. |
RTEMS_SUCCESSFUL | Pin was set successfully. |
RTEMS_INVALID_ID | Pin number is invalid. |
RTEMS_NOT_CONFIGURED | The received pin is not configured as a digital output. |
RTEMS_UNSATISFIED | Could not set the GPIO pin. |
rtems_status_code rtems_gpio_update_configuration | ( | const rtems_gpio_pin_conf * | conf | ) |
Updates the current configuration of a GPIO pin .
[in] | conf | rtems_gpio_pin_conf structure filled with the pin information and desired configurations. |
RTEMS_SUCCESSFUL | Pin configuration was updated successfully. |
RTEMS_INVALID_ID | Pin number is invalid. |
RTEMS_NOT_CONFIGURED | The pin is not being used. |
RTEMS_UNSATISFIED | Could not update the pin's configuration. |
rtems_status_code rtems_gpio_write_group | ( | uint32_t | data, |
rtems_gpio_group * | group | ||
) |
Writes a value to the group's digital outputs. The pins order is as defined in the group definition.
[in] | data | Data to write/send. |
[in] | group | Reference to the group. |
RTEMS_SUCCESSFUL | Data successfully written. |
RTEMS_NOT_DEFINED | Group has no output pins. |
RTEMS_UNSATISFIED | Could not operate on at least one of the pins. |