Kinetis SDK v.1.3 API Reference Manual  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
KV31F51212 SIM HAL driver

Overview

The section describes the enumerations, macros and data structures for KV31F51212 SIM HAL driver.

Files

file  fsl_sim_hal_MKV31F51212.h
 

Macros

#define FSL_SIM_SCGC_BIT(SCGCx, n)   (((SCGCx-1U)<<5U) + n)
 SIM SCGC bit index. More...
 

Enumerations

enum  clock_wdog_src_kv31f51212_t {
  kClockWdogSrcLpoClk,
  kClockWdogSrcAltClk
}
 WDOG clock source select. More...
 
enum  clock_trace_src_kv31f51212_t {
  kClockTraceSrcMcgoutClk,
  kClockTraceSrcCoreClk
}
 Debug trace clock source select. More...
 
enum  clock_port_filter_src_kv31f51212_t {
  kClockPortFilterSrcBusClk,
  kClockPortFilterSrcLpoClk
}
 PORTx digital input filter clock source select. More...
 
enum  clock_lptmr_src_kv31f51212_t {
  kClockLptmrSrcMcgIrClk,
  kClockLptmrSrcLpoClk,
  kClockLptmrSrcEr32kClk,
  kClockLptmrSrcOsc0erClkUndiv
}
 LPTMR clock source select. More...
 
enum  clock_lpuart_src_kv31f51212_t {
  kClockLpuartSrcNone,
  kClockLpuartSrcPllFllSel,
  kClockLpuartSrcOsc0erClk,
  kClockLpuartSrcMcgIrClk
}
 SIM LPUART clock source. More...
 
enum  clock_pllfll_sel_kv31f51212_t {
  kClockPllFllSelFll = 0U,
  kClockPllFllSelPll = 1U,
  kClockPllFllSelIrc48M = 3U
}
 SIM PLLFLLSEL clock source select. More...
 
enum  clock_er32k_src_kv31f51212_t {
  kClockEr32kSrcOsc0 = 0U,
  kClockEr32kSrcLpo = 3U
}
 SIM external reference clock source select (OSC32KSEL). More...
 
enum  clock_clkout_src_kv31f51212_t {
  kClockClkoutSelFlexbusClk = 0U,
  kClockClkoutSelFlashClk = 2U,
  kClockClkoutSelLpoClk = 3U,
  kClockClkoutSelMcgIrClk = 4U,
  kClockClkoutSelOsc0erClk = 6U,
  kClockClkoutSelIrc48M = 7U
}
 SIM CLKOUT_SEL clock source select. More...
 
enum  clock_osc32kout_sel_kv31f51212_t
 SIM OSC32KOUT selection.
 
enum  sim_adc_pretrg_sel_kv31f51212_t {
  kSimAdcPretrgselA,
  kSimAdcPretrgselB
}
 SIM ADCx pre-trigger select. More...
 
enum  sim_adc_trg_sel_kv31f51212_t {
  kSimAdcTrgselExt = 0U,
  kSimAdcTrgSelHighSpeedComp0 = 1U,
  kSimAdcTrgSelHighSpeedComp1 = 2U,
  kSimAdcTrgSelPit0 = 4U,
  kSimAdcTrgSelPit1 = 5U,
  kSimAdcTrgSelPit2 = 6U,
  kSimAdcTrgSelPit3 = 7U,
  kSimAdcTrgSelFtm0 = 8U,
  kSimAdcTrgSelFtm1 = 9U,
  kSimAdcTrgSelFtm2 = 10U,
  kSimAdcTrgSelFtm3 = 11U,
  kSimAdcTrgSelLptimer = 14U
}
 SIM ADCx trigger select. More...
 
enum  sim_lpuart_rxsrc_kv31f51212_t {
  kSimLpuartRxsrcPin,
  kSimLpuartRxsrcCmp0,
  kSimLpuartRxsrcCmp1
}
 SIM LPUART RX source. More...
 
enum  sim_uart_rxsrc_kv31f51212_t {
  kSimUartRxsrcPin,
  kSimUartRxsrcCmp0,
  kSimUartRxsrcCmp1
}
 SIM UART receive data source select. More...
 
enum  sim_uart_txsrc_kv31f51212_t {
  kSimUartTxsrcPin,
  kSimUartTxsrcFtm1,
  kSimUartTxsrcFtm2
}
 SIM UART transmit data source select. More...
 
enum  sim_ftm_trg_src_kv31f51212_t {
  kSimFtmTrgSrc0,
  kSimFtmTrgSrc1
}
 SIM FlexTimer x trigger y select. More...
 
enum  sim_ftm_clk_sel_kv31f51212_t {
  kSimFtmClkSel0,
  kSimFtmClkSel1
}
 SIM FlexTimer external clock select. More...
 
enum  sim_ftm_ch_src_kv31f51212_t {
  kSimFtmChSrc0,
  kSimFtmChSrc1,
  kSimFtmChSrc2,
  kSimFtmChSrc3
}
 SIM FlexTimer x channel y input capture source select. More...
 
enum  sim_ftm_ch_out_src_kv31f51212_t {
  kSimFtmChOutSrc0,
  kSimFtmChOutSrc1
}
 SIM FlexTimer x channel y output source select. More...
 
enum  sim_ftm_flt_sel_kv31f51212_t {
  kSimFtmFltSel0,
  kSimFtmFltSel1
}
 SIM FlexTimer x Fault y select. More...
 
enum  sim_flexbus_security_level_kv31f51212_t {
  kSimFbslLevel0,
  kSimFbslLevel1,
  kSimFbslLevel2,
  kSimFbslLevel3
}
 SIM FlexBus security level. More...
 
enum  sim_clock_gate_name_kv31f51212_t
 Clock gate name used for SIM_HAL_EnableClock/SIM_HAL_DisableClock. More...
 

IP related clock feature APIs

static void SIM_HAL_EnableClock (SIM_Type *base, sim_clock_gate_name_t name)
 Enable the clock for specific module. More...
 
static void SIM_HAL_DisableClock (SIM_Type *base, sim_clock_gate_name_t name)
 Disable the clock for specific module. More...
 
static bool SIM_HAL_GetGateCmd (SIM_Type *base, sim_clock_gate_name_t name)
 Get the the clock gate state for specific module. More...
 
static void CLOCK_HAL_SetLpuartSrc (SIM_Type *base, uint32_t instance, clock_lpuart_src_t setting)
 Set LPUART clock source. More...
 
static clock_lpuart_src_t CLOCK_HAL_GetLpuartSrc (SIM_Type *base, uint32_t instance)
 Get LPUART clock source. More...
 
static void CLOCK_HAL_SetTraceClkSrc (SIM_Type *base, clock_trace_src_t setting)
 Set debug trace clock selection. More...
 
static clock_trace_src_t CLOCK_HAL_GetTraceClkSrc (SIM_Type *base)
 Get debug trace clock selection. More...
 
static void CLOCK_HAL_SetExternalRefClock32kSrc (SIM_Type *base, clock_er32k_src_t setting)
 Set the clock selection of ERCLK32K. More...
 
static clock_er32k_src_t CLOCK_HAL_GetExternalRefClock32kSrc (SIM_Type *base)
 Get the clock selection of ERCLK32K. More...
 
static void CLOCK_HAL_SetPllfllSel (SIM_Type *base, clock_pllfll_sel_t setting)
 Set PLL/FLL clock selection. More...
 
static clock_pllfll_sel_t CLOCK_HAL_GetPllfllSel (SIM_Type *base)
 Get PLL/FLL clock selection. More...
 
static void CLOCK_HAL_SetClkOutSel (SIM_Type *base, clock_clkout_src_t setting)
 Set CLKOUTSEL selection. More...
 
static clock_clkout_src_t CLOCK_HAL_GetClkOutSel (SIM_Type *base)
 Get CLKOUTSEL selection. More...
 
static void CLOCK_HAL_SetOsc32kOutSel (SIM_Type *base, clock_osc32kout_sel_t setting)
 Set OSC32KOUT selection. More...
 
static clock_osc32kout_sel_t CLOCK_HAL_GetOsc32kOutSel (SIM_Type *base)
 Get OSC32KOUT selection. More...
 
static void CLOCK_HAL_SetOutDiv1 (SIM_Type *base, uint8_t setting)
 Set OUTDIV1. More...
 
static uint8_t CLOCK_HAL_GetOutDiv1 (SIM_Type *base)
 Get OUTDIV1. More...
 
static void CLOCK_HAL_SetOutDiv2 (SIM_Type *base, uint8_t setting)
 Set OUTDIV2. More...
 
static uint8_t CLOCK_HAL_GetOutDiv2 (SIM_Type *base)
 Get OUTDIV2. More...
 
static void CLOCK_HAL_SetOutDiv3 (SIM_Type *base, uint8_t setting)
 Set OUTDIV3. More...
 
static uint8_t CLOCK_HAL_GetOutDiv3 (SIM_Type *base)
 Get OUTDIV3. More...
 
static void CLOCK_HAL_SetOutDiv4 (SIM_Type *base, uint8_t setting)
 Set OUTDIV4. More...
 
static uint8_t CLOCK_HAL_GetOutDiv4 (SIM_Type *base)
 Get OUTDIV4. More...
 
void CLOCK_HAL_SetOutDiv (SIM_Type *base, uint8_t outdiv1, uint8_t outdiv2, uint8_t outdiv3, uint8_t outdiv4)
 Sets the clock out dividers setting. More...
 
void CLOCK_HAL_GetOutDiv (SIM_Type *base, uint8_t *outdiv1, uint8_t *outdiv2, uint8_t *outdiv3, uint8_t *outdiv4)
 Gets the clock out dividers setting. More...
 
static uint32_t SIM_HAL_GetRamSize (SIM_Type *base)
 Gets RAM size. More...
 
static void SIM_HAL_SetFlexbusSecurityLevelMode (SIM_Type *base, sim_flexbus_security_level_t setting)
 Sets the FlexBus security level setting. More...
 
static sim_flexbus_security_level_t SIM_HAL_GetFlexbusSecurityLevelMode (SIM_Type *base)
 Gets the FlexBus security level setting. More...
 
void SIM_HAL_SetAdcAlternativeTriggerCmd (SIM_Type *base, uint32_t instance, bool enable)
 Sets the ADCx alternate trigger enable setting. More...
 
bool SIM_HAL_GetAdcAlternativeTriggerCmd (SIM_Type *base, uint32_t instance)
 Gets the ADCx alternate trigger enable setting. More...
 
void SIM_HAL_SetAdcPreTriggerMode (SIM_Type *base, uint32_t instance, sim_adc_pretrg_sel_t select)
 Sets the ADCx pre-trigger select setting. More...
 
sim_adc_pretrg_sel_t SIM_HAL_GetAdcPreTriggerMode (SIM_Type *base, uint32_t instance)
 Gets the ADCx pre-trigger select setting. More...
 
void SIM_HAL_SetAdcTriggerMode (SIM_Type *base, uint32_t instance, sim_adc_trg_sel_t select)
 Sets the ADCx trigger select setting. More...
 
sim_adc_trg_sel_t SIM_HAL_GetAdcTriggerMode (SIM_Type *base, uint32_t instance)
 Gets the ADCx trigger select setting. More...
 
void SIM_HAL_SetAdcTriggerModeOneStep (SIM_Type *base, uint32_t instance, bool altTrigEn, sim_adc_pretrg_sel_t preTrigSel, sim_adc_trg_sel_t trigSel)
 Sets the ADCx trigger select setting in one function. More...
 
void SIM_HAL_SetUartRxSrcMode (SIM_Type *base, uint32_t instance, sim_uart_rxsrc_t select)
 Sets the UARTx receive data source select setting. More...
 
sim_uart_rxsrc_t SIM_HAL_GetUartRxSrcMode (SIM_Type *base, uint32_t instance)
 Gets the UARTx receive data source select setting. More...
 
void SIM_HAL_SetUartTxSrcMode (SIM_Type *base, uint32_t instance, sim_uart_txsrc_t select)
 Sets the UARTx transmit data source select setting. More...
 
sim_uart_txsrc_t SIM_HAL_GetUartTxSrcMode (SIM_Type *base, uint32_t instance)
 Gets the UARTx transmit data source select setting. More...
 
static void SIM_HAL_SetLpuartRxSrcMode (SIM_Type *base, uint32_t instance, sim_lpuart_rxsrc_t select)
 Sets the LPUARTx receive data source select setting. More...
 
static sim_lpuart_rxsrc_t SIM_HAL_GetLpuartRxSrcMode (SIM_Type *base, uint32_t instance)
 Gets the LPUARTx receive data source select setting. More...
 
void SIM_HAL_SetFtmTriggerSrcMode (SIM_Type *base, uint32_t instance, uint8_t trigger, sim_ftm_trg_src_t select)
 Sets the FlexTimer x hardware trigger y source select setting. More...
 
sim_ftm_trg_src_t SIM_HAL_GetFtmTriggerSrcMode (SIM_Type *base, uint32_t instance, uint8_t trigger)
 Gets the FlexTimer x hardware trigger y source select setting. More...
 
void SIM_HAL_SetFtmExternalClkPinMode (SIM_Type *base, uint32_t instance, sim_ftm_clk_sel_t select)
 Sets the FlexTimer x external clock pin select setting. More...
 
sim_ftm_clk_sel_t SIM_HAL_GetFtmExternalClkPinMode (SIM_Type *base, uint32_t instance)
 Gets the FlexTimer x external clock pin select setting. More...
 
void SIM_HAL_SetFtmChSrcMode (SIM_Type *base, uint32_t instance, uint8_t channel, sim_ftm_ch_src_t select)
 Sets the FlexTimer x channel y input capture source select setting. More...
 
sim_ftm_ch_src_t SIM_HAL_GetFtmChSrcMode (SIM_Type *base, uint32_t instance, uint8_t channel)
 Gets the FlexTimer x channel y input capture source select setting. More...
 
void SIM_HAL_SetFtmChOutSrcMode (SIM_Type *base, uint32_t instance, uint8_t channel, sim_ftm_ch_out_src_t select)
 Sets the FlexTimer x channel y output source select setting. More...
 
sim_ftm_ch_out_src_t SIM_HAL_GetFtmChOutSrcMode (SIM_Type *base, uint32_t instance, uint8_t channel)
 Gets the FlexTimer x channel y output source select setting. More...
 
void SIM_HAL_SetFtmSyncCmd (SIM_Type *base, uint32_t instance, bool sync)
 Set FlexTimer x hardware trigger 0 software synchronization. More...
 
static bool SIM_HAL_GetFtmSyncCmd (SIM_Type *base, uint32_t instance)
 Get FlexTimer x hardware trigger 0 software synchronization setting. More...
 
void SIM_HAL_SetFtmFaultSelMode (SIM_Type *base, uint32_t instance, uint8_t fault, sim_ftm_flt_sel_t select)
 Sets the FlexTimer x fault y select setting. More...
 
sim_ftm_flt_sel_t SIM_HAL_GetFtmFaultSelMode (SIM_Type *base, uint32_t instance, uint8_t fault)
 Gets the FlexTimer x fault y select setting. More...
 
static uint32_t SIM_HAL_GetFamilyId (SIM_Type *base)
 Gets the Kinetis Family ID in the System Device ID register (SIM_SDID). More...
 
static uint32_t SIM_HAL_GetSubFamilyId (SIM_Type *base)
 Gets the Kinetis Sub-Family ID in the System Device ID register (SIM_SDID). More...
 
static uint32_t SIM_HAL_GetSeriesId (SIM_Type *base)
 Gets the Kinetis SeriesID in the System Device ID register (SIM_SDID). More...
 
static uint32_t SIM_HAL_GetPinCntId (SIM_Type *base)
 Gets the Kinetis Pincount ID in System Device ID register (SIM_SDID). More...
 
static uint32_t SIM_HAL_GetRevId (SIM_Type *base)
 Gets the Kinetis Revision ID in the System Device ID register (SIM_SDID). More...
 
static uint32_t SIM_HAL_GetDieId (SIM_Type *base)
 Gets the Kinetis Die ID in the System Device ID register (SIM_SDID). More...
 
static uint32_t SIM_HAL_GetProgramFlashSize (SIM_Type *base)
 Gets the program flash size in the Flash Configuration Register 1 (SIM_FCFG). More...
 
static void SIM_HAL_SetFlashDoze (SIM_Type *base, uint32_t setting)
 Sets the Flash Doze in the Flash Configuration Register 1 (SIM_FCFG). More...
 
static uint32_t SIM_HAL_GetFlashDoze (SIM_Type *base)
 Gets the Flash Doze in the Flash Configuration Register 1 (SIM_FCFG). More...
 
static void SIM_HAL_SetFlashDisableCmd (SIM_Type *base, bool disable)
 Sets the Flash disable setting. More...
 
static bool SIM_HAL_GetFlashDisableCmd (SIM_Type *base)
 Gets the Flash disable setting. More...
 
static uint32_t SIM_HAL_GetFlashMaxAddrBlock0 (SIM_Type *base)
 Gets the Flash maximum address block 0 in the Flash Configuration Register 1 (SIM_FCFG). More...
 
static uint32_t SIM_HAL_GetFlashMaxAddrBlock1 (SIM_Type *base)
 Gets the Flash maximum address block 1 in Flash Configuration Register 2. More...
 

Macro Definition Documentation

#define FSL_SIM_SCGC_BIT (   SCGCx,
 
)    (((SCGCx-1U)<<5U) + n)

Enumeration Type Documentation

Enumerator
kClockWdogSrcLpoClk 

LPO.

kClockWdogSrcAltClk 

Alternative clock, for this SOC it is Bus clock.

Enumerator
kClockTraceSrcMcgoutClk 

MCG out clock.

kClockTraceSrcCoreClk 

core clock

Enumerator
kClockPortFilterSrcBusClk 

Bus clock.

kClockPortFilterSrcLpoClk 

LPO.

Enumerator
kClockLptmrSrcMcgIrClk 

MCGIRCLK.

kClockLptmrSrcLpoClk 

LPO clock.

kClockLptmrSrcEr32kClk 

ERCLK32K clock.

kClockLptmrSrcOsc0erClkUndiv 

OSCERCLK_UNDIV clock.

Enumerator
kClockLpuartSrcNone 

Clock disabled.

kClockLpuartSrcPllFllSel 

Clock as selected by SOPT2[PLLFLLSEL].

kClockLpuartSrcOsc0erClk 

OSCERCLK.

kClockLpuartSrcMcgIrClk 

MCGIRCLK.

Enumerator
kClockPllFllSelFll 

Fll clock.

kClockPllFllSelPll 

Pll0 clock.

kClockPllFllSelIrc48M 

IRC48MCLK.

Enumerator
kClockEr32kSrcOsc0 

OSC0 clock (OSC032KCLK).

kClockEr32kSrcLpo 

LPO clock.

Enumerator
kClockClkoutSelFlexbusClk 

Flexbus clock.

kClockClkoutSelFlashClk 

Flash clock.

kClockClkoutSelLpoClk 

LPO clock.

kClockClkoutSelMcgIrClk 

MCGIRCLK.

kClockClkoutSelOsc0erClk 

OSC0ERCLK.

kClockClkoutSelIrc48M 

IRC48MCLK.

Enumerator
kSimAdcPretrgselA 

Pre-trigger A selected for ADCx.

kSimAdcPretrgselB 

Pre-trigger B selected for ADCx.

Enumerator
kSimAdcTrgselExt 

External trigger.

kSimAdcTrgSelHighSpeedComp0 

High speed comparator 0 output.

kSimAdcTrgSelHighSpeedComp1 

High speed comparator 1 output.

kSimAdcTrgSelPit0 

PIT trigger 0.

kSimAdcTrgSelPit1 

PIT trigger 1.

kSimAdcTrgSelPit2 

PIT trigger 2.

kSimAdcTrgSelPit3 

PIT trigger 3.

kSimAdcTrgSelFtm0 

FTM0 trigger.

kSimAdcTrgSelFtm1 

FTM1 trigger.

kSimAdcTrgSelFtm2 

FTM2 trigger.

kSimAdcTrgSelFtm3 

FTM3 trigger.

kSimAdcTrgSelLptimer 

Low-power timer trigger.

Enumerator
kSimLpuartRxsrcPin 

LPUARTx_RX Pin.

kSimLpuartRxsrcCmp0 

CMP0.

kSimLpuartRxsrcCmp1 

CMP1.

Enumerator
kSimUartRxsrcPin 

UARTx_RX Pin.

kSimUartRxsrcCmp0 

CMP0.

kSimUartRxsrcCmp1 

CMP1.

Enumerator
kSimUartTxsrcPin 

UARTx_TX Pin.

kSimUartTxsrcFtm1 

UARTx_TX pin modulated with FTM1 channel 0 output.

kSimUartTxsrcFtm2 

UARTx_TX pin modulated with FTM2 channel 0 output.

Enumerator
kSimFtmTrgSrc0 

FlexTimer x trigger y select 0.

kSimFtmTrgSrc1 

FlexTimer x trigger y select 1.

Enumerator
kSimFtmClkSel0 

FTM CLKIN0 pin.

kSimFtmClkSel1 

FTM CLKIN1 pin.

Enumerator
kSimFtmChSrc0 

FlexTimer x channel y input capture source 0.

kSimFtmChSrc1 

FlexTimer x channel y input capture source 1.

kSimFtmChSrc2 

FlexTimer x channel y input capture source 2.

kSimFtmChSrc3 

FlexTimer x channel y input capture source 3.

Enumerator
kSimFtmChOutSrc0 

FlexTimer x channel y output source 0.

kSimFtmChOutSrc1 

FlexTimer x channel y output source 1.

Enumerator
kSimFtmFltSel0 

FlexTimer x fault y select 0.

kSimFtmFltSel1 

FlexTimer x fault y select 1.

Enumerator
kSimFbslLevel0 

FlexBus security level 0.

kSimFbslLevel1 

FlexBus security level 1.

kSimFbslLevel2 

FlexBus security level 2.

kSimFbslLevel3 

FlexBus security level 3.

Function Documentation

static void SIM_HAL_EnableClock ( SIM_Type *  base,
sim_clock_gate_name_t  name 
)
inlinestatic

This function enables the clock for specific module.

Parameters
baseBase address for current SIM instance.
nameName of the module to enable.
static void SIM_HAL_DisableClock ( SIM_Type *  base,
sim_clock_gate_name_t  name 
)
inlinestatic

This function disables the clock for specific module.

Parameters
baseBase address for current SIM instance.
nameName of the module to disable.
static bool SIM_HAL_GetGateCmd ( SIM_Type *  base,
sim_clock_gate_name_t  name 
)
inlinestatic

This function will get the clock gate state for specific module.

Parameters
baseBase address for current SIM instance.
nameName of the module to get.
Returns
state true - ungated(Enabled), false - gated (Disabled)
static void CLOCK_HAL_SetLpuartSrc ( SIM_Type *  base,
uint32_t  instance,
clock_lpuart_src_t  setting 
)
inlinestatic

This function sets lpuart clock source selection.

Parameters
baseBase address for current SIM instance.
instanceLPUART instance.
settingThe value to set.
static clock_lpuart_src_t CLOCK_HAL_GetLpuartSrc ( SIM_Type *  base,
uint32_t  instance 
)
inlinestatic

This function gets lpuart clock source selection.

Parameters
baseBase address for current SIM instance.
instanceLPUART instance.
Returns
Current selection.
static void CLOCK_HAL_SetTraceClkSrc ( SIM_Type *  base,
clock_trace_src_t  setting 
)
inlinestatic

This function sets debug trace clock selection.

Parameters
baseBase address for current SIM instance.
settingThe value to set.
static clock_trace_src_t CLOCK_HAL_GetTraceClkSrc ( SIM_Type *  base)
inlinestatic

This function gets debug trace clock selection.

Parameters
baseBase address for current SIM instance.
Returns
Current selection.
static void CLOCK_HAL_SetExternalRefClock32kSrc ( SIM_Type *  base,
clock_er32k_src_t  setting 
)
inlinestatic

This function sets the clock selection of ERCLK32K.

Parameters
baseBase address for current SIM instance.
settingThe value to set.
static clock_er32k_src_t CLOCK_HAL_GetExternalRefClock32kSrc ( SIM_Type *  base)
inlinestatic

This function gets the clock selection of ERCLK32K.

Parameters
baseBase address for current SIM instance.
Returns
Current selection.
static void CLOCK_HAL_SetPllfllSel ( SIM_Type *  base,
clock_pllfll_sel_t  setting 
)
inlinestatic

This function sets the selection of the high frequency clock for various peripheral clocking options

Parameters
baseBase address for current SIM instance.
settingThe value to set.
static clock_pllfll_sel_t CLOCK_HAL_GetPllfllSel ( SIM_Type *  base)
inlinestatic

This function gets the selection of the high frequency clock for various peripheral clocking options

Parameters
baseBase address for current SIM instance.
Returns
Current selection.
static void CLOCK_HAL_SetClkOutSel ( SIM_Type *  base,
clock_clkout_src_t  setting 
)
inlinestatic

This function sets the selection of the clock to output on the CLKOUT pin.

Parameters
baseBase address for current SIM instance.
settingThe value to set.
static clock_clkout_src_t CLOCK_HAL_GetClkOutSel ( SIM_Type *  base)
inlinestatic

This function gets the selection of the clock to output on the CLKOUT pin.

Parameters
baseBase address for current SIM instance.
Returns
Current selection.
static void CLOCK_HAL_SetOsc32kOutSel ( SIM_Type *  base,
clock_osc32kout_sel_t  setting 
)
inlinestatic

This function sets ERCLK32K output pin.

Parameters
baseBase address for current SIM instance.
settingThe value to set.
static clock_osc32kout_sel_t CLOCK_HAL_GetOsc32kOutSel ( SIM_Type *  base)
inlinestatic

This function gets ERCLK32K output pin setting.

Parameters
baseBase address for current SIM instance.
Returns
Current selection.
static void CLOCK_HAL_SetOutDiv1 ( SIM_Type *  base,
uint8_t  setting 
)
inlinestatic

This function sets divide value OUTDIV1.

Parameters
baseBase address for current SIM instance.
settingThe value to set.
static uint8_t CLOCK_HAL_GetOutDiv1 ( SIM_Type *  base)
inlinestatic

This function gets divide value OUTDIV1.

Parameters
baseBase address for current SIM instance.
Returns
Current divide value.
static void CLOCK_HAL_SetOutDiv2 ( SIM_Type *  base,
uint8_t  setting 
)
inlinestatic

This function sets divide value OUTDIV2.

Parameters
baseBase address for current SIM instance.
settingThe value to set.
static uint8_t CLOCK_HAL_GetOutDiv2 ( SIM_Type *  base)
inlinestatic

This function gets divide value OUTDIV2.

Parameters
baseBase address for current SIM instance.
Returns
Current divide value.
static void CLOCK_HAL_SetOutDiv3 ( SIM_Type *  base,
uint8_t  setting 
)
inlinestatic

This function sets divide value OUTDIV3.

Parameters
baseBase address for current SIM instance.
settingThe value to set.
static uint8_t CLOCK_HAL_GetOutDiv3 ( SIM_Type *  base)
inlinestatic

This function gets divide value OUTDIV3.

Parameters
baseBase address for current SIM instance.
Returns
Current divide value.
static void CLOCK_HAL_SetOutDiv4 ( SIM_Type *  base,
uint8_t  setting 
)
inlinestatic

This function sets divide value OUTDIV4.

Parameters
baseBase address for current SIM instance.
settingThe value to set.
static uint8_t CLOCK_HAL_GetOutDiv4 ( SIM_Type *  base)
inlinestatic

This function gets divide value OUTDIV4.

Parameters
baseBase address for current SIM instance.
Returns
Current divide value.
void CLOCK_HAL_SetOutDiv ( SIM_Type *  base,
uint8_t  outdiv1,
uint8_t  outdiv2,
uint8_t  outdiv3,
uint8_t  outdiv4 
)

This function sets the setting for all clock out dividers at the same time.

Parameters
baseBase address for current SIM instance.
outdiv1Outdivider1 setting
outdiv2Outdivider2 setting
outdiv3Outdivider3 setting
outdiv4Outdivider4 setting
void CLOCK_HAL_GetOutDiv ( SIM_Type *  base,
uint8_t *  outdiv1,
uint8_t *  outdiv2,
uint8_t *  outdiv3,
uint8_t *  outdiv4 
)

This function gets the setting for all clock out dividers at the same time.

Parameters
baseBase address for current SIM instance.
outdiv1Outdivider1 setting
outdiv2Outdivider2 setting
outdiv3Outdivider3 setting
outdiv4Outdivider4 setting
static uint32_t SIM_HAL_GetRamSize ( SIM_Type *  base)
inlinestatic

This function gets the RAM size. The field specifies the amount of system RAM available on the device.

Parameters
baseBase address for current SIM instance.
Returns
size RAM size on the device
static void SIM_HAL_SetFlexbusSecurityLevelMode ( SIM_Type *  base,
sim_flexbus_security_level_t  setting 
)
inlinestatic

This function sets the FlexBus security level setting. If the security is enabled, this field affects which CPU operations can access the off-chip via the FlexBus and DDR controller interfaces. This field has no effect if the security is not enabled.

Parameters
baseBase address for current SIM instance.
settingFlexBus security level setting
  • 00: All off-chip accesses (op code and data) via the FlexBus and DDR controller are disallowed.
  • 10: Off-chip op code accesses are disallowed. Data accesses are allowed.
  • 11: Off-chip op code accesses and data accesses are allowed.
static sim_flexbus_security_level_t SIM_HAL_GetFlexbusSecurityLevelMode ( SIM_Type *  base)
inlinestatic

This function gets the FlexBus security level setting.

Parameters
baseBase address for current SIM instance.
Returns
setting FlexBus security level setting
void SIM_HAL_SetAdcAlternativeTriggerCmd ( SIM_Type *  base,
uint32_t  instance,
bool  enable 
)
inline

This function enables/disables the alternative conversion triggers for ADCx.

Parameters
baseBase address for current SIM instance.
instancedevice instance.
enableEnable alternative conversion triggers for ADCx
  • true: Select alternative conversion trigger.
  • false: Select PDB trigger.

Sets the USB voltage regulator enabled setting.

This function enables/disables the alternative conversion triggers for ADCx.

Parameters
baseBase address for current SIM instance.
instancedevice instance.
enableEnable alternative conversion triggers for ADCx
  • true: Select alternative conversion trigger.
  • false: Select PDB trigger.

This function controls whether the USB voltage regulator is enabled. This bit can only be written when the SOPT1CFG[URWE] bit is set.

Parameters
baseBase address for current SIM instance.
enableUSB voltage regulator enable setting
  • true: USB voltage regulator is enabled.
  • false: USB voltage regulator is disabled.

Sets the ADCx alternate trigger enable setting.

This function enables/disables the alternative conversion triggers for ADCx.

Parameters
baseBase address for current SIM instance.
instancedevice instance.
enableEnable alternative conversion triggers for ADCx
  • true: Select alternative conversion trigger.
  • false: Select PDB trigger.
bool SIM_HAL_GetAdcAlternativeTriggerCmd ( SIM_Type *  base,
uint32_t  instance 
)
inline

This function gets the ADCx alternate trigger enable setting.

Parameters
baseBase address for current SIM instance.
instancedevice instance.
Returns
enabled True if ADCx alternate trigger is enabled
void SIM_HAL_SetAdcPreTriggerMode ( SIM_Type *  base,
uint32_t  instance,
sim_adc_pretrg_sel_t  select 
)
inline

This function selects the ADCx pre-trigger source when the alternative triggers are enabled through ADCxALTTRGEN.

Parameters
baseBase address for current SIM instance.
instancedevice instance.
selectpre-trigger select setting for ADCx
sim_adc_pretrg_sel_t SIM_HAL_GetAdcPreTriggerMode ( SIM_Type *  base,
uint32_t  instance 
)
inline

This function gets the ADCx pre-trigger select setting.

Parameters
baseBase address for current SIM instance.
instancedevice instance.
Returns
select ADCx pre-trigger select setting
void SIM_HAL_SetAdcTriggerMode ( SIM_Type *  base,
uint32_t  instance,
sim_adc_trg_sel_t  select 
)
inline

This function selects the ADCx trigger source when alternative triggers are enabled through ADCxALTTRGEN.

Parameters
baseBase address for current SIM instance.
instancedevice instance.
selecttrigger select setting for ADCx
sim_adc_trg_sel_t SIM_HAL_GetAdcTriggerMode ( SIM_Type *  base,
uint32_t  instance 
)
inline

This function gets the ADCx trigger select setting.

Parameters
baseBase address for current SIM instance.
instancedevice instance.
Returns
ADCx trigger select setting
void SIM_HAL_SetAdcTriggerModeOneStep ( SIM_Type *  base,
uint32_t  instance,
bool  altTrigEn,
sim_adc_pretrg_sel_t  preTrigSel,
sim_adc_trg_sel_t  trigSel 
)

This function sets ADC alternate trigger, pre-trigger mode and trigger mode.

Parameters
baseBase address for current SIM instance.
instancedevice instance.
altTrigEnAlternative trigger enable or not.
preTrigSelPre-trigger mode.
trigSelTrigger mode.
void SIM_HAL_SetUartRxSrcMode ( SIM_Type *  base,
uint32_t  instance,
sim_uart_rxsrc_t  select 
)
inline

This function selects the source for the UARTx receive data.

Parameters
baseBase address for current SIM instance.
instancedevice instance.
selectthe source for the UARTx receive data
sim_uart_rxsrc_t SIM_HAL_GetUartRxSrcMode ( SIM_Type *  base,
uint32_t  instance 
)
inline

This function gets the UARTx receive data source select setting.

Parameters
baseBase address for current SIM instance.
instancedevice instance.
Returns
select UARTx receive data source select setting
void SIM_HAL_SetUartTxSrcMode ( SIM_Type *  base,
uint32_t  instance,
sim_uart_txsrc_t  select 
)
inline

This function selects the source for the UARTx transmit data.

Parameters
baseBase address for current SIM instance.
instancedevice instance.
selectthe source for the UARTx transmit data
sim_uart_txsrc_t SIM_HAL_GetUartTxSrcMode ( SIM_Type *  base,
uint32_t  instance 
)
inline

This function gets the UARTx transmit data source select setting.

Parameters
baseBase address for current SIM instance.
instancedevice instance.
Returns
select UARTx transmit data source select setting
static void SIM_HAL_SetLpuartRxSrcMode ( SIM_Type *  base,
uint32_t  instance,
sim_lpuart_rxsrc_t  select 
)
inlinestatic

This function selects the source for the LPUARTx receive data.

Parameters
baseBase address for current SIM instance.
instancedevice instance.
selectthe source for the LPUARTx receive data
static sim_lpuart_rxsrc_t SIM_HAL_GetLpuartRxSrcMode ( SIM_Type *  base,
uint32_t  instance 
)
inlinestatic

This function gets the LPUARTx receive data source select setting.

Parameters
baseBase address for current SIM instance.
instancedevice instance.
Returns
select LPUARTx receive data source select setting
void SIM_HAL_SetFtmTriggerSrcMode ( SIM_Type *  base,
uint32_t  instance,
uint8_t  trigger,
sim_ftm_trg_src_t  select 
)

This function selects the source of FTMx hardware trigger y.

Parameters
baseBase address for current SIM instance.
instancedevice instance.
triggerhardware trigger y
selectFlexTimer x hardware trigger y
  • 0: Pre-trigger A selected for ADCx.
  • 1: Pre-trigger B selected for ADCx.
sim_ftm_trg_src_t SIM_HAL_GetFtmTriggerSrcMode ( SIM_Type *  base,
uint32_t  instance,
uint8_t  trigger 
)

This function gets the FlexTimer x hardware trigger y source select setting.

Parameters
baseBase address for current SIM instance.
instancedevice instance.
triggerhardware trigger y
Returns
select FlexTimer x hardware trigger y source select setting
void SIM_HAL_SetFtmExternalClkPinMode ( SIM_Type *  base,
uint32_t  instance,
sim_ftm_clk_sel_t  select 
)

This function selects the source of FTMx external clock pin select.

Parameters
baseBase address for current SIM instance.
instancedevice instance.
selectFTMx external clock pin select
  • 0: FTMx external clock driven by FTM CLKIN0 pin.
  • 1: FTMx external clock driven by FTM CLKIN1 pin.
sim_ftm_clk_sel_t SIM_HAL_GetFtmExternalClkPinMode ( SIM_Type *  base,
uint32_t  instance 
)

This function gets the FlexTimer x external clock pin select setting.

Parameters
baseBase address for current SIM instance.
instancedevice instance.
Returns
select FlexTimer x external clock pin select setting
void SIM_HAL_SetFtmChSrcMode ( SIM_Type *  base,
uint32_t  instance,
uint8_t  channel,
sim_ftm_ch_src_t  select 
)

This function selects the FlexTimer x channel y input capture source.

Parameters
baseBase address for current SIM instance.
instancedevice instance.
channelFlexTimer channel y
selectFlexTimer x channel y input capture source
sim_ftm_ch_src_t SIM_HAL_GetFtmChSrcMode ( SIM_Type *  base,
uint32_t  instance,
uint8_t  channel 
)

This function gets the FlexTimer x channel y input capture source select setting.

Parameters
baseBase address for current SIM instance.
instancedevice instance.
channelFlexTimer channel y
Returns
select FlexTimer x channel y input capture source select setting
void SIM_HAL_SetFtmChOutSrcMode ( SIM_Type *  base,
uint32_t  instance,
uint8_t  channel,
sim_ftm_ch_out_src_t  select 
)

This function selects the FlexTimer x channel y output source.

Parameters
baseBase address for current SIM instance.
instancedevice instance.
channelFlexTimer channel y
selectFlexTimer x channel y output source
sim_ftm_ch_out_src_t SIM_HAL_GetFtmChOutSrcMode ( SIM_Type *  base,
uint32_t  instance,
uint8_t  channel 
)

This function gets the FlexTimer x channel y output source select setting.

Parameters
baseBase address for current SIM instance.
instancedevice instance.
channelFlexTimer channel y
Returns
select FlexTimer x channel y output source select setting
void SIM_HAL_SetFtmSyncCmd ( SIM_Type *  base,
uint32_t  instance,
bool  sync 
)

This function sets FlexTimer x hardware trigger 0 software synchronization. FTMxSYNCBIT.

Parameters
baseBase address for current SIM instance.
instancedevice instance.
syncSynchronize or not.
static bool SIM_HAL_GetFtmSyncCmd ( SIM_Type *  base,
uint32_t  instance 
)
inlinestatic

This function gets FlexTimer x hardware trigger 0 software synchronization. FTMxSYNCBIT.

Parameters
baseBase address for current SIM instance.
instancedevice instance.
Returns
The synchronization value.
void SIM_HAL_SetFtmFaultSelMode ( SIM_Type *  base,
uint32_t  instance,
uint8_t  fault,
sim_ftm_flt_sel_t  select 
)

This function sets the FlexTimer x fault y select setting.

Parameters
baseBase address for current SIM instance.
instancedevice instance.
faultfault y
selectFlexTimer x fault y select setting
  • 0: FlexTimer x fault y select 0.
  • 1: FlexTimer x fault y select 1.
sim_ftm_flt_sel_t SIM_HAL_GetFtmFaultSelMode ( SIM_Type *  base,
uint32_t  instance,
uint8_t  fault 
)

This function gets the FlexTimer x fault y select setting.

Parameters
baseBase address for current SIM instance.
instancedevice instance.
faultfault y
Returns
select FlexTimer x fault y select setting
static uint32_t SIM_HAL_GetFamilyId ( SIM_Type *  base)
inlinestatic

This function gets the Kinetis Family ID in the System Device ID register.

Parameters
baseBase address for current SIM instance.
Returns
id Kinetis Family ID
static uint32_t SIM_HAL_GetSubFamilyId ( SIM_Type *  base)
inlinestatic

This function gets the Kinetis Sub-Family ID in System Device ID register.

Parameters
baseBase address for current SIM instance.
Returns
id Kinetis Sub-Family ID
static uint32_t SIM_HAL_GetSeriesId ( SIM_Type *  base)
inlinestatic

This function gets the Kinetis Series ID in System Device ID register.

Parameters
baseBase address for current SIM instance.
Returns
id Kinetis Series ID
static uint32_t SIM_HAL_GetPinCntId ( SIM_Type *  base)
inlinestatic

This function gets the Kinetis Pincount ID in System Device ID register.

Parameters
baseBase address for current SIM instance.
Returns
id Kinetis Pincount ID
static uint32_t SIM_HAL_GetRevId ( SIM_Type *  base)
inlinestatic

This function gets the Kinetis Revision ID in System Device ID register.

Parameters
baseBase address for current SIM instance.
Returns
id Kinetis Revision ID
static uint32_t SIM_HAL_GetDieId ( SIM_Type *  base)
inlinestatic

This function gets the Kinetis Die ID in System Device ID register.

Parameters
baseBase address for current SIM instance.
Returns
id Kinetis Die ID
static uint32_t SIM_HAL_GetProgramFlashSize ( SIM_Type *  base)
inlinestatic

This function gets the program flash size in the Flash Configuration Register 1.

Parameters
baseBase address for current SIM instance.
Returns
size Program flash Size
static void SIM_HAL_SetFlashDoze ( SIM_Type *  base,
uint32_t  setting 
)
inlinestatic

This function sets the Flash Doze in the Flash Configuration Register 1.

Parameters
baseBase address for current SIM instance.
settingFlash Doze setting
static uint32_t SIM_HAL_GetFlashDoze ( SIM_Type *  base)
inlinestatic

This function gets the Flash Doze in the Flash Configuration Register 1.

Parameters
baseBase address for current SIM instance.
Returns
setting Flash Doze setting
static void SIM_HAL_SetFlashDisableCmd ( SIM_Type *  base,
bool  disable 
)
inlinestatic

This function sets the Flash disable setting in the Flash Configuration Register 1.

Parameters
baseBase address for current SIM instance.
disableFlash disable setting
static bool SIM_HAL_GetFlashDisableCmd ( SIM_Type *  base)
inlinestatic

This function gets the Flash disable setting in the Flash Configuration Register 1.

Parameters
baseBase address for current SIM instance.
Returns
setting Flash disable setting
static uint32_t SIM_HAL_GetFlashMaxAddrBlock0 ( SIM_Type *  base)
inlinestatic

This function gets the Flash maximum block 0 in Flash Configuration Register 2.

Parameters
baseBase address for current SIM instance.
Returns
address Flash maximum block 0 address
static uint32_t SIM_HAL_GetFlashMaxAddrBlock1 ( SIM_Type *  base)
inlinestatic

This function gets the Flash maximum block 1 in Flash Configuration Register 1.

Parameters
baseBase address for current SIM instance.
Returns
address Flash maximum block 0 address