RTEMS 6.1-rc6
|
Data Structures | |
struct | _flexio_config_ |
Define FlexIO user configuration structure. More... | |
struct | _flexio_timer_config |
Define FlexIO timer configuration structure. More... | |
struct | _flexio_shifter_config |
Define FlexIO shifter configuration structure. More... | |
Driver version | |
enum | _flexio_timer_trigger_polarity { kFLEXIO_TimerTriggerPolarityActiveHigh = 0x0U , kFLEXIO_TimerTriggerPolarityActiveLow = 0x1U } |
Define time of timer trigger polarity. More... | |
enum | _flexio_timer_trigger_source { kFLEXIO_TimerTriggerSourceExternal = 0x0U , kFLEXIO_TimerTriggerSourceInternal = 0x1U } |
Define type of timer trigger source. More... | |
enum | _flexio_pin_config { kFLEXIO_PinConfigOutputDisabled = 0x0U , kFLEXIO_PinConfigOpenDrainOrBidirection = 0x1U , kFLEXIO_PinConfigBidirectionOutputData = 0x2U , kFLEXIO_PinConfigOutput = 0x3U } |
Define type of timer/shifter pin configuration. More... | |
enum | _flexio_pin_polarity { kFLEXIO_PinActiveHigh = 0x0U , kFLEXIO_PinActiveLow = 0x1U } |
Definition of pin polarity. More... | |
enum | _flexio_timer_mode { kFLEXIO_TimerModeDisabled = 0x0U , kFLEXIO_TimerModeDual8BitBaudBit = 0x1U , kFLEXIO_TimerModeDual8BitPWM = 0x2U , kFLEXIO_TimerModeSingle16Bit = 0x3U } |
Define type of timer work mode. More... | |
enum | _flexio_timer_output { kFLEXIO_TimerOutputOneNotAffectedByReset = 0x0U , kFLEXIO_TimerOutputZeroNotAffectedByReset = 0x1U , kFLEXIO_TimerOutputOneAffectedByReset = 0x2U , kFLEXIO_TimerOutputZeroAffectedByReset = 0x3U } |
Define type of timer initial output or timer reset condition. More... | |
enum | _flexio_timer_decrement_source { kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput = 0x0U , kFLEXIO_TimerDecSrcOnTriggerInputShiftTimerOutput , kFLEXIO_TimerDecSrcOnPinInputShiftPinInput , kFLEXIO_TimerDecSrcOnTriggerInputShiftTriggerInput } |
Define type of timer decrement. More... | |
enum | _flexio_timer_reset_condition { kFLEXIO_TimerResetNever = 0x0U , kFLEXIO_TimerResetOnTimerPinEqualToTimerOutput = 0x2U , kFLEXIO_TimerResetOnTimerTriggerEqualToTimerOutput = 0x3U , kFLEXIO_TimerResetOnTimerPinRisingEdge = 0x4U , kFLEXIO_TimerResetOnTimerTriggerRisingEdge = 0x6U , kFLEXIO_TimerResetOnTimerTriggerBothEdge = 0x7U } |
Define type of timer reset condition. More... | |
enum | _flexio_timer_disable_condition { kFLEXIO_TimerDisableNever = 0x0U , kFLEXIO_TimerDisableOnPreTimerDisable = 0x1U , kFLEXIO_TimerDisableOnTimerCompare = 0x2U , kFLEXIO_TimerDisableOnTimerCompareTriggerLow = 0x3U , kFLEXIO_TimerDisableOnPinBothEdge = 0x4U , kFLEXIO_TimerDisableOnPinBothEdgeTriggerHigh = 0x5U , kFLEXIO_TimerDisableOnTriggerFallingEdge = 0x6U } |
Define type of timer disable condition. More... | |
enum | _flexio_timer_enable_condition { kFLEXIO_TimerEnabledAlways = 0x0U , kFLEXIO_TimerEnableOnPrevTimerEnable = 0x1U , kFLEXIO_TimerEnableOnTriggerHigh = 0x2U , kFLEXIO_TimerEnableOnTriggerHighPinHigh = 0x3U , kFLEXIO_TimerEnableOnPinRisingEdge = 0x4U , kFLEXIO_TimerEnableOnPinRisingEdgeTriggerHigh = 0x5U , kFLEXIO_TimerEnableOnTriggerRisingEdge = 0x6U , kFLEXIO_TimerEnableOnTriggerBothEdge = 0x7U } |
Define type of timer enable condition. More... | |
enum | _flexio_timer_stop_bit_condition { kFLEXIO_TimerStopBitDisabled = 0x0U , kFLEXIO_TimerStopBitEnableOnTimerCompare = 0x1U , kFLEXIO_TimerStopBitEnableOnTimerDisable = 0x2U , kFLEXIO_TimerStopBitEnableOnTimerCompareDisable = 0x3U } |
Define type of timer stop bit generate condition. More... | |
enum | _flexio_timer_start_bit_condition { kFLEXIO_TimerStartBitDisabled = 0x0U , kFLEXIO_TimerStartBitEnabled = 0x1U } |
Define type of timer start bit generate condition. More... | |
enum | _flexio_timer_output_state { kFLEXIO_PwmLow = 0 , kFLEXIO_PwmHigh } |
FlexIO as PWM channel output state. More... | |
enum | _flexio_shifter_timer_polarity { kFLEXIO_ShifterTimerPolarityOnPositive = 0x0U , kFLEXIO_ShifterTimerPolarityOnNegitive = 0x1U } |
Define type of timer polarity for shifter control. More... | |
enum | _flexio_shifter_mode { kFLEXIO_ShifterDisabled = 0x0U , kFLEXIO_ShifterModeReceive = 0x1U , kFLEXIO_ShifterModeTransmit = 0x2U , kFLEXIO_ShifterModeMatchStore = 0x4U , kFLEXIO_ShifterModeMatchContinuous = 0x5U } |
Define type of shifter working mode. More... | |
enum | _flexio_shifter_input_source { kFLEXIO_ShifterInputFromPin = 0x0U , kFLEXIO_ShifterInputFromNextShifterOutput = 0x1U } |
Define type of shifter input source. More... | |
enum | _flexio_shifter_stop_bit { kFLEXIO_ShifterStopBitDisable = 0x0U , kFLEXIO_ShifterStopBitLow = 0x2U , kFLEXIO_ShifterStopBitHigh = 0x3U } |
Define of STOP bit configuration. More... | |
enum | _flexio_shifter_start_bit { kFLEXIO_ShifterStartBitDisabledLoadDataOnEnable = 0x0U , kFLEXIO_ShifterStartBitDisabledLoadDataOnShift = 0x1U , kFLEXIO_ShifterStartBitLow = 0x2U , kFLEXIO_ShifterStartBitHigh = 0x3U } |
Define type of START bit configuration. More... | |
enum | _flexio_shifter_buffer_type { kFLEXIO_ShifterBuffer = 0x0U , kFLEXIO_ShifterBufferBitSwapped = 0x1U , kFLEXIO_ShifterBufferByteSwapped = 0x2U , kFLEXIO_ShifterBufferBitByteSwapped = 0x3U } |
Define FlexIO shifter buffer type. More... | |
typedef enum _flexio_timer_trigger_polarity | flexio_timer_trigger_polarity_t |
Define time of timer trigger polarity. | |
typedef enum _flexio_timer_trigger_source | flexio_timer_trigger_source_t |
Define type of timer trigger source. | |
typedef enum _flexio_pin_config | flexio_pin_config_t |
Define type of timer/shifter pin configuration. | |
typedef enum _flexio_pin_polarity | flexio_pin_polarity_t |
Definition of pin polarity. | |
typedef enum _flexio_timer_mode | flexio_timer_mode_t |
Define type of timer work mode. | |
typedef enum _flexio_timer_output | flexio_timer_output_t |
Define type of timer initial output or timer reset condition. | |
typedef enum _flexio_timer_decrement_source | flexio_timer_decrement_source_t |
Define type of timer decrement. | |
typedef enum _flexio_timer_reset_condition | flexio_timer_reset_condition_t |
Define type of timer reset condition. | |
typedef enum _flexio_timer_disable_condition | flexio_timer_disable_condition_t |
Define type of timer disable condition. | |
typedef enum _flexio_timer_enable_condition | flexio_timer_enable_condition_t |
Define type of timer enable condition. | |
typedef enum _flexio_timer_stop_bit_condition | flexio_timer_stop_bit_condition_t |
Define type of timer stop bit generate condition. | |
typedef enum _flexio_timer_start_bit_condition | flexio_timer_start_bit_condition_t |
Define type of timer start bit generate condition. | |
typedef enum _flexio_timer_output_state | flexio_timer_output_state_t |
FlexIO as PWM channel output state. | |
typedef enum _flexio_shifter_timer_polarity | flexio_shifter_timer_polarity_t |
Define type of timer polarity for shifter control. | |
typedef enum _flexio_shifter_mode | flexio_shifter_mode_t |
Define type of shifter working mode. | |
typedef enum _flexio_shifter_input_source | flexio_shifter_input_source_t |
Define type of shifter input source. | |
typedef enum _flexio_shifter_stop_bit | flexio_shifter_stop_bit_t |
Define of STOP bit configuration. | |
typedef enum _flexio_shifter_start_bit | flexio_shifter_start_bit_t |
Define type of START bit configuration. | |
typedef enum _flexio_shifter_buffer_type | flexio_shifter_buffer_type_t |
Define FlexIO shifter buffer type. | |
typedef struct _flexio_config_ | flexio_config_t |
Define FlexIO user configuration structure. | |
typedef struct _flexio_timer_config | flexio_timer_config_t |
Define FlexIO timer configuration structure. | |
typedef struct _flexio_shifter_config | flexio_shifter_config_t |
Define FlexIO shifter configuration structure. | |
typedef void(* | flexio_isr_t) (void *base, void *handle) |
typedef for FlexIO simulated driver interrupt handler. | |
FLEXIO_Type *const | s_flexioBases [] |
Pointers to flexio bases for each instance. | |
const clock_ip_name_t | s_flexioClocks [] |
Pointers to flexio clocks for each instance. | |
#define | FSL_FLEXIO_DRIVER_VERSION (MAKE_VERSION(2, 1, 0)) |
FlexIO driver version. | |
#define | FLEXIO_TIMER_TRIGGER_SEL_PININPUT(x) ((uint32_t)(x) << 1U) |
Calculate FlexIO timer trigger. | |
#define | FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(x) (((uint32_t)(x) << 2U) | 0x1U) |
#define | FLEXIO_TIMER_TRIGGER_SEL_TIMn(x) (((uint32_t)(x) << 2U) | 0x3U) |
FlexIO Initialization and De-initialization | |
void | FLEXIO_GetDefaultConfig (flexio_config_t *userConfig) |
Gets the default configuration to configure the FlexIO module. The configuration can used directly to call the FLEXIO_Configure(). | |
void | FLEXIO_Init (FLEXIO_Type *base, const flexio_config_t *userConfig) |
Configures the FlexIO with a FlexIO configuration. The configuration structure can be filled by the user or be set with default values by FLEXIO_GetDefaultConfig(). | |
void | FLEXIO_Deinit (FLEXIO_Type *base) |
Gates the FlexIO clock. Call this API to stop the FlexIO clock. | |
uint32_t | FLEXIO_GetInstance (FLEXIO_Type *base) |
Get instance number for FLEXIO module. | |
FlexIO Basic Operation | |
void | FLEXIO_Reset (FLEXIO_Type *base) |
Resets the FlexIO module. | |
void | FLEXIO_SetShifterConfig (FLEXIO_Type *base, uint8_t index, const flexio_shifter_config_t *shifterConfig) |
Configures the shifter with the shifter configuration. The configuration structure covers both the SHIFTCTL and SHIFTCFG registers. To configure the shifter to the proper mode, select which timer controls the shifter to shift, whether to generate start bit/stop bit, and the polarity of start bit and stop bit. | |
void | FLEXIO_SetTimerConfig (FLEXIO_Type *base, uint8_t index, const flexio_timer_config_t *timerConfig) |
Configures the timer with the timer configuration. The configuration structure covers both the TIMCTL and TIMCFG registers. To configure the timer to the proper mode, select trigger source for timer and the timer pin output and the timing for timer. | |
FlexIO DMA Operation | |
uint32_t | FLEXIO_GetShifterBufferAddress (FLEXIO_Type *base, flexio_shifter_buffer_type_t type, uint8_t index) |
Gets the shifter buffer address for the DMA transfer usage. | |
status_t | FLEXIO_RegisterHandleIRQ (void *base, void *handle, flexio_isr_t isr) |
Registers the handle and the interrupt handler for the FlexIO-simulated peripheral. | |
status_t | FLEXIO_UnregisterHandleIRQ (void *base) |
Unregisters the handle and the interrupt handler for the FlexIO-simulated peripheral. | |
enum _flexio_pin_config |
Define type of timer/shifter pin configuration.
enum _flexio_pin_polarity |
Define FlexIO shifter buffer type.
enum _flexio_shifter_mode |
Define type of START bit configuration.
Define type of timer decrement.
Define type of timer disable condition.
Define type of timer enable condition.
enum _flexio_timer_mode |
enum _flexio_timer_output |
Define type of timer initial output or timer reset condition.
Define type of timer reset condition.
Define type of timer stop bit generate condition.
void FLEXIO_Deinit | ( | FLEXIO_Type * | base | ) |
Gates the FlexIO clock. Call this API to stop the FlexIO clock.
base | FlexIO peripheral base address |
brief Gates the FlexIO clock. Call this API to stop the FlexIO clock.
note After calling this API, call the FLEXO_Init to use the FlexIO module.
param base FlexIO peripheral base address
void FLEXIO_GetDefaultConfig | ( | flexio_config_t * | userConfig | ) |
Gets the default configuration to configure the FlexIO module. The configuration can used directly to call the FLEXIO_Configure().
Example:
userConfig | pointer to flexio_config_t structure |
brief Gets the default configuration to configure the FlexIO module. The configuration can used directly to call the FLEXIO_Configure().
Example: code flexio_config_t config; FLEXIO_GetDefaultConfig(&config); endcode
param userConfig pointer to flexio_config_t structure
uint32_t FLEXIO_GetInstance | ( | FLEXIO_Type * | base | ) |
Get instance number for FLEXIO module.
base | FLEXIO peripheral base address. |
brief Get instance number for FLEXIO module.
param base FLEXIO peripheral base address.
uint32_t FLEXIO_GetShifterBufferAddress | ( | FLEXIO_Type * | base, |
flexio_shifter_buffer_type_t | type, | ||
uint8_t | index | ||
) |
Gets the shifter buffer address for the DMA transfer usage.
base | FlexIO peripheral base address |
type | Shifter type of flexio_shifter_buffer_type_t |
index | Shifter index |
brief Gets the shifter buffer address for the DMA transfer usage.
param base FlexIO peripheral base address param type Shifter type of flexio_shifter_buffer_type_t param index Shifter index return Corresponding shifter buffer index
void FLEXIO_Init | ( | FLEXIO_Type * | base, |
const flexio_config_t * | userConfig | ||
) |
Configures the FlexIO with a FlexIO configuration. The configuration structure can be filled by the user or be set with default values by FLEXIO_GetDefaultConfig().
Example
base | FlexIO peripheral base address |
userConfig | pointer to flexio_config_t structure |
brief Configures the FlexIO with a FlexIO configuration. The configuration structure can be filled by the user or be set with default values by FLEXIO_GetDefaultConfig().
Example code flexio_config_t config = { .enableFlexio = true, .enableInDoze = false, .enableInDebug = true, .enableFastAccess = false }; FLEXIO_Configure(base, &config); endcode
param base FlexIO peripheral base address param userConfig pointer to flexio_config_t structure
status_t FLEXIO_RegisterHandleIRQ | ( | void * | base, |
void * | handle, | ||
flexio_isr_t | isr | ||
) |
Registers the handle and the interrupt handler for the FlexIO-simulated peripheral.
base | Pointer to the FlexIO simulated peripheral type. |
handle | Pointer to the handler for FlexIO simulated peripheral. |
isr | FlexIO simulated peripheral interrupt handler. |
kStatus_Success | Successfully create the handle. |
kStatus_OutOfRange | The FlexIO type/handle/ISR table out of range. |
brief Registers the handle and the interrupt handler for the FlexIO-simulated peripheral.
param base Pointer to the FlexIO simulated peripheral type. param handle Pointer to the handler for FlexIO simulated peripheral. param isr FlexIO simulated peripheral interrupt handler. retval kStatus_Success Successfully create the handle. retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range.
void FLEXIO_Reset | ( | FLEXIO_Type * | base | ) |
Resets the FlexIO module.
base | FlexIO peripheral base address |
brief Resets the FlexIO module.
param base FlexIO peripheral base address
void FLEXIO_SetShifterConfig | ( | FLEXIO_Type * | base, |
uint8_t | index, | ||
const flexio_shifter_config_t * | shifterConfig | ||
) |
Configures the shifter with the shifter configuration. The configuration structure covers both the SHIFTCTL and SHIFTCFG registers. To configure the shifter to the proper mode, select which timer controls the shifter to shift, whether to generate start bit/stop bit, and the polarity of start bit and stop bit.
Example
base | FlexIO peripheral base address |
index | Shifter index |
shifterConfig | Pointer to flexio_shifter_config_t structure |
brief Configures the shifter with the shifter configuration. The configuration structure covers both the SHIFTCTL and SHIFTCFG registers. To configure the shifter to the proper mode, select which timer controls the shifter to shift, whether to generate start bit/stop bit, and the polarity of start bit and stop bit.
Example code flexio_shifter_config_t config = { .timerSelect = 0, .timerPolarity = kFLEXIO_ShifterTimerPolarityOnPositive, .pinConfig = kFLEXIO_PinConfigOpenDrainOrBidirection, .pinPolarity = kFLEXIO_PinActiveLow, .shifterMode = kFLEXIO_ShifterModeTransmit, .inputSource = kFLEXIO_ShifterInputFromPin, .shifterStop = kFLEXIO_ShifterStopBitHigh, .shifterStart = kFLEXIO_ShifterStartBitLow }; FLEXIO_SetShifterConfig(base, &config); endcode
param base FlexIO peripheral base address param index Shifter index param shifterConfig Pointer to flexio_shifter_config_t structure
void FLEXIO_SetTimerConfig | ( | FLEXIO_Type * | base, |
uint8_t | index, | ||
const flexio_timer_config_t * | timerConfig | ||
) |
Configures the timer with the timer configuration. The configuration structure covers both the TIMCTL and TIMCFG registers. To configure the timer to the proper mode, select trigger source for timer and the timer pin output and the timing for timer.
Example
base | FlexIO peripheral base address |
index | Timer index |
timerConfig | Pointer to the flexio_timer_config_t structure |
brief Configures the timer with the timer configuration. The configuration structure covers both the TIMCTL and TIMCFG registers. To configure the timer to the proper mode, select trigger source for timer and the timer pin output and the timing for timer.
Example code flexio_timer_config_t config = { .triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(0), .triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow, .triggerSource = kFLEXIO_TimerTriggerSourceInternal, .pinConfig = kFLEXIO_PinConfigOpenDrainOrBidirection, .pinSelect = 0, .pinPolarity = kFLEXIO_PinActiveHigh, .timerMode = kFLEXIO_TimerModeDual8BitBaudBit, .timerOutput = kFLEXIO_TimerOutputZeroNotAffectedByReset, .timerDecrement = kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput, .timerReset = kFLEXIO_TimerResetOnTimerPinEqualToTimerOutput, .timerDisable = kFLEXIO_TimerDisableOnTimerCompare, .timerEnable = kFLEXIO_TimerEnableOnTriggerHigh, .timerStop = kFLEXIO_TimerStopBitEnableOnTimerDisable, .timerStart = kFLEXIO_TimerStartBitEnabled }; FLEXIO_SetTimerConfig(base, &config); endcode
param base FlexIO peripheral base address param index Timer index param timerConfig Pointer to the flexio_timer_config_t structure
status_t FLEXIO_UnregisterHandleIRQ | ( | void * | base | ) |
Unregisters the handle and the interrupt handler for the FlexIO-simulated peripheral.
base | Pointer to the FlexIO simulated peripheral type. |
kStatus_Success | Successfully create the handle. |
kStatus_OutOfRange | The FlexIO type/handle/ISR table out of range. |
brief Unregisters the handle and the interrupt handler for the FlexIO-simulated peripheral.
param base Pointer to the FlexIO simulated peripheral type. retval kStatus_Success Successfully create the handle. retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range.
bool _flexio_config_::enableFastAccess |
Enable/disable fast access to FlexIO registers, fast access requires the FlexIO clock to be at least twice the frequency of the bus clock.
bool _flexio_config_::enableFlexio |
Enable/disable FlexIO module
bool _flexio_config_::enableInDebug |
Enable/disable FlexIO operation in debug mode
bool _flexio_config_::enableInDoze |
Enable/disable FlexIO operation in doze mode
flexio_shifter_input_source_t _flexio_shifter_config::inputSource |
Selects the input source for the shifter.
flexio_pin_config_t _flexio_timer_config::pinConfig |
Timer Pin Configuration.
flexio_pin_config_t _flexio_shifter_config::pinConfig |
Shifter Pin Configuration.
flexio_pin_polarity_t _flexio_timer_config::pinPolarity |
Timer Pin Polarity.
flexio_pin_polarity_t _flexio_shifter_config::pinPolarity |
Shifter Pin Polarity.
uint32_t _flexio_timer_config::pinSelect |
Timer Pin number Select.
uint32_t _flexio_shifter_config::pinSelect |
Shifter Pin number Select.
flexio_shifter_mode_t _flexio_shifter_config::shifterMode |
Configures the mode of the Shifter.
flexio_shifter_start_bit_t _flexio_shifter_config::shifterStart |
Shifter START bit.
flexio_shifter_stop_bit_t _flexio_shifter_config::shifterStop |
Shifter STOP bit.
uint32_t _flexio_timer_config::timerCompare |
Value for Timer Compare N Register.
flexio_timer_decrement_source_t _flexio_timer_config::timerDecrement |
Configures the source of the Timer decrement and the source of the Shift clock.
flexio_timer_disable_condition_t _flexio_timer_config::timerDisable |
Configures the condition that causes the Timer to be disabled and stop decrementing.
flexio_timer_enable_condition_t _flexio_timer_config::timerEnable |
Configures the condition that causes the Timer to be enabled and start decrementing.
flexio_timer_mode_t _flexio_timer_config::timerMode |
Timer work Mode.
flexio_timer_output_t _flexio_timer_config::timerOutput |
Configures the initial state of the Timer Output and whether it is affected by the Timer reset.
flexio_shifter_timer_polarity_t _flexio_shifter_config::timerPolarity |
Timer Polarity.
flexio_timer_reset_condition_t _flexio_timer_config::timerReset |
Configures the condition that causes the timer counter (and optionally the timer output) to be reset.
uint32_t _flexio_shifter_config::timerSelect |
Selects which Timer is used for controlling the logic/shift register and generating the Shift clock.
flexio_timer_start_bit_condition_t _flexio_timer_config::timerStart |
Timer STRAT Bit generation.
flexio_timer_stop_bit_condition_t _flexio_timer_config::timerStop |
Timer STOP Bit generation.
flexio_timer_trigger_polarity_t _flexio_timer_config::triggerPolarity |
Trigger Polarity.
uint32_t _flexio_timer_config::triggerSelect |
The internal trigger selection number using MACROs.
flexio_timer_trigger_source_t _flexio_timer_config::triggerSource |
Trigger Source, internal (see 'trgsel') or external.