MCUXpresso SDK API Reference Manual
Rev. 0
NXP Semiconductors
|
Data Structures | |
struct | flexio_config_t |
Define FlexIO user configuration structure. More... | |
struct | flexio_timer_config_t |
Define FlexIO timer configuration structure. More... | |
struct | flexio_shifter_config_t |
Define FlexIO shifter configuration structure. More... | |
Macros | |
#define | FLEXIO_TIMER_TRIGGER_SEL_PININPUT(x) ((uint32_t)(x) << 1U) |
Calculate FlexIO timer trigger. More... | |
Typedefs | |
typedef void(* | flexio_isr_t )(void *base, void *handle) |
typedef for FlexIO simulated driver interrupt handler. More... | |
Driver version | |
#define | FSL_FLEXIO_DRIVER_VERSION (MAKE_VERSION(2, 0, 1)) |
FlexIO driver version 2.0.1. More... | |
FlexIO Initialization and De-initialization | |
void | FLEXIO_GetDefaultConfig (flexio_config_t *userConfig) |
Gets the default configuration to configure the FlexIO module. More... | |
void | FLEXIO_Init (FLEXIO_Type *base, const flexio_config_t *userConfig) |
Configures the FlexIO with a FlexIO configuration. More... | |
void | FLEXIO_Deinit (FLEXIO_Type *base) |
Gates the FlexIO clock. More... | |
FlexIO Basic Operation | |
void | FLEXIO_Reset (FLEXIO_Type *base) |
Resets the FlexIO module. More... | |
static void | FLEXIO_Enable (FLEXIO_Type *base, bool enable) |
Enables the FlexIO module operation. More... | |
static uint32_t | FLEXIO_ReadPinInput (FLEXIO_Type *base) |
Reads the input data on each of the FlexIO pins. More... | |
static uint8_t | FLEXIO_GetShifterState (FLEXIO_Type *base) |
Gets the current state pointer for state mode use. More... | |
void | FLEXIO_SetShifterConfig (FLEXIO_Type *base, uint8_t index, const flexio_shifter_config_t *shifterConfig) |
Configures the shifter with the shifter configuration. More... | |
void | FLEXIO_SetTimerConfig (FLEXIO_Type *base, uint8_t index, const flexio_timer_config_t *timerConfig) |
Configures the timer with the timer configuration. More... | |
FlexIO Interrupt Operation | |
static void | FLEXIO_EnableShifterStatusInterrupts (FLEXIO_Type *base, uint32_t mask) |
Enables the shifter status interrupt. More... | |
static void | FLEXIO_DisableShifterStatusInterrupts (FLEXIO_Type *base, uint32_t mask) |
Disables the shifter status interrupt. More... | |
static void | FLEXIO_EnableShifterErrorInterrupts (FLEXIO_Type *base, uint32_t mask) |
Enables the shifter error interrupt. More... | |
static void | FLEXIO_DisableShifterErrorInterrupts (FLEXIO_Type *base, uint32_t mask) |
Disables the shifter error interrupt. More... | |
static void | FLEXIO_EnableTimerStatusInterrupts (FLEXIO_Type *base, uint32_t mask) |
Enables the timer status interrupt. More... | |
static void | FLEXIO_DisableTimerStatusInterrupts (FLEXIO_Type *base, uint32_t mask) |
Disables the timer status interrupt. More... | |
FlexIO Status Operation | |
static uint32_t | FLEXIO_GetShifterStatusFlags (FLEXIO_Type *base) |
Gets the shifter status flags. More... | |
static void | FLEXIO_ClearShifterStatusFlags (FLEXIO_Type *base, uint32_t mask) |
Clears the shifter status flags. More... | |
static uint32_t | FLEXIO_GetShifterErrorFlags (FLEXIO_Type *base) |
Gets the shifter error flags. More... | |
static void | FLEXIO_ClearShifterErrorFlags (FLEXIO_Type *base, uint32_t mask) |
Clears the shifter error flags. More... | |
static uint32_t | FLEXIO_GetTimerStatusFlags (FLEXIO_Type *base) |
Gets the timer status flags. More... | |
static void | FLEXIO_ClearTimerStatusFlags (FLEXIO_Type *base, uint32_t mask) |
Clears the timer status flags. More... | |
FlexIO DMA Operation | |
static void | FLEXIO_EnableShifterStatusDMA (FLEXIO_Type *base, uint32_t mask, bool enable) |
Enables/disables the shifter status DMA. More... | |
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. More... | |
status_t | FLEXIO_RegisterHandleIRQ (void *base, void *handle, flexio_isr_t isr) |
Registers the handle and the interrupt handler for the FlexIO-simulated peripheral. More... | |
status_t | FLEXIO_UnregisterHandleIRQ (void *base) |
Unregisters the handle and the interrupt handler for the FlexIO-simulated peripheral. More... | |
struct flexio_config_t |
Data Fields | |
bool | enableFlexio |
Enable/disable FlexIO module. | |
bool | enableInDoze |
Enable/disable FlexIO operation in doze mode. | |
bool | enableInDebug |
Enable/disable FlexIO operation in debug mode. | |
bool | 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. More... | |
bool flexio_config_t::enableFastAccess |
struct flexio_timer_config_t |
Data Fields | |
uint32_t | triggerSelect |
The internal trigger selection number using MACROs. More... | |
flexio_timer_trigger_polarity_t | triggerPolarity |
Trigger Polarity. More... | |
flexio_timer_trigger_source_t | triggerSource |
Trigger Source, internal (see 'trgsel') or external. More... | |
flexio_pin_config_t | pinConfig |
Timer Pin Configuration. More... | |
uint32_t | pinSelect |
Timer Pin number Select. More... | |
flexio_pin_polarity_t | pinPolarity |
Timer Pin Polarity. More... | |
flexio_timer_mode_t | timerMode |
Timer work Mode. More... | |
flexio_timer_output_t | timerOutput |
Configures the initial state of the Timer Output and whether it is affected by the Timer reset. More... | |
flexio_timer_decrement_source_t | timerDecrement |
Configures the source of the Timer decrement and the source of the Shift clock. More... | |
flexio_timer_reset_condition_t | timerReset |
Configures the condition that causes the timer counter (and optionally the timer output) to be reset. More... | |
flexio_timer_disable_condition_t | timerDisable |
Configures the condition that causes the Timer to be disabled and stop decrementing. More... | |
flexio_timer_enable_condition_t | timerEnable |
Configures the condition that causes the Timer to be enabled and start decrementing. More... | |
flexio_timer_stop_bit_condition_t | timerStop |
Timer STOP Bit generation. More... | |
flexio_timer_start_bit_condition_t | timerStart |
Timer STRAT Bit generation. More... | |
uint32_t | timerCompare |
Value for Timer Compare N Register. More... | |
uint32_t flexio_timer_config_t::triggerSelect |
flexio_timer_trigger_polarity_t flexio_timer_config_t::triggerPolarity |
flexio_timer_trigger_source_t flexio_timer_config_t::triggerSource |
flexio_pin_config_t flexio_timer_config_t::pinConfig |
uint32_t flexio_timer_config_t::pinSelect |
flexio_pin_polarity_t flexio_timer_config_t::pinPolarity |
flexio_timer_mode_t flexio_timer_config_t::timerMode |
flexio_timer_output_t flexio_timer_config_t::timerOutput |
flexio_timer_decrement_source_t flexio_timer_config_t::timerDecrement |
flexio_timer_reset_condition_t flexio_timer_config_t::timerReset |
flexio_timer_disable_condition_t flexio_timer_config_t::timerDisable |
flexio_timer_enable_condition_t flexio_timer_config_t::timerEnable |
flexio_timer_stop_bit_condition_t flexio_timer_config_t::timerStop |
flexio_timer_start_bit_condition_t flexio_timer_config_t::timerStart |
uint32_t flexio_timer_config_t::timerCompare |
struct flexio_shifter_config_t |
Data Fields | |
uint32_t | timerSelect |
Selects which Timer is used for controlling the logic/shift register and generating the Shift clock. More... | |
flexio_shifter_timer_polarity_t | timerPolarity |
Timer Polarity. More... | |
flexio_pin_config_t | pinConfig |
Shifter Pin Configuration. More... | |
uint32_t | pinSelect |
Shifter Pin number Select. More... | |
flexio_pin_polarity_t | pinPolarity |
Shifter Pin Polarity. More... | |
flexio_shifter_mode_t | shifterMode |
Configures the mode of the Shifter. More... | |
uint32_t | parallelWidth |
Configures the parallel width when using parallel mode. More... | |
flexio_shifter_input_source_t | inputSource |
Selects the input source for the shifter. More... | |
flexio_shifter_stop_bit_t | shifterStop |
Shifter STOP bit. More... | |
flexio_shifter_start_bit_t | shifterStart |
Shifter START bit. More... | |
uint32_t flexio_shifter_config_t::timerSelect |
flexio_shifter_timer_polarity_t flexio_shifter_config_t::timerPolarity |
flexio_pin_config_t flexio_shifter_config_t::pinConfig |
uint32_t flexio_shifter_config_t::pinSelect |
flexio_pin_polarity_t flexio_shifter_config_t::pinPolarity |
flexio_shifter_mode_t flexio_shifter_config_t::shifterMode |
uint32_t flexio_shifter_config_t::parallelWidth |
flexio_shifter_input_source_t flexio_shifter_config_t::inputSource |
flexio_shifter_stop_bit_t flexio_shifter_config_t::shifterStop |
flexio_shifter_start_bit_t flexio_shifter_config_t::shifterStart |
#define FSL_FLEXIO_DRIVER_VERSION (MAKE_VERSION(2, 0, 1)) |
#define FLEXIO_TIMER_TRIGGER_SEL_PININPUT | ( | x | ) | ((uint32_t)(x) << 1U) |
typedef void(* flexio_isr_t)(void *base, void *handle) |
enum flexio_pin_config_t |
enum flexio_timer_mode_t |
void FLEXIO_GetDefaultConfig | ( | flexio_config_t * | userConfig | ) |
The configuration can used directly to call the FLEXIO_Configure().
Example:
userConfig | pointer to flexio_config_t structure |
void FLEXIO_Init | ( | FLEXIO_Type * | base, |
const flexio_config_t * | userConfig | ||
) |
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 |
void FLEXIO_Deinit | ( | FLEXIO_Type * | base | ) |
Call this API to stop the FlexIO clock.
base | FlexIO peripheral base address |
void FLEXIO_Reset | ( | FLEXIO_Type * | base | ) |
base | FlexIO peripheral base address |
|
inlinestatic |
base | FlexIO peripheral base address |
enable | true to enable, false to disable. |
|
inlinestatic |
base | FlexIO peripheral base address |
|
inlinestatic |
base | FlexIO peripheral base address |
void FLEXIO_SetShifterConfig | ( | FLEXIO_Type * | base, |
uint8_t | index, | ||
const flexio_shifter_config_t * | shifterConfig | ||
) |
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 |
void FLEXIO_SetTimerConfig | ( | FLEXIO_Type * | base, |
uint8_t | index, | ||
const flexio_timer_config_t * | timerConfig | ||
) |
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 |
|
inlinestatic |
The interrupt generates when the corresponding SSF is set.
base | FlexIO peripheral base address |
mask | The shifter status mask which can be calculated by (1 << shifter index) |
|
inlinestatic |
The interrupt won't generate when the corresponding SSF is set.
base | FlexIO peripheral base address |
mask | The shifter status mask which can be calculated by (1 << shifter index) |
|
inlinestatic |
The interrupt generates when the corresponding SEF is set.
base | FlexIO peripheral base address |
mask | The shifter error mask which can be calculated by (1 << shifter index) |
|
inlinestatic |
The interrupt won't generate when the corresponding SEF is set.
base | FlexIO peripheral base address |
mask | The shifter error mask which can be calculated by (1 << shifter index) |
|
inlinestatic |
The interrupt generates when the corresponding SSF is set.
base | FlexIO peripheral base address |
mask | The timer status mask which can be calculated by (1 << timer index) |
|
inlinestatic |
The interrupt won't generate when the corresponding SSF is set.
base | FlexIO peripheral base address |
mask | The timer status mask which can be calculated by (1 << timer index) |
|
inlinestatic |
base | FlexIO peripheral base address |
|
inlinestatic |
base | FlexIO peripheral base address |
mask | The shifter status mask which can be calculated by (1 << shifter index) |
|
inlinestatic |
base | FlexIO peripheral base address |
|
inlinestatic |
base | FlexIO peripheral base address |
mask | The shifter error mask which can be calculated by (1 << shifter index) |
|
inlinestatic |
base | FlexIO peripheral base address |
|
inlinestatic |
base | FlexIO peripheral base address |
mask | The timer status mask which can be calculated by (1 << timer index) |
|
inlinestatic |
The DMA request generates when the corresponding SSF is set.
base | FlexIO peripheral base address |
mask | The shifter status mask which can be calculated by (1 << shifter index) |
enable | True to enable, false to disable. |
uint32_t FLEXIO_GetShifterBufferAddress | ( | FLEXIO_Type * | base, |
flexio_shifter_buffer_type_t | type, | ||
uint8_t | index | ||
) |
base | FlexIO peripheral base address |
type | Shifter type of flexio_shifter_buffer_type_t |
index | Shifter index |
status_t FLEXIO_RegisterHandleIRQ | ( | void * | base, |
void * | handle, | ||
flexio_isr_t | isr | ||
) |
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. |
status_t FLEXIO_UnregisterHandleIRQ | ( | void * | base | ) |
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. |