All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
FlexIO Driver
FlexIO: FlexIO Driver

## Overview

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

## Enumerations

enum | flexio_timer_trigger_polarity_t { kFLEXIO_TimerTriggerPolarityActiveHigh = 0x0U, kFLEXIO_TimerTriggerPolarityActiveLow = 0x1U }
| Define time of timer trigger polarity. More...
enum | flexio_timer_trigger_source_t { kFLEXIO_TimerTriggerSourceExternal = 0x0U, kFLEXIO_TimerTriggerSourceInternal = 0x1U }
| Define type of timer trigger source. More...
enum | flexio_pin_config_t { kFLEXIO_PinConfigOutputDisabled = 0x0U, kFLEXIO_PinConfigOpenDrainOrBidirection = 0x1U, kFLEXIO_PinConfigBidirectionOutputData = 0x2U, kFLEXIO_PinConfigOutput = 0x3U }
| Define type of timer/shifter pin configuration. More...
enum | flexio_pin_polarity_t { kFLEXIO_PinActiveHigh = 0x0U, kFLEXIO_PinActiveLow = 0x1U }
| Definition of pin polarity. More...
enum | flexio_timer_mode_t { kFLEXIO_TimerModeDisabled = 0x0U, kFLEXIO_TimerModeDual8BitBaudBit = 0x1U, kFLEXIO_TimerModeDual8BitPWM = 0x2U, kFLEXIO_TimerModeSingle16Bit = 0x3U }
| Define type of timer work mode. More...
enum | flexio_timer_output_t { 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_t { kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput = 0x0U, kFLEXIO_TimerDecSrcOnTriggerInputShiftTimerOutput = 0x1U, kFLEXIO_TimerDecSrcOnPinInputShiftPinInput = 0x2U, kFLEXIO_TimerDecSrcOnTriggerInputShiftTriggerInput = 0x3U }
| Define type of timer decrement. More...
enum | flexio_timer_reset_condition_t { 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_t { 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_t { 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_t { 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_t { kFLEXIO_TimerStartBitDisabled = 0x0U, kFLEXIO_TimerStartBitEnabled = 0x1U }
| Define type of timer start bit generate condition. More...
enum | flexio_shifter_timer_polarity_t
| Define type of timer polarity for shifter control. More...
enum | flexio_shifter_mode_t { 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_t { kFLEXIO_ShifterInputFromPin = 0x0U, kFLEXIO_ShifterInputFromNextShifterOutput = 0x1U }
| Define type of shifter input source. More...
enum | flexio_shifter_stop_bit_t { kFLEXIO_ShifterStopBitDisable = 0x0U, kFLEXIO_ShifterStopBitLow = 0x2U, kFLEXIO_ShifterStopBitHigh = 0x3U }
| Define of STOP bit configuration. More...
enum | flexio_shifter_start_bit_t { kFLEXIO_ShifterStartBitDisabledLoadDataOnEnable = 0x0U, kFLEXIO_ShifterStartBitDisabledLoadDataOnShift = 0x1U, kFLEXIO_ShifterStartBitLow = 0x2U, kFLEXIO_ShifterStartBitHigh = 0x3U }
| Define type of START bit configuration. More...
enum | flexio_shifter_buffer_type_t { kFLEXIO_ShifterBuffer = 0x0U, kFLEXIO_ShifterBufferBitSwapped = 0x1U, kFLEXIO_ShifterBufferByteSwapped = 0x2U, kFLEXIO_ShifterBufferBitByteSwapped = 0x3U }
| Define FlexIO shifter buffer type. More...

## Driver version

#define | FSL_FLEXIO_DRIVER_VERSION (MAKE_VERSION(2, 0, 0))
| FlexIO driver version 2.0.0. More...

## FlexIO Initialization and De-initialization

void | FLEXIO_GetDefaultConfig (flexio_config_t *userConfig)
| Gets the default configuration to configure FlexIO module. More...
void | FLEXIO_Init (FLEXIO_Type *base, const flexio_config_t *userConfig)
| Configures the FlexIO with 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...
void | FLEXIO_SetShifterConfig (FLEXIO_Type *base, uint8_t index, const flexio_shifter_config_t *shifterConfig)
| Configures the shifter with 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...

## Data Structure Documentation

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

#### Field Documentation

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

#### Field Documentation

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

#### Field Documentation

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

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

## Macro Definition Documentation

#define FSL_FLEXIO_DRIVER_VERSION (MAKE_VERSION(2, 0, 0))

#define FLEXIO_TIMER_TRIGGER_SEL_PININPUT | ( |  | x | ) | ((uint32_t)(x) << 1U)

## Typedef Documentation

typedef void(* flexio_isr_t)(void *base, void *handle)

## Enumeration Type Documentation

enum flexio_timer_trigger_polarity_t

Enumerator
kFLEXIO_TimerTriggerPolarityActiveHigh | Active high.
kFLEXIO_TimerTriggerPolarityActiveLow | Active low.

enum flexio_timer_trigger_source_t

Enumerator
kFLEXIO_TimerTriggerSourceExternal | External trigger selected.
kFLEXIO_TimerTriggerSourceInternal | Internal trigger selected.

enum flexio_pin_config_t

Enumerator
kFLEXIO_PinConfigOutputDisabled | Pin output disabled.
kFLEXIO_PinConfigOpenDrainOrBidirection | Pin open drain or bidirectional output enable.
kFLEXIO_PinConfigBidirectionOutputData | Pin bidirectional output data.
kFLEXIO_PinConfigOutput | Pin output.

enum flexio_pin_polarity_t

Enumerator
kFLEXIO_PinActiveHigh | Active high.
kFLEXIO_PinActiveLow | Active low.

enum flexio_timer_mode_t

Enumerator
kFLEXIO_TimerModeDisabled | Timer Disabled.
kFLEXIO_TimerModeDual8BitBaudBit | Dual 8-bit counters baud/bit mode.
kFLEXIO_TimerModeDual8BitPWM | Dual 8-bit counters PWM mode.
kFLEXIO_TimerModeSingle16Bit | Single 16-bit counter mode.

enum flexio_timer_output_t

Enumerator
kFLEXIO_TimerOutputOneNotAffectedByReset | Logic one when enabled and is not affected by timer reset.
kFLEXIO_TimerOutputZeroNotAffectedByReset | Logic zero when enabled and is not affected by timer reset.
kFLEXIO_TimerOutputOneAffectedByReset | Logic one when enabled and on timer reset.
kFLEXIO_TimerOutputZeroAffectedByReset | Logic zero when enabled and on timer reset.

enum flexio_timer_decrement_source_t

Enumerator
kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput | Decrement counter on FlexIO clock, Shift clock equals Timer output.
kFLEXIO_TimerDecSrcOnTriggerInputShiftTimerOutput | Decrement counter on Trigger input (both edges), Shift clock equals Timer output.
kFLEXIO_TimerDecSrcOnPinInputShiftPinInput | Decrement counter on Pin input (both edges), Shift clock equals Pin input.
kFLEXIO_TimerDecSrcOnTriggerInputShiftTriggerInput | Decrement counter on Trigger input (both edges), Shift clock equals Trigger input.

enum flexio_timer_reset_condition_t

Enumerator
kFLEXIO_TimerResetNever | Timer never reset.
kFLEXIO_TimerResetOnTimerPinEqualToTimerOutput | Timer reset on Timer Pin equal to Timer Output.
kFLEXIO_TimerResetOnTimerTriggerEqualToTimerOutput | Timer reset on Timer Trigger equal to Timer Output.
kFLEXIO_TimerResetOnTimerPinRisingEdge | Timer reset on Timer Pin rising edge.
kFLEXIO_TimerResetOnTimerTriggerRisingEdge | Timer reset on Trigger rising edge.
kFLEXIO_TimerResetOnTimerTriggerBothEdge | Timer reset on Trigger rising or falling edge.

enum flexio_timer_disable_condition_t

Enumerator
kFLEXIO_TimerDisableNever | Timer never disabled.
kFLEXIO_TimerDisableOnPreTimerDisable | Timer disabled on Timer N-1 disable.
kFLEXIO_TimerDisableOnTimerCompare | Timer disabled on Timer compare.
kFLEXIO_TimerDisableOnTimerCompareTriggerLow | Timer disabled on Timer compare and Trigger Low.
kFLEXIO_TimerDisableOnPinBothEdge | Timer disabled on Pin rising or falling edge.
kFLEXIO_TimerDisableOnPinBothEdgeTriggerHigh | Timer disabled on Pin rising or falling edge provided Trigger is high.
kFLEXIO_TimerDisableOnTriggerFallingEdge | Timer disabled on Trigger falling edge.

enum flexio_timer_enable_condition_t

Enumerator
kFLEXIO_TimerEnabledAlways | Timer always enabled.
kFLEXIO_TimerEnableOnPrevTimerEnable | Timer enabled on Timer N-1 enable.
kFLEXIO_TimerEnableOnTriggerHigh | Timer enabled on Trigger high.
kFLEXIO_TimerEnableOnTriggerHighPinHigh | Timer enabled on Trigger high and Pin high.
kFLEXIO_TimerEnableOnPinRisingEdge | Timer enabled on Pin rising edge.
kFLEXIO_TimerEnableOnPinRisingEdgeTriggerHigh | Timer enabled on Pin rising edge and Trigger high.
kFLEXIO_TimerEnableOnTriggerRisingEdge | Timer enabled on Trigger rising edge.
kFLEXIO_TimerEnableOnTriggerBothEdge | Timer enabled on Trigger rising or falling edge.

enum flexio_timer_stop_bit_condition_t

Enumerator
kFLEXIO_TimerStopBitDisabled | Stop bit disabled.
kFLEXIO_TimerStopBitEnableOnTimerCompare | Stop bit is enabled on timer compare.
kFLEXIO_TimerStopBitEnableOnTimerDisable | Stop bit is enabled on timer disable.
kFLEXIO_TimerStopBitEnableOnTimerCompareDisable | Stop bit is enabled on timer compare and timer disable.

enum flexio_timer_start_bit_condition_t

Enumerator
kFLEXIO_TimerStartBitDisabled | Start bit disabled.
kFLEXIO_TimerStartBitEnabled | Start bit enabled.

enum flexio_shifter_timer_polarity_t

enum flexio_shifter_mode_t

Enumerator
kFLEXIO_ShifterDisabled | Shifter is disabled.
kFLEXIO_ShifterModeReceive | Receive mode.
kFLEXIO_ShifterModeTransmit | Transmit mode.
kFLEXIO_ShifterModeMatchStore | Match store mode.
kFLEXIO_ShifterModeMatchContinuous | Match continuous mode.

enum flexio_shifter_input_source_t

Enumerator
kFLEXIO_ShifterInputFromPin | Shifter input from pin.
kFLEXIO_ShifterInputFromNextShifterOutput | Shifter input from Shifter N+1.

enum flexio_shifter_stop_bit_t

Enumerator
kFLEXIO_ShifterStopBitDisable | Disable shifter stop bit.
kFLEXIO_ShifterStopBitLow | Set shifter stop bit to logic low level.
kFLEXIO_ShifterStopBitHigh | Set shifter stop bit to logic high level.

enum flexio_shifter_start_bit_t

Enumerator
kFLEXIO_ShifterStartBitDisabledLoadDataOnEnable | Disable shifter start bit, transmitter loads data on enable.
kFLEXIO_ShifterStartBitDisabledLoadDataOnShift | Disable shifter start bit, transmitter loads data on first shift.
kFLEXIO_ShifterStartBitLow | Set shifter start bit to logic low level.
kFLEXIO_ShifterStartBitHigh | Set shifter start bit to logic high level.

enum flexio_shifter_buffer_type_t

Enumerator
kFLEXIO_ShifterBuffer | Shifter Buffer N Register.
kFLEXIO_ShifterBufferBitSwapped | Shifter Buffer N Bit Byte Swapped Register.
kFLEXIO_ShifterBufferByteSwapped | Shifter Buffer N Byte Swapped Register.
kFLEXIO_ShifterBufferBitByteSwapped | Shifter Buffer N Bit Swapped Register.

## Function Documentation

void FLEXIO_GetDefaultConfig | ( | flexio_config_t * | userConfig | ) |

The configuration can used directly for calling FLEXIO_Configure().

Example:

flexio_config_t config;
FLEXIO_GetDefaultConfig(&config);

Parameters

  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

flexio_config_t config = {
.enableFlexio = true,
.enableInDoze = false,
.enableInDebug = true,
.enableFastAccess = false
};
FLEXIO_Configure(base, &config);

Parameters

  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.

Note
  After calling this API, call the FLEXO_Init to use the FlexIO module.

Parameters

  base | FlexIO peripheral base address

void FLEXIO_Reset | ( | FLEXIO_Type * | base | ) |

Parameters

  base | FlexIO peripheral base address

static void FLEXIO_Enable | ( | FLEXIO_Type * | base,
|  | bool | enable
| ) |  |

inlinestatic

Parameters

  base | FlexIO peripheral base address
  enable | true to enable, false to disable.

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

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);

Parameters

  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

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);

Parameters

  base | FlexIO peripheral base address
  index | timer index
  timerConfig | pointer to flexio_timer_config_t structure

static void FLEXIO_EnableShifterStatusInterrupts | ( | FLEXIO_Type * | base,
|  | uint32_t | mask
| ) |  |

inlinestatic

The interrupt generates when the corresponding SSF is set.

Parameters

  base | FlexIO peripheral base address
  mask | the shifter status mask which could be calculated by (1 << shifter index)

Note
  for multiple shifter status interrupt enable, for example, two shifter status enable, could calculate the mask by using ((1 << shifter index0) | (1 << shifter index1))

static void FLEXIO_DisableShifterStatusInterrupts | ( | FLEXIO_Type * | base,
|  | uint32_t | mask
| ) |  |

inlinestatic

The interrupt won't generate when the corresponding SSF is set.

Parameters

  base | FlexIO peripheral base address
  mask | the shifter status mask which could be calculated by (1 << shifter index)

Note
  for multiple shifter status interrupt enable, for example, two shifter status enable, could calculate the mask by using ((1 << shifter index0) | (1 << shifter index1))

static void FLEXIO_EnableShifterErrorInterrupts | ( | FLEXIO_Type * | base,
|  | uint32_t | mask
| ) |  |

inlinestatic

The interrupt generates when the corresponding SEF is set.

Parameters

  base | FlexIO peripheral base address
  mask | the shifter error mask which could be calculated by (1 << shifter index)

Note
  for multiple shifter error interrupt enable, for example, two shifter error enable, could calculate the mask by using ((1 << shifter index0) | (1 << shifter index1))

static void FLEXIO_DisableShifterErrorInterrupts | ( | FLEXIO_Type * | base,
|  | uint32_t | mask
| ) |  |

inlinestatic

The interrupt won't generate when the corresponding SEF is set.

Parameters

  base | FlexIO peripheral base address
  mask | the shifter error mask which could be calculated by (1 << shifter index)

Note
  for multiple shifter error interrupt enable, for example, two shifter error enable, could calculate the mask by using ((1 << shifter index0) | (1 << shifter index1))

static void FLEXIO_EnableTimerStatusInterrupts | ( | FLEXIO_Type * | base,
|  | uint32_t | mask
| ) |  |

inlinestatic

The interrupt generates when the corresponding SSF is set.

Parameters

  base | FlexIO peripheral base address
  mask | the timer status mask which could be calculated by (1 << timer index)

Note
  for multiple timer status interrupt enable, for example, two timer status enable, could calculate the mask by using ((1 << timer index0) | (1 << timer index1))

static void FLEXIO_DisableTimerStatusInterrupts | ( | FLEXIO_Type * | base,
|  | uint32_t | mask
| ) |  |

inlinestatic

The interrupt won't generate when the corresponding SSF is set.

Parameters

  base | FlexIO peripheral base address
  mask | the timer status mask which could be calculated by (1 << timer index)

Note
  for multiple timer status interrupt enable, for example, two timer status enable, could calculate the mask by using ((1 << timer index0) | (1 << timer index1))

static uint32_t FLEXIO_GetShifterStatusFlags | ( | FLEXIO_Type * | base | ) |

inlinestatic

Parameters

  base | FlexIO peripheral base address

Returns
  shifter status flags

static void FLEXIO_ClearShifterStatusFlags | ( | FLEXIO_Type * | base,
|  | uint32_t | mask
| ) |  |

inlinestatic

Parameters

  base | FlexIO peripheral base address
  mask | the shifter status mask which could be calculated by (1 << shifter index)

Note
  for clearing multiple shifter status flags, for example, two shifter status flags, could calculate the mask by using ((1 << shifter index0) | (1 << shifter index1))

static uint32_t FLEXIO_GetShifterErrorFlags | ( | FLEXIO_Type * | base | ) |

inlinestatic

Parameters

  base | FlexIO peripheral base address

Returns
  shifter error flags

static void FLEXIO_ClearShifterErrorFlags | ( | FLEXIO_Type * | base,
|  | uint32_t | mask
| ) |  |

inlinestatic

Parameters

  base | FlexIO peripheral base address
  mask | the shifter error mask which could be calculated by (1 << shifter index)

Note
  for clearing multiple shifter error flags, for example, two shifter error flags, could calculate the mask by using ((1 << shifter index0) | (1 << shifter index1))

static uint32_t FLEXIO_GetTimerStatusFlags | ( | FLEXIO_Type * | base | ) |

inlinestatic

Parameters

  base | FlexIO peripheral base address

Returns
  timer status flags

static void FLEXIO_ClearTimerStatusFlags | ( | FLEXIO_Type * | base,
|  | uint32_t | mask
| ) |  |

inlinestatic

Parameters

  base | FlexIO peripheral base address
  mask | the timer status mask which could be calculated by (1 << timer index)

Note
  for clearing multiple timer status flags, for example, two timer status flags, could calculate the mask by using ((1 << timer index0) | (1 << timer index1))

static void FLEXIO_EnableShifterStatusDMA | ( | FLEXIO_Type * | base,
|  | uint32_t | mask,
|  | bool | enable
| ) |  |

inlinestatic

The DMA request generates when the corresponding SSF is set.

Note
  For multiple shifter status DMA enables, for example, calculate the mask by using ((1 << shifter index0) | (1 << shifter index1))

Parameters

  base | FlexIO peripheral base address
  mask | the shifter status mask which could 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
| ) |  |

Parameters

  base | FlexIO peripheral base address
  type | shifter type of flexio_shifter_buffer_type_t
  index | shifter index

Returns
  corresponding shifter buffer index

status_t FLEXIO_RegisterHandleIRQ | ( | void * | base,
|  | void * | handle,
|  | flexio_isr_t | isr
| ) |  |

Parameters

  base | pointer to FlexIO simulated peripheral type.
  handle | pointer to handler for FlexIO simulated peripheral.
  isr | FlexIO simulated peripheral interrupt handler.

Return values

  kStatus_Success | Successfully create the handle.
  kStatus_OutOfRange | The FlexIO type/handle/ISR table out of range.

status_t FLEXIO_UnregisterHandleIRQ | ( | void * | base | ) |

Parameters

  base | pointer to FlexIO simulated peripheral type.

Return values

  kStatus_Success | Successfully create the handle.
  kStatus_OutOfRange | The FlexIO type/handle/ISR table out of range.