![]() |
MCUXpresso SDK API Reference Manual
Rev 2.16.000
NXP Semiconductors
|
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... | |
Macros | |
#define | FLEXIO_TIMER_TRIGGER_SEL_PININPUT(x) ((uint32_t)(x) << 1U) |
Calculate FlexIO timer trigger. More... | |
Typedefs | |
typedef enum _flexio_timer_trigger_polarity | flexio_timer_trigger_polarity_t |
Define time of timer trigger polarity. More... | |
typedef enum _flexio_timer_trigger_source | flexio_timer_trigger_source_t |
Define type of timer trigger source. More... | |
typedef enum _flexio_pin_config | flexio_pin_config_t |
Define type of timer/shifter pin configuration. More... | |
typedef enum _flexio_pin_polarity | flexio_pin_polarity_t |
Definition of pin polarity. More... | |
typedef enum _flexio_timer_mode | flexio_timer_mode_t |
Define type of timer work mode. More... | |
typedef enum _flexio_timer_output | flexio_timer_output_t |
Define type of timer initial output or timer reset condition. More... | |
typedef enum _flexio_timer_decrement_source | flexio_timer_decrement_source_t |
Define type of timer decrement. More... | |
typedef enum _flexio_timer_reset_condition | flexio_timer_reset_condition_t |
Define type of timer reset condition. More... | |
typedef enum _flexio_timer_disable_condition | flexio_timer_disable_condition_t |
Define type of timer disable condition. More... | |
typedef enum _flexio_timer_enable_condition | flexio_timer_enable_condition_t |
Define type of timer enable condition. More... | |
typedef enum _flexio_timer_stop_bit_condition | flexio_timer_stop_bit_condition_t |
Define type of timer stop bit generate condition. More... | |
typedef enum _flexio_timer_start_bit_condition | flexio_timer_start_bit_condition_t |
Define type of timer start bit generate condition. More... | |
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. More... | |
typedef enum _flexio_shifter_mode | flexio_shifter_mode_t |
Define type of shifter working mode. More... | |
typedef enum _flexio_shifter_input_source | flexio_shifter_input_source_t |
Define type of shifter input source. More... | |
typedef enum _flexio_shifter_stop_bit | flexio_shifter_stop_bit_t |
Define of STOP bit configuration. More... | |
typedef enum _flexio_shifter_start_bit | flexio_shifter_start_bit_t |
Define type of START bit configuration. More... | |
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. More... | |
typedef struct _flexio_timer_config | flexio_timer_config_t |
Define FlexIO timer configuration structure. More... | |
typedef struct _flexio_shifter_config | flexio_shifter_config_t |
Define FlexIO shifter configuration structure. More... | |
typedef void(* | flexio_isr_t )(void *base, void *handle) |
typedef for FlexIO simulated driver interrupt handler. 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... | |
struct _flexio_config_ |
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_::enableFastAccess |
struct _flexio_timer_config |
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::triggerSelect |
flexio_timer_trigger_polarity_t _flexio_timer_config::triggerPolarity |
flexio_timer_trigger_source_t _flexio_timer_config::triggerSource |
flexio_pin_config_t _flexio_timer_config::pinConfig |
uint32_t _flexio_timer_config::pinSelect |
flexio_pin_polarity_t _flexio_timer_config::pinPolarity |
flexio_timer_mode_t _flexio_timer_config::timerMode |
flexio_timer_output_t _flexio_timer_config::timerOutput |
flexio_timer_decrement_source_t _flexio_timer_config::timerDecrement |
flexio_timer_reset_condition_t _flexio_timer_config::timerReset |
flexio_timer_disable_condition_t _flexio_timer_config::timerDisable |
flexio_timer_enable_condition_t _flexio_timer_config::timerEnable |
flexio_timer_stop_bit_condition_t _flexio_timer_config::timerStop |
flexio_timer_start_bit_condition_t _flexio_timer_config::timerStart |
uint32_t _flexio_timer_config::timerCompare |
struct _flexio_shifter_config |
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::timerSelect |
flexio_shifter_timer_polarity_t _flexio_shifter_config::timerPolarity |
flexio_pin_config_t _flexio_shifter_config::pinConfig |
uint32_t _flexio_shifter_config::pinSelect |
flexio_pin_polarity_t _flexio_shifter_config::pinPolarity |
flexio_shifter_mode_t _flexio_shifter_config::shifterMode |
uint32_t _flexio_shifter_config::parallelWidth |
flexio_shifter_input_source_t _flexio_shifter_config::inputSource |
flexio_shifter_stop_bit_t _flexio_shifter_config::shifterStop |
flexio_shifter_start_bit_t _flexio_shifter_config::shifterStart |
#define FSL_FLEXIO_DRIVER_VERSION (MAKE_VERSION(2, 2, 2)) |
#define FLEXIO_TIMER_TRIGGER_SEL_PININPUT | ( | x | ) | ((uint32_t)(x) << 1U) |
typedef enum _flexio_pin_config flexio_pin_config_t |
typedef enum _flexio_pin_polarity flexio_pin_polarity_t |
typedef enum _flexio_timer_mode flexio_timer_mode_t |
typedef enum _flexio_timer_output flexio_timer_output_t |
typedef enum _flexio_shifter_mode flexio_shifter_mode_t |
typedef enum _flexio_shifter_stop_bit flexio_shifter_stop_bit_t |
typedef enum _flexio_shifter_start_bit flexio_shifter_start_bit_t |
typedef struct _flexio_config_ flexio_config_t |
typedef struct _flexio_timer_config flexio_timer_config_t |
typedef struct _flexio_shifter_config flexio_shifter_config_t |
typedef void(* flexio_isr_t)(void *base, void *handle) |
enum _flexio_pin_config |
enum _flexio_pin_polarity |
enum _flexio_timer_mode |
enum _flexio_timer_output |
enum _flexio_shifter_mode |
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. |
FLEXIO_Type* const s_flexioBases[] |
const clock_ip_name_t s_flexioClocks[] |