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

Overview

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

Files

file  fsl_sim_hal_MKM34Z7.h
 

Enumerations

enum  clock_wdog_src_t { ,
  kClockWdogSrcLpoClk,
  kClockWdogSrcAltClk,
  kClockWdogSrcLpoClk,
  kClockWdogSrcAltClk,
  kClockWdogSrcLpoClk,
  kClockWdogSrcAltClk,
  kClockWdogSrcLpoClk,
  kClockWdogSrcAltClk,
  kClockWdogSrcLpoClk,
  kClockWdogSrcAltClk
}
 WDOG clock source select. More...
 
enum  clock_afe_src_t
 AFE clock source select. More...
 
enum  clock_lptmr_src_t { ,
  kClockLptmrSrcMcgIrClk,
  kClockLptmrSrcLpoClk,
  kClockLptmrSrcEr32kClk,
  kClockLptmrSrcOsc0erClkUndiv,
  kClockLptmrSrcMcgIrClk,
  kClockLptmrSrcLpoClk,
  kClockLptmrSrcEr32kClk,
  kClockLptmrSrcOsc0erClkUndiv,
  kClockLptmrSrcMcgIrClk,
  kClockLptmrSrcLpoClk,
  kClockLptmrSrcEr32kClk,
  kClockLptmrSrcOsc0erClkUndiv,
  kClockLptmrSrcMcgIrClk,
  kClockLptmrSrcLpoClk,
  kClockLptmrSrcEr32kClk,
  kClockLptmrSrcOsc0erClkUndiv,
  kClockLptmrSrcMcgIrClk,
  kClockLptmrSrcLpoClk,
  kClockLptmrSrcEr32kClk,
  kClockLptmrSrcOsc0erClkUndiv
}
 LPTMR clock source select, table 5-2. More...
 
enum  clock_slcd_src_t
 LCD clock source select, table 5-2.
 
enum  clock_er32k_src_t { ,
  kClockEr32kSrcOsc0 = 0U,
  kClockEr32kSrcLpo = 3U,
  kClockEr32kSrcOsc0 = 0U,
  kClockEr32kSrcLpo = 3U,
  kClockEr32kSrcOsc0 = 0U,
  kClockEr32kSrcLpo = 3U,
  kClockEr32kSrcOsc0 = 0U,
  kClockEr32kSrcLpo = 3U,
  kClockEr32kSrcOsc0 = 0U,
  kClockEr32kSrcLpo = 3U
}
 SIM external reference clock source select (OSC32KSEL) More...
 
enum  clock_clkout_src_t
 SIM CLKOUT_SEL clock source select.
 
enum  clock_rtcout_src_t
 SIM RTCCLKSEL clock source select, SIM_MISC_CTL.
 
enum  clock_lpuart_src_t
 SIM LPUART clock source selection, SIM_CTRL_REG.
 
enum  sim_tmr_cnt_freeze_sel_t
 SIM TMR counter freeze control, SIM_CTRL_REG.
 
enum  sim_afe_clk_div_sel_t
 SIM AFE clock out dividing setting, SIM_CTRL_REG.
 
enum  clock_xbar_out_src_t
 SIM XBAR clock out source select, SIM_CTRL_REG.
 
enum  clock_pllfll_sel_t
 SIM PLLFLLSEL clock source select, SIM_CTRL_REG.
 
enum  sim_spi_out_invert_sel_t
 SIM SPI output signal inverting setting, SIM_CTRL_REG.
 
enum  sim_sadc_trg_clk_sel_t
 SIM SAR ADC trigger clock select, SIM_CTRL_REG.
 
enum  sim_lptmr_src_sel_t
 SIM LP timer channel x source selection, SIM_SOPT1_CFG.
 
enum  sim_vref_buff_input_sel_t
 SIM VrefBuffer input selection, SIM_MISC_CTL.
 
enum  sim_tmr_Primary_src_sel_t
 SIM Quadtimer channel x primary count source selection, SIM_MISC_CTL.
 
enum  sim_tmr_sencond_src_sel_t
 SIM Quadtimer channel x secondary count source selection.
 
enum  clock_tmr0_pll_src_t
 SIM Timer channel 0 PLL clock selection, SIM_MISC_CTL.
 
enum  sim_ewm_input_sel_t
 SIM External watchdog monitor input selection, SIM_MISC_CTL.
 
enum  sim_uart_irda_sel_t
 SIM UARTx IRDA selection, SIM_MISC_CTL.
 
enum  sim_uart_irda_type_sel_t
 SIM UARTx IRDA modulation type selection, SIM_MISC_CTL.
 
enum  sim_afe_clk_pad_dir_t
 SIM, Controls the direction of the AFE CLK pin, SIM_MISC_CTL.
 
enum  sim_dma_done_sel_t
 SIM DMA done selection, SIM_MISC_CTL.
 
enum  sim_adc_trg_src_sel_t
 SIM ADC trigger source selection, SIM_MISC_CTL.
 

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 uint32_t SIM_HAL_GetSRamSize (SIM_Type *base)
 Gets the Kinetis system RAM size in the System Options register 1(SIM_SOPT1). 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 SIM_HAL_SetRamBitlinePrechargeCmd (SIM_Type *base, bool enable)
 Sets the RAM Bitline Precharge enable setting. More...
 
static bool SIM_HAL_GetRamBitlinePrechargeCmd (SIM_Type *base)
 Gets the RAM Bitline Precharge enable setting. More...
 
static void SIM_HAL_SetRamSrcBiasCmd (SIM_Type *base, bool disable)
 Sets the source bias of SRAM arrays enable setting. More...
 
static bool SIM_HAL_GetRamSrcBiasCmd (SIM_Type *base)
 Gets the source bias of SRAM arrays enable setting. More...
 
void SIM_HAL_SetLptmrChSelMode (SIM_Type *base, uint8_t channel, sim_lptmr_src_sel_t select)
 Sets the LPTMR channel x source select setting. More...
 
sim_lptmr_src_sel_t SIM_HAL_GetLptmrChSelMode (SIM_Type *base, uint8_t channel)
 Gets the LPTMR channel x source select setting. 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_SetSAdcTrgClkSel (SIM_Type *base, sim_sadc_trg_clk_sel_t setting)
 Set SAR ADC trigger clock selection. More...
 
static sim_sadc_trg_clk_sel_t CLOCK_HAL_GetSAdcTrgClkSel (SIM_Type *base)
 Get the SAR ADC trigger clock selection. More...
 
static void CLOCK_HAL_SetTmrCntFreezeCmd (SIM_Type *base, sim_tmr_cnt_freeze_sel_t setting)
 Set TMR counter freeze setting. More...
 
static sim_tmr_cnt_freeze_sel_t CLOCK_HAL_GetTmrCntFreezeCmd (SIM_Type *base)
 Get the TMR counter freeze setting. More...
 
static void CLOCK_HAL_SetLpuartClkSel (SIM_Type *base, clock_lpuart_src_t setting)
 Set LPUART clock source selection. More...
 
static clock_lpuart_src_t CLOCK_HAL_GetLpuartClkSel (SIM_Type *base)
 Get the LPUART clock source selection. More...
 
static void CLOCK_HAL_SetAfeOutDivCmd (SIM_Type *base, sim_afe_clk_div_sel_t setting)
 Set AFE output clock dividing setting. More...
 
static sim_afe_clk_div_sel_t CLOCK_HAL_GetAfeOutDivCmd (SIM_Type *base)
 Get the AFE output clock dividing setting. More...
 
static void CLOCK_HAL_SetXbarOutSel (SIM_Type *base, clock_xbar_out_src_t setting)
 Set XBARCLKOUT selection. More...
 
static clock_xbar_out_src_t CLOCK_HAL_GetXbarOutSel (SIM_Type *base)
 Get XBARCLKOUT selection. 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...
 
void CLOCK_HAL_SetSpiOutInvCmd (SIM_Type *base, uint32_t instance, uint8_t inv_type, sim_spi_out_invert_sel_t setting)
 Set SPI output signal inverting setting. More...
 
sim_spi_out_invert_sel_t CLOCK_HAL_GetSpiOutInvCmd (SIM_Type *base, uint32_t instance, uint8_t inv_type)
 Get the SPI output signal inverting setting. More...
 
static void SIM_HAL_SetPllInVlpCmd (SIM_Type *base, bool enable)
 Sets the PLL VLP enable setting. More...
 
static bool SIM_HAL_GetPllInVlpCmd (SIM_Type *base)
 Gets the PLL VLP enable setting. More...
 
static void SIM_HAL_SetNmiDisCmd (SIM_Type *base, bool disable)
 Sets the NMI feature enable setting. More...
 
static bool SIM_HAL_GetNmiDisCmd (SIM_Type *base)
 Gets the NMI feature enable 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_GetAttributeId (SIM_Type *base)
 Gets the Attribute ID in the System Device ID register (SIM_SDID). More...
 
static uint32_t SIM_HAL_GetSRamSizeId (SIM_Type *base)
 Gets the SRAM SIZE in the 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_GetPinCntId (SIM_Type *base)
 Gets the Kinetis Pincount ID in System Device ID register (SIM_SDID). More...
 
static void CLOCK_HAL_SetSysDiv (SIM_Type *base, uint8_t setting)
 Set system clock divider. More...
 
static uint8_t CLOCK_HAL_GetSysDiv (SIM_Type *base)
 Get SYSDIV. More...
 
static void CLOCK_HAL_SetBusDiv (SIM_Type *base, uint8_t setting)
 Set BUS clock divider. More...
 
static uint8_t CLOCK_HAL_GetBusDiv (SIM_Type *base)
 Get BUS clock divider value. More...
 
static void CLOCK_HAL_SetFlashClkMode (SIM_Type *base, uint8_t setting)
 Set FLASH clock mode. More...
 
static uint8_t CLOCK_HAL_GetFlashClkMode (SIM_Type *base)
 Get FLASH clock mode value. More...
 
void CLOCK_HAL_SetOutDiv (SIM_Type *base, uint8_t sysDiv, uint8_t busDiv, uint8_t flashclkmode)
 Set all clock out dividers setting at one time. More...
 
void CLOCK_HAL_GetOutDiv (SIM_Type *base, uint8_t *sysDiv, uint8_t *busDiv, uint8_t *flashclkmode)
 Get all clock out dividers setting at one time. 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_GetRamSize (SIM_Type *base)
 Gets the RAM size. 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 in the Flash Configuration Register 2(SIM_FCFG2). More...
 
static void SIM_HAL_SetVrefBuffPowerDownCmd (SIM_Type *base, bool enable)
 Sets the VrefBuffer enable setting. More...
 
static bool SIM_HAL_GetVrefBuffPowerDownCmd (SIM_Type *base)
 Gets the VrefBuffer enable setting. More...
 
static void CLOCK_HAL_SetVrefBuffInputSel (SIM_Type *base, sim_vref_buff_input_sel_t setting)
 Set the VrefBuffer input selection. More...
 
static sim_vref_buff_input_sel_t CLOCK_HAL_GetVrefBuffInputSel (SIM_Type *base)
 Get the VrefBuffer input selection. More...
 
static void SIM_HAL_SetVrefBuffOutCmd (SIM_Type *base, bool enable)
 Sets the VrefBuffer Output enable setting. More...
 
static bool SIM_HAL_GetVrefBuffOutCmd (SIM_Type *base)
 Gets the VrefBuffer Output enable setting. More...
 
static void CLOCK_HAL_SetRtcClkSel (SIM_Type *base, clock_rtcout_src_t setting)
 Set the RTC clock source selection for RTC operation. More...
 
static clock_rtcout_src_t CLOCK_HAL_GetRtcClkSel (SIM_Type *base)
 Get the RTC clock source selection for RTC operation. More...
 
void SIM_HAL_SetTmrPrimaryCntSrcSelMode (SIM_Type *base, uint8_t channel, sim_tmr_Primary_src_sel_t select)
 Sets the Quadtimer channel x Primary Count source select setting. More...
 
sim_tmr_Primary_src_sel_t SIM_HAL_GetTmrPrimaryCntSrcSelMode (SIM_Type *base, uint8_t channel)
 Gets the Quadtimer channel x Primary Count source select setting. More...
 
void SIM_HAL_SetTmrSecondCntSrcSelMode (SIM_Type *base, uint8_t channel, sim_tmr_sencond_src_sel_t select)
 Sets the Quadtimer channel x Secondary Count source select setting. More...
 
sim_tmr_sencond_src_sel_t SIM_HAL_GetTmrSecondCntSrcSelMode (SIM_Type *base, uint8_t channel)
 Gets the Quadtimer channel x Secondary Count source select setting. More...
 
static void SIM_HAL_SetTmr0PllClkSelMode (SIM_Type *base, clock_tmr0_pll_src_t select)
 Sets the Timer0 CH0 PLL clock source select setting. More...
 
static clock_tmr0_pll_src_t SIM_HAL_GetTmr0PllClkSelMode (SIM_Type *base)
 Gets the Timer0 CH0 PLL clock source select setting. More...
 
static void SIM_HAL_SetEwmInputSelMode (SIM_Type *base, sim_ewm_input_sel_t select)
 Sets the EWM input select setting. More...
 
static sim_ewm_input_sel_t SIM_HAL_GetEwmInputSelMode (SIM_Type *base)
 Gets the EWM input select setting. More...
 
void SIM_HAL_SetUartIrdaSelMode (SIM_Type *base, uint32_t instance, sim_uart_irda_sel_t select)
 Sets the UART x IRDA select setting. More...
 
sim_uart_irda_sel_t SIM_HAL_GetUartIrdaSelMode (SIM_Type *base, uint32_t instance)
 Gets the UART x IRDA select setting. More...
 
static void SIM_HAL_SetUartModTypeSelMode (SIM_Type *base, sim_uart_irda_type_sel_t select)
 Sets the UART modulation select setting. More...
 
static sim_uart_irda_type_sel_t SIM_HAL_GetUartModTypeSelMode (SIM_Type *base)
 Gets the UART modulation select setting. More...
 
static void SIM_HAL_SetAfeClkPadDirCmd (SIM_Type *base, sim_afe_clk_pad_dir_t setting)
 Sets the AFE clock Pad direction setting. More...
 
static sim_afe_clk_pad_dir_t SIM_HAL_GetAfeClkPadDirCmd (SIM_Type *base)
 Gets the AFE clock Pad direction setting. More...
 
static void CLOCK_HAL_SetAfeClkSrc (SIM_Type *base, clock_afe_src_t select)
 Set the clock selection of AFECLKSEL. More...
 
static clock_afe_src_t CLOCK_HAL_GetAfeClkSrc (SIM_Type *base)
 Get the clock source selection of AFECLKSEL. More...
 
static void SIM_HAL_SetDmaDoneSelMode (SIM_Type *base, sim_dma_done_sel_t select)
 Sets the DMA Done select setting. More...
 
static sim_dma_done_sel_t SIM_HAL_GetDmaDoneSelMode (SIM_Type *base)
 Gets the DMA Done select setting. More...
 
static void SIM_HAL_SetAdcTrgSelMode (SIM_Type *base, sim_adc_trg_src_sel_t select)
 Sets the ADC trigger source setting. More...
 
static sim_adc_trg_src_sel_t SIM_HAL_GetAdcTrgSelMode (SIM_Type *base)
 Gets the ADC trigger source setting. More...
 
static bool SIM_HAL_GetRtcOscStatusCmd (SIM_Type *base)
 Gets the status of RTC oscillator. More...
 
uint16_t SIM_HAL_GetAdcCompensationValueCmd (SIM_Type *base, uint8_t temperature)
 Gets the ADC Temperature Compensation Value. More...
 

Enumeration Type Documentation

Enumerator
kClockWdogSrcLpoClk 

LPO.

kClockWdogSrcAltClk 

Alternative clock, for K64F12 it is Bus clock.

kClockWdogSrcLpoClk 

LPO.

kClockWdogSrcAltClk 

Alternative clock, for K64F12 it is Bus clock.

kClockWdogSrcLpoClk 

LPO.

kClockWdogSrcAltClk 

Alternative clock, for K64F12 it is Bus clock.

kClockWdogSrcLpoClk 

LPO.

kClockWdogSrcAltClk 

Alternative clock, for K64F12 it is Bus clock.

kClockWdogSrcLpoClk 

LPO.

kClockWdogSrcAltClk 

Alternative clock, for K64F12 it is Bus clock.

SIM_MISC_CTL[AFECLKSEL]

Enumerator
kClockLptmrSrcMcgIrClk 

MCGIRCLK.

kClockLptmrSrcLpoClk 

LPO clock.

kClockLptmrSrcEr32kClk 

ERCLK32K clock.

kClockLptmrSrcOsc0erClkUndiv 

OSCERCLK_UNDIV clock.

kClockLptmrSrcMcgIrClk 

MCGIRCLK.

kClockLptmrSrcLpoClk 

LPO clock.

kClockLptmrSrcEr32kClk 

ERCLK32K clock.

kClockLptmrSrcOsc0erClkUndiv 

OSCERCLK_UNDIV clock.

kClockLptmrSrcMcgIrClk 

MCGIRCLK.

kClockLptmrSrcLpoClk 

LPO clock.

kClockLptmrSrcEr32kClk 

ERCLK32K clock.

kClockLptmrSrcOsc0erClkUndiv 

OSCERCLK_UNDIV clock.

kClockLptmrSrcMcgIrClk 

MCGIRCLK.

kClockLptmrSrcLpoClk 

LPO clock.

kClockLptmrSrcEr32kClk 

ERCLK32K clock.

kClockLptmrSrcOsc0erClkUndiv 

OSCERCLK_UNDIV clock.

kClockLptmrSrcMcgIrClk 

MCGIRCLK.

kClockLptmrSrcLpoClk 

LPO clock.

kClockLptmrSrcEr32kClk 

ERCLK32K clock.

kClockLptmrSrcOsc0erClkUndiv 

OSCERCLK_UNDIV clock.

Enumerator
kClockEr32kSrcOsc0 

OSC0 clock (OSC032KCLK).

kClockEr32kSrcLpo 

LPO clock.

kClockEr32kSrcOsc0 

OSC0 clock (OSC032KCLK).

kClockEr32kSrcLpo 

LPO clock.

kClockEr32kSrcOsc0 

OSC0 clock (OSC032KCLK).

kClockEr32kSrcLpo 

LPO clock.

kClockEr32kSrcOsc0 

OSC0 clock (OSC032KCLK).

kClockEr32kSrcLpo 

LPO clock.

kClockEr32kSrcOsc0 

OSC0 clock (OSC032KCLK).

kClockEr32kSrcLpo 

LPO clock.

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 uint32_t SIM_HAL_GetSRamSize ( SIM_Type *  base)
inlinestatic

This function gets the Kinetis system RAM size.

Parameters
baseBase address for current SIM instance.
Returns
Kinetis System RAM Size
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 SIM_HAL_SetRamBitlinePrechargeCmd ( SIM_Type *  base,
bool  enable 
)
inlinestatic

This function controls whether System SRAM bitline precharge is enabled during VLPR and VLPW modes.

Parameters
baseBase address for current SIM instance.
enableRAM Bitline Precharge enable setting
  • true: feature enabled.
  • false: feature disabled.
static bool SIM_HAL_GetRamBitlinePrechargeCmd ( SIM_Type *  base)
inlinestatic

This function gets the RAM Bitline Precharge enable setting.

Parameters
baseBase address for current SIM instance.
Returns
True, if RAM Bitline Precharge is enabled.
static void SIM_HAL_SetRamSrcBiasCmd ( SIM_Type *  base,
bool  disable 
)
inlinestatic

This function controls whether to DISABLE source bias of System SRAM arrays during VLPR and VLPW modes.

Parameters
baseBase address for current SIM instance.
disablesource bias of SRAM arrays enable setting
  • true: feature DISABLED.
  • false: feature ENABLED.
static bool SIM_HAL_GetRamSrcBiasCmd ( SIM_Type *  base)
inlinestatic

This function gets the source bias of SRAM arrays enable setting.

Parameters
baseBase address for current SIM instance.
Returns
1, if source bias of SRAM arrays is Disabled. 0, if source bias of SRAM arrays is Enabled.
void SIM_HAL_SetLptmrChSelMode ( SIM_Type *  base,
uint8_t  channel,
sim_lptmr_src_sel_t  select 
)

This function selects the LPTMR channel x source select setting.

Parameters
baseBase address for current SIM instance.
channelLPTMR channel x
selectLPTMR channel x source
sim_lptmr_src_sel_t SIM_HAL_GetLptmrChSelMode ( SIM_Type *  base,
uint8_t  channel 
)

This function gets the LPTMR channel x source select setting.

Parameters
baseBase address for current SIM instance.
channelLPTMR channel x
Returns
select LPTMR channel x source select setting
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_SetSAdcTrgClkSel ( SIM_Type *  base,
sim_sadc_trg_clk_sel_t  setting 
)
inlinestatic

This function selects the clock used to generate the ADC triggers.

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

This function gets the selection of SAR ADC trigger clock.

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

This function sets TMR counter freeze setting.

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

This function gets the TMR counter freeze setting.

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

This function selects the clock used for LPUART.

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

This function gets the selection of LPUART clock.

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

This function controls whether AFE output clock is divided by AFE clock prescaler.

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

This function gets the AFE output clock dividing setting.

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

This function sets the selection of the clock to XBAR_IN[5] pin.

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

This function gets the selection of the clock to XBAR_IN[5] pin.

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.
void CLOCK_HAL_SetSpiOutInvCmd ( SIM_Type *  base,
uint32_t  instance,
uint8_t  inv_type,
sim_spi_out_invert_sel_t  setting 
)

This function sets SPI output signal inverting setting.

Parameters
baseBase address for current SIM instance.
instancedevice instance
inv_typeinverting type 3 - MISI 2 - MOSI 1 - SCK 0 - SS
settingThe value to set.
sim_spi_out_invert_sel_t CLOCK_HAL_GetSpiOutInvCmd ( SIM_Type *  base,
uint32_t  instance,
uint8_t  inv_type 
)

This function gets the SPI output signal inverting setting.

Parameters
baseBase address for current SIM instance.
instancedevice instance
inv_typeinverting type 3 - MISI 2 - MOSI 1 - SCK 0 - SS
Returns
Current selection.
static void SIM_HAL_SetPllInVlpCmd ( SIM_Type *  base,
bool  enable 
)
inlinestatic

This function controls whether to enable the PLL in VLP modes.

Parameters
baseBase address for current SIM instance.
enableenable setting of PLL VLP feature
  • true: feature enabled.
  • false: feature disabled.
static bool SIM_HAL_GetPllInVlpCmd ( SIM_Type *  base)
inlinestatic

This function gets the PLL VLP enable setting.

Parameters
baseBase address for current SIM instance.
Returns
1, if PLL in VLP modes feature is enabled. 0, if PLL in VLP modes feature is disabled.
static void SIM_HAL_SetNmiDisCmd ( SIM_Type *  base,
bool  disable 
)
inlinestatic

This function controls whether to disable the NMI feature.

Parameters
baseBase address for current SIM instance.
disableenable setting of NMI feature
  • true: feature DISABLED.
  • false: feature ENABLED.
static bool SIM_HAL_GetNmiDisCmd ( SIM_Type *  base)
inlinestatic

This function gets the NMI feature enable setting.

Parameters
baseBase address for current SIM instance.
Returns
1, if PLL in VLP modes feature is DISABLED. 0, if PLL in VLP modes feature is ENABLED.
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_GetAttributeId ( SIM_Type *  base)
inlinestatic

This function gets the Attribute ID in System Device ID register.

Parameters
baseBase address for current SIM instance.
Returns
id Attribute ID
static uint32_t SIM_HAL_GetSRamSizeId ( SIM_Type *  base)
inlinestatic

This function gets the SRAM SIZE in System Device ID register.

Parameters
baseBase address for current SIM instance.
Returns
id SRAM size
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_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 void CLOCK_HAL_SetSysDiv ( SIM_Type *  base,
uint8_t  setting 
)
inlinestatic

This function sets divide value SYSDIV.

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

This function gets divide value SYSDIV.

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

This function sets BUS clock divider.

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

This function gets BUS clock divider value.

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

This function sets FLASH clock mode.

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

This function gets FLASH clock mode value.

Parameters
baseBase address for current SIM instance.
Returns
Current divide value.
void CLOCK_HAL_SetOutDiv ( SIM_Type *  base,
uint8_t  sysDiv,
uint8_t  busDiv,
uint8_t  flashclkmode 
)

This function sets all clock out dividers setting at one time.

Parameters
baseBase address for current SIM instance.
sysDivsystem clock divider
busDivbus clock divider
flashclkmodeflash clock mode setting
void CLOCK_HAL_GetOutDiv ( SIM_Type *  base,
uint8_t *  sysDiv,
uint8_t *  busDiv,
uint8_t *  flashclkmode 
)

This function gets all clock out dividers setting at one time

Parameters
baseBase address for current SIM instance.
sysDivsystem clock divider
busDivbus clock divider
flashclkmodeflash clock mode setting
Returns
Current all divide values.
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_GetRamSize ( SIM_Type *  base)
inlinestatic

This function gets the RAM size

Parameters
baseBase address for current SIM instance.
Returns
RAM size
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 in Flash Configuration Register 2.

Parameters
baseBase address for current SIM instance.
Returns
address Flash maximum block address
static void SIM_HAL_SetVrefBuffPowerDownCmd ( SIM_Type *  base,
bool  enable 
)
inlinestatic

This function controls whether to enable the VrefBuffer power down feature.

Parameters
baseBase address for current SIM instance.
enableenable setting of VrefBuffer Power Down feature
  • true: power down VrefBuffer.
  • false: VrefBuffer enabled.
static bool SIM_HAL_GetVrefBuffPowerDownCmd ( SIM_Type *  base)
inlinestatic

This function gets the VrefBuffer enable setting.

Parameters
baseBase address for current SIM instance.
Returns
1, if VrefBuffer is powered down. 0, if VrefBuffer is enabled.
static void CLOCK_HAL_SetVrefBuffInputSel ( SIM_Type *  base,
sim_vref_buff_input_sel_t  setting 
)
inlinestatic

This function selects the VrefBuffer input selection.

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

This function gets the selection of VrefBuffer input.

Parameters
baseBase address for current SIM instance.
Returns
Current selection.
static void SIM_HAL_SetVrefBuffOutCmd ( SIM_Type *  base,
bool  enable 
)
inlinestatic

This function controls whether to enable the VrefBuffer to drive PAD.

Parameters
baseBase address for current SIM instance.
enableenable setting of VrefBuffer output drive feature
  • true: VrefBuffer drives selected voltage on pad.
  • false: VrefBuffer not drive PAD.
static bool SIM_HAL_GetVrefBuffOutCmd ( SIM_Type *  base)
inlinestatic

This function gets the VrefBuffer Output enable setting.

Parameters
baseBase address for current SIM instance.
Returns
1, if VrefBuffer output drive feature is enabled. 0, if VrefBuffer output drive feature is disabled.
static void CLOCK_HAL_SetRtcClkSel ( SIM_Type *  base,
clock_rtcout_src_t  setting 
)
inlinestatic

This function selects the clock source for RTC operation.

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

This function gets the selection of RTC clock source.

Parameters
baseBase address for current SIM instance.
Returns
Current selection.
void SIM_HAL_SetTmrPrimaryCntSrcSelMode ( SIM_Type *  base,
uint8_t  channel,
sim_tmr_Primary_src_sel_t  select 
)

This function selects the Quadtimer channel x Primary Count source.

Parameters
baseBase address for current SIM instance.
channelQuadtimer channel x
selectQuadtimer channel x primary count source
sim_tmr_Primary_src_sel_t SIM_HAL_GetTmrPrimaryCntSrcSelMode ( SIM_Type *  base,
uint8_t  channel 
)

This function gets the Quadtimer channel x Primary Count source select setting.

Parameters
baseBase address for current SIM instance.
channelQuadtimer channel x
Returns
select Quadtimer channel x primary count source select setting
void SIM_HAL_SetTmrSecondCntSrcSelMode ( SIM_Type *  base,
uint8_t  channel,
sim_tmr_sencond_src_sel_t  select 
)

This function selects the Quadtimer channel x Secondary Count source.

Parameters
baseBase address for current SIM instance.
channelQuadtimer channel x
selectQuadtimer channel x Secondary count source
sim_tmr_sencond_src_sel_t SIM_HAL_GetTmrSecondCntSrcSelMode ( SIM_Type *  base,
uint8_t  channel 
)

This function gets the Quadtimer channel x Secondary Count source select setting.

Parameters
baseBase address for current SIM instance.
channelQuadtimer channel x
Returns
select Quadtimer channel x Secondary count source select setting
static void SIM_HAL_SetTmr0PllClkSelMode ( SIM_Type *  base,
clock_tmr0_pll_src_t  select 
)
inlinestatic

This function selects the Timer0 CH0 PLL clock source.

Parameters
baseBase address for current SIM instance.
selectTimer0 CH0 PLL clock source selection
static clock_tmr0_pll_src_t SIM_HAL_GetTmr0PllClkSelMode ( SIM_Type *  base)
inlinestatic

This function gets the Timer0 CH0 PLL clock source select setting.

Parameters
baseBase address for current SIM instance.
Returns
select Timer0 CH0 PLL clock source selection.
static void SIM_HAL_SetEwmInputSelMode ( SIM_Type *  base,
sim_ewm_input_sel_t  select 
)
inlinestatic

This function selects the External Watchdog Monitor Input source.

Parameters
baseBase address for current SIM instance.
selectEWM input source selection
static sim_ewm_input_sel_t SIM_HAL_GetEwmInputSelMode ( SIM_Type *  base)
inlinestatic

This function gets the EWM input select setting.

Parameters
baseBase address for current SIM instance.
Returns
select EWM input source selection.
void SIM_HAL_SetUartIrdaSelMode ( SIM_Type *  base,
uint32_t  instance,
sim_uart_irda_sel_t  select 
)

This function sets the UART x IRDA select setting.

Parameters
baseBase address for current SIM instance.
instanceDevice instance.
selectUART x IRDA selection.
sim_uart_irda_sel_t SIM_HAL_GetUartIrdaSelMode ( SIM_Type *  base,
uint32_t  instance 
)

This function gets the UART x IRDA select setting.

Parameters
baseBase address for current SIM instance.
instanceDevice instance.
Returns
select UART x IRDA selection.
static void SIM_HAL_SetUartModTypeSelMode ( SIM_Type *  base,
sim_uart_irda_type_sel_t  select 
)
inlinestatic

This function selects the modulation type for IRDA support.

Parameters
baseBase address for current SIM instance.
selectUART modulation type selection.
static sim_uart_irda_type_sel_t SIM_HAL_GetUartModTypeSelMode ( SIM_Type *  base)
inlinestatic

This function gets the UART modulation select setting.

Parameters
baseBase address for current SIM instance.
Returns
select UART modulation selection.
static void SIM_HAL_SetAfeClkPadDirCmd ( SIM_Type *  base,
sim_afe_clk_pad_dir_t  setting 
)
inlinestatic

This function controls the direction of the AFE CLK pin.

Parameters
baseBase address for current SIM instance.
settingAFE clock Pad direction setting
  • 0: input.
  • 1: output.
static sim_afe_clk_pad_dir_t SIM_HAL_GetAfeClkPadDirCmd ( SIM_Type *  base)
inlinestatic

This function gets the AFE clock Pad direction setting.

Parameters
baseBase address for current SIM instance.
Returns
setting AFE clock Pad direction setting.
static void CLOCK_HAL_SetAfeClkSrc ( SIM_Type *  base,
clock_afe_src_t  select 
)
inlinestatic

This function sets the clock selection of AFECLKSEL.

Parameters
baseBase address for current SIM instance.
selectThe clock source to select.
static clock_afe_src_t CLOCK_HAL_GetAfeClkSrc ( SIM_Type *  base)
inlinestatic

This function gets the clock source selection of AFECLKSEL.

Parameters
baseBase address for current SIM instance.
Returns
Current selection.
static void SIM_HAL_SetDmaDoneSelMode ( SIM_Type *  base,
sim_dma_done_sel_t  select 
)
inlinestatic

This function selects the DMA Done flag to drive XBAR_IN[32].

Parameters
baseBase address for current SIM instance.
selectDMA Done selection.
static sim_dma_done_sel_t SIM_HAL_GetDmaDoneSelMode ( SIM_Type *  base)
inlinestatic

This function gets the DMA Done select setting.

Parameters
baseBase address for current SIM instance.
Returns
Current DMA Done selection.
static void SIM_HAL_SetAdcTrgSelMode ( SIM_Type *  base,
sim_adc_trg_src_sel_t  select 
)
inlinestatic

This function controls whether PDB can trigger ADC directly.

Parameters
baseBase address for current SIM instance.
selectADC trigger selection.
static sim_adc_trg_src_sel_t SIM_HAL_GetAdcTrgSelMode ( SIM_Type *  base)
inlinestatic

This function gets the ADC trigger source setting.

Parameters
baseBase address for current SIM instance.
Returns
Current ADC trigger selection.
static bool SIM_HAL_GetRtcOscStatusCmd ( SIM_Type *  base)
inlinestatic

This function gets the status of RTC oscillator.

Parameters
baseBase address for current SIM instance.
Returns
1, if RTC oscillator is enabled. 0, if RTC oscillator is disabled.
uint16_t SIM_HAL_GetAdcCompensationValueCmd ( SIM_Type *  base,
uint8_t  temperature 
)

This function gets the status of RTC oscillator.

Parameters
baseBase address for current SIM instance.
temperatureunder which temperature 0 - +25 degrees Celsius 1 - -40 degrees Celsius 2 - +85 degrees Celsius
Returns
Compensation value