![]() |
MCUXpresso SDK API Reference Manual
Rev 2.16.000
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... | |
struct | flexio_gpio_config_t |
The FLEXIO pin 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... | |
Functions | |
void | FLEXIO_SetPinConfig (FLEXIO_Type *base, uint32_t pin, flexio_gpio_config_t *config) |
Configure a FLEXIO pin used by the board. More... | |
Variables | |
FLEXIO_Type *const | s_flexioBases [] |
Pointers to flexio bases for each instance. More... | |
const clock_ip_name_t | s_flexioClocks [] |
Pointers to flexio clocks for each instance. More... | |
Driver version | |
#define | FSL_FLEXIO_DRIVER_VERSION (MAKE_VERSION(2, 2, 2)) |
FlexIO driver version. 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... | |
uint32_t | FLEXIO_GetInstance (FLEXIO_Type *base) |
Get instance number for FLEXIO module. 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... | |
static void | FLEXIO_SetClockMode (FLEXIO_Type *base, uint8_t index, flexio_timer_decrement_source_t clocksource) |
This function set the value of the prescaler on flexio channels. 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... | |
GPIO Output Operations | |
static void | FLEXIO_ClearPortOutput (FLEXIO_Type *base, uint32_t mask) |
Sets the output level of the multiple FLEXIO pins to the logic 0. More... | |
static void | FLEXIO_SetPortOutput (FLEXIO_Type *base, uint32_t mask) |
Sets the output level of the multiple FLEXIO pins to the logic 1. More... | |
static void | FLEXIO_TogglePortOutput (FLEXIO_Type *base, uint32_t mask) |
Reverses the current output logic of the multiple FLEXIO pins. More... | |
static void | FLEXIO_PinWrite (FLEXIO_Type *base, uint32_t pin, uint8_t output) |
Sets the output level of the FLEXIO pins to the logic 1 or 0. More... | |
static void | FLEXIO_EnablePinOutput (FLEXIO_Type *base, uint32_t pin) |
Enables the FLEXIO output pin function. More... | |
FLEXIO PIN Input Operations | |
static uint32_t | FLEXIO_PinRead (FLEXIO_Type *base, uint32_t pin) |
Reads the current input value of the FLEXIO pin. More... | |
static uint32_t | FLEXIO_GetPinStatus (FLEXIO_Type *base, uint32_t pin) |
Gets the FLEXIO input pin status. More... | |
static void | FLEXIO_ClearPortStatus (FLEXIO_Type *base, uint32_t mask) |
Clears the multiple FLEXIO input pins status. 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 |
struct flexio_gpio_config_t |
Each pin can only be configured as either an output pin or an input pin at a time. If configured as an input pin, use inputConfig param. If configured as an output pin, use outputLogic.
Data Fields | |
flexio_gpio_direction_t | pinDirection |
FLEXIO pin direction, input or output. | |
uint8_t | outputLogic |
Set a default output logic, which has no use in input. | |
uint8_t | inputConfig |
Set an input config. | |
#define FSL_FLEXIO_DRIVER_VERSION (MAKE_VERSION(2, 2, 2)) |
#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 |
uint32_t FLEXIO_GetInstance | ( | FLEXIO_Type * | base | ) |
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 |
base | Pointer to the FlexIO simulated peripheral type. |
index | Timer index |
clocksource | Set clock value |
|
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. |
void FLEXIO_SetPinConfig | ( | FLEXIO_Type * | base, |
uint32_t | pin, | ||
flexio_gpio_config_t * | config | ||
) |
To Config the FLEXIO PIN, define a pin configuration, as either input or output, in the user file. Then, call the FLEXIO_SetPinConfig() function.
This is an example to define an input pin or an output pin configuration.
base | FlexIO peripheral base address |
pin | FLEXIO pin number. |
config | FLEXIO pin configuration pointer. |
|
inlinestatic |
base | FlexIO peripheral base address |
mask | FLEXIO pin number mask |
|
inlinestatic |
base | FlexIO peripheral base address |
mask | FLEXIO pin number mask |
|
inlinestatic |
base | FlexIO peripheral base address |
mask | FLEXIO pin number mask |
|
inlinestatic |
base | FlexIO peripheral base address |
pin | FLEXIO pin number. |
output | FLEXIO pin output logic level.
|
|
inlinestatic |
base | FlexIO peripheral base address |
pin | FLEXIO pin number. |
|
inlinestatic |
base | FlexIO peripheral base address |
pin | FLEXIO pin number. |
FLEXIO | port input value
|
|
inlinestatic |
base | FlexIO peripheral base address |
pin | FLEXIO pin number. |
FLEXIO | port input status
|
|
inlinestatic |
base | FlexIO peripheral base address |
mask | FLEXIO pin number mask |
FLEXIO_Type* const s_flexioBases[] |
const clock_ip_name_t s_flexioClocks[] |