FlexIO Common Driver

Detailed Description

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.

Functionality

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.

Important Notes

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.

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...
 

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...
 

Enumeration Type Documentation

Driver type: interrupts/polling/DMA Implements : flexio_driver_type_t_Class.

Enumerator
FLEXIO_DRIVER_TYPE_INTERRUPTS 

Driver uses interrupts for data transfers

FLEXIO_DRIVER_TYPE_POLLING 

Driver is based on polling

FLEXIO_DRIVER_TYPE_DMA 

Driver uses DMA for data transfers

Definition at line 49 of file flexio.h.

Function Documentation

status_t FLEXIO_DRV_DeinitDevice ( uint32_t  instance)

De-initializes the FlexIO device.

This function de-initializes the FlexIO device.

Parameters
instanceFLEXIO peripheral instance number
Returns
Error or success status returned by API

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.

Parameters
instanceFLEXIO peripheral instance number
deviceStatePointer 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().
Returns
Error or success status returned by API

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.

Parameters
instanceFLEXIO peripheral instance number
Returns
Error or success status returned by API

Definition at line 153 of file flexio_common.c.