mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Committer:
mbed_official
Date:
Thu Sep 18 14:00:17 2014 +0100
Revision:
324:406fd2029f23
Parent:
149:1fb5f62b92bd
Synchronized with git revision a73f28e6fbca9559fbed2726410eeb4c0534a4a5

Full URL: https://github.com/mbedmicro/mbed/commit/a73f28e6fbca9559fbed2726410eeb4c0534a4a5/

Extended #476, which does not break ethernet for K64F

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 146:f64d43ff0c18 1 /*
mbed_official 146:f64d43ff0c18 2 * Copyright (c) 2013 - 2014, Freescale Semiconductor, Inc.
mbed_official 146:f64d43ff0c18 3 * All rights reserved.
mbed_official 146:f64d43ff0c18 4 *
mbed_official 146:f64d43ff0c18 5 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 146:f64d43ff0c18 6 * are permitted provided that the following conditions are met:
mbed_official 146:f64d43ff0c18 7 *
mbed_official 146:f64d43ff0c18 8 * o Redistributions of source code must retain the above copyright notice, this list
mbed_official 146:f64d43ff0c18 9 * of conditions and the following disclaimer.
mbed_official 146:f64d43ff0c18 10 *
mbed_official 146:f64d43ff0c18 11 * o Redistributions in binary form must reproduce the above copyright notice, this
mbed_official 146:f64d43ff0c18 12 * list of conditions and the following disclaimer in the documentation and/or
mbed_official 146:f64d43ff0c18 13 * other materials provided with the distribution.
mbed_official 146:f64d43ff0c18 14 *
mbed_official 146:f64d43ff0c18 15 * o Neither the name of Freescale Semiconductor, Inc. nor the names of its
mbed_official 146:f64d43ff0c18 16 * contributors may be used to endorse or promote products derived from this
mbed_official 146:f64d43ff0c18 17 * software without specific prior written permission.
mbed_official 146:f64d43ff0c18 18 *
mbed_official 146:f64d43ff0c18 19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
mbed_official 146:f64d43ff0c18 20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
mbed_official 146:f64d43ff0c18 21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 146:f64d43ff0c18 22 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
mbed_official 146:f64d43ff0c18 23 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
mbed_official 146:f64d43ff0c18 24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
mbed_official 146:f64d43ff0c18 25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
mbed_official 146:f64d43ff0c18 26 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
mbed_official 146:f64d43ff0c18 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
mbed_official 146:f64d43ff0c18 28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 146:f64d43ff0c18 29 */
mbed_official 146:f64d43ff0c18 30
mbed_official 146:f64d43ff0c18 31 #if !defined(__FSL_SIM_HAL_H__)
mbed_official 146:f64d43ff0c18 32 #define __FSL_SIM_HAL_H__
mbed_official 146:f64d43ff0c18 33
mbed_official 146:f64d43ff0c18 34 #include <stdint.h>
mbed_official 146:f64d43ff0c18 35 #include <stdbool.h>
mbed_official 146:f64d43ff0c18 36 #include <assert.h>
mbed_official 146:f64d43ff0c18 37 #include "fsl_device_registers.h"
mbed_official 146:f64d43ff0c18 38 #include "fsl_sim_features.h"
mbed_official 146:f64d43ff0c18 39
mbed_official 146:f64d43ff0c18 40 /*! @addtogroup sim_hal*/
mbed_official 146:f64d43ff0c18 41 /*! @{*/
mbed_official 146:f64d43ff0c18 42
mbed_official 146:f64d43ff0c18 43 /*! @file*/
mbed_official 146:f64d43ff0c18 44
mbed_official 146:f64d43ff0c18 45 /*******************************************************************************
mbed_official 146:f64d43ff0c18 46 * Definitions
mbed_official 146:f64d43ff0c18 47 ******************************************************************************/
mbed_official 324:406fd2029f23 48 typedef enum _clock_names {
mbed_official 324:406fd2029f23 49
mbed_official 146:f64d43ff0c18 50 /* default clocks*/
mbed_official 324:406fd2029f23 51 kCoreClock, /**/
mbed_official 324:406fd2029f23 52 kSystemClock, /**/
mbed_official 324:406fd2029f23 53 kPlatformClock, /**/
mbed_official 324:406fd2029f23 54 kBusClock, /**/
mbed_official 324:406fd2029f23 55 kFlexBusClock, /**/
mbed_official 324:406fd2029f23 56 kFlashClock, /**/
mbed_official 324:406fd2029f23 57
mbed_official 146:f64d43ff0c18 58 /* other internal clocks used by peripherals*/
mbed_official 146:f64d43ff0c18 59 /* osc clock*/
mbed_official 324:406fd2029f23 60 kOsc32kClock,
mbed_official 324:406fd2029f23 61 kOsc0ErClock,
mbed_official 324:406fd2029f23 62 kOsc1ErClock,
mbed_official 146:f64d43ff0c18 63
mbed_official 146:f64d43ff0c18 64 /* irc 48Mhz clock */
mbed_official 324:406fd2029f23 65 kIrc48mClock,
mbed_official 146:f64d43ff0c18 66
mbed_official 146:f64d43ff0c18 67 /* rtc clock*/
mbed_official 324:406fd2029f23 68 kRtc32kClock,
mbed_official 324:406fd2029f23 69 kRtc1hzClock,
mbed_official 146:f64d43ff0c18 70
mbed_official 146:f64d43ff0c18 71 /* lpo clcok*/
mbed_official 324:406fd2029f23 72 kLpoClock,
mbed_official 324:406fd2029f23 73
mbed_official 146:f64d43ff0c18 74 /* mcg clocks*/
mbed_official 324:406fd2029f23 75 kMcgFfClock,
mbed_official 324:406fd2029f23 76 kMcgFllClock,
mbed_official 324:406fd2029f23 77 kMcgPll0Clock,
mbed_official 324:406fd2029f23 78 kMcgPll1Clock,
mbed_official 324:406fd2029f23 79 kMcgOutClock,
mbed_official 324:406fd2029f23 80 kMcgIrClock,
mbed_official 146:f64d43ff0c18 81
mbed_official 324:406fd2029f23 82 /* constant clocks (provided in other header files?)*/
mbed_official 324:406fd2029f23 83 kSDHC0_CLKIN,
mbed_official 324:406fd2029f23 84 kENET_1588_CLKIN,
mbed_official 324:406fd2029f23 85 kEXTAL_Clock,
mbed_official 324:406fd2029f23 86 kEXTAL1_Clock,
mbed_official 324:406fd2029f23 87 kUSB_CLKIN,
mbed_official 146:f64d43ff0c18 88
mbed_official 324:406fd2029f23 89 /* reserved value*/
mbed_official 324:406fd2029f23 90 kReserved,
mbed_official 146:f64d43ff0c18 91
mbed_official 324:406fd2029f23 92 kClockNameCount
mbed_official 324:406fd2029f23 93 } clock_names_t;
mbed_official 146:f64d43ff0c18 94
mbed_official 146:f64d43ff0c18 95 /*! @brief Clock source and sel names */
mbed_official 324:406fd2029f23 96 typedef enum _clock_source_names {
mbed_official 324:406fd2029f23 97 kClockNfcSrc, /* NFCSRC*/
mbed_official 324:406fd2029f23 98 kClockEsdhcSrc, /* ESDHCSRC K70*/
mbed_official 324:406fd2029f23 99 kClockSdhcSrc, /* SDHCSRC K64*/
mbed_official 324:406fd2029f23 100 kClockLcdcSrc, /* LCDCSRC*/
mbed_official 324:406fd2029f23 101 kClockTimeSrc, /* TIMESRC*/
mbed_official 324:406fd2029f23 102 kClockRmiiSrc, /* RMIISRC*/
mbed_official 324:406fd2029f23 103 kClockUsbfSrc, /* USBFSRC K70*/
mbed_official 324:406fd2029f23 104 kClockUsbSrc, /* USBSRC K64, KL25, KV31, and K22*/
mbed_official 324:406fd2029f23 105 kClockUsbhSrc, /* USBHSRC*/
mbed_official 324:406fd2029f23 106 kClockUart0Src, /* UART0SRC*/
mbed_official 324:406fd2029f23 107 kClockLpuartSrc, /* LPUARTSRC K22, KV31 */
mbed_official 324:406fd2029f23 108 kClockTpmSrc, /* TPMSRC*/
mbed_official 324:406fd2029f23 109 kClockOsc32kSel, /* OSC32KSEL*/
mbed_official 324:406fd2029f23 110 kClockUsbfSel, /* USBF_CLKSEL*/
mbed_official 324:406fd2029f23 111 kClockPllfllSel, /* PLLFLLSEL*/
mbed_official 324:406fd2029f23 112 kClockNfcSel, /* NFC_CLKSEL*/
mbed_official 324:406fd2029f23 113 kClockLcdcSel, /* LCDC_CLKSEL*/
mbed_official 324:406fd2029f23 114 kClockTraceSel, /* TRACE_CLKSEL*/
mbed_official 324:406fd2029f23 115 kClockClkoutSel, /* CLKOUTSEL*/
mbed_official 324:406fd2029f23 116 kClockRtcClkoutSel, /* RTCCLKOUTSEL */
mbed_official 324:406fd2029f23 117 kClockSourceMax
mbed_official 324:406fd2029f23 118 } clock_source_names_t;
mbed_official 146:f64d43ff0c18 119
mbed_official 146:f64d43ff0c18 120 /*! @brief Clock Divider names*/
mbed_official 324:406fd2029f23 121 typedef enum _clock_divider_names {
mbed_official 324:406fd2029f23 122 kClockDividerOutdiv1, /* OUTDIV1*/
mbed_official 324:406fd2029f23 123 kClockDividerOutdiv2, /* OUTDIV2*/
mbed_official 324:406fd2029f23 124 kClockDividerOutdiv3, /* OUTDIV3*/
mbed_official 324:406fd2029f23 125 kClockDividerOutdiv4, /* OUTDIV4*/
mbed_official 324:406fd2029f23 126 kClockDividerUsbFrac, /* (USBFRAC + 1) / (USBDIV + 1)*/
mbed_official 324:406fd2029f23 127 kClockDividerUsbDiv,
mbed_official 324:406fd2029f23 128 kClockDividerUsbfsFrac, /* (USBFSFRAC + 1) / (USBFSDIV) + 1)*/
mbed_official 324:406fd2029f23 129 kClockDividerUsbfsDiv,
mbed_official 324:406fd2029f23 130 kClockDividerUsbhsFrac, /* (USBHSFRAC + 1) / (USBHSDIV + 1)*/
mbed_official 324:406fd2029f23 131 kClockDividerUsbhsDiv,
mbed_official 324:406fd2029f23 132 kClockDividerLcdcFrac, /* (LCDCFRAC + 1) / (LCDCDIV + 1)*/
mbed_official 324:406fd2029f23 133 kClockDividerLcdcDiv,
mbed_official 324:406fd2029f23 134 kClockDividerNfcFrac, /* (NFCFRAC + 1) / (NFCDIV + 1)*/
mbed_official 324:406fd2029f23 135 kClockDividerNfcDiv,
mbed_official 324:406fd2029f23 136 kClockDividerSpecial1, /* special divider 1*/
mbed_official 324:406fd2029f23 137 kClockDividerMax
mbed_official 324:406fd2029f23 138 } clock_divider_names_t;
mbed_official 146:f64d43ff0c18 139
mbed_official 146:f64d43ff0c18 140 /*! @brief SIM USB voltage regulator in standby mode setting during stop modes */
mbed_official 146:f64d43ff0c18 141 typedef enum _sim_usbsstby_stop
mbed_official 146:f64d43ff0c18 142 {
mbed_official 146:f64d43ff0c18 143 kSimUsbsstbyNoRegulator, /* regulator not in standby during Stop modes */
mbed_official 146:f64d43ff0c18 144 kSimUsbsstbyWithRegulator /* regulator in standby during Stop modes */
mbed_official 146:f64d43ff0c18 145 } sim_usbsstby_stop_t;
mbed_official 146:f64d43ff0c18 146
mbed_official 146:f64d43ff0c18 147 /*! @brief SIM USB voltage regulator in standby mode setting during VLPR and VLPW modes */
mbed_official 146:f64d43ff0c18 148 typedef enum _sim_usbvstby_stop
mbed_official 146:f64d43ff0c18 149 {
mbed_official 146:f64d43ff0c18 150 kSimUsbvstbyNoRegulator, /* regulator not in standby during VLPR and VLPW modes */
mbed_official 146:f64d43ff0c18 151 kSimUsbvstbyWithRegulator /* regulator in standby during VLPR and VLPW modes */
mbed_official 146:f64d43ff0c18 152 } sim_usbvstby_stop_t;
mbed_official 146:f64d43ff0c18 153
mbed_official 146:f64d43ff0c18 154 /*! @brief SIM CMT/UART pad drive strength */
mbed_official 146:f64d43ff0c18 155 typedef enum _sim_cmtuartpad_strengh
mbed_official 146:f64d43ff0c18 156 {
mbed_official 146:f64d43ff0c18 157 kSimCmtuartSinglePad, /* Single-pad drive strength for CMT IRO or UART0_TXD */
mbed_official 146:f64d43ff0c18 158 kSimCmtuartDualPad /* Dual-pad drive strength for CMT IRO or UART0_TXD */
mbed_official 146:f64d43ff0c18 159 } sim_cmtuartpad_strengh_t;
mbed_official 146:f64d43ff0c18 160
mbed_official 146:f64d43ff0c18 161 /*! @brief SIM PTD7 pad drive strength */
mbed_official 146:f64d43ff0c18 162 typedef enum _sim_ptd7pad_strengh
mbed_official 146:f64d43ff0c18 163 {
mbed_official 146:f64d43ff0c18 164 kSimPtd7padSinglePad, /* Single-pad drive strength for PTD7 */
mbed_official 146:f64d43ff0c18 165 kSimPtd7padDualPad /* Dual-pad drive strength for PTD7 */
mbed_official 146:f64d43ff0c18 166 } sim_ptd7pad_strengh_t;
mbed_official 146:f64d43ff0c18 167
mbed_official 146:f64d43ff0c18 168 /*! @brief SIM FlexBus security level */
mbed_official 146:f64d43ff0c18 169 typedef enum _sim_flexbus_security_level
mbed_official 146:f64d43ff0c18 170 {
mbed_official 146:f64d43ff0c18 171 kSimFbslLevel0, /* All off-chip accesses (op code and data) via the FlexBus */
mbed_official 146:f64d43ff0c18 172 /* and DDR controller are disallowed */
mbed_official 146:f64d43ff0c18 173 kSimFbslLevel1, /* Undefined */
mbed_official 146:f64d43ff0c18 174 kSimFbslLevel2, /* Off-chip op code accesses are disallowed. Data accesses */
mbed_official 146:f64d43ff0c18 175 /* are allowed */
mbed_official 146:f64d43ff0c18 176 kSimFbslLevel3 /* Off-chip op code accesses and data accesses are allowed */
mbed_official 146:f64d43ff0c18 177 } sim_flexbus_security_level_t;
mbed_official 146:f64d43ff0c18 178
mbed_official 146:f64d43ff0c18 179 /*! @brief SIM ADCx pre-trigger select */
mbed_official 146:f64d43ff0c18 180 typedef enum _sim_pretrgsel
mbed_official 146:f64d43ff0c18 181 {
mbed_official 146:f64d43ff0c18 182 kSimAdcPretrgselA, /* Pre-trigger A selected for ADCx */
mbed_official 146:f64d43ff0c18 183 kSimAdcPretrgselB /* Pre-trigger B selected for ADCx */
mbed_official 146:f64d43ff0c18 184 } sim_pretrgsel_t;
mbed_official 146:f64d43ff0c18 185
mbed_official 146:f64d43ff0c18 186 /*! @brief SIM ADCx trigger select */
mbed_official 146:f64d43ff0c18 187 typedef enum _sim_trgsel
mbed_official 146:f64d43ff0c18 188 {
mbed_official 146:f64d43ff0c18 189 kSimAdcTrgselExt, /* External trigger */
mbed_official 146:f64d43ff0c18 190 kSimAdcTrgSelHighSpeedComp0, /* High speed comparator 0 asynchronous interrupt */
mbed_official 146:f64d43ff0c18 191 kSimAdcTrgSelHighSpeedComp1, /* High speed comparator 1 asynchronous interrupt */
mbed_official 146:f64d43ff0c18 192 kSimAdcTrgSelHighSpeedComp2, /* High speed comparator 2 asynchronous interrupt */
mbed_official 146:f64d43ff0c18 193 kSimAdcTrgSelPit0, /* PIT trigger 0 */
mbed_official 146:f64d43ff0c18 194 kSimAdcTrgSelPit1, /* PIT trigger 1 */
mbed_official 146:f64d43ff0c18 195 kSimAdcTrgSelPit2, /* PIT trigger 2 */
mbed_official 146:f64d43ff0c18 196 kSimAdcTrgSelPit3, /* PIT trigger 3 */
mbed_official 146:f64d43ff0c18 197 kSimAdcTrgSelFtm0, /* FTM0 trigger */
mbed_official 146:f64d43ff0c18 198 kSimAdcTrgSelFtm1, /* FTM1 trigger */
mbed_official 146:f64d43ff0c18 199 kSimAdcTrgSelFtm2, /* FTM2 trigger */
mbed_official 146:f64d43ff0c18 200 kSimAdcTrgSelFtm3, /* FTM3 trigger */
mbed_official 146:f64d43ff0c18 201 kSimAdcTrgSelRtcAlarm, /* RTC alarm */
mbed_official 146:f64d43ff0c18 202 kSimAdcTrgSelRtcSec, /* RTC seconds */
mbed_official 146:f64d43ff0c18 203 kSimAdcTrgSelLptimer, /* Low-power timer trigger */
mbed_official 146:f64d43ff0c18 204 kSimAdcTrgSelHigSpeedComp3 /* High speed comparator 3 asynchronous interrupt */
mbed_official 146:f64d43ff0c18 205 } sim_trgsel_t;
mbed_official 146:f64d43ff0c18 206
mbed_official 146:f64d43ff0c18 207 /*! @brief SIM receive data source select */
mbed_official 146:f64d43ff0c18 208 typedef enum _sim_uart_rxsrc
mbed_official 146:f64d43ff0c18 209 {
mbed_official 146:f64d43ff0c18 210 kSimUartRxsrcPin, /* UARTx_RX Pin */
mbed_official 146:f64d43ff0c18 211 kSimUartRxsrcCmp0, /* CMP0 */
mbed_official 146:f64d43ff0c18 212 kSimUartRxsrcCmp1, /* CMP1 */
mbed_official 146:f64d43ff0c18 213 kSimUartRxsrcReserved /* Reserved */
mbed_official 146:f64d43ff0c18 214 } sim_uart_rxsrc_t;
mbed_official 146:f64d43ff0c18 215
mbed_official 146:f64d43ff0c18 216 /*! @brief SIM transmit data source select */
mbed_official 146:f64d43ff0c18 217 typedef enum _sim_uart_txsrc
mbed_official 146:f64d43ff0c18 218 {
mbed_official 146:f64d43ff0c18 219 kSimUartTxsrcPin, /* UARTx_TX Pin */
mbed_official 146:f64d43ff0c18 220 kSimUartTxsrcCmp0, /* UARTx_TX pin modulated with FTM1 channel 0 output */
mbed_official 146:f64d43ff0c18 221 kSimUartTxsrcCmp1, /* UARTx_TX pin modulated with FTM2 channel 0 output */
mbed_official 146:f64d43ff0c18 222 kSimUartTxsrcReserved /* Reserved */
mbed_official 146:f64d43ff0c18 223 } sim_uart_txsrc_t;
mbed_official 146:f64d43ff0c18 224
mbed_official 146:f64d43ff0c18 225 /*! @brief SIM FlexTimer x trigger y select */
mbed_official 146:f64d43ff0c18 226 typedef enum _sim_ftm_trg_src
mbed_official 146:f64d43ff0c18 227 {
mbed_official 146:f64d43ff0c18 228 kSimFtmTrgSrc0, /* FlexTimer x trigger y select 0 */
mbed_official 146:f64d43ff0c18 229 kSimFtmTrgSrc1 /* FlexTimer x trigger y select 1 */
mbed_official 146:f64d43ff0c18 230 } sim_ftm_trg_src_t;
mbed_official 146:f64d43ff0c18 231
mbed_official 146:f64d43ff0c18 232 /*! @brief SIM FlexTimer external clock select */
mbed_official 146:f64d43ff0c18 233 typedef enum _sim_ftm_clk_sel
mbed_official 146:f64d43ff0c18 234 {
mbed_official 146:f64d43ff0c18 235 kSimFtmClkSel0, /* FTM CLKIN0 pin. */
mbed_official 146:f64d43ff0c18 236 kSimFtmClkSel1 /* FTM CLKIN1 pin. */
mbed_official 146:f64d43ff0c18 237 } sim_ftm_clk_sel_t;
mbed_official 146:f64d43ff0c18 238
mbed_official 146:f64d43ff0c18 239 /*! @brief SIM FlexTimer x channel y input capture source select */
mbed_official 146:f64d43ff0c18 240 typedef enum _sim_ftm_ch_src
mbed_official 146:f64d43ff0c18 241 {
mbed_official 146:f64d43ff0c18 242 kSimFtmChSrc0, /* See RM for details of each selection for each channel */
mbed_official 146:f64d43ff0c18 243 kSimFtmChSrc1, /* See RM for details of each selection for each channel */
mbed_official 146:f64d43ff0c18 244 kSimFtmChSrc2, /* See RM for details of each selection for each channel */
mbed_official 146:f64d43ff0c18 245 kSimFtmChSrc3 /* See RM for details of each selection for each channel */
mbed_official 146:f64d43ff0c18 246 } sim_ftm_ch_src_t;
mbed_official 146:f64d43ff0c18 247
mbed_official 146:f64d43ff0c18 248 /*! @brief SIM FlexTimer x Fault y select */
mbed_official 146:f64d43ff0c18 249 typedef enum _sim_ftm_flt_sel
mbed_official 146:f64d43ff0c18 250 {
mbed_official 146:f64d43ff0c18 251 kSimFtmFltSel0, /* FlexTimer x fault y select 0 */
mbed_official 146:f64d43ff0c18 252 kSimFtmFltSel1 /* FlexTimer x fault y select 1 */
mbed_official 146:f64d43ff0c18 253 } sim_ftm_flt_sel_t;
mbed_official 146:f64d43ff0c18 254
mbed_official 146:f64d43ff0c18 255 /*! @brief SIM Timer/PWM external clock select */
mbed_official 146:f64d43ff0c18 256 typedef enum _sim_tpm_clk_sel
mbed_official 146:f64d43ff0c18 257 {
mbed_official 146:f64d43ff0c18 258 kSimTpmClkSel0, /* Timer/PWM TPM_CLKIN0 pin. */
mbed_official 146:f64d43ff0c18 259 kSimTpmClkSel1 /* Timer/PWM TPM_CLKIN1 pin. */
mbed_official 146:f64d43ff0c18 260 } sim_tpm_clk_sel_t;
mbed_official 146:f64d43ff0c18 261
mbed_official 146:f64d43ff0c18 262 /*! @brief SIM Timer/PWM x channel y input capture source select */
mbed_official 146:f64d43ff0c18 263 typedef enum _sim_tpm_ch_src
mbed_official 146:f64d43ff0c18 264 {
mbed_official 146:f64d43ff0c18 265 kSimTpmChSrc0, /* TPMx_CH0 signal */
mbed_official 146:f64d43ff0c18 266 kSimTpmChSrc1 /* CMP0 output */
mbed_official 146:f64d43ff0c18 267 } sim_tpm_ch_src_t;
mbed_official 146:f64d43ff0c18 268
mbed_official 146:f64d43ff0c18 269 /*! @brief SIM HAL API return status*/
mbed_official 146:f64d43ff0c18 270 typedef enum _sim_hal_status {
mbed_official 146:f64d43ff0c18 271 kSimHalSuccess,
mbed_official 146:f64d43ff0c18 272 kSimHalFail,
mbed_official 146:f64d43ff0c18 273 kSimHalNoSuchModule,
mbed_official 146:f64d43ff0c18 274 kSimHalNoSuchClockSrc,
mbed_official 146:f64d43ff0c18 275 kSimHalNoSuchDivider
mbed_official 146:f64d43ff0c18 276 } sim_hal_status_t;
mbed_official 146:f64d43ff0c18 277
mbed_official 146:f64d43ff0c18 278 /*! @brief Clock name configuration table structure*/
mbed_official 324:406fd2029f23 279 typedef struct ClockNameConfig {
mbed_official 324:406fd2029f23 280 bool useOtherRefClock; /*!< if it uses the other ref clock*/
mbed_official 324:406fd2029f23 281 clock_names_t otherRefClockName; /*!< other ref clock name*/
mbed_official 324:406fd2029f23 282 clock_divider_names_t dividerName; /*!< clock divider name*/
mbed_official 324:406fd2029f23 283 } clock_name_config_t;
mbed_official 146:f64d43ff0c18 284
mbed_official 146:f64d43ff0c18 285 /*! @brief clock name configuration table for specified CPU defined in fsl_clock_module_names_Kxxx.h*/
mbed_official 324:406fd2029f23 286 extern const clock_name_config_t kClockNameConfigTable[];
mbed_official 146:f64d43ff0c18 287
mbed_official 146:f64d43ff0c18 288
mbed_official 146:f64d43ff0c18 289 /*******************************************************************************
mbed_official 146:f64d43ff0c18 290 * API
mbed_official 146:f64d43ff0c18 291 ******************************************************************************/
mbed_official 146:f64d43ff0c18 292
mbed_official 146:f64d43ff0c18 293 #if defined(__cplusplus)
mbed_official 146:f64d43ff0c18 294 extern "C" {
mbed_official 146:f64d43ff0c18 295 #endif /* __cplusplus*/
mbed_official 146:f64d43ff0c18 296
mbed_official 324:406fd2029f23 297 /*! @name clock-related feature APIs*/
mbed_official 146:f64d43ff0c18 298 /*@{*/
mbed_official 146:f64d43ff0c18 299
mbed_official 146:f64d43ff0c18 300 /*!
mbed_official 146:f64d43ff0c18 301 * @brief Sets the clock source setting.
mbed_official 146:f64d43ff0c18 302 *
mbed_official 146:f64d43ff0c18 303 * This function sets the settings for a specified clock source. Each clock
mbed_official 146:f64d43ff0c18 304 * source has its own clock selection settings. See the chip reference manual for
mbed_official 324:406fd2029f23 305 * clock source detailed settings and the clock_source_names_t
mbed_official 146:f64d43ff0c18 306 * for clock sources.
mbed_official 146:f64d43ff0c18 307 *
mbed_official 324:406fd2029f23 308 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 309 * @param clockSource Clock source name defined in sim_clock_source_names_t
mbed_official 146:f64d43ff0c18 310 * @param setting Setting value
mbed_official 324:406fd2029f23 311 * @return status If the clock source doesn't exist, it returns an error.
mbed_official 146:f64d43ff0c18 312 */
mbed_official 324:406fd2029f23 313 sim_hal_status_t CLOCK_HAL_SetSource(uint32_t baseAddr, clock_source_names_t clockSource, uint8_t setting);
mbed_official 146:f64d43ff0c18 314
mbed_official 146:f64d43ff0c18 315 /*!
mbed_official 146:f64d43ff0c18 316 * @brief Gets the clock source setting.
mbed_official 146:f64d43ff0c18 317 *
mbed_official 324:406fd2029f23 318 * This function gets the settings for a specified clock source. Each clock
mbed_official 324:406fd2029f23 319 * source has its own clock selection settings. See the reference manual for
mbed_official 324:406fd2029f23 320 * clock source detailed settings and the clock_source_names_t
mbed_official 146:f64d43ff0c18 321 * for clock sources.
mbed_official 146:f64d43ff0c18 322 *
mbed_official 324:406fd2029f23 323 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 324 * @param clockSource Clock source name
mbed_official 324:406fd2029f23 325 * @param setting Current setting pointer for the clock source
mbed_official 324:406fd2029f23 326 * @return status If the clock source doesn't exist, it returns an error.
mbed_official 146:f64d43ff0c18 327 */
mbed_official 324:406fd2029f23 328 sim_hal_status_t CLOCK_HAL_GetSource(uint32_t baseAddr, clock_source_names_t clockSource,
mbed_official 146:f64d43ff0c18 329 uint8_t *setting);
mbed_official 146:f64d43ff0c18 330
mbed_official 146:f64d43ff0c18 331 /*!
mbed_official 146:f64d43ff0c18 332 * @brief Sets the clock divider setting.
mbed_official 146:f64d43ff0c18 333 *
mbed_official 146:f64d43ff0c18 334 * This function sets the setting for a specified clock divider. See the
mbed_official 324:406fd2029f23 335 * reference manual for a supported clock divider and value range and the
mbed_official 324:406fd2029f23 336 * clock_divider_names_t for dividers.
mbed_official 146:f64d43ff0c18 337 *
mbed_official 324:406fd2029f23 338 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 339 * @param clockDivider Clock divider name
mbed_official 324:406fd2029f23 340 * @param setting Divider setting
mbed_official 146:f64d43ff0c18 341 * @return status If the clock divider doesn't exist, it returns an error.
mbed_official 146:f64d43ff0c18 342 */
mbed_official 324:406fd2029f23 343 sim_hal_status_t CLOCK_HAL_SetDivider(uint32_t baseAddr, clock_divider_names_t clockDivider,
mbed_official 146:f64d43ff0c18 344 uint32_t setting);
mbed_official 146:f64d43ff0c18 345
mbed_official 146:f64d43ff0c18 346 /*!
mbed_official 146:f64d43ff0c18 347 * @brief Sets the clock out dividers setting.
mbed_official 146:f64d43ff0c18 348 *
mbed_official 146:f64d43ff0c18 349 * This function sets the setting for all clock out dividers at the same time.
mbed_official 324:406fd2029f23 350 * See the reference manual for a supported clock divider and value range and the
mbed_official 324:406fd2029f23 351 * clock_divider_names_t for clock out dividers.
mbed_official 146:f64d43ff0c18 352 *
mbed_official 324:406fd2029f23 353 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 354 * @param outdiv1 Outdivider1 setting
mbed_official 146:f64d43ff0c18 355 * @param outdiv2 Outdivider2 setting
mbed_official 146:f64d43ff0c18 356 * @param outdiv3 Outdivider3 setting
mbed_official 146:f64d43ff0c18 357 * @param outdiv4 Outdivider4 setting
mbed_official 146:f64d43ff0c18 358 */
mbed_official 324:406fd2029f23 359 void CLOCK_HAL_SetOutDividers(uint32_t baseAddr, uint32_t outdiv1, uint32_t outdiv2,
mbed_official 146:f64d43ff0c18 360 uint32_t outdiv3, uint32_t outdiv4);
mbed_official 146:f64d43ff0c18 361
mbed_official 146:f64d43ff0c18 362 /*!
mbed_official 146:f64d43ff0c18 363 * @brief Gets the clock divider setting.
mbed_official 146:f64d43ff0c18 364 *
mbed_official 146:f64d43ff0c18 365 * This function gets the setting for a specified clock divider. See the
mbed_official 146:f64d43ff0c18 366 * reference manual for a supported clock divider and value range and the
mbed_official 324:406fd2029f23 367 * clock_divider_names_t for dividers.
mbed_official 146:f64d43ff0c18 368 *
mbed_official 324:406fd2029f23 369 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 370 * @param clockDivider Clock divider name
mbed_official 324:406fd2029f23 371 * @param setting Divider value pointer
mbed_official 146:f64d43ff0c18 372 * @return status If the clock divider doesn't exist, it returns an error.
mbed_official 146:f64d43ff0c18 373 */
mbed_official 324:406fd2029f23 374 sim_hal_status_t CLOCK_HAL_GetDivider(uint32_t baseAddr, clock_divider_names_t clockDivider,
mbed_official 146:f64d43ff0c18 375 uint32_t *setting);
mbed_official 146:f64d43ff0c18 376
mbed_official 146:f64d43ff0c18 377 /*@}*/
mbed_official 146:f64d43ff0c18 378
mbed_official 146:f64d43ff0c18 379 /*! @name individual field access APIs*/
mbed_official 146:f64d43ff0c18 380 /*@{*/
mbed_official 146:f64d43ff0c18 381
mbed_official 324:406fd2029f23 382 #if FSL_FEATURE_SIM_OPT_HAS_RAMSIZE
mbed_official 324:406fd2029f23 383 /*!
mbed_official 324:406fd2029f23 384 * @brief Gets RAM size.
mbed_official 324:406fd2029f23 385 *
mbed_official 324:406fd2029f23 386 * This function gets the RAM size. The field specifies the amount of system RAM
mbed_official 324:406fd2029f23 387 * available on the device.
mbed_official 324:406fd2029f23 388 *
mbed_official 324:406fd2029f23 389 * @param baseAddr Base address for current SIM instance.
mbed_official 324:406fd2029f23 390 * @return size RAM size on the device
mbed_official 324:406fd2029f23 391 */
mbed_official 324:406fd2029f23 392 static inline uint32_t SIM_HAL_GetRamSize(uint32_t baseAddr)
mbed_official 324:406fd2029f23 393 {
mbed_official 324:406fd2029f23 394 return BR_SIM_SOPT1_RAMSIZE(baseAddr);
mbed_official 324:406fd2029f23 395 }
mbed_official 324:406fd2029f23 396 #endif /* FSL_FEATURE_SIM_OPT_HAS_RAMSIZE */
mbed_official 324:406fd2029f23 397
mbed_official 324:406fd2029f23 398 #if FSL_FEATURE_SIM_OPT_HAS_USB_VOLTAGE_REGULATOR
mbed_official 146:f64d43ff0c18 399 /*!
mbed_official 146:f64d43ff0c18 400 * @brief Sets the USB voltage regulator enabled setting.
mbed_official 146:f64d43ff0c18 401 *
mbed_official 146:f64d43ff0c18 402 * This function controls whether the USB voltage regulator is enabled. This bit
mbed_official 146:f64d43ff0c18 403 * can only be written when the SOPT1CFG[URWE] bit is set.
mbed_official 146:f64d43ff0c18 404 *
mbed_official 324:406fd2029f23 405 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 406 * @param enable USB voltage regulator enable setting
mbed_official 146:f64d43ff0c18 407 * - true: USB voltage regulator is enabled.
mbed_official 146:f64d43ff0c18 408 * - false: USB voltage regulator is disabled.
mbed_official 146:f64d43ff0c18 409 */
mbed_official 324:406fd2029f23 410 static inline void SIM_HAL_SetUsbVoltRegulatorCmd(uint32_t baseAddr, bool enable)
mbed_official 146:f64d43ff0c18 411 {
mbed_official 324:406fd2029f23 412 BW_SIM_SOPT1_USBREGEN(baseAddr, enable ? 1 : 0);
mbed_official 146:f64d43ff0c18 413 }
mbed_official 146:f64d43ff0c18 414
mbed_official 146:f64d43ff0c18 415 /*!
mbed_official 146:f64d43ff0c18 416 * @brief Gets the USB voltage regulator enabled setting.
mbed_official 146:f64d43ff0c18 417 *
mbed_official 146:f64d43ff0c18 418 * This function gets the USB voltage regulator enabled setting.
mbed_official 146:f64d43ff0c18 419 *
mbed_official 324:406fd2029f23 420 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 421 * @return enabled True if the USB voltage regulator is enabled.
mbed_official 146:f64d43ff0c18 422 */
mbed_official 324:406fd2029f23 423 static inline bool SIM_HAL_GetUsbVoltRegulatorCmd(uint32_t baseAddr)
mbed_official 146:f64d43ff0c18 424 {
mbed_official 324:406fd2029f23 425 return BR_SIM_SOPT1_USBREGEN(baseAddr);
mbed_official 146:f64d43ff0c18 426 }
mbed_official 146:f64d43ff0c18 427
mbed_official 146:f64d43ff0c18 428 /*!
mbed_official 146:f64d43ff0c18 429 * @brief Sets the USB voltage regulator in a standby mode setting during Stop, VLPS, LLS, and VLLS.
mbed_official 146:f64d43ff0c18 430 *
mbed_official 146:f64d43ff0c18 431 * This function controls whether the USB voltage regulator is placed in a standby
mbed_official 146:f64d43ff0c18 432 * mode during Stop, VLPS, LLS, and VLLS modes. This bit can only be written when the
mbed_official 324:406fd2029f23 433 * SOPT1CFG[USSWE] bit is set.
mbed_official 146:f64d43ff0c18 434 *
mbed_official 324:406fd2029f23 435 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 436 * @param setting USB voltage regulator in standby mode setting
mbed_official 146:f64d43ff0c18 437 * - 0: USB voltage regulator not in standby during Stop, VLPS, LLS and
mbed_official 146:f64d43ff0c18 438 * VLLS modes.
mbed_official 146:f64d43ff0c18 439 * - 1: USB voltage regulator in standby during Stop, VLPS, LLS and VLLS
mbed_official 146:f64d43ff0c18 440 * modes.
mbed_official 146:f64d43ff0c18 441 */
mbed_official 324:406fd2029f23 442 static inline void SIM_HAL_SetUsbVoltRegulatorInStdbyDuringStopMode(uint32_t baseAddr,
mbed_official 324:406fd2029f23 443 sim_usbsstby_stop_t setting)
mbed_official 146:f64d43ff0c18 444 {
mbed_official 324:406fd2029f23 445 BW_SIM_SOPT1_USBSSTBY(baseAddr, setting);
mbed_official 146:f64d43ff0c18 446 }
mbed_official 146:f64d43ff0c18 447
mbed_official 146:f64d43ff0c18 448 /*!
mbed_official 146:f64d43ff0c18 449 * @brief Gets the USB voltage regulator in a standby mode setting.
mbed_official 146:f64d43ff0c18 450 *
mbed_official 146:f64d43ff0c18 451 * This function gets the USB voltage regulator in a standby mode setting.
mbed_official 146:f64d43ff0c18 452 *
mbed_official 324:406fd2029f23 453 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 454 * @return setting USB voltage regulator in a standby mode setting
mbed_official 146:f64d43ff0c18 455 */
mbed_official 324:406fd2029f23 456 static inline sim_usbsstby_stop_t SIM_HAL_GetUsbVoltRegulatorInStdbyDuringStopMode(uint32_t baseAddr)
mbed_official 146:f64d43ff0c18 457 {
mbed_official 324:406fd2029f23 458 return (sim_usbsstby_stop_t)BR_SIM_SOPT1_USBSSTBY(baseAddr);
mbed_official 146:f64d43ff0c18 459 }
mbed_official 146:f64d43ff0c18 460
mbed_official 146:f64d43ff0c18 461 /*!
mbed_official 146:f64d43ff0c18 462 * @brief Sets the USB voltage regulator in a standby mode during the VLPR or the VLPW.
mbed_official 146:f64d43ff0c18 463 *
mbed_official 146:f64d43ff0c18 464 * This function controls whether the USB voltage regulator is placed in a standby
mbed_official 324:406fd2029f23 465 * mode during the VLPR and the VLPW modes. This bit can only be written when the
mbed_official 324:406fd2029f23 466 * SOPT1CFG[UVSWE] bit is set.
mbed_official 146:f64d43ff0c18 467 *
mbed_official 324:406fd2029f23 468 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 469 * @param setting USB voltage regulator in standby mode setting
mbed_official 146:f64d43ff0c18 470 * - 0: USB voltage regulator not in standby during VLPR and VLPW modes.
mbed_official 146:f64d43ff0c18 471 * - 1: USB voltage regulator in standby during VLPR and VLPW modes.
mbed_official 146:f64d43ff0c18 472 */
mbed_official 324:406fd2029f23 473 static inline void SIM_HAL_SetUsbVoltRegulatorInStdbyDuringVlprwMode(uint32_t baseAddr,
mbed_official 324:406fd2029f23 474 sim_usbvstby_stop_t setting)
mbed_official 146:f64d43ff0c18 475 {
mbed_official 324:406fd2029f23 476 BW_SIM_SOPT1_USBVSTBY(baseAddr, setting);
mbed_official 146:f64d43ff0c18 477 }
mbed_official 146:f64d43ff0c18 478
mbed_official 146:f64d43ff0c18 479 /*!
mbed_official 146:f64d43ff0c18 480 * @brief Gets the USB voltage regulator in a standby mode during the VLPR or the VLPW.
mbed_official 146:f64d43ff0c18 481 *
mbed_official 146:f64d43ff0c18 482 * This function gets the USB voltage regulator in a standby mode during the VLPR or the VLPW.
mbed_official 146:f64d43ff0c18 483 *
mbed_official 324:406fd2029f23 484 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 485 * @return setting USB voltage regulator in a standby mode during the VLPR or the VLPW
mbed_official 146:f64d43ff0c18 486 */
mbed_official 324:406fd2029f23 487 static inline sim_usbvstby_stop_t SIM_HAL_GetUsbVoltRegulatorInStdbyDuringVlprwMode(uint32_t baseAddr)
mbed_official 146:f64d43ff0c18 488 {
mbed_official 324:406fd2029f23 489 return (sim_usbvstby_stop_t)BR_SIM_SOPT1_USBVSTBY(baseAddr);
mbed_official 146:f64d43ff0c18 490 }
mbed_official 146:f64d43ff0c18 491
mbed_official 146:f64d43ff0c18 492 /*!
mbed_official 146:f64d43ff0c18 493 * @brief Sets the USB voltage regulator stop standby write enable setting.
mbed_official 146:f64d43ff0c18 494 *
mbed_official 146:f64d43ff0c18 495 * This function controls whether the USB voltage regulator stop standby write
mbed_official 146:f64d43ff0c18 496 * feature is enabled. Writing one to this bit allows the SOPT1[USBSSTBY] bit to be written. This
mbed_official 324:406fd2029f23 497 * register bit clears after a write to SOPT1[USBSSTBY].
mbed_official 146:f64d43ff0c18 498 *
mbed_official 324:406fd2029f23 499 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 500 * @param enable USB voltage regulator stop standby write enable setting
mbed_official 146:f64d43ff0c18 501 * - true: SOPT1[USBSSTBY] can be written.
mbed_official 146:f64d43ff0c18 502 * - false: SOPT1[USBSSTBY] cannot be written.
mbed_official 146:f64d43ff0c18 503 */
mbed_official 324:406fd2029f23 504 static inline void SIM_HAL_SetUsbVoltRegulatorInStdbyDuringStopCmd(uint32_t baseAddr, bool enable)
mbed_official 146:f64d43ff0c18 505 {
mbed_official 324:406fd2029f23 506 BW_SIM_SOPT1CFG_USSWE(baseAddr, enable ? 1 : 0);
mbed_official 146:f64d43ff0c18 507 }
mbed_official 146:f64d43ff0c18 508
mbed_official 146:f64d43ff0c18 509 /*!
mbed_official 146:f64d43ff0c18 510 * @brief Gets the USB voltage regulator stop standby write enable setting.
mbed_official 146:f64d43ff0c18 511 *
mbed_official 146:f64d43ff0c18 512 * This function gets the USB voltage regulator stop standby write enable setting.
mbed_official 146:f64d43ff0c18 513 *
mbed_official 324:406fd2029f23 514 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 515 * @return enabled True if the USB voltage regulator stop standby write is enabled.
mbed_official 146:f64d43ff0c18 516 */
mbed_official 324:406fd2029f23 517 static inline bool SIM_HAL_GetUsbVoltRegulatorInStdbyDuringStopCmd(uint32_t baseAddr)
mbed_official 146:f64d43ff0c18 518 {
mbed_official 324:406fd2029f23 519 return BR_SIM_SOPT1CFG_USSWE(baseAddr);
mbed_official 146:f64d43ff0c18 520 }
mbed_official 146:f64d43ff0c18 521
mbed_official 146:f64d43ff0c18 522 /*!
mbed_official 146:f64d43ff0c18 523 * @brief Sets the USB voltage regulator VLP standby write enable setting.
mbed_official 146:f64d43ff0c18 524 *
mbed_official 146:f64d43ff0c18 525 * This function controls whether USB voltage regulator VLP standby write
mbed_official 146:f64d43ff0c18 526 * feature is enabled. Writing one to this bit allows the SOPT1[USBVSTBY] bit to be written. This
mbed_official 324:406fd2029f23 527 * register bit clears after a write to SOPT1[USBVSTBY].
mbed_official 146:f64d43ff0c18 528 *
mbed_official 324:406fd2029f23 529 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 530 * @param enable USB voltage regulator VLP standby write enable setting
mbed_official 146:f64d43ff0c18 531 * - true: SOPT1[USBSSTBY] can be written.
mbed_official 146:f64d43ff0c18 532 * - false: SOPT1[USBSSTBY] cannot be written.
mbed_official 146:f64d43ff0c18 533 */
mbed_official 324:406fd2029f23 534 static inline void SIM_HAL_SetUsbVoltRegulatorInStdbyDuringVlprwCmd(uint32_t baseAddr, bool enable)
mbed_official 146:f64d43ff0c18 535 {
mbed_official 324:406fd2029f23 536 BW_SIM_SOPT1CFG_UVSWE(baseAddr, enable ? 1 : 0);
mbed_official 146:f64d43ff0c18 537 }
mbed_official 146:f64d43ff0c18 538
mbed_official 146:f64d43ff0c18 539 /*!
mbed_official 146:f64d43ff0c18 540 * @brief Gets the USB voltage regulator VLP standby write enable setting.
mbed_official 146:f64d43ff0c18 541 *
mbed_official 146:f64d43ff0c18 542 * This function gets the USB voltage regulator VLP standby write enable setting.
mbed_official 146:f64d43ff0c18 543 *
mbed_official 324:406fd2029f23 544 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 545 * @return enabled True if the USB voltage regulator VLP standby write is enabled.
mbed_official 146:f64d43ff0c18 546 */
mbed_official 324:406fd2029f23 547 static inline bool SIM_HAL_GetUsbVoltRegulatorInStdbyDuringVlprwCmd(uint32_t baseAddr)
mbed_official 146:f64d43ff0c18 548 {
mbed_official 324:406fd2029f23 549 return BR_SIM_SOPT1CFG_UVSWE(baseAddr);
mbed_official 146:f64d43ff0c18 550 }
mbed_official 146:f64d43ff0c18 551
mbed_official 146:f64d43ff0c18 552 /*!
mbed_official 146:f64d43ff0c18 553 * @brief Sets the USB voltage regulator enable write enable setting.
mbed_official 146:f64d43ff0c18 554 *
mbed_official 146:f64d43ff0c18 555 * This function controls whether the USB voltage regulator write enable
mbed_official 324:406fd2029f23 556 * feature is enabled. Writing one to this bit allows the SOPT1[USBREGEN] bit to be written.
mbed_official 324:406fd2029f23 557 * This register bit clears after a write to SOPT1[USBREGEN].
mbed_official 146:f64d43ff0c18 558 *
mbed_official 324:406fd2029f23 559 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 560 * @param enable USB voltage regulator enable write enable setting
mbed_official 146:f64d43ff0c18 561 * - true: SOPT1[USBSSTBY] can be written.
mbed_official 146:f64d43ff0c18 562 * - false: SOPT1[USBSSTBY] cannot be written.
mbed_official 146:f64d43ff0c18 563 */
mbed_official 324:406fd2029f23 564 static inline void SIM_HAL_SetUsbVoltRegulatorWriteCmd(uint32_t baseAddr, bool enable)
mbed_official 146:f64d43ff0c18 565 {
mbed_official 324:406fd2029f23 566 BW_SIM_SOPT1CFG_URWE(baseAddr, enable ? 1 : 0);
mbed_official 146:f64d43ff0c18 567 }
mbed_official 146:f64d43ff0c18 568
mbed_official 146:f64d43ff0c18 569 /*!
mbed_official 146:f64d43ff0c18 570 * @brief Gets the USB voltage regulator enable write enable setting.
mbed_official 146:f64d43ff0c18 571 *
mbed_official 146:f64d43ff0c18 572 * This function gets the USB voltage regulator enable write enable setting.
mbed_official 146:f64d43ff0c18 573 *
mbed_official 324:406fd2029f23 574 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 575 * @return enabled True if USB voltage regulator enable write is enabled.
mbed_official 146:f64d43ff0c18 576 */
mbed_official 324:406fd2029f23 577 static inline bool SIM_HAL_GetUsbVoltRegulatorWriteCmd(uint32_t baseAddr)
mbed_official 146:f64d43ff0c18 578 {
mbed_official 324:406fd2029f23 579 return BR_SIM_SOPT1CFG_URWE(baseAddr);
mbed_official 146:f64d43ff0c18 580 }
mbed_official 324:406fd2029f23 581 #endif
mbed_official 146:f64d43ff0c18 582
mbed_official 146:f64d43ff0c18 583 #if FSL_FEATURE_SIM_OPT_HAS_CMTUARTPAD
mbed_official 146:f64d43ff0c18 584 /*!
mbed_official 146:f64d43ff0c18 585 * @brief Sets the CMT/UART pad drive strength setting.
mbed_official 146:f64d43ff0c18 586 *
mbed_official 324:406fd2029f23 587 * This function controls the output drive strength of the CMT IRO signal or
mbed_official 324:406fd2029f23 588 * UART0_TXD signal on PTD7 pin by selecting either one or two pads to drive it.
mbed_official 146:f64d43ff0c18 589 *
mbed_official 324:406fd2029f23 590 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 591 * @param setting CMT/UART pad drive strength setting
mbed_official 146:f64d43ff0c18 592 * - 0: Single-pad drive strength for CMT IRO or UART0_TXD.
mbed_official 146:f64d43ff0c18 593 * - 1: Dual-pad drive strength for CMT IRO or UART0_TXD.
mbed_official 146:f64d43ff0c18 594 */
mbed_official 324:406fd2029f23 595 static inline void SIM_HAL_SetCmtUartPadDriveStrengthMode(uint32_t baseAddr,
mbed_official 324:406fd2029f23 596 sim_cmtuartpad_strengh_t setting)
mbed_official 146:f64d43ff0c18 597 {
mbed_official 324:406fd2029f23 598 BW_SIM_SOPT2_CMTUARTPAD(baseAddr, setting);
mbed_official 146:f64d43ff0c18 599 }
mbed_official 146:f64d43ff0c18 600
mbed_official 146:f64d43ff0c18 601 /*!
mbed_official 146:f64d43ff0c18 602 * @brief Gets the CMT/UART pad drive strength setting.
mbed_official 146:f64d43ff0c18 603 *
mbed_official 146:f64d43ff0c18 604 * This function gets the CMT/UART pad drive strength setting.
mbed_official 146:f64d43ff0c18 605 *
mbed_official 324:406fd2029f23 606 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 607 * @return setting CMT/UART pad drive strength setting
mbed_official 146:f64d43ff0c18 608 */
mbed_official 324:406fd2029f23 609 static inline sim_cmtuartpad_strengh_t SIM_HAL_GetCmtUartPadDriveStrengthMode(uint32_t baseAddr)
mbed_official 146:f64d43ff0c18 610 {
mbed_official 324:406fd2029f23 611 return (sim_cmtuartpad_strengh_t)BR_SIM_SOPT2_CMTUARTPAD(baseAddr);
mbed_official 146:f64d43ff0c18 612 }
mbed_official 146:f64d43ff0c18 613 #endif /* FSL_FEATURE_SIM_OPT_HAS_CMTUARTPAD */
mbed_official 146:f64d43ff0c18 614
mbed_official 146:f64d43ff0c18 615 #if FSL_FEATURE_SIM_OPT_HAS_PTD7PAD
mbed_official 146:f64d43ff0c18 616 /*!
mbed_official 146:f64d43ff0c18 617 * @brief Sets the PTD7 pad drive strength setting.
mbed_official 146:f64d43ff0c18 618 *
mbed_official 146:f64d43ff0c18 619 * This function controls the output drive strength of the PTD7 pin by selecting
mbed_official 324:406fd2029f23 620 * either one or two pads to drive it.
mbed_official 146:f64d43ff0c18 621 *
mbed_official 324:406fd2029f23 622 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 623 * @param setting PTD7 pad drive strength setting
mbed_official 146:f64d43ff0c18 624 * - 0: Single-pad drive strength for PTD7.
mbed_official 146:f64d43ff0c18 625 * - 1: Double pad drive strength for PTD7.
mbed_official 146:f64d43ff0c18 626 */
mbed_official 324:406fd2029f23 627 static inline void SIM_HAL_SetPtd7PadDriveStrengthMode(uint32_t baseAddr,
mbed_official 324:406fd2029f23 628 sim_ptd7pad_strengh_t setting)
mbed_official 146:f64d43ff0c18 629 {
mbed_official 324:406fd2029f23 630 BW_SIM_SOPT2_PTD7PAD(baseAddr, setting);
mbed_official 146:f64d43ff0c18 631 }
mbed_official 146:f64d43ff0c18 632
mbed_official 146:f64d43ff0c18 633 /*!
mbed_official 146:f64d43ff0c18 634 * @brief Gets the PTD7 pad drive strength setting.
mbed_official 146:f64d43ff0c18 635 *
mbed_official 146:f64d43ff0c18 636 * This function gets the PTD7 pad drive strength setting.
mbed_official 146:f64d43ff0c18 637 *
mbed_official 324:406fd2029f23 638 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 639 * @return setting PTD7 pad drive strength setting
mbed_official 146:f64d43ff0c18 640 */
mbed_official 324:406fd2029f23 641 static inline sim_ptd7pad_strengh_t SIM_HAL_GetPtd7PadDriveStrengthMode(uint32_t baseAddr)
mbed_official 146:f64d43ff0c18 642 {
mbed_official 324:406fd2029f23 643 return (sim_ptd7pad_strengh_t)BR_SIM_SOPT2_PTD7PAD(baseAddr);
mbed_official 146:f64d43ff0c18 644 }
mbed_official 146:f64d43ff0c18 645 #endif /* FSL_FEATURE_SIM_OPT_HAS_PTD7PAD */
mbed_official 146:f64d43ff0c18 646
mbed_official 146:f64d43ff0c18 647 #if FSL_FEATURE_SIM_OPT_HAS_FBSL
mbed_official 146:f64d43ff0c18 648 /*!
mbed_official 146:f64d43ff0c18 649 * @brief Sets the FlexBus security level setting.
mbed_official 146:f64d43ff0c18 650 *
mbed_official 146:f64d43ff0c18 651 * This function sets the FlexBus security level setting. If the security is enabled,
mbed_official 324:406fd2029f23 652 * this field affects which CPU operations can access the off-chip via the FlexBus
mbed_official 324:406fd2029f23 653 * and DDR controller interfaces. This field has no effect if the security is not enabled.
mbed_official 146:f64d43ff0c18 654 *
mbed_official 324:406fd2029f23 655 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 656 * @param setting FlexBus security level setting
mbed_official 324:406fd2029f23 657 * - 00: All off-chip accesses (op code and data) via the FlexBus and
mbed_official 146:f64d43ff0c18 658 * DDR controller are disallowed.
mbed_official 146:f64d43ff0c18 659 * - 10: Off-chip op code accesses are disallowed. Data accesses are
mbed_official 146:f64d43ff0c18 660 * allowed.
mbed_official 146:f64d43ff0c18 661 * - 11: Off-chip op code accesses and data accesses are allowed.
mbed_official 146:f64d43ff0c18 662 */
mbed_official 324:406fd2029f23 663 static inline void SIM_HAL_SetFlexbusSecurityLevelMode(uint32_t baseAddr,
mbed_official 324:406fd2029f23 664 sim_flexbus_security_level_t setting)
mbed_official 146:f64d43ff0c18 665 {
mbed_official 324:406fd2029f23 666 BW_SIM_SOPT2_FBSL(baseAddr, setting);
mbed_official 146:f64d43ff0c18 667 }
mbed_official 146:f64d43ff0c18 668
mbed_official 146:f64d43ff0c18 669 /*!
mbed_official 146:f64d43ff0c18 670 * @brief Gets the FlexBus security level setting.
mbed_official 146:f64d43ff0c18 671 *
mbed_official 146:f64d43ff0c18 672 * This function gets the FlexBus security level setting.
mbed_official 146:f64d43ff0c18 673 *
mbed_official 324:406fd2029f23 674 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 675 * @return setting FlexBus security level setting
mbed_official 146:f64d43ff0c18 676 */
mbed_official 324:406fd2029f23 677 static inline sim_flexbus_security_level_t SIM_HAL_GetFlexbusSecurityLevelMode(uint32_t baseAddr)
mbed_official 146:f64d43ff0c18 678 {
mbed_official 324:406fd2029f23 679 return (sim_flexbus_security_level_t)BR_SIM_SOPT2_FBSL(baseAddr);
mbed_official 146:f64d43ff0c18 680 }
mbed_official 146:f64d43ff0c18 681 #endif /* FSL_FEATURE_SIM_OPT_HAS_FBSL */
mbed_official 146:f64d43ff0c18 682
mbed_official 146:f64d43ff0c18 683 #if FSL_FEATURE_SIM_OPT_HAS_PCR
mbed_official 146:f64d43ff0c18 684 /*!
mbed_official 146:f64d43ff0c18 685 * @brief Sets the PCR setting.
mbed_official 146:f64d43ff0c18 686 *
mbed_official 324:406fd2029f23 687 * This function sets the PCR setting. This is the FlexBus hold cycles before
mbed_official 146:f64d43ff0c18 688 * FlexBus can release bus to NFC or to IDLE.
mbed_official 146:f64d43ff0c18 689 *
mbed_official 324:406fd2029f23 690 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 691 * @param setting PCR setting
mbed_official 146:f64d43ff0c18 692 */
mbed_official 324:406fd2029f23 693 static inline void SIM_HAL_SetFlexbusHoldCycles(uint32_t baseAddr, uint32_t setting)
mbed_official 146:f64d43ff0c18 694 {
mbed_official 324:406fd2029f23 695 BW_SIM_SOPT6_PCR(baseAddr, setting);
mbed_official 146:f64d43ff0c18 696 }
mbed_official 146:f64d43ff0c18 697
mbed_official 146:f64d43ff0c18 698 /*!
mbed_official 146:f64d43ff0c18 699 * @brief Gets the PCR setting.
mbed_official 146:f64d43ff0c18 700 *
mbed_official 146:f64d43ff0c18 701 * This function gets the PCR setting.
mbed_official 146:f64d43ff0c18 702 *
mbed_official 324:406fd2029f23 703 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 704 * @return setting PCR setting
mbed_official 146:f64d43ff0c18 705 */
mbed_official 324:406fd2029f23 706 static inline uint32_t SIM_HAL_GetFlexbusHoldCycles(uint32_t baseAddr)
mbed_official 146:f64d43ff0c18 707 {
mbed_official 324:406fd2029f23 708 return BR_SIM_SOPT6_PCR(baseAddr);
mbed_official 146:f64d43ff0c18 709 }
mbed_official 146:f64d43ff0c18 710 #endif /* FSL_FEATURE_SIM_OPT_HAS_PCR */
mbed_official 146:f64d43ff0c18 711
mbed_official 146:f64d43ff0c18 712 #if FSL_FEATURE_SIM_OPT_HAS_MCC
mbed_official 146:f64d43ff0c18 713 /*!
mbed_official 324:406fd2029f23 714 * @brief Sets the MCC setting.
mbed_official 146:f64d43ff0c18 715 *
mbed_official 146:f64d43ff0c18 716 * This function sets the MCC setting. This is the NFC hold cycle in case the
mbed_official 146:f64d43ff0c18 717 * FlexBus request during NFC is granted.
mbed_official 146:f64d43ff0c18 718 *
mbed_official 324:406fd2029f23 719 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 720 * @param setting MCC setting
mbed_official 146:f64d43ff0c18 721 */
mbed_official 324:406fd2029f23 722 static inline void SIM_HAL_SetNandFlashControllerHoldCycles(uint32_t baseAddr, uint32_t setting)
mbed_official 146:f64d43ff0c18 723 {
mbed_official 324:406fd2029f23 724 BW_SIM_SOPT6_MCC(baseAddr, setting);
mbed_official 146:f64d43ff0c18 725 }
mbed_official 146:f64d43ff0c18 726
mbed_official 146:f64d43ff0c18 727 /*!
mbed_official 146:f64d43ff0c18 728 * @brief Gets the MCC setting.
mbed_official 146:f64d43ff0c18 729 *
mbed_official 146:f64d43ff0c18 730 * This function gets the MCC setting.
mbed_official 146:f64d43ff0c18 731 *
mbed_official 324:406fd2029f23 732 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 733 * @return setting MCC setting
mbed_official 146:f64d43ff0c18 734 */
mbed_official 324:406fd2029f23 735 static inline uint32_t SIM_HAL_GetNandFlashControllerHoldCycles(uint32_t baseAddr)
mbed_official 146:f64d43ff0c18 736 {
mbed_official 324:406fd2029f23 737 return BR_SIM_SOPT6_MCC(baseAddr);
mbed_official 146:f64d43ff0c18 738 }
mbed_official 146:f64d43ff0c18 739 #endif /* FSL_FEATURE_SIM_OPT_HAS_MCC */
mbed_official 146:f64d43ff0c18 740
mbed_official 146:f64d43ff0c18 741 /*!
mbed_official 146:f64d43ff0c18 742 * @brief Sets the ADCx alternate trigger enable setting.
mbed_official 146:f64d43ff0c18 743 *
mbed_official 146:f64d43ff0c18 744 * This function enables/disables the alternative conversion triggers for ADCx.
mbed_official 146:f64d43ff0c18 745 *
mbed_official 324:406fd2029f23 746 * @param baseAddr Base address for current SIM instance.
mbed_official 324:406fd2029f23 747 * @param instance device instance.
mbed_official 146:f64d43ff0c18 748 * @param enable Enable alternative conversion triggers for ADCx
mbed_official 146:f64d43ff0c18 749 * - true: Select alternative conversion trigger.
mbed_official 146:f64d43ff0c18 750 * - false: Select PDB trigger.
mbed_official 146:f64d43ff0c18 751 */
mbed_official 324:406fd2029f23 752 void SIM_HAL_SetAdcAlternativeTriggerCmd(uint32_t baseAddr, uint8_t instance, bool enable);
mbed_official 146:f64d43ff0c18 753
mbed_official 146:f64d43ff0c18 754 /*!
mbed_official 146:f64d43ff0c18 755 * @brief Gets the ADCx alternate trigger enable setting.
mbed_official 146:f64d43ff0c18 756 *
mbed_official 146:f64d43ff0c18 757 * This function gets the ADCx alternate trigger enable setting.
mbed_official 146:f64d43ff0c18 758 *
mbed_official 324:406fd2029f23 759 * @param baseAddr Base address for current SIM instance.
mbed_official 324:406fd2029f23 760 * @param instance device instance.
mbed_official 146:f64d43ff0c18 761 * @return enabled True if ADCx alternate trigger is enabled
mbed_official 146:f64d43ff0c18 762 */
mbed_official 324:406fd2029f23 763 bool SIM_HAL_GetAdcAlternativeTriggerCmd(uint32_t baseAddr, uint8_t instance);
mbed_official 146:f64d43ff0c18 764
mbed_official 146:f64d43ff0c18 765 /*!
mbed_official 146:f64d43ff0c18 766 * @brief Sets the ADCx pre-trigger select setting.
mbed_official 146:f64d43ff0c18 767 *
mbed_official 146:f64d43ff0c18 768 * This function selects the ADCx pre-trigger source when the alternative triggers
mbed_official 146:f64d43ff0c18 769 * are enabled through ADCxALTTRGEN.
mbed_official 146:f64d43ff0c18 770 *
mbed_official 324:406fd2029f23 771 * @param baseAddr Base address for current SIM instance.
mbed_official 324:406fd2029f23 772 * @param instance device instance.
mbed_official 146:f64d43ff0c18 773 * @param select pre-trigger select setting for ADCx
mbed_official 146:f64d43ff0c18 774 * - 0: Pre-trigger A selected for ADCx.
mbed_official 146:f64d43ff0c18 775 * - 1: Pre-trigger B selected for ADCx.
mbed_official 146:f64d43ff0c18 776 */
mbed_official 324:406fd2029f23 777 void SIM_HAL_SetAdcPreTriggerMode(uint32_t baseAddr, uint8_t instance, sim_pretrgsel_t select);
mbed_official 146:f64d43ff0c18 778
mbed_official 146:f64d43ff0c18 779 /*!
mbed_official 146:f64d43ff0c18 780 * @brief Gets the ADCx pre-trigger select setting.
mbed_official 146:f64d43ff0c18 781 *
mbed_official 146:f64d43ff0c18 782 * This function gets the ADCx pre-trigger select setting.
mbed_official 146:f64d43ff0c18 783 *
mbed_official 324:406fd2029f23 784 * @param baseAddr Base address for current SIM instance.
mbed_official 324:406fd2029f23 785 * @param instance device instance.
mbed_official 146:f64d43ff0c18 786 * @return select ADCx pre-trigger select setting
mbed_official 146:f64d43ff0c18 787 */
mbed_official 324:406fd2029f23 788 sim_pretrgsel_t SIM_HAL_GetAdcPreTriggerMode(uint32_t baseAddr, uint8_t instance);
mbed_official 146:f64d43ff0c18 789
mbed_official 146:f64d43ff0c18 790 /*!
mbed_official 146:f64d43ff0c18 791 * @brief Sets the ADCx trigger select setting.
mbed_official 146:f64d43ff0c18 792 *
mbed_official 146:f64d43ff0c18 793 * This function selects the ADCx trigger source when alternative triggers
mbed_official 146:f64d43ff0c18 794 * are enabled through ADCxALTTRGEN.
mbed_official 146:f64d43ff0c18 795 *
mbed_official 324:406fd2029f23 796 * @param baseAddr Base address for current SIM instance.
mbed_official 324:406fd2029f23 797 * @param instance device instance.
mbed_official 146:f64d43ff0c18 798 * @param select trigger select setting for ADCx
mbed_official 146:f64d43ff0c18 799 * - 0000: External trigger
mbed_official 146:f64d43ff0c18 800 * - 0001: High speed comparator 0 asynchronous interrupt
mbed_official 146:f64d43ff0c18 801 * - 0010: High speed comparator 1 asynchronous interrupt
mbed_official 324:406fd2029f23 802 * - 0011: High speed comparator 2 asynchronous interrupt
mbed_official 146:f64d43ff0c18 803 * - 0100: PIT trigger 0
mbed_official 146:f64d43ff0c18 804 * - 0101: PIT trigger 1
mbed_official 146:f64d43ff0c18 805 * - 0110: PIT trigger 2
mbed_official 146:f64d43ff0c18 806 * - 0111: PIT trigger 3
mbed_official 146:f64d43ff0c18 807 * - 1000: FTM0 trigger
mbed_official 146:f64d43ff0c18 808 * - 1001: FTM1 trigger
mbed_official 146:f64d43ff0c18 809 * - 1010: FTM2 trigger
mbed_official 146:f64d43ff0c18 810 * - 1011: FTM3 trigger
mbed_official 146:f64d43ff0c18 811 * - 1100: RTC alarm
mbed_official 146:f64d43ff0c18 812 * - 1101: RTC seconds
mbed_official 146:f64d43ff0c18 813 * - 1110: Low-power timer trigger
mbed_official 146:f64d43ff0c18 814 * - 1111: High speed comparator 3 asynchronous interrupt
mbed_official 146:f64d43ff0c18 815 */
mbed_official 324:406fd2029f23 816 void SIM_HAL_SetAdcTriggerMode(uint32_t baseAddr, uint8_t instance, sim_trgsel_t select);
mbed_official 146:f64d43ff0c18 817
mbed_official 146:f64d43ff0c18 818 /*!
mbed_official 146:f64d43ff0c18 819 * @brief Gets the ADCx trigger select setting.
mbed_official 146:f64d43ff0c18 820 *
mbed_official 146:f64d43ff0c18 821 * This function gets the ADCx trigger select setting.
mbed_official 146:f64d43ff0c18 822 *
mbed_official 324:406fd2029f23 823 * @param baseAddr Base address for current SIM instance.
mbed_official 324:406fd2029f23 824 * @param instance device instance.
mbed_official 146:f64d43ff0c18 825 * @return select ADCx trigger select setting
mbed_official 146:f64d43ff0c18 826 */
mbed_official 324:406fd2029f23 827 sim_pretrgsel_t SIM_HAL_GetAdcTriggerMode(uint32_t baseAddr, uint8_t instance);
mbed_official 146:f64d43ff0c18 828
mbed_official 146:f64d43ff0c18 829 /*!
mbed_official 146:f64d43ff0c18 830 * @brief Sets the UARTx receive data source select setting.
mbed_official 146:f64d43ff0c18 831 *
mbed_official 146:f64d43ff0c18 832 * This function selects the source for the UARTx receive data.
mbed_official 146:f64d43ff0c18 833 *
mbed_official 324:406fd2029f23 834 * @param baseAddr Base address for current SIM instance.
mbed_official 324:406fd2029f23 835 * @param instance device instance.
mbed_official 146:f64d43ff0c18 836 * @param select the source for the UARTx receive data
mbed_official 146:f64d43ff0c18 837 * - 00: UARTx_RX pin.
mbed_official 146:f64d43ff0c18 838 * - 01: CMP0.
mbed_official 146:f64d43ff0c18 839 * - 10: CMP1.
mbed_official 146:f64d43ff0c18 840 * - 11: Reserved.
mbed_official 146:f64d43ff0c18 841 */
mbed_official 324:406fd2029f23 842 void SIM_HAL_SetUartRxSrcMode(uint32_t baseAddr, uint8_t instance, sim_uart_rxsrc_t select);
mbed_official 146:f64d43ff0c18 843
mbed_official 146:f64d43ff0c18 844 /*!
mbed_official 324:406fd2029f23 845 * @brief Gets the UARTx receive data source select setting.
mbed_official 146:f64d43ff0c18 846 *
mbed_official 146:f64d43ff0c18 847 * This function gets the UARTx receive data source select setting.
mbed_official 146:f64d43ff0c18 848 *
mbed_official 324:406fd2029f23 849 * @param baseAddr Base address for current SIM instance.
mbed_official 324:406fd2029f23 850 * @param instance device instance.
mbed_official 146:f64d43ff0c18 851 * @return select UARTx receive data source select setting
mbed_official 146:f64d43ff0c18 852 */
mbed_official 324:406fd2029f23 853 sim_uart_rxsrc_t SIM_HAL_GetUartRxSrcMode(uint32_t baseAddr, uint8_t instance);
mbed_official 146:f64d43ff0c18 854
mbed_official 146:f64d43ff0c18 855 /*!
mbed_official 146:f64d43ff0c18 856 * @brief Sets the UARTx transmit data source select setting.
mbed_official 146:f64d43ff0c18 857 *
mbed_official 146:f64d43ff0c18 858 * This function selects the source for the UARTx transmit data.
mbed_official 146:f64d43ff0c18 859 *
mbed_official 324:406fd2029f23 860 * @param baseAddr Base address for current SIM instance.
mbed_official 324:406fd2029f23 861 * @param instance device instance.
mbed_official 146:f64d43ff0c18 862 * @param select the source for the UARTx transmit data
mbed_official 146:f64d43ff0c18 863 * - 00: UARTx_TX pin.
mbed_official 146:f64d43ff0c18 864 * - 01: UARTx_TX pin modulated with FTM1 channel 0 output.
mbed_official 146:f64d43ff0c18 865 * - 10: UARTx_TX pin modulated with FTM2 channel 0 output.
mbed_official 146:f64d43ff0c18 866 * - 11: Reserved.
mbed_official 146:f64d43ff0c18 867 */
mbed_official 324:406fd2029f23 868 void SIM_HAL_SetUartTxSrcMode(uint32_t baseAddr, uint8_t instance, sim_uart_txsrc_t select);
mbed_official 146:f64d43ff0c18 869
mbed_official 146:f64d43ff0c18 870 /*!
mbed_official 146:f64d43ff0c18 871 * @brief Gets the UARTx transmit data source select setting.
mbed_official 146:f64d43ff0c18 872 *
mbed_official 146:f64d43ff0c18 873 * This function gets the UARTx transmit data source select setting.
mbed_official 146:f64d43ff0c18 874 *
mbed_official 324:406fd2029f23 875 * @param baseAddr Base address for current SIM instance.
mbed_official 324:406fd2029f23 876 * @param instance device instance.
mbed_official 146:f64d43ff0c18 877 * @return select UARTx transmit data source select setting
mbed_official 146:f64d43ff0c18 878 */
mbed_official 324:406fd2029f23 879 sim_uart_txsrc_t SIM_HAL_GetUartTxSrcMode(uint32_t baseAddr, uint8_t instance);
mbed_official 146:f64d43ff0c18 880
mbed_official 146:f64d43ff0c18 881 #if FSL_FEATURE_SIM_OPT_HAS_ODE
mbed_official 146:f64d43ff0c18 882 /*!
mbed_official 146:f64d43ff0c18 883 * @brief Sets the UARTx Open Drain Enable setting.
mbed_official 146:f64d43ff0c18 884 *
mbed_official 146:f64d43ff0c18 885 * This function enables/disables the UARTx Open Drain.
mbed_official 146:f64d43ff0c18 886 *
mbed_official 324:406fd2029f23 887 * @param baseAddr Base address for current SIM instance.
mbed_official 324:406fd2029f23 888 * @param instance device instance.
mbed_official 146:f64d43ff0c18 889 * @param enable Enable/disable UARTx Open Drain
mbed_official 146:f64d43ff0c18 890 * - True: Enable UARTx Open Drain
mbed_official 146:f64d43ff0c18 891 * - False: Disable UARTx Open Drain
mbed_official 146:f64d43ff0c18 892 */
mbed_official 324:406fd2029f23 893 void SIM_HAL_SetUartOpenDrainCmd(uint32_t baseAddr, uint8_t instance, bool enable);
mbed_official 146:f64d43ff0c18 894
mbed_official 146:f64d43ff0c18 895 /*!
mbed_official 146:f64d43ff0c18 896 * @brief Gets the UARTx Open Drain Enable setting.
mbed_official 146:f64d43ff0c18 897 *
mbed_official 324:406fd2029f23 898 * This function gets the UARTx Open Drain Enable setting.
mbed_official 146:f64d43ff0c18 899 *
mbed_official 324:406fd2029f23 900 * @param baseAddr Base address for current SIM instance.
mbed_official 324:406fd2029f23 901 * @param instance device instance.
mbed_official 146:f64d43ff0c18 902 * @return enabled True if UARTx Open Drain is enabled.
mbed_official 146:f64d43ff0c18 903 */
mbed_official 324:406fd2029f23 904 bool SIM_HAL_GetUartOpenDrainCmd(uint32_t baseAddr, uint8_t instance);
mbed_official 146:f64d43ff0c18 905 #endif
mbed_official 146:f64d43ff0c18 906
mbed_official 146:f64d43ff0c18 907 #if FSL_FEATURE_SIM_OPT_HAS_FTM
mbed_official 146:f64d43ff0c18 908 /*!
mbed_official 146:f64d43ff0c18 909 * @brief Sets the FlexTimer x hardware trigger y source select setting.
mbed_official 146:f64d43ff0c18 910 *
mbed_official 146:f64d43ff0c18 911 * This function selects the source of FTMx hardware trigger y.
mbed_official 146:f64d43ff0c18 912 *
mbed_official 324:406fd2029f23 913 * @param baseAddr Base address for current SIM instance.
mbed_official 324:406fd2029f23 914 * @param instance device instance.
mbed_official 324:406fd2029f23 915 * @param trigger hardware trigger y
mbed_official 146:f64d43ff0c18 916 * @param select FlexTimer x hardware trigger y
mbed_official 146:f64d43ff0c18 917 * - 0: Pre-trigger A selected for ADCx.
mbed_official 146:f64d43ff0c18 918 * - 1: Pre-trigger B selected for ADCx.
mbed_official 146:f64d43ff0c18 919 */
mbed_official 324:406fd2029f23 920 void SIM_HAL_SetFtmTriggerSrcMode(uint32_t baseAddr,
mbed_official 324:406fd2029f23 921 uint8_t instance,
mbed_official 324:406fd2029f23 922 uint8_t trigger,
mbed_official 324:406fd2029f23 923 sim_ftm_trg_src_t select);
mbed_official 146:f64d43ff0c18 924
mbed_official 146:f64d43ff0c18 925 /*!
mbed_official 146:f64d43ff0c18 926 * @brief Gets the FlexTimer x hardware trigger y source select setting.
mbed_official 146:f64d43ff0c18 927 *
mbed_official 324:406fd2029f23 928 * This function gets the FlexTimer x hardware trigger y source select setting.
mbed_official 146:f64d43ff0c18 929 *
mbed_official 324:406fd2029f23 930 * @param baseAddr Base address for current SIM instance.
mbed_official 324:406fd2029f23 931 * @param instance device instance.
mbed_official 324:406fd2029f23 932 * @param trigger hardware trigger y
mbed_official 146:f64d43ff0c18 933 * @return select FlexTimer x hardware trigger y source select setting
mbed_official 146:f64d43ff0c18 934 */
mbed_official 324:406fd2029f23 935 sim_ftm_trg_src_t SIM_HAL_GetFtmTriggerSrcMode(uint32_t baseAddr, uint8_t instance, uint8_t trigger);
mbed_official 146:f64d43ff0c18 936
mbed_official 146:f64d43ff0c18 937 /*!
mbed_official 146:f64d43ff0c18 938 * @brief Sets the FlexTimer x external clock pin select setting.
mbed_official 146:f64d43ff0c18 939 *
mbed_official 146:f64d43ff0c18 940 * This function selects the source of FTMx external clock pin select.
mbed_official 146:f64d43ff0c18 941 *
mbed_official 324:406fd2029f23 942 * @param baseAddr Base address for current SIM instance.
mbed_official 324:406fd2029f23 943 * @param instance device instance.
mbed_official 146:f64d43ff0c18 944 * @param select FTMx external clock pin select
mbed_official 146:f64d43ff0c18 945 * - 0: FTMx external clock driven by FTM CLKIN0 pin.
mbed_official 146:f64d43ff0c18 946 * - 1: FTMx external clock driven by FTM CLKIN1 pin.
mbed_official 146:f64d43ff0c18 947 */
mbed_official 324:406fd2029f23 948 void SIM_HAL_SetFtmExternalClkPinMode(uint32_t baseAddr, uint8_t instance, sim_ftm_clk_sel_t select);
mbed_official 146:f64d43ff0c18 949
mbed_official 146:f64d43ff0c18 950 /*!
mbed_official 146:f64d43ff0c18 951 * @brief Gets the FlexTimer x external clock pin select setting.
mbed_official 146:f64d43ff0c18 952 *
mbed_official 324:406fd2029f23 953 * This function gets the FlexTimer x external clock pin select setting.
mbed_official 146:f64d43ff0c18 954 *
mbed_official 324:406fd2029f23 955 * @param baseAddr Base address for current SIM instance.
mbed_official 324:406fd2029f23 956 * @param instance device instance.
mbed_official 146:f64d43ff0c18 957 * @return select FlexTimer x external clock pin select setting
mbed_official 146:f64d43ff0c18 958 */
mbed_official 324:406fd2029f23 959 sim_ftm_clk_sel_t SIM_HAL_GetFtmExternalClkPinMode(uint32_t baseAddr, uint8_t instance);
mbed_official 146:f64d43ff0c18 960
mbed_official 146:f64d43ff0c18 961 /*!
mbed_official 146:f64d43ff0c18 962 * @brief Sets the FlexTimer x channel y input capture source select setting.
mbed_official 146:f64d43ff0c18 963 *
mbed_official 146:f64d43ff0c18 964 * This function selects the FlexTimer x channel y input capture source.
mbed_official 146:f64d43ff0c18 965 *
mbed_official 324:406fd2029f23 966 * @param baseAddr Base address for current SIM instance.
mbed_official 324:406fd2029f23 967 * @param instance device instance.
mbed_official 324:406fd2029f23 968 * @param channel FlexTimer channel y
mbed_official 324:406fd2029f23 969 * @param select FlexTimer x channel y input capture source
mbed_official 146:f64d43ff0c18 970 * See the reference manual for detailed definition for each channel and selection.
mbed_official 146:f64d43ff0c18 971 */
mbed_official 324:406fd2029f23 972 void SIM_HAL_SetFtmChSrcMode(uint32_t baseAddr, uint8_t instance, uint8_t channel, sim_ftm_ch_src_t select);
mbed_official 146:f64d43ff0c18 973
mbed_official 146:f64d43ff0c18 974 /*!
mbed_official 146:f64d43ff0c18 975 * @brief Gets the FlexTimer x channel y input capture source select setting.
mbed_official 146:f64d43ff0c18 976 *
mbed_official 324:406fd2029f23 977 * This function gets the FlexTimer x channel y input capture source select setting.
mbed_official 146:f64d43ff0c18 978 *
mbed_official 324:406fd2029f23 979 * @param baseAddr Base address for current SIM instance.
mbed_official 324:406fd2029f23 980 * @param instance device instance.
mbed_official 324:406fd2029f23 981 * @param channel FlexTimer channel y
mbed_official 146:f64d43ff0c18 982 * @return select FlexTimer x channel y input capture source select setting
mbed_official 146:f64d43ff0c18 983 */
mbed_official 324:406fd2029f23 984 sim_ftm_ch_src_t SIM_HAL_GetFtmChSrcMode(uint32_t baseAddr, uint8_t instance, uint8_t channel);
mbed_official 146:f64d43ff0c18 985
mbed_official 146:f64d43ff0c18 986 /*!
mbed_official 146:f64d43ff0c18 987 * @brief Sets the FlexTimer x fault y select setting.
mbed_official 146:f64d43ff0c18 988 *
mbed_official 146:f64d43ff0c18 989 * This function sets the FlexTimer x fault y select setting.
mbed_official 146:f64d43ff0c18 990 *
mbed_official 324:406fd2029f23 991 * @param baseAddr Base address for current SIM instance.
mbed_official 324:406fd2029f23 992 * @param instance device instance.
mbed_official 324:406fd2029f23 993 * @param fault fault y
mbed_official 146:f64d43ff0c18 994 * @param select FlexTimer x fault y select setting
mbed_official 146:f64d43ff0c18 995 * - 0: FlexTimer x fault y select 0.
mbed_official 146:f64d43ff0c18 996 * - 1: FlexTimer x fault y select 1.
mbed_official 146:f64d43ff0c18 997 */
mbed_official 324:406fd2029f23 998 void SIM_HAL_SetFtmFaultSelMode(uint32_t baseAddr, uint8_t instance, uint8_t fault, sim_ftm_flt_sel_t select);
mbed_official 146:f64d43ff0c18 999
mbed_official 146:f64d43ff0c18 1000 /*!
mbed_official 146:f64d43ff0c18 1001 * @brief Gets the FlexTimer x fault y select setting.
mbed_official 146:f64d43ff0c18 1002 *
mbed_official 324:406fd2029f23 1003 * This function gets the FlexTimer x fault y select setting.
mbed_official 146:f64d43ff0c18 1004 *
mbed_official 324:406fd2029f23 1005 * @param baseAddr Base address for current SIM instance.
mbed_official 324:406fd2029f23 1006 * @param instance device instance.
mbed_official 324:406fd2029f23 1007 * @param fault fault y
mbed_official 146:f64d43ff0c18 1008 * @return select FlexTimer x fault y select setting
mbed_official 146:f64d43ff0c18 1009 */
mbed_official 324:406fd2029f23 1010 sim_ftm_flt_sel_t SIM_HAL_GetFtmFaultSelMode(uint32_t baseAddr, uint8_t instance, uint8_t fault);
mbed_official 146:f64d43ff0c18 1011 #endif
mbed_official 146:f64d43ff0c18 1012
mbed_official 146:f64d43ff0c18 1013 #if FSL_FEATURE_SIM_OPT_HAS_TPM
mbed_official 146:f64d43ff0c18 1014 /*!
mbed_official 146:f64d43ff0c18 1015 * @brief Sets the Timer/PWM x external clock pin select setting.
mbed_official 146:f64d43ff0c18 1016 *
mbed_official 146:f64d43ff0c18 1017 * This function selects the source of the Timer/PWM x external clock pin select.
mbed_official 146:f64d43ff0c18 1018 *
mbed_official 324:406fd2029f23 1019 * @param baseAddr Base address for current SIM instance.
mbed_official 324:406fd2029f23 1020 * @param instance device instance.
mbed_official 146:f64d43ff0c18 1021 * @param select Timer/PWM x external clock pin select
mbed_official 146:f64d43ff0c18 1022 * - 0: Timer/PWM x external clock driven by the TPM_CLKIN0 pin.
mbed_official 146:f64d43ff0c18 1023 * - 1: Timer/PWM x external clock driven by the TPM_CLKIN1 pin.
mbed_official 146:f64d43ff0c18 1024 */
mbed_official 324:406fd2029f23 1025 void SIM_HAL_SetTpmExternalClkPinSelMode(uint32_t baseAddr, uint8_t instance, sim_tpm_clk_sel_t select);
mbed_official 146:f64d43ff0c18 1026
mbed_official 146:f64d43ff0c18 1027 /*!
mbed_official 146:f64d43ff0c18 1028 * @brief Gets the Timer/PWM x external clock pin select setting.
mbed_official 146:f64d43ff0c18 1029 *
mbed_official 324:406fd2029f23 1030 * This function gets the Timer/PWM x external clock pin select setting.
mbed_official 146:f64d43ff0c18 1031 *
mbed_official 324:406fd2029f23 1032 * @param baseAddr Base address for current SIM instance.
mbed_official 324:406fd2029f23 1033 * @param instance device instance.
mbed_official 146:f64d43ff0c18 1034 * @return select Timer/PWM x external clock pin select setting
mbed_official 146:f64d43ff0c18 1035 */
mbed_official 324:406fd2029f23 1036 sim_tpm_clk_sel_t SIM_HAL_GetTpmExternalClkPinSelMode(uint32_t baseAddr, uint8_t instance);
mbed_official 146:f64d43ff0c18 1037
mbed_official 146:f64d43ff0c18 1038 /*!
mbed_official 146:f64d43ff0c18 1039 * @brief Sets the Timer/PWM x channel y input capture source select setting.
mbed_official 146:f64d43ff0c18 1040 *
mbed_official 146:f64d43ff0c18 1041 * This function selects the Timer/PWM x channel y input capture source.
mbed_official 146:f64d43ff0c18 1042 *
mbed_official 324:406fd2029f23 1043 * @param baseAddr Base address for current SIM instance.
mbed_official 324:406fd2029f23 1044 * @param instance device instance.
mbed_official 324:406fd2029f23 1045 * @param channel TPM channel y
mbed_official 324:406fd2029f23 1046 * @param select Timer/PWM x channel y input capture source
mbed_official 146:f64d43ff0c18 1047 * - 0: TPMx_CH0 signal
mbed_official 146:f64d43ff0c18 1048 * - 1: CMP0 output
mbed_official 146:f64d43ff0c18 1049 */
mbed_official 324:406fd2029f23 1050 void SIM_HAL_SetTpmChSrcMode(uint32_t baseAddr, uint8_t instance, uint8_t channel, sim_tpm_ch_src_t select);
mbed_official 146:f64d43ff0c18 1051
mbed_official 146:f64d43ff0c18 1052 /*!
mbed_official 146:f64d43ff0c18 1053 * @brief Gets the Timer/PWM x channel y input capture source select setting.
mbed_official 146:f64d43ff0c18 1054 *
mbed_official 324:406fd2029f23 1055 * This function gets the Timer/PWM x channel y input capture source select setting.
mbed_official 146:f64d43ff0c18 1056 *
mbed_official 324:406fd2029f23 1057 * @param baseAddr Base address for current SIM instance.
mbed_official 324:406fd2029f23 1058 * @param instance device instance.
mbed_official 324:406fd2029f23 1059 * @param channel Tpm channel y
mbed_official 146:f64d43ff0c18 1060 * @return select Timer/PWM x channel y input capture source select setting
mbed_official 146:f64d43ff0c18 1061 */
mbed_official 324:406fd2029f23 1062 sim_tpm_ch_src_t SIM_HAL_GetTpmChSrcMode(uint32_t baseAddr, uint8_t instance, uint8_t channel);
mbed_official 146:f64d43ff0c18 1063 #endif
mbed_official 146:f64d43ff0c18 1064
mbed_official 146:f64d43ff0c18 1065 #if FSL_FEATURE_SIM_SDID_HAS_FAMILYID
mbed_official 146:f64d43ff0c18 1066 /*!
mbed_official 146:f64d43ff0c18 1067 * @brief Gets the Kinetis Family ID in the System Device ID register (SIM_SDID).
mbed_official 146:f64d43ff0c18 1068 *
mbed_official 324:406fd2029f23 1069 * This function gets the Kinetis Family ID in the System Device ID register.
mbed_official 146:f64d43ff0c18 1070 *
mbed_official 324:406fd2029f23 1071 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 1072 * @return id Kinetis Family ID
mbed_official 146:f64d43ff0c18 1073 */
mbed_official 324:406fd2029f23 1074 static inline uint32_t SIM_HAL_GetFamilyId(uint32_t baseAddr)
mbed_official 146:f64d43ff0c18 1075 {
mbed_official 324:406fd2029f23 1076 return BR_SIM_SDID_FAMILYID(baseAddr);
mbed_official 146:f64d43ff0c18 1077 }
mbed_official 146:f64d43ff0c18 1078 #endif
mbed_official 146:f64d43ff0c18 1079
mbed_official 146:f64d43ff0c18 1080 #if FSL_FEATURE_SIM_SDID_HAS_SUBFAMID
mbed_official 146:f64d43ff0c18 1081 /*!
mbed_official 324:406fd2029f23 1082 * @brief Gets the Kinetis Sub-Family ID in the System Device ID register (SIM_SDID).
mbed_official 146:f64d43ff0c18 1083 *
mbed_official 324:406fd2029f23 1084 * This function gets the Kinetis Sub-Family ID in System Device ID register.
mbed_official 146:f64d43ff0c18 1085 *
mbed_official 324:406fd2029f23 1086 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 1087 * @return id Kinetis Sub-Family ID
mbed_official 146:f64d43ff0c18 1088 */
mbed_official 324:406fd2029f23 1089 static inline uint32_t SIM_HAL_GetSubFamilyId(uint32_t baseAddr)
mbed_official 146:f64d43ff0c18 1090 {
mbed_official 324:406fd2029f23 1091 return BR_SIM_SDID_SUBFAMID(baseAddr);
mbed_official 146:f64d43ff0c18 1092 }
mbed_official 146:f64d43ff0c18 1093 #endif
mbed_official 146:f64d43ff0c18 1094
mbed_official 146:f64d43ff0c18 1095 #if FSL_FEATURE_SIM_SDID_HAS_SERIESID
mbed_official 146:f64d43ff0c18 1096 /*!
mbed_official 146:f64d43ff0c18 1097 * @brief Gets the Kinetis SeriesID in the System Device ID register (SIM_SDID).
mbed_official 146:f64d43ff0c18 1098 *
mbed_official 324:406fd2029f23 1099 * This function gets the Kinetis Series ID in System Device ID register.
mbed_official 146:f64d43ff0c18 1100 *
mbed_official 324:406fd2029f23 1101 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 1102 * @return id Kinetis Series ID
mbed_official 146:f64d43ff0c18 1103 */
mbed_official 324:406fd2029f23 1104 static inline uint32_t SIM_HAL_GetSeriesId(uint32_t baseAddr)
mbed_official 146:f64d43ff0c18 1105 {
mbed_official 324:406fd2029f23 1106 return BR_SIM_SDID_SERIESID(baseAddr);
mbed_official 324:406fd2029f23 1107 }
mbed_official 324:406fd2029f23 1108 #endif
mbed_official 324:406fd2029f23 1109
mbed_official 324:406fd2029f23 1110 #if FSL_FEATURE_SIM_SDID_HAS_FAMID
mbed_official 324:406fd2029f23 1111 /*!
mbed_official 324:406fd2029f23 1112 * @brief Gets the Kinetis Fam ID in System Device ID register (SIM_SDID).
mbed_official 324:406fd2029f23 1113 *
mbed_official 324:406fd2029f23 1114 * This function gets the Kinetis Fam ID in System Device ID register.
mbed_official 324:406fd2029f23 1115 *
mbed_official 324:406fd2029f23 1116 * @param baseAddr Base address for current SIM instance.
mbed_official 324:406fd2029f23 1117 * @return id Kinetis Fam ID
mbed_official 324:406fd2029f23 1118 */
mbed_official 324:406fd2029f23 1119 static inline uint32_t SIM_HAL_GetFamId(uint32_t baseAddr)
mbed_official 324:406fd2029f23 1120 {
mbed_official 324:406fd2029f23 1121 return BR_SIM_SDID_FAMID(baseAddr);
mbed_official 146:f64d43ff0c18 1122 }
mbed_official 146:f64d43ff0c18 1123 #endif
mbed_official 146:f64d43ff0c18 1124
mbed_official 146:f64d43ff0c18 1125 /*!
mbed_official 324:406fd2029f23 1126 * @brief Gets the Kinetis Pincount ID in System Device ID register (SIM_SDID).
mbed_official 146:f64d43ff0c18 1127 *
mbed_official 324:406fd2029f23 1128 * This function gets the Kinetis Pincount ID in System Device ID register.
mbed_official 146:f64d43ff0c18 1129 *
mbed_official 324:406fd2029f23 1130 * @param baseAddr Base address for current SIM instance.
mbed_official 324:406fd2029f23 1131 * @return id Kinetis Pincount ID
mbed_official 146:f64d43ff0c18 1132 */
mbed_official 324:406fd2029f23 1133 static inline uint32_t SIM_HAL_GetPinCntId(uint32_t baseAddr)
mbed_official 146:f64d43ff0c18 1134 {
mbed_official 324:406fd2029f23 1135 return BR_SIM_SDID_PINID(baseAddr);
mbed_official 146:f64d43ff0c18 1136 }
mbed_official 146:f64d43ff0c18 1137
mbed_official 146:f64d43ff0c18 1138 /*!
mbed_official 324:406fd2029f23 1139 * @brief Gets the Kinetis Revision ID in the System Device ID register (SIM_SDID).
mbed_official 146:f64d43ff0c18 1140 *
mbed_official 324:406fd2029f23 1141 * This function gets the Kinetis Revision ID in System Device ID register.
mbed_official 146:f64d43ff0c18 1142 *
mbed_official 324:406fd2029f23 1143 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 1144 * @return id Kinetis Revision ID
mbed_official 146:f64d43ff0c18 1145 */
mbed_official 324:406fd2029f23 1146 static inline uint32_t SIM_HAL_GetRevId(uint32_t baseAddr)
mbed_official 146:f64d43ff0c18 1147 {
mbed_official 324:406fd2029f23 1148 return BR_SIM_SDID_REVID(baseAddr);
mbed_official 146:f64d43ff0c18 1149 }
mbed_official 146:f64d43ff0c18 1150
mbed_official 146:f64d43ff0c18 1151 #if FSL_FEATURE_SIM_SDID_HAS_DIEID
mbed_official 146:f64d43ff0c18 1152 /*!
mbed_official 146:f64d43ff0c18 1153 * @brief Gets the Kinetis Die ID in the System Device ID register (SIM_SDID).
mbed_official 146:f64d43ff0c18 1154 *
mbed_official 324:406fd2029f23 1155 * This function gets the Kinetis Die ID in System Device ID register.
mbed_official 146:f64d43ff0c18 1156 *
mbed_official 324:406fd2029f23 1157 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 1158 * @return id Kinetis Die ID
mbed_official 146:f64d43ff0c18 1159 */
mbed_official 324:406fd2029f23 1160 static inline uint32_t SIM_HAL_GetDieId(uint32_t baseAddr)
mbed_official 146:f64d43ff0c18 1161 {
mbed_official 324:406fd2029f23 1162 return BR_SIM_SDID_DIEID(baseAddr);
mbed_official 146:f64d43ff0c18 1163 }
mbed_official 146:f64d43ff0c18 1164 #endif
mbed_official 146:f64d43ff0c18 1165
mbed_official 146:f64d43ff0c18 1166 #if FSL_FEATURE_SIM_SDID_HAS_SRAMSIZE
mbed_official 146:f64d43ff0c18 1167 /*!
mbed_official 146:f64d43ff0c18 1168 * @brief Gets the Kinetis SRAM size in the System Device ID register (SIM_SDID).
mbed_official 146:f64d43ff0c18 1169 *
mbed_official 324:406fd2029f23 1170 * This function gets the Kinetis SRAM Size in System Device ID register.
mbed_official 146:f64d43ff0c18 1171 *
mbed_official 324:406fd2029f23 1172 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 1173 * @return id Kinetis SRAM Size
mbed_official 146:f64d43ff0c18 1174 */
mbed_official 324:406fd2029f23 1175 static inline uint32_t SIM_HAL_GetSramSize(uint32_t baseAddr)
mbed_official 146:f64d43ff0c18 1176 {
mbed_official 324:406fd2029f23 1177 return BR_SIM_SDID_SRAMSIZE(baseAddr);
mbed_official 146:f64d43ff0c18 1178 }
mbed_official 146:f64d43ff0c18 1179 #endif
mbed_official 146:f64d43ff0c18 1180
mbed_official 146:f64d43ff0c18 1181 #if FSL_FEATURE_SIM_FCFG_HAS_NVMSIZE
mbed_official 146:f64d43ff0c18 1182 /*!
mbed_official 146:f64d43ff0c18 1183 * @brief Gets the FlexNVM size in the Flash Configuration Register 1 (SIM_FCFG).
mbed_official 146:f64d43ff0c18 1184 *
mbed_official 146:f64d43ff0c18 1185 * This function gets the FlexNVM size in the Flash Configuration Register 1.
mbed_official 146:f64d43ff0c18 1186 *
mbed_official 324:406fd2029f23 1187 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 1188 * @return size FlexNVM Size
mbed_official 146:f64d43ff0c18 1189 */
mbed_official 324:406fd2029f23 1190 static inline uint32_t SIM_HAL_GetFlexnvmSize(uint32_t baseAddr)
mbed_official 146:f64d43ff0c18 1191 {
mbed_official 324:406fd2029f23 1192 return BR_SIM_FCFG1_NVMSIZE(baseAddr);
mbed_official 146:f64d43ff0c18 1193 }
mbed_official 146:f64d43ff0c18 1194 #endif
mbed_official 146:f64d43ff0c18 1195
mbed_official 146:f64d43ff0c18 1196 /*!
mbed_official 146:f64d43ff0c18 1197 * @brief Gets the program flash size in the Flash Configuration Register 1 (SIM_FCFG).
mbed_official 146:f64d43ff0c18 1198 *
mbed_official 146:f64d43ff0c18 1199 * This function gets the program flash size in the Flash Configuration Register 1.
mbed_official 146:f64d43ff0c18 1200 *
mbed_official 324:406fd2029f23 1201 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 1202 * @return size Program flash Size
mbed_official 146:f64d43ff0c18 1203 */
mbed_official 324:406fd2029f23 1204 static inline uint32_t SIM_HAL_GetProgramFlashSize(uint32_t baseAddr)
mbed_official 146:f64d43ff0c18 1205 {
mbed_official 324:406fd2029f23 1206 return BR_SIM_FCFG1_PFSIZE(baseAddr);
mbed_official 146:f64d43ff0c18 1207 }
mbed_official 146:f64d43ff0c18 1208
mbed_official 146:f64d43ff0c18 1209 #if FSL_FEATURE_SIM_FCFG_HAS_EESIZE
mbed_official 146:f64d43ff0c18 1210 /*!
mbed_official 146:f64d43ff0c18 1211 * @brief Gets the EEProm size in the Flash Configuration Register 1 (SIM_FCFG).
mbed_official 146:f64d43ff0c18 1212 *
mbed_official 146:f64d43ff0c18 1213 * This function gets the EEProm size in the Flash Configuration Register 1.
mbed_official 146:f64d43ff0c18 1214 *
mbed_official 324:406fd2029f23 1215 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 1216 * @return size EEProm Size
mbed_official 146:f64d43ff0c18 1217 */
mbed_official 324:406fd2029f23 1218 static inline uint32_t SIM_HAL_GetEepromSize(uint32_t baseAddr)
mbed_official 146:f64d43ff0c18 1219 {
mbed_official 324:406fd2029f23 1220 return BR_SIM_FCFG1_EESIZE(baseAddr);
mbed_official 146:f64d43ff0c18 1221 }
mbed_official 146:f64d43ff0c18 1222 #endif
mbed_official 146:f64d43ff0c18 1223
mbed_official 146:f64d43ff0c18 1224 #if FSL_FEATURE_SIM_FCFG_HAS_DEPART
mbed_official 146:f64d43ff0c18 1225 /*!
mbed_official 146:f64d43ff0c18 1226 * @brief Gets the FlexNVM partition in the Flash Configuration Register 1 (SIM_FCFG).
mbed_official 146:f64d43ff0c18 1227 *
mbed_official 324:406fd2029f23 1228 * This function gets the FlexNVM partition in the Flash Configuration Register 1
mbed_official 146:f64d43ff0c18 1229 *
mbed_official 324:406fd2029f23 1230 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 1231 * @return setting FlexNVM partition setting
mbed_official 146:f64d43ff0c18 1232 */
mbed_official 324:406fd2029f23 1233 static inline uint32_t SIM_HAL_GetFlexnvmPartition(uint32_t baseAddr)
mbed_official 146:f64d43ff0c18 1234 {
mbed_official 324:406fd2029f23 1235 return BR_SIM_FCFG1_DEPART(baseAddr);
mbed_official 146:f64d43ff0c18 1236 }
mbed_official 146:f64d43ff0c18 1237 #endif
mbed_official 146:f64d43ff0c18 1238
mbed_official 146:f64d43ff0c18 1239 #if FSL_FEATURE_SIM_FCFG_HAS_FLASHDOZE
mbed_official 146:f64d43ff0c18 1240 /*!
mbed_official 146:f64d43ff0c18 1241 * @brief Sets the Flash Doze in the Flash Configuration Register 1 (SIM_FCFG).
mbed_official 146:f64d43ff0c18 1242 *
mbed_official 146:f64d43ff0c18 1243 * This function sets the Flash Doze in the Flash Configuration Register 1.
mbed_official 324:406fd2029f23 1244 *
mbed_official 324:406fd2029f23 1245 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 1246 * @param setting Flash Doze setting
mbed_official 146:f64d43ff0c18 1247 */
mbed_official 324:406fd2029f23 1248 static inline void SIM_HAL_SetFlashDoze(uint32_t baseAddr, uint32_t setting)
mbed_official 146:f64d43ff0c18 1249 {
mbed_official 324:406fd2029f23 1250 BW_SIM_FCFG1_FLASHDOZE(baseAddr, setting);
mbed_official 146:f64d43ff0c18 1251 }
mbed_official 146:f64d43ff0c18 1252
mbed_official 146:f64d43ff0c18 1253 /*!
mbed_official 146:f64d43ff0c18 1254 * @brief Gets the Flash Doze in the Flash Configuration Register 1 (SIM_FCFG).
mbed_official 146:f64d43ff0c18 1255 *
mbed_official 146:f64d43ff0c18 1256 * This function gets the Flash Doze in the Flash Configuration Register 1.
mbed_official 146:f64d43ff0c18 1257 *
mbed_official 324:406fd2029f23 1258 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 1259 * @return setting Flash Doze setting
mbed_official 146:f64d43ff0c18 1260 */
mbed_official 324:406fd2029f23 1261 static inline uint32_t SIM_HAL_GetFlashDoze(uint32_t baseAddr)
mbed_official 146:f64d43ff0c18 1262 {
mbed_official 324:406fd2029f23 1263 return BR_SIM_FCFG1_FLASHDOZE(baseAddr);
mbed_official 146:f64d43ff0c18 1264 }
mbed_official 146:f64d43ff0c18 1265 #endif
mbed_official 146:f64d43ff0c18 1266
mbed_official 146:f64d43ff0c18 1267 #if FSL_FEATURE_SIM_FCFG_HAS_FLASHDIS
mbed_official 146:f64d43ff0c18 1268 /*!
mbed_official 146:f64d43ff0c18 1269 * @brief Sets the Flash disable setting in the Flash Configuration Register 1 (SIM_FCFG).
mbed_official 146:f64d43ff0c18 1270 *
mbed_official 324:406fd2029f23 1271 * This function sets the Flash disable setting in the Flash Configuration Register 1.
mbed_official 146:f64d43ff0c18 1272 *
mbed_official 324:406fd2029f23 1273 * @param baseAddr Base address for current SIM instance.
mbed_official 324:406fd2029f23 1274 * @param disable Flash disable setting
mbed_official 146:f64d43ff0c18 1275 */
mbed_official 324:406fd2029f23 1276 static inline void SIM_HAL_SetFlashDisableCmd(uint32_t baseAddr, bool disable)
mbed_official 146:f64d43ff0c18 1277 {
mbed_official 324:406fd2029f23 1278 BW_SIM_FCFG1_FLASHDIS(baseAddr, disable);
mbed_official 146:f64d43ff0c18 1279 }
mbed_official 146:f64d43ff0c18 1280
mbed_official 146:f64d43ff0c18 1281 /*!
mbed_official 146:f64d43ff0c18 1282 * @brief Gets the Flash disable setting in the Flash Configuration Register 1 (SIM_FCFG).
mbed_official 146:f64d43ff0c18 1283 *
mbed_official 146:f64d43ff0c18 1284 * This function gets the Flash disable setting in the Flash Configuration Register 1.
mbed_official 146:f64d43ff0c18 1285 *
mbed_official 324:406fd2029f23 1286 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 1287 * @return setting Flash disable setting
mbed_official 146:f64d43ff0c18 1288 */
mbed_official 324:406fd2029f23 1289 static inline bool SIM_HAL_GetFlashDisableCmd(uint32_t baseAddr)
mbed_official 146:f64d43ff0c18 1290 {
mbed_official 324:406fd2029f23 1291 return (bool)BR_SIM_FCFG1_FLASHDIS(baseAddr);
mbed_official 146:f64d43ff0c18 1292 }
mbed_official 146:f64d43ff0c18 1293 #endif
mbed_official 146:f64d43ff0c18 1294
mbed_official 146:f64d43ff0c18 1295 #if FSL_FEATURE_SIM_FCFG_HAS_MAXADDR0
mbed_official 146:f64d43ff0c18 1296 /*!
mbed_official 146:f64d43ff0c18 1297 * @brief Gets the Flash maximum address block 0 in the Flash Configuration Register 1 (SIM_FCFG).
mbed_official 146:f64d43ff0c18 1298 *
mbed_official 146:f64d43ff0c18 1299 * This function gets the Flash maximum block 0 in Flash Configuration Register 2.
mbed_official 146:f64d43ff0c18 1300 *
mbed_official 324:406fd2029f23 1301 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 1302 * @return address Flash maximum block 0 address
mbed_official 146:f64d43ff0c18 1303 */
mbed_official 324:406fd2029f23 1304 static inline uint32_t SIM_HAL_GetFlashMaxAddrBlock0(uint32_t baseAddr)
mbed_official 146:f64d43ff0c18 1305 {
mbed_official 324:406fd2029f23 1306 return BR_SIM_FCFG2_MAXADDR0(baseAddr);
mbed_official 146:f64d43ff0c18 1307 }
mbed_official 146:f64d43ff0c18 1308 #endif
mbed_official 146:f64d43ff0c18 1309
mbed_official 146:f64d43ff0c18 1310 #if FSL_FEATURE_SIM_FCFG_HAS_MAXADDR1
mbed_official 146:f64d43ff0c18 1311 /*!
mbed_official 146:f64d43ff0c18 1312 * @brief Gets the Flash maximum address block 1 in Flash Configuration Register 2.
mbed_official 146:f64d43ff0c18 1313 *
mbed_official 146:f64d43ff0c18 1314 * This function gets the Flash maximum block 1 in Flash Configuration Register 1.
mbed_official 146:f64d43ff0c18 1315 *
mbed_official 324:406fd2029f23 1316 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 1317 * @return address Flash maximum block 0 address
mbed_official 146:f64d43ff0c18 1318 */
mbed_official 324:406fd2029f23 1319 static inline uint32_t SIM_HAL_GetFlashMaxAddrBlock1(uint32_t baseAddr)
mbed_official 146:f64d43ff0c18 1320 {
mbed_official 324:406fd2029f23 1321 return BR_SIM_FCFG2_MAXADDR1(baseAddr);
mbed_official 146:f64d43ff0c18 1322 }
mbed_official 146:f64d43ff0c18 1323 #endif
mbed_official 146:f64d43ff0c18 1324
mbed_official 146:f64d43ff0c18 1325 #if FSL_FEATURE_SIM_FCFG_HAS_MAXADDR01
mbed_official 146:f64d43ff0c18 1326 /*!
mbed_official 146:f64d43ff0c18 1327 * @brief Gets the Flash maximum address block 0 in the Flash Configuration Register 1 (SIM_FCFG).
mbed_official 146:f64d43ff0c18 1328 *
mbed_official 324:406fd2029f23 1329 * This function gets the Flash maximum block 0 in Flash Configuration Register 2.
mbed_official 146:f64d43ff0c18 1330 *
mbed_official 324:406fd2029f23 1331 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 1332 * @return address Flash maximum block 0 address
mbed_official 146:f64d43ff0c18 1333 */
mbed_official 324:406fd2029f23 1334 static inline uint32_t SIM_HAL_GetFlashMaxAddrBlock01(uint32_t baseAddr)
mbed_official 146:f64d43ff0c18 1335 {
mbed_official 324:406fd2029f23 1336 return BR_SIM_FCFG2_MAXADDR01(baseAddr);
mbed_official 146:f64d43ff0c18 1337 }
mbed_official 146:f64d43ff0c18 1338 #endif
mbed_official 146:f64d43ff0c18 1339
mbed_official 146:f64d43ff0c18 1340 #if FSL_FEATURE_SIM_FCFG_HAS_MAXADDR23
mbed_official 146:f64d43ff0c18 1341 /*!
mbed_official 146:f64d43ff0c18 1342 * @brief Gets the Flash maximum address block 1 in the Flash Configuration Register 2.
mbed_official 146:f64d43ff0c18 1343 *
mbed_official 146:f64d43ff0c18 1344 * This function gets the Flash maximum block 1 in Flash Configuration Register 1.
mbed_official 146:f64d43ff0c18 1345 *
mbed_official 324:406fd2029f23 1346 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 1347 * @return address Flash maximum block 0 address
mbed_official 146:f64d43ff0c18 1348 */
mbed_official 324:406fd2029f23 1349 static inline uint32_t SIM_HAL_GetFlashMaxAddrBlock23(uint32_t baseAddr)
mbed_official 146:f64d43ff0c18 1350 {
mbed_official 324:406fd2029f23 1351 return BR_SIM_FCFG2_MAXADDR23(baseAddr);
mbed_official 146:f64d43ff0c18 1352 }
mbed_official 146:f64d43ff0c18 1353 #endif
mbed_official 146:f64d43ff0c18 1354
mbed_official 146:f64d43ff0c18 1355 #if FSL_FEATURE_SIM_FCFG_HAS_PFLSH
mbed_official 146:f64d43ff0c18 1356 /*!
mbed_official 146:f64d43ff0c18 1357 * @brief Gets the program flash in the Flash Configuration Register 2.
mbed_official 146:f64d43ff0c18 1358 *
mbed_official 146:f64d43ff0c18 1359 * This function gets the program flash maximum block 0 in Flash Configuration Register 1.
mbed_official 146:f64d43ff0c18 1360 *
mbed_official 324:406fd2029f23 1361 * @param baseAddr Base address for current SIM instance.
mbed_official 146:f64d43ff0c18 1362 * @return status program flash status
mbed_official 146:f64d43ff0c18 1363 */
mbed_official 324:406fd2029f23 1364 static inline uint32_t SIM_HAL_GetProgramFlashCmd(uint32_t baseAddr)
mbed_official 146:f64d43ff0c18 1365 {
mbed_official 324:406fd2029f23 1366 return BR_SIM_FCFG2_PFLSH(baseAddr);
mbed_official 146:f64d43ff0c18 1367 }
mbed_official 146:f64d43ff0c18 1368 #endif
mbed_official 146:f64d43ff0c18 1369
mbed_official 146:f64d43ff0c18 1370 /*@}*/
mbed_official 146:f64d43ff0c18 1371
mbed_official 146:f64d43ff0c18 1372 #if defined(__cplusplus)
mbed_official 146:f64d43ff0c18 1373 }
mbed_official 146:f64d43ff0c18 1374 #endif /* __cplusplus*/
mbed_official 146:f64d43ff0c18 1375
mbed_official 146:f64d43ff0c18 1376 /*! @}*/
mbed_official 146:f64d43ff0c18 1377
mbed_official 324:406fd2029f23 1378
mbed_official 324:406fd2029f23 1379 /*
mbed_official 324:406fd2029f23 1380 * Include the CPU-specific clock API header files.
mbed_official 324:406fd2029f23 1381 */
mbed_official 324:406fd2029f23 1382 #if (defined(CPU_MK02FN128VFM10) || defined(CPU_MK02FN64VFM10) || defined(CPU_MK02FN128VLF10) || \
mbed_official 324:406fd2029f23 1383 defined(CPU_MK02FN64VLF10) || defined(CPU_MK02FN128VLH10) || defined(CPU_MK02FN64VLH10))
mbed_official 324:406fd2029f23 1384
mbed_official 324:406fd2029f23 1385 #define K02F12810_SERIES
mbed_official 324:406fd2029f23 1386
mbed_official 324:406fd2029f23 1387 #elif (defined(CPU_MK20DX128VMP5) || defined(CPU_MK20DN128VMP5) || defined(CPU_MK20DX64VMP5) || \
mbed_official 324:406fd2029f23 1388 defined(CPU_MK20DN64VMP5) || defined(CPU_MK20DX32VMP5) || defined(CPU_MK20DN32VMP5) || \
mbed_official 324:406fd2029f23 1389 defined(CPU_MK20DX128VLH5) || defined(CPU_MK20DN128VLH5) || defined(CPU_MK20DX64VLH5) || \
mbed_official 324:406fd2029f23 1390 defined(CPU_MK20DN64VLH5) || defined(CPU_MK20DX32VLH5) || defined(CPU_MK20DN32VLH5) || \
mbed_official 324:406fd2029f23 1391 defined(CPU_MK20DX128VFM5) || defined(CPU_MK20DN128VFM5) || defined(CPU_MK20DX64VFM5) || \
mbed_official 324:406fd2029f23 1392 defined(CPU_MK20DN64VFM5) || defined(CPU_MK20DX32VFM5) || defined(CPU_MK20DN32VFM5) || \
mbed_official 324:406fd2029f23 1393 defined(CPU_MK20DX128VFT5) || defined(CPU_MK20DN128VFT5) || defined(CPU_MK20DX64VFT5) || \
mbed_official 324:406fd2029f23 1394 defined(CPU_MK20DN64VFT5) || defined(CPU_MK20DX32VFT5) || defined(CPU_MK20DN32VFT5) || \
mbed_official 324:406fd2029f23 1395 defined(CPU_MK20DX128VLF5) || defined(CPU_MK20DN128VLF5) || defined(CPU_MK20DX64VLF5) || \
mbed_official 324:406fd2029f23 1396 defined(CPU_MK20DN64VLF5) || defined(CPU_MK20DX32VLF5) || defined(CPU_MK20DN32VLF5))
mbed_official 324:406fd2029f23 1397
mbed_official 324:406fd2029f23 1398 #define K20D5_SERIES
mbed_official 324:406fd2029f23 1399
mbed_official 324:406fd2029f23 1400
mbed_official 324:406fd2029f23 1401 #elif (defined(CPU_MK22FN128VDC10) || defined(CPU_MK22FN128VLH10) || defined(CPU_MK22FN128VLL10) || \
mbed_official 324:406fd2029f23 1402 defined(CPU_MK22FN128VMP10))
mbed_official 324:406fd2029f23 1403
mbed_official 324:406fd2029f23 1404 #define K22F12810_SERIES
mbed_official 324:406fd2029f23 1405
mbed_official 324:406fd2029f23 1406 /* Clock System Level API header file */
mbed_official 324:406fd2029f23 1407 #include "MK22F12810/fsl_sim_hal_K22F12810.h"
mbed_official 324:406fd2029f23 1408
mbed_official 324:406fd2029f23 1409 #elif (defined(CPU_MK22FN256VDC12) || defined(CPU_MK22FN256VLH12) || defined(CPU_MK22FN256VLL12) || \
mbed_official 324:406fd2029f23 1410 defined(CPU_MK22FN256VMP12))
mbed_official 324:406fd2029f23 1411
mbed_official 324:406fd2029f23 1412 #define K22F25612_SERIES
mbed_official 324:406fd2029f23 1413
mbed_official 324:406fd2029f23 1414 /* Clock System Level API header file */
mbed_official 324:406fd2029f23 1415 #include "MK22F25612/fsl_sim_hal_K22F25612.h"
mbed_official 324:406fd2029f23 1416
mbed_official 324:406fd2029f23 1417
mbed_official 324:406fd2029f23 1418
mbed_official 324:406fd2029f23 1419 #elif (defined(CPU_MK22FN512VDC12) || defined(CPU_MK22FN512VLH12) || defined(CPU_MK22FN512VLL12))
mbed_official 324:406fd2029f23 1420
mbed_official 324:406fd2029f23 1421 #define K22F51212_SERIES
mbed_official 324:406fd2029f23 1422
mbed_official 324:406fd2029f23 1423 /* Clock System Level API header file */
mbed_official 324:406fd2029f23 1424 #include "MK22F51212/fsl_sim_hal_K22F51212.h"
mbed_official 324:406fd2029f23 1425
mbed_official 324:406fd2029f23 1426
mbed_official 324:406fd2029f23 1427 #elif (defined(CPU_MK24FN1M0VDC12) || defined(CPU_MK24FN1M0VLQ12))
mbed_official 324:406fd2029f23 1428
mbed_official 324:406fd2029f23 1429 #define K24F12_SERIES
mbed_official 324:406fd2029f23 1430
mbed_official 324:406fd2029f23 1431 /* Clock System Level API header file */
mbed_official 324:406fd2029f23 1432 #include "MK24F12/fsl_sim_hal_K24F12.h"
mbed_official 324:406fd2029f23 1433
mbed_official 324:406fd2029f23 1434 #elif (defined(CPU_MK24FN256VDC12))
mbed_official 324:406fd2029f23 1435
mbed_official 324:406fd2029f23 1436 #define K24F25612_SERIES
mbed_official 324:406fd2029f23 1437
mbed_official 324:406fd2029f23 1438
mbed_official 324:406fd2029f23 1439 #elif (defined(CPU_MK63FN1M0VLQ12) || defined(CPU_MK63FN1M0VMD12))
mbed_official 324:406fd2029f23 1440
mbed_official 324:406fd2029f23 1441 #define K63F12_SERIES
mbed_official 324:406fd2029f23 1442
mbed_official 324:406fd2029f23 1443 /* Clock System Level API header file */
mbed_official 324:406fd2029f23 1444 #include "MK63F12/fsl_sim_hal_K63F12.h"
mbed_official 324:406fd2029f23 1445
mbed_official 324:406fd2029f23 1446 #elif (defined(CPU_MK64FX512VDC12) || defined(CPU_MK64FN1M0VDC12) || defined(CPU_MK64FX512VLL12) || \
mbed_official 324:406fd2029f23 1447 defined(CPU_MK64FN1M0VLL12) || defined(CPU_MK64FX512VLQ12) || defined(CPU_MK64FN1M0VLQ12) || \
mbed_official 324:406fd2029f23 1448 defined(CPU_MK64FX512VMD12) || defined(CPU_MK64FN1M0VMD12))
mbed_official 324:406fd2029f23 1449
mbed_official 324:406fd2029f23 1450 #define K64F12_SERIES
mbed_official 324:406fd2029f23 1451
mbed_official 324:406fd2029f23 1452 /* Clock System Level API header file */
mbed_official 324:406fd2029f23 1453 #include "MK64F12/fsl_sim_hal_K64F12.h"
mbed_official 324:406fd2029f23 1454
mbed_official 324:406fd2029f23 1455 #elif (defined(CPU_MK65FN2M0CAC18) || defined(CPU_MK65FX1M0CAC18) || defined(CPU_MK65FN2M0VMI18) || \
mbed_official 324:406fd2029f23 1456 defined(CPU_MK65FX1M0VMI18))
mbed_official 324:406fd2029f23 1457
mbed_official 324:406fd2029f23 1458 #define K65F18_SERIES
mbed_official 324:406fd2029f23 1459
mbed_official 324:406fd2029f23 1460
mbed_official 324:406fd2029f23 1461 #elif (defined(CPU_MK66FN2M0VLQ18) || defined(CPU_MK66FX1M0VLQ18) || defined(CPU_MK66FN2M0VMD18) || \
mbed_official 324:406fd2029f23 1462 defined(CPU_MK66FX1M0VMD18))
mbed_official 324:406fd2029f23 1463
mbed_official 324:406fd2029f23 1464 #define K66F18_SERIES
mbed_official 324:406fd2029f23 1465
mbed_official 324:406fd2029f23 1466
mbed_official 324:406fd2029f23 1467 #elif (defined(CPU_MK70FN1M0VMF12) || defined(CPU_MK70FX512VMF12) || defined(CPU_MK70FN1M0VMF15) || \
mbed_official 324:406fd2029f23 1468 defined(CPU_MK70FX512VMF15) || defined(CPU_MK70FN1M0VMJ12) || defined(CPU_MK70FX512VMJ12) || \
mbed_official 324:406fd2029f23 1469 defined(CPU_MK70FN1M0VMJ15) || defined(CPU_MK70FX512VMJ15))
mbed_official 324:406fd2029f23 1470
mbed_official 324:406fd2029f23 1471 #define K70F12_SERIES
mbed_official 324:406fd2029f23 1472
mbed_official 324:406fd2029f23 1473
mbed_official 324:406fd2029f23 1474 #elif (defined(CPU_MK70FN1M0VMF12) || defined(CPU_MK70FX512VMF12) || defined(CPU_MK70FN1M0VMF15) || \
mbed_official 324:406fd2029f23 1475 defined(CPU_MK70FX512VMF15) || defined(CPU_MK70FN1M0VMJ12) || defined(CPU_MK70FX512VMJ12) || \
mbed_official 324:406fd2029f23 1476 defined(CPU_MK70FN1M0VMJ15) || defined(CPU_MK70FX512VMJ15))
mbed_official 324:406fd2029f23 1477
mbed_official 324:406fd2029f23 1478 #define K70F15_SERIES
mbed_official 324:406fd2029f23 1479
mbed_official 324:406fd2029f23 1480
mbed_official 324:406fd2029f23 1481 #elif (defined(CPU_MKL02Z32CAF4) || defined(CPU_MKL02Z8VFG4) || defined(CPU_MKL02Z16VFG4) || \
mbed_official 324:406fd2029f23 1482 defined(CPU_MKL02Z32VFG4) || defined(CPU_MKL02Z16VFK4) || defined(CPU_MKL02Z32VFK4) || \
mbed_official 324:406fd2029f23 1483 defined(CPU_MKL02Z16VFM4) || defined(CPU_MKL02Z32VFM4))
mbed_official 324:406fd2029f23 1484
mbed_official 324:406fd2029f23 1485 #define KL02Z4_SERIES
mbed_official 324:406fd2029f23 1486
mbed_official 324:406fd2029f23 1487
mbed_official 324:406fd2029f23 1488 #elif (defined(CPU_MKL03Z32CAF4) || defined(CPU_MKL03Z8VFG4) || defined(CPU_MKL03Z16VFG4) || \
mbed_official 324:406fd2029f23 1489 defined(CPU_MKL03Z32VFG4) || defined(CPU_MKL03Z8VFK4) || defined(CPU_MKL03Z16VFK4) || \
mbed_official 324:406fd2029f23 1490 defined(CPU_MKL03Z32VFK4))
mbed_official 324:406fd2029f23 1491
mbed_official 324:406fd2029f23 1492 #define KL03Z4_SERIES
mbed_official 324:406fd2029f23 1493
mbed_official 324:406fd2029f23 1494
mbed_official 324:406fd2029f23 1495 #elif (defined(CPU_MKL05Z8VFK4) || defined(CPU_MKL05Z16VFK4) || defined(CPU_MKL05Z32VFK4) || \
mbed_official 324:406fd2029f23 1496 defined(CPU_MKL05Z8VLC4) || defined(CPU_MKL05Z16VLC4) || defined(CPU_MKL05Z32VLC4) || \
mbed_official 324:406fd2029f23 1497 defined(CPU_MKL05Z8VFM4) || defined(CPU_MKL05Z16VFM4) || defined(CPU_MKL05Z32VFM4) || \
mbed_official 324:406fd2029f23 1498 defined(CPU_MKL05Z16VLF4) || defined(CPU_MKL05Z32VLF4))
mbed_official 324:406fd2029f23 1499
mbed_official 324:406fd2029f23 1500 #define KL05Z4_SERIES
mbed_official 324:406fd2029f23 1501
mbed_official 324:406fd2029f23 1502
mbed_official 324:406fd2029f23 1503 #elif (defined(CPU_MKL13Z64VFM4) || defined(CPU_MKL13Z128VFM4) || defined(CPU_MKL13Z256VFM4) || \
mbed_official 324:406fd2029f23 1504 defined(CPU_MKL13Z64VFT4) || defined(CPU_MKL13Z128VFT4) || defined(CPU_MKL13Z256VFT4) || \
mbed_official 324:406fd2029f23 1505 defined(CPU_MKL13Z64VLH4) || defined(CPU_MKL13Z128VLH4) || defined(CPU_MKL13Z256VLH4) || \
mbed_official 324:406fd2029f23 1506 defined(CPU_MKL13Z64VMP4) || defined(CPU_MKL13Z128VMP4) || defined(CPU_MKL13Z256VMP4))
mbed_official 324:406fd2029f23 1507
mbed_official 324:406fd2029f23 1508 #define KL13Z4_SERIES
mbed_official 324:406fd2029f23 1509
mbed_official 324:406fd2029f23 1510
mbed_official 324:406fd2029f23 1511 #elif (defined(CPU_MKL23Z64VFM4) || defined(CPU_MKL23Z128VFM4) || defined(CPU_MKL23Z256VFM4) || \
mbed_official 324:406fd2029f23 1512 defined(CPU_MKL23Z64VFT4) || defined(CPU_MKL23Z128VFT4) || defined(CPU_MKL23Z256VFT4) || \
mbed_official 324:406fd2029f23 1513 defined(CPU_MKL23Z64VLH4) || defined(CPU_MKL23Z128VLH4) || defined(CPU_MKL23Z256VLH4) || \
mbed_official 324:406fd2029f23 1514 defined(CPU_MKL23Z64VMP4) || defined(CPU_MKL23Z128VMP4) || defined(CPU_MKL23Z256VMP4))
mbed_official 324:406fd2029f23 1515
mbed_official 324:406fd2029f23 1516 #define KL23Z4_SERIES
mbed_official 324:406fd2029f23 1517
mbed_official 324:406fd2029f23 1518
mbed_official 324:406fd2029f23 1519 #elif (defined(CPU_MKL25Z32VFM4) || defined(CPU_MKL25Z64VFM4) || defined(CPU_MKL25Z128VFM4) || \
mbed_official 324:406fd2029f23 1520 defined(CPU_MKL25Z32VFT4) || defined(CPU_MKL25Z64VFT4) || defined(CPU_MKL25Z128VFT4) || \
mbed_official 324:406fd2029f23 1521 defined(CPU_MKL25Z32VLH4) || defined(CPU_MKL25Z64VLH4) || defined(CPU_MKL25Z128VLH4) || \
mbed_official 324:406fd2029f23 1522 defined(CPU_MKL25Z32VLK4) || defined(CPU_MKL25Z64VLK4) || defined(CPU_MKL25Z128VLK4))
mbed_official 324:406fd2029f23 1523
mbed_official 324:406fd2029f23 1524 #define KL25Z4_SERIES
mbed_official 324:406fd2029f23 1525
mbed_official 324:406fd2029f23 1526 /* Clock System Level API header file */
mbed_official 324:406fd2029f23 1527 #include "MKL25Z4/fsl_sim_hal_KL25Z4.h"
mbed_official 324:406fd2029f23 1528
mbed_official 324:406fd2029f23 1529 #elif (defined(CPU_MKL26Z32VFM4) || defined(CPU_MKL26Z64VFM4) || defined(CPU_MKL26Z128VFM4) || \
mbed_official 324:406fd2029f23 1530 defined(CPU_MKL26Z32VFT4) || defined(CPU_MKL26Z64VFT4) || defined(CPU_MKL26Z128VFT4) || \
mbed_official 324:406fd2029f23 1531 defined(CPU_MKL26Z32VLH4) || defined(CPU_MKL26Z64VLH4) || defined(CPU_MKL26Z128VLH4) || \
mbed_official 324:406fd2029f23 1532 defined(CPU_MKL26Z256VLH4) || defined(CPU_MKL26Z256VLK4) || defined(CPU_MKL26Z128VLL4) || \
mbed_official 324:406fd2029f23 1533 defined(CPU_MKL26Z256VLL4) || defined(CPU_MKL26Z128VMC4) || defined(CPU_MKL26Z256VMC4))
mbed_official 324:406fd2029f23 1534
mbed_official 324:406fd2029f23 1535 #define KL26Z4_SERIES
mbed_official 324:406fd2029f23 1536
mbed_official 324:406fd2029f23 1537
mbed_official 324:406fd2029f23 1538 #elif (defined(CPU_MKL33Z128VLH4) || defined(CPU_MKL33Z256VLH4) || defined(CPU_MKL33Z128VMP4) || \
mbed_official 324:406fd2029f23 1539 defined(CPU_MKL33Z256VMP4))
mbed_official 324:406fd2029f23 1540
mbed_official 324:406fd2029f23 1541 #define KL33Z4_SERIES
mbed_official 324:406fd2029f23 1542
mbed_official 324:406fd2029f23 1543
mbed_official 324:406fd2029f23 1544 #elif (defined(CPU_MKL43Z64VLH4) || defined(CPU_MKL43Z128VLH4) || defined(CPU_MKL43Z256VLH4) || \
mbed_official 324:406fd2029f23 1545 defined(CPU_MKL43Z64VMP4) || defined(CPU_MKL43Z128VMP4) || defined(CPU_MKL43Z256VMP4))
mbed_official 324:406fd2029f23 1546
mbed_official 324:406fd2029f23 1547 #define KL43Z4_SERIES
mbed_official 324:406fd2029f23 1548
mbed_official 324:406fd2029f23 1549
mbed_official 324:406fd2029f23 1550 #elif (defined(CPU_MKL46Z128VLH4) || defined(CPU_MKL46Z256VLH4) || defined(CPU_MKL46Z128VLL4) || \
mbed_official 324:406fd2029f23 1551 defined(CPU_MKL46Z256VLL4) || defined(CPU_MKL46Z128VMC4) || defined(CPU_MKL46Z256VMC4))
mbed_official 324:406fd2029f23 1552
mbed_official 324:406fd2029f23 1553 #define KL46Z4_SERIES
mbed_official 324:406fd2029f23 1554
mbed_official 324:406fd2029f23 1555
mbed_official 324:406fd2029f23 1556 #elif (defined(CPU_MKV30F128VFM10) || defined(CPU_MKV30F64VFM10) || defined(CPU_MKV30F128VLF10) || \
mbed_official 324:406fd2029f23 1557 defined(CPU_MKV30F64VLF10) || defined(CPU_MKV30F128VLH10) || defined(CPU_MKV30F64VLH10))
mbed_official 324:406fd2029f23 1558
mbed_official 324:406fd2029f23 1559 #define KV30F12810_SERIES
mbed_official 324:406fd2029f23 1560
mbed_official 324:406fd2029f23 1561
mbed_official 324:406fd2029f23 1562 #elif (defined(CPU_MKV31F128VLH10) || defined(CPU_MKV31F128VLL10))
mbed_official 324:406fd2029f23 1563
mbed_official 324:406fd2029f23 1564 #define KV31F12810_SERIES
mbed_official 324:406fd2029f23 1565
mbed_official 324:406fd2029f23 1566 /* Clock System Level API header file */
mbed_official 324:406fd2029f23 1567 #include "MKV31F12810/fsl_sim_hal_KV31F12810.h"
mbed_official 324:406fd2029f23 1568
mbed_official 324:406fd2029f23 1569 #elif (defined(CPU_MKV31F256VLH12) || defined(CPU_MKV31F256VLL12))
mbed_official 324:406fd2029f23 1570
mbed_official 324:406fd2029f23 1571 #define KV31F25612_SERIES
mbed_official 324:406fd2029f23 1572
mbed_official 324:406fd2029f23 1573 /* Clock System Level API header file */
mbed_official 324:406fd2029f23 1574 #include "MKV31F25612/fsl_sim_hal_KV31F25612.h"
mbed_official 324:406fd2029f23 1575
mbed_official 324:406fd2029f23 1576
mbed_official 324:406fd2029f23 1577 #elif (defined(CPU_MKV31F512VLH12) || defined(CPU_MKV31F512VLL12))
mbed_official 324:406fd2029f23 1578
mbed_official 324:406fd2029f23 1579 #define KV31F51212_SERIES
mbed_official 324:406fd2029f23 1580
mbed_official 324:406fd2029f23 1581 /* Clock System Level API header file */
mbed_official 324:406fd2029f23 1582 #include "MKV31F51212/fsl_sim_hal_KV31F51212.h"
mbed_official 324:406fd2029f23 1583
mbed_official 324:406fd2029f23 1584 #elif (defined(CPU_MKV40F128VLH15) || defined(CPU_MKV40F128VLL15) || defined(CPU_MKV40F256VLH15) || \
mbed_official 324:406fd2029f23 1585 defined(CPU_MKV40F256VLL15) || defined(CPU_MKV40F64VLH15))
mbed_official 324:406fd2029f23 1586
mbed_official 324:406fd2029f23 1587 #define KV40F15_SERIES
mbed_official 324:406fd2029f23 1588
mbed_official 324:406fd2029f23 1589
mbed_official 324:406fd2029f23 1590 #elif (defined(CPU_MKV43F128VLH15) || defined(CPU_MKV43F128VLL15) || defined(CPU_MKV43F64VLH15))
mbed_official 324:406fd2029f23 1591
mbed_official 324:406fd2029f23 1592 #define KV43F15_SERIES
mbed_official 324:406fd2029f23 1593
mbed_official 324:406fd2029f23 1594
mbed_official 324:406fd2029f23 1595 #elif (defined(CPU_MKV44F128VLH15) || defined(CPU_MKV44F128VLL15) || defined(CPU_MKV44F64VLH15))
mbed_official 324:406fd2029f23 1596
mbed_official 324:406fd2029f23 1597 #define KV44F15_SERIES
mbed_official 324:406fd2029f23 1598
mbed_official 324:406fd2029f23 1599
mbed_official 324:406fd2029f23 1600 #elif (defined(CPU_MKV45F128VLH15) || defined(CPU_MKV45F128VLL15) || defined(CPU_MKV45F256VLH15) || \
mbed_official 324:406fd2029f23 1601 defined(CPU_MKV45F256VLL15))
mbed_official 324:406fd2029f23 1602
mbed_official 324:406fd2029f23 1603 #define KV45F15_SERIES
mbed_official 324:406fd2029f23 1604
mbed_official 324:406fd2029f23 1605
mbed_official 324:406fd2029f23 1606 #elif (defined(CPU_MKV46F128VLH15) || defined(CPU_MKV46F128VLL15) || defined(CPU_MKV46F256VLH15) || \
mbed_official 324:406fd2029f23 1607 defined(CPU_MKV46F256VLL15))
mbed_official 324:406fd2029f23 1608
mbed_official 324:406fd2029f23 1609 #define KV46F15_SERIES
mbed_official 324:406fd2029f23 1610
mbed_official 324:406fd2029f23 1611
mbed_official 324:406fd2029f23 1612 #else
mbed_official 324:406fd2029f23 1613 #error "No valid CPU defined!"
mbed_official 324:406fd2029f23 1614 #endif
mbed_official 324:406fd2029f23 1615
mbed_official 146:f64d43ff0c18 1616 #endif /* __FSL_SIM_HAL_H__*/
mbed_official 146:f64d43ff0c18 1617 /*******************************************************************************
mbed_official 146:f64d43ff0c18 1618 * EOF
mbed_official 146:f64d43ff0c18 1619 ******************************************************************************/
mbed_official 146:f64d43ff0c18 1620