![]() |
S32 SDK
|
Common services for FlexIO drivers.
The Flexio Common driver layer contains services used by all Flexio drivers. The need for this layer derives from the requirement to allow multiple Flexio drivers to run in parallel on the same device, to the extent that enough hardware resources (shifters and timers) are available.
The Flexio Common driver layer provides functions for device initialization and reset. Before using any Flexio driver the device must first be initialized using function FLEXIO_DRV_InitDevice(). Then any number of Flexio drivers can be initialized on the same device, to the extent that enough hardware resources (shifters and timers) are available. Driver initialization functions will return STATUS_ERROR if not enough resources are available for a new driver.
Calling any Flexio common function will destroy any driver that is active on that device. Normally these functions should be called only when there are no active driver instances on the device.
Typedefs | |
typedef void(* | flexio_callback_t) (void *driverState, flexio_event_t event, void *userData) |
flexio callback function More... | |
Enumerations | |
enum | flexio_driver_type_t { FLEXIO_DRIVER_TYPE_INTERRUPTS = 0U, FLEXIO_DRIVER_TYPE_POLLING = 1U, FLEXIO_DRIVER_TYPE_DMA = 2U } |
Driver type: interrupts/polling/DMA Implements : flexio_driver_type_t_Class. More... | |
enum | flexio_event_t { FLEXIO_EVENT_RX_FULL = 0x00U, FLEXIO_EVENT_TX_EMPTY = 0x01U, FLEXIO_EVENT_END_TRANSFER = 0x02U } |
flexio events Implements : flexio_event_t_Class More... | |
FLEXIO_I2C Driver | |
status_t | FLEXIO_DRV_InitDevice (uint32_t instance, flexio_device_state_t *deviceState) |
Initializes the FlexIO device. More... | |
status_t | FLEXIO_DRV_DeinitDevice (uint32_t instance) |
De-initializes the FlexIO device. More... | |
status_t | FLEXIO_DRV_Reset (uint32_t instance) |
Resets the FlexIO device. More... | |
typedef void(* flexio_callback_t) (void *driverState, flexio_event_t event, void *userData) |
flexio callback function
Callback functions are called by flexio drivers when relevant events must be reported. See type flexio_event_t for a list of events. The callback can then react to the event, for example providing the buffers for transmission or reception, or waking a task to use the received data. Note that callback functions are called from interrupts, so the callback execution time should be as small as possible.
enum flexio_driver_type_t |
enum flexio_event_t |
status_t FLEXIO_DRV_DeinitDevice | ( | uint32_t | instance | ) |
De-initializes the FlexIO device.
This function de-initializes the FlexIO device.
instance | FLEXIO peripheral instance number |
Definition at line 128 of file flexio_common.c.
status_t FLEXIO_DRV_InitDevice | ( | uint32_t | instance, |
flexio_device_state_t * | deviceState | ||
) |
Initializes the FlexIO device.
This function resets the FlexIO device, enables interrupts in interrupt manager and enables the device.
instance | FLEXIO peripheral instance number |
deviceState | Pointer to the FLEXIO device context structure. The driver uses this memory area for its internal logic. The application must make no assumptions about the content of this structure, and must not free this memory until the device is de-initialized using FLEXIO_DRV_DeinitDevice(). |
Definition at line 89 of file flexio_common.c.
status_t FLEXIO_DRV_Reset | ( | uint32_t | instance | ) |
Resets the FlexIO device.
This function resets the FlexIO device.
instance | FLEXIO peripheral instance number |
Definition at line 153 of file flexio_common.c.