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 Apr 03 11:45:06 2014 +0100
Revision:
149:1fb5f62b92bd
Parent:
targets/hal/TARGET_Freescale/TARGET_KSDK_MCUS/TARGET_KSDK_CODE/hal/sim/fsl_sim_hal.h@146:f64d43ff0c18
Child:
324:406fd2029f23
Synchronized with git revision 220c0bb39ceee40016e1e86350c058963d01ed42

Full URL: https://github.com/mbedmicro/mbed/commit/220c0bb39ceee40016e1e86350c058963d01ed42/

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 146:f64d43ff0c18 48 typedef enum _sim_clock_names {
mbed_official 146:f64d43ff0c18 49
mbed_official 146:f64d43ff0c18 50 /* default clocks*/
mbed_official 146:f64d43ff0c18 51 kSimCoreClock, /**/
mbed_official 146:f64d43ff0c18 52 kSimSystemClock, /**/
mbed_official 146:f64d43ff0c18 53 kSimPlatformClock, /**/
mbed_official 146:f64d43ff0c18 54 kSimBusClock, /**/
mbed_official 146:f64d43ff0c18 55 kSimFlexBusClock, /**/
mbed_official 146:f64d43ff0c18 56 kSimFlashClock, /**/
mbed_official 146:f64d43ff0c18 57
mbed_official 146:f64d43ff0c18 58 /* other internal clocks used by peripherals*/
mbed_official 146:f64d43ff0c18 59 /* osc clock*/
mbed_official 146:f64d43ff0c18 60 kSimOsc32kClock,
mbed_official 146:f64d43ff0c18 61 kSimOsc0ErClock,
mbed_official 146:f64d43ff0c18 62 kSimOsc1ErClock,
mbed_official 146:f64d43ff0c18 63
mbed_official 146:f64d43ff0c18 64 /* irc 48Mhz clock */
mbed_official 146:f64d43ff0c18 65 kSimIrc48mClock,
mbed_official 146:f64d43ff0c18 66
mbed_official 146:f64d43ff0c18 67 /* rtc clock*/
mbed_official 146:f64d43ff0c18 68 kSimRtc32kClock,
mbed_official 146:f64d43ff0c18 69 kSimRtc1hzClock,
mbed_official 146:f64d43ff0c18 70
mbed_official 146:f64d43ff0c18 71 /* lpo clcok*/
mbed_official 146:f64d43ff0c18 72 kSimLpoClock,
mbed_official 146:f64d43ff0c18 73
mbed_official 146:f64d43ff0c18 74 /* mcg clocks*/
mbed_official 146:f64d43ff0c18 75 kSimMcgFllClock,
mbed_official 146:f64d43ff0c18 76 kSimMcgPll0Clock,
mbed_official 146:f64d43ff0c18 77 kSimMcgPll1Clock,
mbed_official 146:f64d43ff0c18 78 kSimMcgOutClock,
mbed_official 146:f64d43ff0c18 79 kSimMcgIrClock,
mbed_official 146:f64d43ff0c18 80
mbed_official 146:f64d43ff0c18 81 /* constant clocks (provided in other header files?)*/
mbed_official 146:f64d43ff0c18 82 kSimSDHC0_CLKIN,
mbed_official 146:f64d43ff0c18 83 kSimENET_1588_CLKIN,
mbed_official 146:f64d43ff0c18 84 kSimEXTAL_Clock,
mbed_official 146:f64d43ff0c18 85 kSimEXTAL1_Clock,
mbed_official 146:f64d43ff0c18 86 kSimUSB_CLKIN,
mbed_official 146:f64d43ff0c18 87
mbed_official 146:f64d43ff0c18 88 /* reserved value*/
mbed_official 146:f64d43ff0c18 89 kSimReserved,
mbed_official 146:f64d43ff0c18 90
mbed_official 146:f64d43ff0c18 91 kSimClockNameCount
mbed_official 146:f64d43ff0c18 92 } sim_clock_names_t;
mbed_official 146:f64d43ff0c18 93
mbed_official 146:f64d43ff0c18 94 /*! @brief Clock gate module names */
mbed_official 146:f64d43ff0c18 95 typedef enum _sim_clock_gate_module_names {
mbed_official 146:f64d43ff0c18 96
mbed_official 146:f64d43ff0c18 97 /* System modules*/
mbed_official 146:f64d43ff0c18 98 kSimClockModuleDMA, /**/
mbed_official 146:f64d43ff0c18 99 kSimClockModuleDMAMUX, /* instance 0, 1*/
mbed_official 146:f64d43ff0c18 100 kSimClockModulePORT, /* instance 0 - 5 (A - F)*/
mbed_official 146:f64d43ff0c18 101 kSimClockModuleMPU, /**/
mbed_official 146:f64d43ff0c18 102 kSimClockModuleLLWU, /**/
mbed_official 146:f64d43ff0c18 103 kSimClockModuleEWM, /**/
mbed_official 146:f64d43ff0c18 104
mbed_official 146:f64d43ff0c18 105 /* Clocks*/
mbed_official 146:f64d43ff0c18 106 kSimClockModuleOSC1, /**/
mbed_official 146:f64d43ff0c18 107
mbed_official 146:f64d43ff0c18 108 /* Memory and memory interfaces*/
mbed_official 146:f64d43ff0c18 109 kSimClockModuleFTF, /* Flash memory control clock*/
mbed_official 146:f64d43ff0c18 110 kSimClockModuleNFC, /* NAND flash control clock*/
mbed_official 146:f64d43ff0c18 111 kSimClockModuleFLEXBUS, /**/
mbed_official 146:f64d43ff0c18 112 kSimClockModuleDDR, /**/
mbed_official 146:f64d43ff0c18 113
mbed_official 146:f64d43ff0c18 114 /* Security*/
mbed_official 146:f64d43ff0c18 115 kSimClockModuleCRC, /**/
mbed_official 146:f64d43ff0c18 116 kSimClockModuleRNGA, /**/
mbed_official 146:f64d43ff0c18 117 kSimClockModuleREGFILE, /**/
mbed_official 146:f64d43ff0c18 118 kSimClockModuleDRYICESECREG, /**/
mbed_official 146:f64d43ff0c18 119 kSimClockModuleDRYICE, /**/
mbed_official 146:f64d43ff0c18 120
mbed_official 146:f64d43ff0c18 121 /* Analog*/
mbed_official 146:f64d43ff0c18 122 kSimClockModuleADC, /* instance 0 - 3*/
mbed_official 146:f64d43ff0c18 123 kSimClockModuleCMP, /* */
mbed_official 146:f64d43ff0c18 124 kSimClockModuleDAC, /* instance 0, 1*/
mbed_official 146:f64d43ff0c18 125 kSimClockModuleVREF, /* */
mbed_official 146:f64d43ff0c18 126 kSimClockModuleSAI, /* instance 0, 1*/
mbed_official 146:f64d43ff0c18 127
mbed_official 146:f64d43ff0c18 128 /* Timers*/
mbed_official 146:f64d43ff0c18 129 kSimClockModuleTPM, /* TPM timers 0 - 2*/
mbed_official 146:f64d43ff0c18 130 kSimClockModulePDB, /* */
mbed_official 146:f64d43ff0c18 131 kSimClockModuleFTM, /* instance 0 - 3*/
mbed_official 146:f64d43ff0c18 132 kSimClockModulePIT, /**/
mbed_official 146:f64d43ff0c18 133 kSimClockModuleLPTIMER, /**/
mbed_official 146:f64d43ff0c18 134 kSimClockModuleCMT, /**/
mbed_official 146:f64d43ff0c18 135 kSimClockModuleRTC, /**/
mbed_official 146:f64d43ff0c18 136
mbed_official 146:f64d43ff0c18 137 /* Communication Interfaces*/
mbed_official 146:f64d43ff0c18 138 kSimClockModuleENET, /**/
mbed_official 146:f64d43ff0c18 139 kSimClockModuleUSBHS, /**/
mbed_official 146:f64d43ff0c18 140 kSimClockModuleUSBFS, /**/
mbed_official 146:f64d43ff0c18 141 kSimClockModuleUSBDCD, /**/
mbed_official 146:f64d43ff0c18 142 kSimClockModuleFLEXCAN, /* instance 0, 1*/
mbed_official 146:f64d43ff0c18 143 kSimClockModuleSPI, /* instance 0 - 2*/
mbed_official 146:f64d43ff0c18 144 kSimClockModuleI2C, /* instance 0, 1*/
mbed_official 146:f64d43ff0c18 145 kSimClockModuleUART, /* instance 0 - 5*/
mbed_official 146:f64d43ff0c18 146 kSimClockModuleESDHC, /**/
mbed_official 146:f64d43ff0c18 147 kSimClockModuleLPUART, /**/
mbed_official 146:f64d43ff0c18 148
mbed_official 146:f64d43ff0c18 149 /* Human-machine Interfaces*/
mbed_official 146:f64d43ff0c18 150 kSimClockModuleTSI, /**/
mbed_official 146:f64d43ff0c18 151 kSimClockModuleLCDC, /**/
mbed_official 146:f64d43ff0c18 152 kSimClockModuleMax
mbed_official 146:f64d43ff0c18 153 } sim_clock_gate_module_names_t;
mbed_official 146:f64d43ff0c18 154
mbed_official 146:f64d43ff0c18 155 /*! @brief Clock source and sel names */
mbed_official 146:f64d43ff0c18 156 typedef enum _sim_clock_source_names {
mbed_official 146:f64d43ff0c18 157 kSimClockNfcSrc, /* NFCSRC*/
mbed_official 146:f64d43ff0c18 158 kSimClockEsdhcSrc, /* ESDHCSRC K70*/
mbed_official 146:f64d43ff0c18 159 kSimClockSdhcSrc, /* SDHCSRC K64*/
mbed_official 146:f64d43ff0c18 160 kSimClockLcdcSrc, /* LCDCSRC*/
mbed_official 146:f64d43ff0c18 161 kSimClockTimeSrc, /* TIMESRC*/
mbed_official 146:f64d43ff0c18 162 kSimClockRmiiSrc, /* RMIISRC*/
mbed_official 146:f64d43ff0c18 163 kSimClockUsbfSrc, /* USBFSRC K70*/
mbed_official 146:f64d43ff0c18 164 kSimClockUsbSrc, /* USBSRC K64, KL25, KV31, and K22*/
mbed_official 146:f64d43ff0c18 165 kSimClockUsbhSrc, /* USBHSRC*/
mbed_official 146:f64d43ff0c18 166 kSimClockUart0Src, /* UART0SRC*/
mbed_official 146:f64d43ff0c18 167 kSimClockTpmSrc, /* TPMSRC*/
mbed_official 146:f64d43ff0c18 168 kSimClockOsc32kSel, /* OSC32KSEL*/
mbed_official 146:f64d43ff0c18 169 kSimClockUsbfSel, /* USBF_CLKSEL*/
mbed_official 146:f64d43ff0c18 170 kSimClockPllfllSel, /* PLLFLLSEL*/
mbed_official 146:f64d43ff0c18 171 kSimClockNfcSel, /* NFC_CLKSEL*/
mbed_official 146:f64d43ff0c18 172 kSimClockLcdcSel, /* LCDC_CLKSEL*/
mbed_official 146:f64d43ff0c18 173 kSimClockTraceSel, /* TRACE_CLKSEL*/
mbed_official 146:f64d43ff0c18 174 kSimClockClkoutSel, /* CLKOUTSEL*/
mbed_official 146:f64d43ff0c18 175 kSimClockRtcClkoutSel, /* RTCCLKOUTSEL */
mbed_official 146:f64d43ff0c18 176 kSimClockSourceMax
mbed_official 146:f64d43ff0c18 177 } sim_clock_source_names_t;
mbed_official 146:f64d43ff0c18 178
mbed_official 146:f64d43ff0c18 179 /*! @brief Clock Divider names*/
mbed_official 146:f64d43ff0c18 180 typedef enum _sim_clock_divider_names {
mbed_official 146:f64d43ff0c18 181 kSimClockDividerOutdiv1, /* OUTDIV1*/
mbed_official 146:f64d43ff0c18 182 kSimClockDividerOutdiv2, /* OUTDIV2*/
mbed_official 146:f64d43ff0c18 183 kSimClockDividerOutdiv3, /* OUTDIV3*/
mbed_official 146:f64d43ff0c18 184 kSimClockDividerOutdiv4, /* OUTDIV4*/
mbed_official 146:f64d43ff0c18 185 kSimClockDividerUsbFrac, /* (USBFRAC + 1) / (USBDIV + 1)*/
mbed_official 146:f64d43ff0c18 186 kSimClockDividerUsbDiv,
mbed_official 146:f64d43ff0c18 187 kSimClockDividerUsbfsFrac, /* (USBFSFRAC + 1) / (USBFSDIV) + 1)*/
mbed_official 146:f64d43ff0c18 188 kSimClockDividerUsbfsDiv,
mbed_official 146:f64d43ff0c18 189 kSimClockDividerUsbhsFrac, /* (USBHSFRAC + 1) / (USBHSDIV + 1)*/
mbed_official 146:f64d43ff0c18 190 kSimClockDividerUsbhsDiv,
mbed_official 146:f64d43ff0c18 191 kSimClockDividerLcdcFrac, /* (LCDCFRAC + 1) / (LCDCDIV + 1)*/
mbed_official 146:f64d43ff0c18 192 kSimClockDividerLcdcDiv,
mbed_official 146:f64d43ff0c18 193 kSimClockDividerNfcFrac, /* (NFCFRAC + 1) / (NFCDIV + 1)*/
mbed_official 146:f64d43ff0c18 194 kSimClockDividerNfcDiv,
mbed_official 146:f64d43ff0c18 195 kSimClockDividerSpecial1, /* special divider 1*/
mbed_official 146:f64d43ff0c18 196 kSimClockDividerMax
mbed_official 146:f64d43ff0c18 197 } sim_clock_divider_names_t;
mbed_official 146:f64d43ff0c18 198
mbed_official 146:f64d43ff0c18 199 /*! @brief SIM USB voltage regulator in standby mode setting during stop modes */
mbed_official 146:f64d43ff0c18 200 typedef enum _sim_usbsstby_stop
mbed_official 146:f64d43ff0c18 201 {
mbed_official 146:f64d43ff0c18 202 kSimUsbsstbyNoRegulator, /* regulator not in standby during Stop modes */
mbed_official 146:f64d43ff0c18 203 kSimUsbsstbyWithRegulator /* regulator in standby during Stop modes */
mbed_official 146:f64d43ff0c18 204 } sim_usbsstby_stop_t;
mbed_official 146:f64d43ff0c18 205
mbed_official 146:f64d43ff0c18 206 /*! @brief SIM USB voltage regulator in standby mode setting during VLPR and VLPW modes */
mbed_official 146:f64d43ff0c18 207 typedef enum _sim_usbvstby_stop
mbed_official 146:f64d43ff0c18 208 {
mbed_official 146:f64d43ff0c18 209 kSimUsbvstbyNoRegulator, /* regulator not in standby during VLPR and VLPW modes */
mbed_official 146:f64d43ff0c18 210 kSimUsbvstbyWithRegulator /* regulator in standby during VLPR and VLPW modes */
mbed_official 146:f64d43ff0c18 211 } sim_usbvstby_stop_t;
mbed_official 146:f64d43ff0c18 212
mbed_official 146:f64d43ff0c18 213 /*! @brief SIM CMT/UART pad drive strength */
mbed_official 146:f64d43ff0c18 214 typedef enum _sim_cmtuartpad_strengh
mbed_official 146:f64d43ff0c18 215 {
mbed_official 146:f64d43ff0c18 216 kSimCmtuartSinglePad, /* Single-pad drive strength for CMT IRO or UART0_TXD */
mbed_official 146:f64d43ff0c18 217 kSimCmtuartDualPad /* Dual-pad drive strength for CMT IRO or UART0_TXD */
mbed_official 146:f64d43ff0c18 218 } sim_cmtuartpad_strengh_t;
mbed_official 146:f64d43ff0c18 219
mbed_official 146:f64d43ff0c18 220 /*! @brief SIM PTD7 pad drive strength */
mbed_official 146:f64d43ff0c18 221 typedef enum _sim_ptd7pad_strengh
mbed_official 146:f64d43ff0c18 222 {
mbed_official 146:f64d43ff0c18 223 kSimPtd7padSinglePad, /* Single-pad drive strength for PTD7 */
mbed_official 146:f64d43ff0c18 224 kSimPtd7padDualPad /* Dual-pad drive strength for PTD7 */
mbed_official 146:f64d43ff0c18 225 } sim_ptd7pad_strengh_t;
mbed_official 146:f64d43ff0c18 226
mbed_official 146:f64d43ff0c18 227 /*! @brief SIM FlexBus security level */
mbed_official 146:f64d43ff0c18 228 typedef enum _sim_flexbus_security_level
mbed_official 146:f64d43ff0c18 229 {
mbed_official 146:f64d43ff0c18 230 kSimFbslLevel0, /* All off-chip accesses (op code and data) via the FlexBus */
mbed_official 146:f64d43ff0c18 231 /* and DDR controller are disallowed */
mbed_official 146:f64d43ff0c18 232 kSimFbslLevel1, /* Undefined */
mbed_official 146:f64d43ff0c18 233 kSimFbslLevel2, /* Off-chip op code accesses are disallowed. Data accesses */
mbed_official 146:f64d43ff0c18 234 /* are allowed */
mbed_official 146:f64d43ff0c18 235 kSimFbslLevel3 /* Off-chip op code accesses and data accesses are allowed */
mbed_official 146:f64d43ff0c18 236 } sim_flexbus_security_level_t;
mbed_official 146:f64d43ff0c18 237
mbed_official 146:f64d43ff0c18 238 /*! @brief SIM ADCx pre-trigger select */
mbed_official 146:f64d43ff0c18 239 typedef enum _sim_pretrgsel
mbed_official 146:f64d43ff0c18 240 {
mbed_official 146:f64d43ff0c18 241 kSimAdcPretrgselA, /* Pre-trigger A selected for ADCx */
mbed_official 146:f64d43ff0c18 242 kSimAdcPretrgselB /* Pre-trigger B selected for ADCx */
mbed_official 146:f64d43ff0c18 243 } sim_pretrgsel_t;
mbed_official 146:f64d43ff0c18 244
mbed_official 146:f64d43ff0c18 245 /*! @brief SIM ADCx trigger select */
mbed_official 146:f64d43ff0c18 246 typedef enum _sim_trgsel
mbed_official 146:f64d43ff0c18 247 {
mbed_official 146:f64d43ff0c18 248 kSimAdcTrgselExt, /* External trigger */
mbed_official 146:f64d43ff0c18 249 kSimAdcTrgSelHighSpeedComp0, /* High speed comparator 0 asynchronous interrupt */
mbed_official 146:f64d43ff0c18 250 kSimAdcTrgSelHighSpeedComp1, /* High speed comparator 1 asynchronous interrupt */
mbed_official 146:f64d43ff0c18 251 kSimAdcTrgSelHighSpeedComp2, /* High speed comparator 2 asynchronous interrupt */
mbed_official 146:f64d43ff0c18 252 kSimAdcTrgSelPit0, /* PIT trigger 0 */
mbed_official 146:f64d43ff0c18 253 kSimAdcTrgSelPit1, /* PIT trigger 1 */
mbed_official 146:f64d43ff0c18 254 kSimAdcTrgSelPit2, /* PIT trigger 2 */
mbed_official 146:f64d43ff0c18 255 kSimAdcTrgSelPit3, /* PIT trigger 3 */
mbed_official 146:f64d43ff0c18 256 kSimAdcTrgSelFtm0, /* FTM0 trigger */
mbed_official 146:f64d43ff0c18 257 kSimAdcTrgSelFtm1, /* FTM1 trigger */
mbed_official 146:f64d43ff0c18 258 kSimAdcTrgSelFtm2, /* FTM2 trigger */
mbed_official 146:f64d43ff0c18 259 kSimAdcTrgSelFtm3, /* FTM3 trigger */
mbed_official 146:f64d43ff0c18 260 kSimAdcTrgSelRtcAlarm, /* RTC alarm */
mbed_official 146:f64d43ff0c18 261 kSimAdcTrgSelRtcSec, /* RTC seconds */
mbed_official 146:f64d43ff0c18 262 kSimAdcTrgSelLptimer, /* Low-power timer trigger */
mbed_official 146:f64d43ff0c18 263 kSimAdcTrgSelHigSpeedComp3 /* High speed comparator 3 asynchronous interrupt */
mbed_official 146:f64d43ff0c18 264 } sim_trgsel_t;
mbed_official 146:f64d43ff0c18 265
mbed_official 146:f64d43ff0c18 266 /*! @brief SIM receive data source select */
mbed_official 146:f64d43ff0c18 267 typedef enum _sim_uart_rxsrc
mbed_official 146:f64d43ff0c18 268 {
mbed_official 146:f64d43ff0c18 269 kSimUartRxsrcPin, /* UARTx_RX Pin */
mbed_official 146:f64d43ff0c18 270 kSimUartRxsrcCmp0, /* CMP0 */
mbed_official 146:f64d43ff0c18 271 kSimUartRxsrcCmp1, /* CMP1 */
mbed_official 146:f64d43ff0c18 272 kSimUartRxsrcReserved /* Reserved */
mbed_official 146:f64d43ff0c18 273 } sim_uart_rxsrc_t;
mbed_official 146:f64d43ff0c18 274
mbed_official 146:f64d43ff0c18 275 /*! @brief SIM transmit data source select */
mbed_official 146:f64d43ff0c18 276 typedef enum _sim_uart_txsrc
mbed_official 146:f64d43ff0c18 277 {
mbed_official 146:f64d43ff0c18 278 kSimUartTxsrcPin, /* UARTx_TX Pin */
mbed_official 146:f64d43ff0c18 279 kSimUartTxsrcCmp0, /* UARTx_TX pin modulated with FTM1 channel 0 output */
mbed_official 146:f64d43ff0c18 280 kSimUartTxsrcCmp1, /* UARTx_TX pin modulated with FTM2 channel 0 output */
mbed_official 146:f64d43ff0c18 281 kSimUartTxsrcReserved /* Reserved */
mbed_official 146:f64d43ff0c18 282 } sim_uart_txsrc_t;
mbed_official 146:f64d43ff0c18 283
mbed_official 146:f64d43ff0c18 284 /*! @brief SIM FlexTimer x trigger y select */
mbed_official 146:f64d43ff0c18 285 typedef enum _sim_ftm_trg_src
mbed_official 146:f64d43ff0c18 286 {
mbed_official 146:f64d43ff0c18 287 kSimFtmTrgSrc0, /* FlexTimer x trigger y select 0 */
mbed_official 146:f64d43ff0c18 288 kSimFtmTrgSrc1 /* FlexTimer x trigger y select 1 */
mbed_official 146:f64d43ff0c18 289 } sim_ftm_trg_src_t;
mbed_official 146:f64d43ff0c18 290
mbed_official 146:f64d43ff0c18 291 /*! @brief SIM FlexTimer external clock select */
mbed_official 146:f64d43ff0c18 292 typedef enum _sim_ftm_clk_sel
mbed_official 146:f64d43ff0c18 293 {
mbed_official 146:f64d43ff0c18 294 kSimFtmClkSel0, /* FTM CLKIN0 pin. */
mbed_official 146:f64d43ff0c18 295 kSimFtmClkSel1 /* FTM CLKIN1 pin. */
mbed_official 146:f64d43ff0c18 296 } sim_ftm_clk_sel_t;
mbed_official 146:f64d43ff0c18 297
mbed_official 146:f64d43ff0c18 298 /*! @brief SIM FlexTimer x channel y input capture source select */
mbed_official 146:f64d43ff0c18 299 typedef enum _sim_ftm_ch_src
mbed_official 146:f64d43ff0c18 300 {
mbed_official 146:f64d43ff0c18 301 kSimFtmChSrc0, /* See RM for details of each selection for each channel */
mbed_official 146:f64d43ff0c18 302 kSimFtmChSrc1, /* See RM for details of each selection for each channel */
mbed_official 146:f64d43ff0c18 303 kSimFtmChSrc2, /* See RM for details of each selection for each channel */
mbed_official 146:f64d43ff0c18 304 kSimFtmChSrc3 /* See RM for details of each selection for each channel */
mbed_official 146:f64d43ff0c18 305 } sim_ftm_ch_src_t;
mbed_official 146:f64d43ff0c18 306
mbed_official 146:f64d43ff0c18 307 /*! @brief SIM FlexTimer x Fault y select */
mbed_official 146:f64d43ff0c18 308 typedef enum _sim_ftm_flt_sel
mbed_official 146:f64d43ff0c18 309 {
mbed_official 146:f64d43ff0c18 310 kSimFtmFltSel0, /* FlexTimer x fault y select 0 */
mbed_official 146:f64d43ff0c18 311 kSimFtmFltSel1 /* FlexTimer x fault y select 1 */
mbed_official 146:f64d43ff0c18 312 } sim_ftm_flt_sel_t;
mbed_official 146:f64d43ff0c18 313
mbed_official 146:f64d43ff0c18 314 /*! @brief SIM Timer/PWM external clock select */
mbed_official 146:f64d43ff0c18 315 typedef enum _sim_tpm_clk_sel
mbed_official 146:f64d43ff0c18 316 {
mbed_official 146:f64d43ff0c18 317 kSimTpmClkSel0, /* Timer/PWM TPM_CLKIN0 pin. */
mbed_official 146:f64d43ff0c18 318 kSimTpmClkSel1 /* Timer/PWM TPM_CLKIN1 pin. */
mbed_official 146:f64d43ff0c18 319 } sim_tpm_clk_sel_t;
mbed_official 146:f64d43ff0c18 320
mbed_official 146:f64d43ff0c18 321 /*! @brief SIM Timer/PWM x channel y input capture source select */
mbed_official 146:f64d43ff0c18 322 typedef enum _sim_tpm_ch_src
mbed_official 146:f64d43ff0c18 323 {
mbed_official 146:f64d43ff0c18 324 kSimTpmChSrc0, /* TPMx_CH0 signal */
mbed_official 146:f64d43ff0c18 325 kSimTpmChSrc1 /* CMP0 output */
mbed_official 146:f64d43ff0c18 326 } sim_tpm_ch_src_t;
mbed_official 146:f64d43ff0c18 327
mbed_official 146:f64d43ff0c18 328 /*! @brief SIM HAL API return status*/
mbed_official 146:f64d43ff0c18 329 typedef enum _sim_hal_status {
mbed_official 146:f64d43ff0c18 330 kSimHalSuccess,
mbed_official 146:f64d43ff0c18 331 kSimHalFail,
mbed_official 146:f64d43ff0c18 332 kSimHalNoSuchModule,
mbed_official 146:f64d43ff0c18 333 kSimHalNoSuchClockSrc,
mbed_official 146:f64d43ff0c18 334 kSimHalNoSuchDivider
mbed_official 146:f64d43ff0c18 335 } sim_hal_status_t;
mbed_official 146:f64d43ff0c18 336
mbed_official 146:f64d43ff0c18 337 /*! @brief Clock gate module configuration table structure*/
mbed_official 146:f64d43ff0c18 338 typedef struct SimClockGateModuleConfig {
mbed_official 146:f64d43ff0c18 339 sim_clock_gate_module_names_t clockGateModuleName; /*!< clock module name*/
mbed_official 146:f64d43ff0c18 340 uint8_t deviceInstance; /*!< device instance*/
mbed_official 146:f64d43ff0c18 341 uint32_t scgcRegAddress; /*!< clock gate control register address*/
mbed_official 146:f64d43ff0c18 342 uint32_t deviceMask; /*!< device mask in control register*/
mbed_official 146:f64d43ff0c18 343 } sim_clock_gate_module_config_t;
mbed_official 146:f64d43ff0c18 344
mbed_official 146:f64d43ff0c18 345 /*! @brief clock source value table structure*/
mbed_official 146:f64d43ff0c18 346 typedef struct SimClockSourceValue {
mbed_official 146:f64d43ff0c18 347 union{
mbed_official 146:f64d43ff0c18 348 uint8_t name;
mbed_official 146:f64d43ff0c18 349 sim_clock_names_t clockName; /*!< clock name*/
mbed_official 146:f64d43ff0c18 350 sim_clock_source_names_t clockSelName;
mbed_official 146:f64d43ff0c18 351 };
mbed_official 146:f64d43ff0c18 352 bool isSel; /*!< clock sel flag*/
mbed_official 146:f64d43ff0c18 353 bool hasDivider; /*!< has divider*/
mbed_official 146:f64d43ff0c18 354 sim_clock_divider_names_t dividerName; /*!< divider name*/
mbed_official 146:f64d43ff0c18 355 } sim_clock_source_value_t;
mbed_official 146:f64d43ff0c18 356
mbed_official 146:f64d43ff0c18 357 /*! @brief Clock name configuration table structure*/
mbed_official 146:f64d43ff0c18 358 typedef struct SimClockNameConfig {
mbed_official 146:f64d43ff0c18 359 sim_clock_names_t clockName; /*!< clock name*/
mbed_official 146:f64d43ff0c18 360 bool useOtherRefClock; /*!< if it uses the other ref clock*/
mbed_official 146:f64d43ff0c18 361 sim_clock_names_t otherRefClockName; /*!< other ref clock name*/
mbed_official 146:f64d43ff0c18 362 sim_clock_divider_names_t dividerName; /*!< clock divider name*/
mbed_official 146:f64d43ff0c18 363 } sim_clock_name_config_t;
mbed_official 146:f64d43ff0c18 364
mbed_official 146:f64d43ff0c18 365 /*! @brief clock name configuration table for specified CPU defined in fsl_clock_module_names_Kxxx.h*/
mbed_official 146:f64d43ff0c18 366 extern const sim_clock_name_config_t kSimClockNameConfigTable[];
mbed_official 146:f64d43ff0c18 367
mbed_official 146:f64d43ff0c18 368 /*! @brief SIM configuration table for clock module names*/
mbed_official 146:f64d43ff0c18 369 extern const sim_clock_gate_module_config_t kSimClockGateModuleConfigTable[];
mbed_official 146:f64d43ff0c18 370
mbed_official 146:f64d43ff0c18 371 /*! @brief clock source value table for specified CPU */
mbed_official 146:f64d43ff0c18 372 extern const sim_clock_source_value_t *kClockSourceValueTable[];
mbed_official 146:f64d43ff0c18 373
mbed_official 146:f64d43ff0c18 374 /*******************************************************************************
mbed_official 146:f64d43ff0c18 375 * API
mbed_official 146:f64d43ff0c18 376 ******************************************************************************/
mbed_official 146:f64d43ff0c18 377
mbed_official 146:f64d43ff0c18 378 #if defined(__cplusplus)
mbed_official 146:f64d43ff0c18 379 extern "C" {
mbed_official 146:f64d43ff0c18 380 #endif /* __cplusplus*/
mbed_official 146:f64d43ff0c18 381
mbed_official 146:f64d43ff0c18 382 /*! @name clock related feature APIs*/
mbed_official 146:f64d43ff0c18 383 /*@{*/
mbed_official 146:f64d43ff0c18 384
mbed_official 146:f64d43ff0c18 385 /*!
mbed_official 146:f64d43ff0c18 386 * @brief Enables or disables the clock for a specified clock module.
mbed_official 146:f64d43ff0c18 387 *
mbed_official 146:f64d43ff0c18 388 * This function enables/disables the clock for a specified clock module and instance.
mbed_official 146:f64d43ff0c18 389 *
mbed_official 146:f64d43ff0c18 390 * @param clockModule Clock module name defined in the sim_clock_gate_module_names_t
mbed_official 146:f64d43ff0c18 391 * @param instance Module instance
mbed_official 146:f64d43ff0c18 392 * @param enable Enable or disable the clock
mbed_official 146:f64d43ff0c18 393 * - true: enable the clock
mbed_official 146:f64d43ff0c18 394 * - false: disable the clock
mbed_official 146:f64d43ff0c18 395 * @return status If the clock module name doesn't exist, it returns an error.
mbed_official 146:f64d43ff0c18 396 */
mbed_official 146:f64d43ff0c18 397 sim_hal_status_t clock_hal_set_gate(sim_clock_gate_module_names_t clockModule, uint8_t instance,
mbed_official 146:f64d43ff0c18 398 bool enable);
mbed_official 146:f64d43ff0c18 399
mbed_official 146:f64d43ff0c18 400 /*!
mbed_official 146:f64d43ff0c18 401 * @brief Gets the clock enabled or disabled state.
mbed_official 146:f64d43ff0c18 402 *
mbed_official 146:f64d43ff0c18 403 * This function gets the current clock gate status of the specified clock
mbed_official 146:f64d43ff0c18 404 * module and instance.
mbed_official 146:f64d43ff0c18 405 *
mbed_official 146:f64d43ff0c18 406 * @param clockModule Clock module name defined in sim_clock_gate_module_names_t
mbed_official 146:f64d43ff0c18 407 * @param instance Module instance
mbed_official 146:f64d43ff0c18 408 * @param isEnabled returned status, clock is enabled or disabled for the module.
mbed_official 146:f64d43ff0c18 409 * - true: enabled
mbed_official 146:f64d43ff0c18 410 * - false: disabled
mbed_official 146:f64d43ff0c18 411 * @return status if the clock module name doesn't exist, it returns an error.
mbed_official 146:f64d43ff0c18 412 */
mbed_official 146:f64d43ff0c18 413 sim_hal_status_t clock_hal_get_gate(sim_clock_gate_module_names_t clockModule, uint8_t instance,
mbed_official 146:f64d43ff0c18 414 bool *isEnabled);
mbed_official 146:f64d43ff0c18 415
mbed_official 146:f64d43ff0c18 416 /*!
mbed_official 146:f64d43ff0c18 417 * @brief Sets the clock source setting.
mbed_official 146:f64d43ff0c18 418 *
mbed_official 146:f64d43ff0c18 419 * This function sets the settings for a specified clock source. Each clock
mbed_official 146:f64d43ff0c18 420 * source has its own clock selection settings. See the chip reference manual for
mbed_official 146:f64d43ff0c18 421 * clock source detailed settings and the sim_clock_source_names_t
mbed_official 146:f64d43ff0c18 422 * for clock sources.
mbed_official 146:f64d43ff0c18 423 *
mbed_official 146:f64d43ff0c18 424 * @param clockSource Clock source name defined in sim_clock_source_names_t
mbed_official 146:f64d43ff0c18 425 * @param setting Setting value
mbed_official 146:f64d43ff0c18 426 * @return status If the clock source doesn't exist, it returns an error.
mbed_official 146:f64d43ff0c18 427 */
mbed_official 146:f64d43ff0c18 428 sim_hal_status_t clock_hal_set_clock_source(sim_clock_source_names_t clockSource, uint8_t setting);
mbed_official 146:f64d43ff0c18 429
mbed_official 146:f64d43ff0c18 430 /*!
mbed_official 146:f64d43ff0c18 431 * @brief Gets the clock source setting.
mbed_official 146:f64d43ff0c18 432 *
mbed_official 146:f64d43ff0c18 433 * This function gets the settings for a specified clock source. Each clock
mbed_official 146:f64d43ff0c18 434 * source has its own clock selection settings. See the reference manual for
mbed_official 146:f64d43ff0c18 435 * clock source detailed settings and the sim_clock_source_names_t
mbed_official 146:f64d43ff0c18 436 * for clock sources.
mbed_official 146:f64d43ff0c18 437 *
mbed_official 146:f64d43ff0c18 438 * @param clockSource Clock source name
mbed_official 146:f64d43ff0c18 439 * @param setting Current setting for the clock source
mbed_official 146:f64d43ff0c18 440 * @return status If the clock source doesn't exist, it returns an error.
mbed_official 146:f64d43ff0c18 441 */
mbed_official 146:f64d43ff0c18 442 sim_hal_status_t clock_hal_get_clock_source(sim_clock_source_names_t clockSource,
mbed_official 146:f64d43ff0c18 443 uint8_t *setting);
mbed_official 146:f64d43ff0c18 444
mbed_official 146:f64d43ff0c18 445 /*!
mbed_official 146:f64d43ff0c18 446 * @brief Sets the clock divider setting.
mbed_official 146:f64d43ff0c18 447 *
mbed_official 146:f64d43ff0c18 448 * This function sets the setting for a specified clock divider. See the
mbed_official 146:f64d43ff0c18 449 * reference manual for a supported clock divider and value range and the
mbed_official 146:f64d43ff0c18 450 * sim_clock_divider_names_t for dividers.
mbed_official 146:f64d43ff0c18 451 *
mbed_official 146:f64d43ff0c18 452 * @param clockDivider Clock divider name
mbed_official 146:f64d43ff0c18 453 * @param divider Divider setting
mbed_official 146:f64d43ff0c18 454 * @return status If the clock divider doesn't exist, it returns an error.
mbed_official 146:f64d43ff0c18 455 */
mbed_official 146:f64d43ff0c18 456 sim_hal_status_t clock_hal_set_clock_divider(sim_clock_divider_names_t clockDivider,
mbed_official 146:f64d43ff0c18 457 uint32_t setting);
mbed_official 146:f64d43ff0c18 458
mbed_official 146:f64d43ff0c18 459 /*!
mbed_official 146:f64d43ff0c18 460 * @brief Sets the clock out dividers setting.
mbed_official 146:f64d43ff0c18 461 *
mbed_official 146:f64d43ff0c18 462 * This function sets the setting for all clock out dividers at the same time.
mbed_official 146:f64d43ff0c18 463 * See the reference manual for a supported clock divider and value range and the
mbed_official 146:f64d43ff0c18 464 * sim_clock_divider_names_t for clock out dividers.
mbed_official 146:f64d43ff0c18 465 *
mbed_official 146:f64d43ff0c18 466 * @param outdiv1 Outdivider1 setting
mbed_official 146:f64d43ff0c18 467 * @param outdiv2 Outdivider2 setting
mbed_official 146:f64d43ff0c18 468 * @param outdiv3 Outdivider3 setting
mbed_official 146:f64d43ff0c18 469 * @param outdiv4 Outdivider4 setting
mbed_official 146:f64d43ff0c18 470 */
mbed_official 146:f64d43ff0c18 471 void clock_hal_set_clock_out_dividers(uint32_t outdiv1, uint32_t outdiv2,
mbed_official 146:f64d43ff0c18 472 uint32_t outdiv3, uint32_t outdiv4);
mbed_official 146:f64d43ff0c18 473
mbed_official 146:f64d43ff0c18 474 /*!
mbed_official 146:f64d43ff0c18 475 * @brief Gets the clock divider setting.
mbed_official 146:f64d43ff0c18 476 *
mbed_official 146:f64d43ff0c18 477 * This function gets the setting for a specified clock divider. See the
mbed_official 146:f64d43ff0c18 478 * reference manual for a supported clock divider and value range and the
mbed_official 146:f64d43ff0c18 479 * sim_clock_divider_names_t for dividers.
mbed_official 146:f64d43ff0c18 480 *
mbed_official 146:f64d43ff0c18 481 * @param clockDivider Clock divider name
mbed_official 146:f64d43ff0c18 482 * @param divider Divider value pointer
mbed_official 146:f64d43ff0c18 483 * @return status If the clock divider doesn't exist, it returns an error.
mbed_official 146:f64d43ff0c18 484 */
mbed_official 146:f64d43ff0c18 485 sim_hal_status_t clock_hal_get_clock_divider(sim_clock_divider_names_t clockDivider,
mbed_official 146:f64d43ff0c18 486 uint32_t *setting);
mbed_official 146:f64d43ff0c18 487
mbed_official 146:f64d43ff0c18 488 /*@}*/
mbed_official 146:f64d43ff0c18 489
mbed_official 146:f64d43ff0c18 490 /*! @name individual field access APIs*/
mbed_official 146:f64d43ff0c18 491 /*@{*/
mbed_official 146:f64d43ff0c18 492
mbed_official 146:f64d43ff0c18 493 /*!
mbed_official 146:f64d43ff0c18 494 * @brief Sets the USB voltage regulator enabled setting.
mbed_official 146:f64d43ff0c18 495 *
mbed_official 146:f64d43ff0c18 496 * This function controls whether the USB voltage regulator is enabled. This bit
mbed_official 146:f64d43ff0c18 497 * can only be written when the SOPT1CFG[URWE] bit is set.
mbed_official 146:f64d43ff0c18 498 *
mbed_official 146:f64d43ff0c18 499 * @param enable USB voltage regulator enable setting
mbed_official 146:f64d43ff0c18 500 * - true: USB voltage regulator is enabled.
mbed_official 146:f64d43ff0c18 501 * - false: USB voltage regulator is disabled.
mbed_official 146:f64d43ff0c18 502 */
mbed_official 146:f64d43ff0c18 503 static inline void sim_set_usbregen(bool enable)
mbed_official 146:f64d43ff0c18 504 {
mbed_official 146:f64d43ff0c18 505 BW_SIM_SOPT1_USBREGEN(enable ? 1 : 0);
mbed_official 146:f64d43ff0c18 506 }
mbed_official 146:f64d43ff0c18 507
mbed_official 146:f64d43ff0c18 508 /*!
mbed_official 146:f64d43ff0c18 509 * @brief Gets the USB voltage regulator enabled setting.
mbed_official 146:f64d43ff0c18 510 *
mbed_official 146:f64d43ff0c18 511 * This function gets the USB voltage regulator enabled setting.
mbed_official 146:f64d43ff0c18 512 *
mbed_official 146:f64d43ff0c18 513 * @return enabled True if the USB voltage regulator is enabled.
mbed_official 146:f64d43ff0c18 514 */
mbed_official 146:f64d43ff0c18 515 static inline bool sim_get_usbregen(void)
mbed_official 146:f64d43ff0c18 516 {
mbed_official 146:f64d43ff0c18 517 return BR_SIM_SOPT1_USBREGEN;
mbed_official 146:f64d43ff0c18 518 }
mbed_official 146:f64d43ff0c18 519
mbed_official 146:f64d43ff0c18 520 /*!
mbed_official 146:f64d43ff0c18 521 * @brief Sets the USB voltage regulator in a standby mode setting during Stop, VLPS, LLS, and VLLS.
mbed_official 146:f64d43ff0c18 522 *
mbed_official 146:f64d43ff0c18 523 * This function controls whether the USB voltage regulator is placed in a standby
mbed_official 146:f64d43ff0c18 524 * mode during Stop, VLPS, LLS, and VLLS modes. This bit can only be written when the
mbed_official 146:f64d43ff0c18 525 * SOPT1CFG[USSWE] bit is set.
mbed_official 146:f64d43ff0c18 526 *
mbed_official 146:f64d43ff0c18 527 * @param setting USB voltage regulator in standby mode setting
mbed_official 146:f64d43ff0c18 528 * - 0: USB voltage regulator not in standby during Stop, VLPS, LLS and
mbed_official 146:f64d43ff0c18 529 * VLLS modes.
mbed_official 146:f64d43ff0c18 530 * - 1: USB voltage regulator in standby during Stop, VLPS, LLS and VLLS
mbed_official 146:f64d43ff0c18 531 * modes.
mbed_official 146:f64d43ff0c18 532 */
mbed_official 146:f64d43ff0c18 533 static inline void sim_set_usbsstby(sim_usbsstby_stop_t setting)
mbed_official 146:f64d43ff0c18 534 {
mbed_official 146:f64d43ff0c18 535 BW_SIM_SOPT1_USBSSTBY(setting);
mbed_official 146:f64d43ff0c18 536 }
mbed_official 146:f64d43ff0c18 537
mbed_official 146:f64d43ff0c18 538 /*!
mbed_official 146:f64d43ff0c18 539 * @brief Gets the USB voltage regulator in a standby mode setting.
mbed_official 146:f64d43ff0c18 540 *
mbed_official 146:f64d43ff0c18 541 * This function gets the USB voltage regulator in a standby mode setting.
mbed_official 146:f64d43ff0c18 542 *
mbed_official 146:f64d43ff0c18 543 * @return setting USB voltage regulator in a standby mode setting
mbed_official 146:f64d43ff0c18 544 */
mbed_official 146:f64d43ff0c18 545 static inline sim_usbsstby_stop_t sim_get_usbsstby(void)
mbed_official 146:f64d43ff0c18 546 {
mbed_official 146:f64d43ff0c18 547 return (sim_usbsstby_stop_t)BR_SIM_SOPT1_USBSSTBY;
mbed_official 146:f64d43ff0c18 548 }
mbed_official 146:f64d43ff0c18 549
mbed_official 146:f64d43ff0c18 550 /*!
mbed_official 146:f64d43ff0c18 551 * @brief Sets the USB voltage regulator in a standby mode during the VLPR or the VLPW.
mbed_official 146:f64d43ff0c18 552 *
mbed_official 146:f64d43ff0c18 553 * This function controls whether the USB voltage regulator is placed in a standby
mbed_official 146:f64d43ff0c18 554 * mode during the VLPR and the VLPW modes. This bit can only be written when the
mbed_official 146:f64d43ff0c18 555 * SOPT1CFG[UVSWE] bit is set.
mbed_official 146:f64d43ff0c18 556 *
mbed_official 146:f64d43ff0c18 557 * @param setting USB voltage regulator in standby mode setting
mbed_official 146:f64d43ff0c18 558 * - 0: USB voltage regulator not in standby during VLPR and VLPW modes.
mbed_official 146:f64d43ff0c18 559 * - 1: USB voltage regulator in standby during VLPR and VLPW modes.
mbed_official 146:f64d43ff0c18 560 */
mbed_official 146:f64d43ff0c18 561 static inline void sim_set_usbvstby(sim_usbvstby_stop_t setting)
mbed_official 146:f64d43ff0c18 562 {
mbed_official 146:f64d43ff0c18 563 BW_SIM_SOPT1_USBVSTBY(setting);
mbed_official 146:f64d43ff0c18 564 }
mbed_official 146:f64d43ff0c18 565
mbed_official 146:f64d43ff0c18 566 /*!
mbed_official 146:f64d43ff0c18 567 * @brief Gets the USB voltage regulator in a standby mode during the VLPR or the VLPW.
mbed_official 146:f64d43ff0c18 568 *
mbed_official 146:f64d43ff0c18 569 * This function gets the USB voltage regulator in a standby mode during the VLPR or the VLPW.
mbed_official 146:f64d43ff0c18 570 *
mbed_official 146:f64d43ff0c18 571 * @return setting USB voltage regulator in a standby mode during the VLPR or the VLPW
mbed_official 146:f64d43ff0c18 572 */
mbed_official 146:f64d43ff0c18 573 static inline sim_usbvstby_stop_t sim_get_usbvstby(void)
mbed_official 146:f64d43ff0c18 574 {
mbed_official 146:f64d43ff0c18 575 return (sim_usbvstby_stop_t)BR_SIM_SOPT1_USBVSTBY;
mbed_official 146:f64d43ff0c18 576 }
mbed_official 146:f64d43ff0c18 577
mbed_official 146:f64d43ff0c18 578 #if FSL_FEATURE_SIM_OPT_HAS_RAMSIZE
mbed_official 146:f64d43ff0c18 579 /*!
mbed_official 146:f64d43ff0c18 580 * @brief Gets the RAM size.
mbed_official 146:f64d43ff0c18 581 *
mbed_official 146:f64d43ff0c18 582 * This function gets the RAM size. The field specifies the amount of system RAM, which is
mbed_official 146:f64d43ff0c18 583 * available on the device.
mbed_official 146:f64d43ff0c18 584 *
mbed_official 146:f64d43ff0c18 585 * @return size RAM size on the device
mbed_official 146:f64d43ff0c18 586 */
mbed_official 146:f64d43ff0c18 587 static inline uint32_t sim_get_ramsize(void)
mbed_official 146:f64d43ff0c18 588 {
mbed_official 146:f64d43ff0c18 589 return BR_SIM_SOPT1_RAMSIZE;
mbed_official 146:f64d43ff0c18 590 }
mbed_official 146:f64d43ff0c18 591 #endif /* FSL_FEATURE_SIM_OPT_HAS_RAMSIZE */
mbed_official 146:f64d43ff0c18 592
mbed_official 146:f64d43ff0c18 593 /*!
mbed_official 146:f64d43ff0c18 594 * @brief Sets the USB voltage regulator stop standby write enable setting.
mbed_official 146:f64d43ff0c18 595 *
mbed_official 146:f64d43ff0c18 596 * This function controls whether the USB voltage regulator stop standby write
mbed_official 146:f64d43ff0c18 597 * feature is enabled. Writing one to this bit allows the SOPT1[USBSSTBY] bit to be written. This
mbed_official 146:f64d43ff0c18 598 * register bit clears after a write to SOPT1[USBSSTBY].
mbed_official 146:f64d43ff0c18 599 *
mbed_official 146:f64d43ff0c18 600 * @param enable USB voltage regulator stop standby write enable setting
mbed_official 146:f64d43ff0c18 601 * - true: SOPT1[USBSSTBY] can be written.
mbed_official 146:f64d43ff0c18 602 * - false: SOPT1[USBSSTBY] cannot be written.
mbed_official 146:f64d43ff0c18 603 */
mbed_official 146:f64d43ff0c18 604 static inline void sim_set_usswe(bool enable)
mbed_official 146:f64d43ff0c18 605 {
mbed_official 146:f64d43ff0c18 606 BW_SIM_SOPT1CFG_USSWE(enable ? 1 : 0);
mbed_official 146:f64d43ff0c18 607 }
mbed_official 146:f64d43ff0c18 608
mbed_official 146:f64d43ff0c18 609 /*!
mbed_official 146:f64d43ff0c18 610 * @brief Gets the USB voltage regulator stop standby write enable setting.
mbed_official 146:f64d43ff0c18 611 *
mbed_official 146:f64d43ff0c18 612 * This function gets the USB voltage regulator stop standby write enable setting.
mbed_official 146:f64d43ff0c18 613 *
mbed_official 146:f64d43ff0c18 614 * @return enabled True if the USB voltage regulator stop standby write is enabled.
mbed_official 146:f64d43ff0c18 615 */
mbed_official 146:f64d43ff0c18 616 static inline bool sim_get_usswe(void)
mbed_official 146:f64d43ff0c18 617 {
mbed_official 146:f64d43ff0c18 618 return BR_SIM_SOPT1CFG_USSWE;
mbed_official 146:f64d43ff0c18 619 }
mbed_official 146:f64d43ff0c18 620
mbed_official 146:f64d43ff0c18 621 /*!
mbed_official 146:f64d43ff0c18 622 * @brief Sets the USB voltage regulator VLP standby write enable setting.
mbed_official 146:f64d43ff0c18 623 *
mbed_official 146:f64d43ff0c18 624 * This function controls whether USB voltage regulator VLP standby write
mbed_official 146:f64d43ff0c18 625 * feature is enabled. Writing one to this bit allows the SOPT1[USBVSTBY] bit to be written. This
mbed_official 146:f64d43ff0c18 626 * register bit clears after a write to SOPT1[USBVSTBY].
mbed_official 146:f64d43ff0c18 627 *
mbed_official 146:f64d43ff0c18 628 * @param enable USB voltage regulator VLP standby write enable setting
mbed_official 146:f64d43ff0c18 629 * - true: SOPT1[USBSSTBY] can be written.
mbed_official 146:f64d43ff0c18 630 * - false: SOPT1[USBSSTBY] cannot be written.
mbed_official 146:f64d43ff0c18 631 */
mbed_official 146:f64d43ff0c18 632 static inline void sim_set_uvswe(bool enable)
mbed_official 146:f64d43ff0c18 633 {
mbed_official 146:f64d43ff0c18 634 BW_SIM_SOPT1CFG_UVSWE(enable ? 1 : 0);
mbed_official 146:f64d43ff0c18 635 }
mbed_official 146:f64d43ff0c18 636
mbed_official 146:f64d43ff0c18 637 /*!
mbed_official 146:f64d43ff0c18 638 * @brief Gets the USB voltage regulator VLP standby write enable setting.
mbed_official 146:f64d43ff0c18 639 *
mbed_official 146:f64d43ff0c18 640 * This function gets the USB voltage regulator VLP standby write enable setting.
mbed_official 146:f64d43ff0c18 641 *
mbed_official 146:f64d43ff0c18 642 * @return enabled True if the USB voltage regulator VLP standby write is enabled.
mbed_official 146:f64d43ff0c18 643 */
mbed_official 146:f64d43ff0c18 644 static inline bool sim_get_uvswe(void)
mbed_official 146:f64d43ff0c18 645 {
mbed_official 146:f64d43ff0c18 646 return BR_SIM_SOPT1CFG_UVSWE;
mbed_official 146:f64d43ff0c18 647 }
mbed_official 146:f64d43ff0c18 648
mbed_official 146:f64d43ff0c18 649 /*!
mbed_official 146:f64d43ff0c18 650 * @brief Sets the USB voltage regulator enable write enable setting.
mbed_official 146:f64d43ff0c18 651 *
mbed_official 146:f64d43ff0c18 652 * This function controls whether the USB voltage regulator write enable
mbed_official 146:f64d43ff0c18 653 * feature is enabled. Writing one to this bit allows the SOPT1[USBREGEN] bit to be written.
mbed_official 146:f64d43ff0c18 654 * This register bit clears after a write to SOPT1[USBREGEN].
mbed_official 146:f64d43ff0c18 655 *
mbed_official 146:f64d43ff0c18 656 * @param enable USB voltage regulator enable write enable setting
mbed_official 146:f64d43ff0c18 657 * - true: SOPT1[USBSSTBY] can be written.
mbed_official 146:f64d43ff0c18 658 * - false: SOPT1[USBSSTBY] cannot be written.
mbed_official 146:f64d43ff0c18 659 */
mbed_official 146:f64d43ff0c18 660 static inline void sim_set_urwe(bool enable)
mbed_official 146:f64d43ff0c18 661 {
mbed_official 146:f64d43ff0c18 662 BW_SIM_SOPT1CFG_URWE(enable ? 1 : 0);
mbed_official 146:f64d43ff0c18 663 }
mbed_official 146:f64d43ff0c18 664
mbed_official 146:f64d43ff0c18 665 /*!
mbed_official 146:f64d43ff0c18 666 * @brief Gets the USB voltage regulator enable write enable setting.
mbed_official 146:f64d43ff0c18 667 *
mbed_official 146:f64d43ff0c18 668 * This function gets the USB voltage regulator enable write enable setting.
mbed_official 146:f64d43ff0c18 669 *
mbed_official 146:f64d43ff0c18 670 * @return enabled True if USB voltage regulator enable write is enabled.
mbed_official 146:f64d43ff0c18 671 */
mbed_official 146:f64d43ff0c18 672 static inline bool sim_get_urwe(void)
mbed_official 146:f64d43ff0c18 673 {
mbed_official 146:f64d43ff0c18 674 return BR_SIM_SOPT1CFG_URWE;
mbed_official 146:f64d43ff0c18 675 }
mbed_official 146:f64d43ff0c18 676
mbed_official 146:f64d43ff0c18 677 #if FSL_FEATURE_SIM_OPT_HAS_CMTUARTPAD
mbed_official 146:f64d43ff0c18 678 /*!
mbed_official 146:f64d43ff0c18 679 * @brief Sets the CMT/UART pad drive strength setting.
mbed_official 146:f64d43ff0c18 680 *
mbed_official 146:f64d43ff0c18 681 * This function controls the output drive strength of the CMT IRO signal or
mbed_official 146:f64d43ff0c18 682 * UART0_TXD signal on PTD7 pin by selecting either one or two pads to drive it.
mbed_official 146:f64d43ff0c18 683 *
mbed_official 146:f64d43ff0c18 684 * @param setting CMT/UART pad drive strength setting
mbed_official 146:f64d43ff0c18 685 * - 0: Single-pad drive strength for CMT IRO or UART0_TXD.
mbed_official 146:f64d43ff0c18 686 * - 1: Dual-pad drive strength for CMT IRO or UART0_TXD.
mbed_official 146:f64d43ff0c18 687 */
mbed_official 146:f64d43ff0c18 688 static inline void sim_set_cmtuartpad(sim_cmtuartpad_strengh_t setting)
mbed_official 146:f64d43ff0c18 689 {
mbed_official 146:f64d43ff0c18 690 BW_SIM_SOPT2_CMTUARTPAD(setting);
mbed_official 146:f64d43ff0c18 691 }
mbed_official 146:f64d43ff0c18 692
mbed_official 146:f64d43ff0c18 693 /*!
mbed_official 146:f64d43ff0c18 694 * @brief Gets the CMT/UART pad drive strength setting.
mbed_official 146:f64d43ff0c18 695 *
mbed_official 146:f64d43ff0c18 696 * This function gets the CMT/UART pad drive strength setting.
mbed_official 146:f64d43ff0c18 697 *
mbed_official 146:f64d43ff0c18 698 * @return setting CMT/UART pad drive strength setting
mbed_official 146:f64d43ff0c18 699 */
mbed_official 146:f64d43ff0c18 700 static inline sim_cmtuartpad_strengh_t sim_get_cmtuartpad(void)
mbed_official 146:f64d43ff0c18 701 {
mbed_official 146:f64d43ff0c18 702 return (sim_cmtuartpad_strengh_t)BR_SIM_SOPT2_CMTUARTPAD;
mbed_official 146:f64d43ff0c18 703 }
mbed_official 146:f64d43ff0c18 704 #endif /* FSL_FEATURE_SIM_OPT_HAS_CMTUARTPAD */
mbed_official 146:f64d43ff0c18 705
mbed_official 146:f64d43ff0c18 706 #if FSL_FEATURE_SIM_OPT_HAS_PTD7PAD
mbed_official 146:f64d43ff0c18 707 /*!
mbed_official 146:f64d43ff0c18 708 * @brief Sets the PTD7 pad drive strength setting.
mbed_official 146:f64d43ff0c18 709 *
mbed_official 146:f64d43ff0c18 710 * This function controls the output drive strength of the PTD7 pin by selecting
mbed_official 146:f64d43ff0c18 711 * either one or two pads to drive it.
mbed_official 146:f64d43ff0c18 712 *
mbed_official 146:f64d43ff0c18 713 * @param setting PTD7 pad drive strength setting
mbed_official 146:f64d43ff0c18 714 * - 0: Single-pad drive strength for PTD7.
mbed_official 146:f64d43ff0c18 715 * - 1: Double pad drive strength for PTD7.
mbed_official 146:f64d43ff0c18 716 */
mbed_official 146:f64d43ff0c18 717 static inline void sim_set_ptd7pad(sim_ptd7pad_strengh_t setting)
mbed_official 146:f64d43ff0c18 718 {
mbed_official 146:f64d43ff0c18 719 BW_SIM_SOPT2_PTD7PAD(setting);
mbed_official 146:f64d43ff0c18 720 }
mbed_official 146:f64d43ff0c18 721
mbed_official 146:f64d43ff0c18 722 /*!
mbed_official 146:f64d43ff0c18 723 * @brief Gets the PTD7 pad drive strength setting.
mbed_official 146:f64d43ff0c18 724 *
mbed_official 146:f64d43ff0c18 725 * This function gets the PTD7 pad drive strength setting.
mbed_official 146:f64d43ff0c18 726 *
mbed_official 146:f64d43ff0c18 727 * @return setting PTD7 pad drive strength setting
mbed_official 146:f64d43ff0c18 728 */
mbed_official 146:f64d43ff0c18 729 static inline sim_ptd7pad_strengh_t sim_get_ptd7pad(void)
mbed_official 146:f64d43ff0c18 730 {
mbed_official 146:f64d43ff0c18 731 return (sim_ptd7pad_strengh_t)BR_SIM_SOPT2_PTD7PAD;
mbed_official 146:f64d43ff0c18 732 }
mbed_official 146:f64d43ff0c18 733 #endif /* FSL_FEATURE_SIM_OPT_HAS_PTD7PAD */
mbed_official 146:f64d43ff0c18 734
mbed_official 146:f64d43ff0c18 735 #if FSL_FEATURE_SIM_OPT_HAS_FBSL
mbed_official 146:f64d43ff0c18 736 /*!
mbed_official 146:f64d43ff0c18 737 * @brief Sets the FlexBus security level setting.
mbed_official 146:f64d43ff0c18 738 *
mbed_official 146:f64d43ff0c18 739 * This function sets the FlexBus security level setting. If the security is enabled,
mbed_official 146:f64d43ff0c18 740 * this field affects which CPU operations can access the off-chip via the FlexBus
mbed_official 146:f64d43ff0c18 741 * and DDR controller interfaces. This field has no effect if the security is not enabled.
mbed_official 146:f64d43ff0c18 742 *
mbed_official 146:f64d43ff0c18 743 * @param setting FlexBus security level setting
mbed_official 146:f64d43ff0c18 744 * - 00: All off-chip accesses (op code and data) via the FlexBus and
mbed_official 146:f64d43ff0c18 745 * DDR controller are disallowed.
mbed_official 146:f64d43ff0c18 746 * - 10: Off-chip op code accesses are disallowed. Data accesses are
mbed_official 146:f64d43ff0c18 747 * allowed.
mbed_official 146:f64d43ff0c18 748 * - 11: Off-chip op code accesses and data accesses are allowed.
mbed_official 146:f64d43ff0c18 749 */
mbed_official 146:f64d43ff0c18 750 static inline void sim_set_fbsl(sim_flexbus_security_level_t setting)
mbed_official 146:f64d43ff0c18 751 {
mbed_official 146:f64d43ff0c18 752 BW_SIM_SOPT2_FBSL(setting);
mbed_official 146:f64d43ff0c18 753 }
mbed_official 146:f64d43ff0c18 754
mbed_official 146:f64d43ff0c18 755 /*!
mbed_official 146:f64d43ff0c18 756 * @brief Gets the FlexBus security level setting.
mbed_official 146:f64d43ff0c18 757 *
mbed_official 146:f64d43ff0c18 758 * This function gets the FlexBus security level setting.
mbed_official 146:f64d43ff0c18 759 *
mbed_official 146:f64d43ff0c18 760 * @return setting FlexBus security level setting
mbed_official 146:f64d43ff0c18 761 */
mbed_official 146:f64d43ff0c18 762 static inline sim_flexbus_security_level_t sim_get_fbsl(void)
mbed_official 146:f64d43ff0c18 763 {
mbed_official 146:f64d43ff0c18 764 return (sim_flexbus_security_level_t)BR_SIM_SOPT2_FBSL;
mbed_official 146:f64d43ff0c18 765 }
mbed_official 146:f64d43ff0c18 766 #endif /* FSL_FEATURE_SIM_OPT_HAS_FBSL */
mbed_official 146:f64d43ff0c18 767
mbed_official 146:f64d43ff0c18 768 #if FSL_FEATURE_SIM_OPT_HAS_PCR
mbed_official 146:f64d43ff0c18 769 /*!
mbed_official 146:f64d43ff0c18 770 * @brief Sets the PCR setting.
mbed_official 146:f64d43ff0c18 771 *
mbed_official 146:f64d43ff0c18 772 * This function sets the PCR setting. This is the FlexBus hold cycles before
mbed_official 146:f64d43ff0c18 773 * FlexBus can release bus to NFC or to IDLE.
mbed_official 146:f64d43ff0c18 774 *
mbed_official 146:f64d43ff0c18 775 * @param setting PCR setting
mbed_official 146:f64d43ff0c18 776 */
mbed_official 146:f64d43ff0c18 777 static inline void sim_set_pcr(uint32_t setting)
mbed_official 146:f64d43ff0c18 778 {
mbed_official 146:f64d43ff0c18 779 BW_SIM_SOPT6_PCR(setting);
mbed_official 146:f64d43ff0c18 780 }
mbed_official 146:f64d43ff0c18 781
mbed_official 146:f64d43ff0c18 782 /*!
mbed_official 146:f64d43ff0c18 783 * @brief Gets the PCR setting.
mbed_official 146:f64d43ff0c18 784 *
mbed_official 146:f64d43ff0c18 785 * This function gets the PCR setting.
mbed_official 146:f64d43ff0c18 786 *
mbed_official 146:f64d43ff0c18 787 * @return setting PCR setting
mbed_official 146:f64d43ff0c18 788 */
mbed_official 146:f64d43ff0c18 789 static inline uint32_t sim_get_pcr(void)
mbed_official 146:f64d43ff0c18 790 {
mbed_official 146:f64d43ff0c18 791 return BR_SIM_SOPT6_PCR;
mbed_official 146:f64d43ff0c18 792 }
mbed_official 146:f64d43ff0c18 793 #endif /* FSL_FEATURE_SIM_OPT_HAS_PCR */
mbed_official 146:f64d43ff0c18 794
mbed_official 146:f64d43ff0c18 795 #if FSL_FEATURE_SIM_OPT_HAS_MCC
mbed_official 146:f64d43ff0c18 796 /*!
mbed_official 146:f64d43ff0c18 797 * @brief Sets the MCC setting.
mbed_official 146:f64d43ff0c18 798 *
mbed_official 146:f64d43ff0c18 799 * This function sets the MCC setting. This is the NFC hold cycle in case the
mbed_official 146:f64d43ff0c18 800 * FlexBus request during NFC is granted.
mbed_official 146:f64d43ff0c18 801 *
mbed_official 146:f64d43ff0c18 802 * @param setting MCC setting
mbed_official 146:f64d43ff0c18 803 */
mbed_official 146:f64d43ff0c18 804 static inline void sim_set_mcc(uint32_t setting)
mbed_official 146:f64d43ff0c18 805 {
mbed_official 146:f64d43ff0c18 806 BW_SIM_SOPT6_MCC(setting);
mbed_official 146:f64d43ff0c18 807 }
mbed_official 146:f64d43ff0c18 808
mbed_official 146:f64d43ff0c18 809 /*!
mbed_official 146:f64d43ff0c18 810 * @brief Gets the MCC setting.
mbed_official 146:f64d43ff0c18 811 *
mbed_official 146:f64d43ff0c18 812 * This function gets the MCC setting.
mbed_official 146:f64d43ff0c18 813 *
mbed_official 146:f64d43ff0c18 814 * @return setting MCC setting
mbed_official 146:f64d43ff0c18 815 */
mbed_official 146:f64d43ff0c18 816 static inline uint32_t sim_get_mcc(void)
mbed_official 146:f64d43ff0c18 817 {
mbed_official 146:f64d43ff0c18 818 return BR_SIM_SOPT6_MCC;
mbed_official 146:f64d43ff0c18 819 }
mbed_official 146:f64d43ff0c18 820 #endif /* FSL_FEATURE_SIM_OPT_HAS_MCC */
mbed_official 146:f64d43ff0c18 821
mbed_official 146:f64d43ff0c18 822 /*!
mbed_official 146:f64d43ff0c18 823 * @brief Sets the ADCx alternate trigger enable setting.
mbed_official 146:f64d43ff0c18 824 *
mbed_official 146:f64d43ff0c18 825 * This function enables/disables the alternative conversion triggers for ADCx.
mbed_official 146:f64d43ff0c18 826 *
mbed_official 146:f64d43ff0c18 827 * @param enable Enable alternative conversion triggers for ADCx
mbed_official 146:f64d43ff0c18 828 * - true: Select alternative conversion trigger.
mbed_official 146:f64d43ff0c18 829 * - false: Select PDB trigger.
mbed_official 146:f64d43ff0c18 830 */
mbed_official 146:f64d43ff0c18 831 void sim_set_alttrgen(uint8_t instance, bool enable);
mbed_official 146:f64d43ff0c18 832
mbed_official 146:f64d43ff0c18 833 /*!
mbed_official 146:f64d43ff0c18 834 * @brief Gets the ADCx alternate trigger enable setting.
mbed_official 146:f64d43ff0c18 835 *
mbed_official 146:f64d43ff0c18 836 * This function gets the ADCx alternate trigger enable setting.
mbed_official 146:f64d43ff0c18 837 *
mbed_official 146:f64d43ff0c18 838 * @return enabled True if ADCx alternate trigger is enabled
mbed_official 146:f64d43ff0c18 839 */
mbed_official 146:f64d43ff0c18 840 bool sim_get_alttrgen(uint8_t instance);
mbed_official 146:f64d43ff0c18 841
mbed_official 146:f64d43ff0c18 842 /*!
mbed_official 146:f64d43ff0c18 843 * @brief Sets the ADCx pre-trigger select setting.
mbed_official 146:f64d43ff0c18 844 *
mbed_official 146:f64d43ff0c18 845 * This function selects the ADCx pre-trigger source when the alternative triggers
mbed_official 146:f64d43ff0c18 846 * are enabled through ADCxALTTRGEN.
mbed_official 146:f64d43ff0c18 847 *
mbed_official 146:f64d43ff0c18 848 * @param select pre-trigger select setting for ADCx
mbed_official 146:f64d43ff0c18 849 * - 0: Pre-trigger A selected for ADCx.
mbed_official 146:f64d43ff0c18 850 * - 1: Pre-trigger B selected for ADCx.
mbed_official 146:f64d43ff0c18 851 */
mbed_official 146:f64d43ff0c18 852 void sim_set_pretrgsel(uint8_t instance, sim_pretrgsel_t select);
mbed_official 146:f64d43ff0c18 853
mbed_official 146:f64d43ff0c18 854 /*!
mbed_official 146:f64d43ff0c18 855 * @brief Gets the ADCx pre-trigger select setting.
mbed_official 146:f64d43ff0c18 856 *
mbed_official 146:f64d43ff0c18 857 * This function gets the ADCx pre-trigger select setting.
mbed_official 146:f64d43ff0c18 858 *
mbed_official 146:f64d43ff0c18 859 * @return select ADCx pre-trigger select setting
mbed_official 146:f64d43ff0c18 860 */
mbed_official 146:f64d43ff0c18 861 sim_pretrgsel_t sim_get_pretrgsel(uint8_t instance);
mbed_official 146:f64d43ff0c18 862
mbed_official 146:f64d43ff0c18 863 /*!
mbed_official 146:f64d43ff0c18 864 * @brief Sets the ADCx trigger select setting.
mbed_official 146:f64d43ff0c18 865 *
mbed_official 146:f64d43ff0c18 866 * This function selects the ADCx trigger source when alternative triggers
mbed_official 146:f64d43ff0c18 867 * are enabled through ADCxALTTRGEN.
mbed_official 146:f64d43ff0c18 868 *
mbed_official 146:f64d43ff0c18 869 * @param select trigger select setting for ADCx
mbed_official 146:f64d43ff0c18 870 * - 0000: External trigger
mbed_official 146:f64d43ff0c18 871 * - 0001: High speed comparator 0 asynchronous interrupt
mbed_official 146:f64d43ff0c18 872 * - 0010: High speed comparator 1 asynchronous interrupt
mbed_official 146:f64d43ff0c18 873 * - 0011: High speed comparator 2 asynchronous interrupt
mbed_official 146:f64d43ff0c18 874 * - 0100: PIT trigger 0
mbed_official 146:f64d43ff0c18 875 * - 0101: PIT trigger 1
mbed_official 146:f64d43ff0c18 876 * - 0110: PIT trigger 2
mbed_official 146:f64d43ff0c18 877 * - 0111: PIT trigger 3
mbed_official 146:f64d43ff0c18 878 * - 1000: FTM0 trigger
mbed_official 146:f64d43ff0c18 879 * - 1001: FTM1 trigger
mbed_official 146:f64d43ff0c18 880 * - 1010: FTM2 trigger
mbed_official 146:f64d43ff0c18 881 * - 1011: FTM3 trigger
mbed_official 146:f64d43ff0c18 882 * - 1100: RTC alarm
mbed_official 146:f64d43ff0c18 883 * - 1101: RTC seconds
mbed_official 146:f64d43ff0c18 884 * - 1110: Low-power timer trigger
mbed_official 146:f64d43ff0c18 885 * - 1111: High speed comparator 3 asynchronous interrupt
mbed_official 146:f64d43ff0c18 886 */
mbed_official 146:f64d43ff0c18 887 void sim_set_trgsel(uint8_t instance, sim_trgsel_t select);
mbed_official 146:f64d43ff0c18 888
mbed_official 146:f64d43ff0c18 889 /*!
mbed_official 146:f64d43ff0c18 890 * @brief Gets the ADCx trigger select setting.
mbed_official 146:f64d43ff0c18 891 *
mbed_official 146:f64d43ff0c18 892 * This function gets the ADCx trigger select setting.
mbed_official 146:f64d43ff0c18 893 *
mbed_official 146:f64d43ff0c18 894 * @return select ADCx trigger select setting
mbed_official 146:f64d43ff0c18 895 */
mbed_official 146:f64d43ff0c18 896 sim_pretrgsel_t sims_get_trgsel(uint8_t instance);
mbed_official 146:f64d43ff0c18 897
mbed_official 146:f64d43ff0c18 898 /*!
mbed_official 146:f64d43ff0c18 899 * @brief Sets the UARTx receive data source select setting.
mbed_official 146:f64d43ff0c18 900 *
mbed_official 146:f64d43ff0c18 901 * This function selects the source for the UARTx receive data.
mbed_official 146:f64d43ff0c18 902 *
mbed_official 146:f64d43ff0c18 903 * @param select the source for the UARTx receive data
mbed_official 146:f64d43ff0c18 904 * - 00: UARTx_RX pin.
mbed_official 146:f64d43ff0c18 905 * - 01: CMP0.
mbed_official 146:f64d43ff0c18 906 * - 10: CMP1.
mbed_official 146:f64d43ff0c18 907 * - 11: Reserved.
mbed_official 146:f64d43ff0c18 908 */
mbed_official 146:f64d43ff0c18 909 void sim_set_uart_rxsrc(uint8_t instance, sim_uart_rxsrc_t select);
mbed_official 146:f64d43ff0c18 910
mbed_official 146:f64d43ff0c18 911 /*!
mbed_official 146:f64d43ff0c18 912 * @brief Gets the UARTx receive data source select setting.
mbed_official 146:f64d43ff0c18 913 *
mbed_official 146:f64d43ff0c18 914 * This function gets the UARTx receive data source select setting.
mbed_official 146:f64d43ff0c18 915 *
mbed_official 146:f64d43ff0c18 916 * @return select UARTx receive data source select setting
mbed_official 146:f64d43ff0c18 917 */
mbed_official 146:f64d43ff0c18 918 sim_uart_rxsrc_t sim_get_uart_rxsrc(uint8_t instance);
mbed_official 146:f64d43ff0c18 919
mbed_official 146:f64d43ff0c18 920 /*!
mbed_official 146:f64d43ff0c18 921 * @brief Sets the UARTx transmit data source select setting.
mbed_official 146:f64d43ff0c18 922 *
mbed_official 146:f64d43ff0c18 923 * This function selects the source for the UARTx transmit data.
mbed_official 146:f64d43ff0c18 924 *
mbed_official 146:f64d43ff0c18 925 * @param select the source for the UARTx transmit data
mbed_official 146:f64d43ff0c18 926 * - 00: UARTx_TX pin.
mbed_official 146:f64d43ff0c18 927 * - 01: UARTx_TX pin modulated with FTM1 channel 0 output.
mbed_official 146:f64d43ff0c18 928 * - 10: UARTx_TX pin modulated with FTM2 channel 0 output.
mbed_official 146:f64d43ff0c18 929 * - 11: Reserved.
mbed_official 146:f64d43ff0c18 930 */
mbed_official 146:f64d43ff0c18 931 void sim_set_uart_txsrc(uint8_t instance, sim_uart_txsrc_t select);
mbed_official 146:f64d43ff0c18 932
mbed_official 146:f64d43ff0c18 933 /*!
mbed_official 146:f64d43ff0c18 934 * @brief Gets the UARTx transmit data source select setting.
mbed_official 146:f64d43ff0c18 935 *
mbed_official 146:f64d43ff0c18 936 * This function gets the UARTx transmit data source select setting.
mbed_official 146:f64d43ff0c18 937 *
mbed_official 146:f64d43ff0c18 938 * @return select UARTx transmit data source select setting
mbed_official 146:f64d43ff0c18 939 */
mbed_official 146:f64d43ff0c18 940 sim_uart_txsrc_t sim_get_uart_txsrc(uint8_t instance);
mbed_official 146:f64d43ff0c18 941
mbed_official 146:f64d43ff0c18 942 #if FSL_FEATURE_SIM_OPT_HAS_ODE
mbed_official 146:f64d43ff0c18 943 /*!
mbed_official 146:f64d43ff0c18 944 * @brief Sets the UARTx Open Drain Enable setting.
mbed_official 146:f64d43ff0c18 945 *
mbed_official 146:f64d43ff0c18 946 * This function enables/disables the UARTx Open Drain.
mbed_official 146:f64d43ff0c18 947 *
mbed_official 146:f64d43ff0c18 948 * @param enable Enable/disable UARTx Open Drain
mbed_official 146:f64d43ff0c18 949 * - True: Enable UARTx Open Drain
mbed_official 146:f64d43ff0c18 950 * - False: Disable UARTx Open Drain
mbed_official 146:f64d43ff0c18 951 */
mbed_official 146:f64d43ff0c18 952 void sim_set_uart_ode(uint8_t instance, bool enable);
mbed_official 146:f64d43ff0c18 953
mbed_official 146:f64d43ff0c18 954 /*!
mbed_official 146:f64d43ff0c18 955 * @brief Gets the UARTx Open Drain Enable setting.
mbed_official 146:f64d43ff0c18 956 *
mbed_official 146:f64d43ff0c18 957 * This function gets the UARTx Open Drain Enable setting.
mbed_official 146:f64d43ff0c18 958 *
mbed_official 146:f64d43ff0c18 959 * @return enabled True if UARTx Open Drain is enabled.
mbed_official 146:f64d43ff0c18 960 */
mbed_official 146:f64d43ff0c18 961 bool sim_get_uart_ode(uint8_t instance);
mbed_official 146:f64d43ff0c18 962 #endif
mbed_official 146:f64d43ff0c18 963
mbed_official 146:f64d43ff0c18 964 #if FSL_FEATURE_SIM_OPT_HAS_FTM
mbed_official 146:f64d43ff0c18 965 /*!
mbed_official 146:f64d43ff0c18 966 * @brief Sets the FlexTimer x hardware trigger y source select setting.
mbed_official 146:f64d43ff0c18 967 *
mbed_official 146:f64d43ff0c18 968 * This function selects the source of FTMx hardware trigger y.
mbed_official 146:f64d43ff0c18 969 *
mbed_official 146:f64d43ff0c18 970 * @param select FlexTimer x hardware trigger y
mbed_official 146:f64d43ff0c18 971 * - 0: Pre-trigger A selected for ADCx.
mbed_official 146:f64d43ff0c18 972 * - 1: Pre-trigger B selected for ADCx.
mbed_official 146:f64d43ff0c18 973 */
mbed_official 146:f64d43ff0c18 974 void sim_set_ftm_trg_src(uint8_t instance, uint8_t trigger, sim_ftm_trg_src_t select);
mbed_official 146:f64d43ff0c18 975
mbed_official 146:f64d43ff0c18 976 /*!
mbed_official 146:f64d43ff0c18 977 * @brief Gets the FlexTimer x hardware trigger y source select setting.
mbed_official 146:f64d43ff0c18 978 *
mbed_official 146:f64d43ff0c18 979 * This function gets the FlexTimer x hardware trigger y source select setting.
mbed_official 146:f64d43ff0c18 980 *
mbed_official 146:f64d43ff0c18 981 * @return select FlexTimer x hardware trigger y source select setting
mbed_official 146:f64d43ff0c18 982 */
mbed_official 146:f64d43ff0c18 983 sim_ftm_trg_src_t sim_get_ftm_trg_src(uint8_t instance, uint8_t trigger);
mbed_official 146:f64d43ff0c18 984
mbed_official 146:f64d43ff0c18 985 /*!
mbed_official 146:f64d43ff0c18 986 * @brief Sets the FlexTimer x external clock pin select setting.
mbed_official 146:f64d43ff0c18 987 *
mbed_official 146:f64d43ff0c18 988 * This function selects the source of FTMx external clock pin select.
mbed_official 146:f64d43ff0c18 989 *
mbed_official 146:f64d43ff0c18 990 * @param select FTMx external clock pin select
mbed_official 146:f64d43ff0c18 991 * - 0: FTMx external clock driven by FTM CLKIN0 pin.
mbed_official 146:f64d43ff0c18 992 * - 1: FTMx external clock driven by FTM CLKIN1 pin.
mbed_official 146:f64d43ff0c18 993 */
mbed_official 146:f64d43ff0c18 994 void sim_set_ftm_clk_sel(uint8_t instance, sim_ftm_clk_sel_t select);
mbed_official 146:f64d43ff0c18 995
mbed_official 146:f64d43ff0c18 996 /*!
mbed_official 146:f64d43ff0c18 997 * @brief Gets the FlexTimer x external clock pin select setting.
mbed_official 146:f64d43ff0c18 998 *
mbed_official 146:f64d43ff0c18 999 * This function gets the FlexTimer x external clock pin select setting.
mbed_official 146:f64d43ff0c18 1000 *
mbed_official 146:f64d43ff0c18 1001 * @return select FlexTimer x external clock pin select setting
mbed_official 146:f64d43ff0c18 1002 */
mbed_official 146:f64d43ff0c18 1003 sim_ftm_clk_sel_t sim_get_ftm_clk_sel(uint8_t instance);
mbed_official 146:f64d43ff0c18 1004
mbed_official 146:f64d43ff0c18 1005 /*!
mbed_official 146:f64d43ff0c18 1006 * @brief Sets the FlexTimer x channel y input capture source select setting.
mbed_official 146:f64d43ff0c18 1007 *
mbed_official 146:f64d43ff0c18 1008 * This function selects the FlexTimer x channel y input capture source.
mbed_official 146:f64d43ff0c18 1009 *
mbed_official 146:f64d43ff0c18 1010 * @param select FlexTimer x channel y input capture source
mbed_official 146:f64d43ff0c18 1011 * See the reference manual for detailed definition for each channel and selection.
mbed_official 146:f64d43ff0c18 1012 */
mbed_official 146:f64d43ff0c18 1013 void sim_set_ftm_ch_src(uint8_t instance, uint8_t channel, sim_ftm_ch_src_t select);
mbed_official 146:f64d43ff0c18 1014
mbed_official 146:f64d43ff0c18 1015 /*!
mbed_official 146:f64d43ff0c18 1016 * @brief Gets the FlexTimer x channel y input capture source select setting.
mbed_official 146:f64d43ff0c18 1017 *
mbed_official 146:f64d43ff0c18 1018 * This function gets the FlexTimer x channel y input capture source select setting.
mbed_official 146:f64d43ff0c18 1019 *
mbed_official 146:f64d43ff0c18 1020 * @return select FlexTimer x channel y input capture source select setting
mbed_official 146:f64d43ff0c18 1021 */
mbed_official 146:f64d43ff0c18 1022 sim_ftm_ch_src_t sim_get_ftm_ch_src(uint8_t instance, uint8_t channel);
mbed_official 146:f64d43ff0c18 1023
mbed_official 146:f64d43ff0c18 1024 /*!
mbed_official 146:f64d43ff0c18 1025 * @brief Sets the FlexTimer x fault y select setting.
mbed_official 146:f64d43ff0c18 1026 *
mbed_official 146:f64d43ff0c18 1027 * This function sets the FlexTimer x fault y select setting.
mbed_official 146:f64d43ff0c18 1028 *
mbed_official 146:f64d43ff0c18 1029 * @param select FlexTimer x fault y select setting
mbed_official 146:f64d43ff0c18 1030 * - 0: FlexTimer x fault y select 0.
mbed_official 146:f64d43ff0c18 1031 * - 1: FlexTimer x fault y select 1.
mbed_official 146:f64d43ff0c18 1032 */
mbed_official 146:f64d43ff0c18 1033 void sim_set_ftm_flt_sel(uint8_t instance, uint8_t fault, sim_ftm_flt_sel_t select);
mbed_official 146:f64d43ff0c18 1034
mbed_official 146:f64d43ff0c18 1035 /*!
mbed_official 146:f64d43ff0c18 1036 * @brief Gets the FlexTimer x fault y select setting.
mbed_official 146:f64d43ff0c18 1037 *
mbed_official 146:f64d43ff0c18 1038 * This function gets the FlexTimer x fault y select setting.
mbed_official 146:f64d43ff0c18 1039 *
mbed_official 146:f64d43ff0c18 1040 * @return select FlexTimer x fault y select setting
mbed_official 146:f64d43ff0c18 1041 */
mbed_official 146:f64d43ff0c18 1042 sim_ftm_flt_sel_t sim_get_ftm_flt_sel(uint8_t instance, uint8_t fault);
mbed_official 146:f64d43ff0c18 1043 #endif
mbed_official 146:f64d43ff0c18 1044
mbed_official 146:f64d43ff0c18 1045 #if FSL_FEATURE_SIM_OPT_HAS_TPM
mbed_official 146:f64d43ff0c18 1046 /*!
mbed_official 146:f64d43ff0c18 1047 * @brief Sets the Timer/PWM x external clock pin select setting.
mbed_official 146:f64d43ff0c18 1048 *
mbed_official 146:f64d43ff0c18 1049 * This function selects the source of the Timer/PWM x external clock pin select.
mbed_official 146:f64d43ff0c18 1050 *
mbed_official 146:f64d43ff0c18 1051 * @param select Timer/PWM x external clock pin select
mbed_official 146:f64d43ff0c18 1052 * - 0: Timer/PWM x external clock driven by the TPM_CLKIN0 pin.
mbed_official 146:f64d43ff0c18 1053 * - 1: Timer/PWM x external clock driven by the TPM_CLKIN1 pin.
mbed_official 146:f64d43ff0c18 1054 */
mbed_official 146:f64d43ff0c18 1055 void sim_set_tpm_clk_sel(uint8_t instance, sim_tpm_clk_sel_t select);
mbed_official 146:f64d43ff0c18 1056
mbed_official 146:f64d43ff0c18 1057 /*!
mbed_official 146:f64d43ff0c18 1058 * @brief Gets the Timer/PWM x external clock pin select setting.
mbed_official 146:f64d43ff0c18 1059 *
mbed_official 146:f64d43ff0c18 1060 * This function gets the Timer/PWM x external clock pin select setting.
mbed_official 146:f64d43ff0c18 1061 *
mbed_official 146:f64d43ff0c18 1062 * @return select Timer/PWM x external clock pin select setting
mbed_official 146:f64d43ff0c18 1063 */
mbed_official 146:f64d43ff0c18 1064 sim_tpm_clk_sel_t sim_get_tpm_clk_sel(uint8_t instance);
mbed_official 146:f64d43ff0c18 1065
mbed_official 146:f64d43ff0c18 1066 /*!
mbed_official 146:f64d43ff0c18 1067 * @brief Sets the Timer/PWM x channel y input capture source select setting.
mbed_official 146:f64d43ff0c18 1068 *
mbed_official 146:f64d43ff0c18 1069 * This function selects the Timer/PWM x channel y input capture source.
mbed_official 146:f64d43ff0c18 1070 *
mbed_official 146:f64d43ff0c18 1071 * @param select Timer/PWM x channel y input capture source
mbed_official 146:f64d43ff0c18 1072 * - 0: TPMx_CH0 signal
mbed_official 146:f64d43ff0c18 1073 * - 1: CMP0 output
mbed_official 146:f64d43ff0c18 1074 */
mbed_official 146:f64d43ff0c18 1075 void sim_set_tpm_ch_src(uint8_t instance, uint8_t channel, sim_tpm_ch_src_t select);
mbed_official 146:f64d43ff0c18 1076
mbed_official 146:f64d43ff0c18 1077 /*!
mbed_official 146:f64d43ff0c18 1078 * @brief Gets the Timer/PWM x channel y input capture source select setting.
mbed_official 146:f64d43ff0c18 1079 *
mbed_official 146:f64d43ff0c18 1080 * This function gets the Timer/PWM x channel y input capture source select setting.
mbed_official 146:f64d43ff0c18 1081 *
mbed_official 146:f64d43ff0c18 1082 * @return select Timer/PWM x channel y input capture source select setting
mbed_official 146:f64d43ff0c18 1083 */
mbed_official 146:f64d43ff0c18 1084 sim_tpm_ch_src_t sim_get_tpm_ch_src(uint8_t instance, uint8_t channel);
mbed_official 146:f64d43ff0c18 1085 #endif
mbed_official 146:f64d43ff0c18 1086
mbed_official 146:f64d43ff0c18 1087 #if FSL_FEATURE_SIM_SDID_HAS_FAMILYID
mbed_official 146:f64d43ff0c18 1088 /*!
mbed_official 146:f64d43ff0c18 1089 * @brief Gets the Kinetis Family ID in the System Device ID register (SIM_SDID).
mbed_official 146:f64d43ff0c18 1090 *
mbed_official 146:f64d43ff0c18 1091 * This function gets the Kinetis Family ID in the System Device ID register.
mbed_official 146:f64d43ff0c18 1092 *
mbed_official 146:f64d43ff0c18 1093 * @return id Kinetis Family ID
mbed_official 146:f64d43ff0c18 1094 */
mbed_official 146:f64d43ff0c18 1095 static inline uint32_t sim_get_family_id(void)
mbed_official 146:f64d43ff0c18 1096 {
mbed_official 146:f64d43ff0c18 1097 return BR_SIM_SDID_FAMILYID;
mbed_official 146:f64d43ff0c18 1098 }
mbed_official 146:f64d43ff0c18 1099 #endif
mbed_official 146:f64d43ff0c18 1100
mbed_official 146:f64d43ff0c18 1101 #if FSL_FEATURE_SIM_SDID_HAS_SUBFAMID
mbed_official 146:f64d43ff0c18 1102 /*!
mbed_official 146:f64d43ff0c18 1103 * @brief Gets the Kinetis Sub-Family ID in the System Device ID register (SIM_SDID).
mbed_official 146:f64d43ff0c18 1104 *
mbed_official 146:f64d43ff0c18 1105 * This function gets the Kinetis Sub-Family ID in System Device ID register.
mbed_official 146:f64d43ff0c18 1106 *
mbed_official 146:f64d43ff0c18 1107 * @return id Kinetis Sub-Family ID
mbed_official 146:f64d43ff0c18 1108 */
mbed_official 146:f64d43ff0c18 1109 static inline uint32_t sim_get_subfam_id(void)
mbed_official 146:f64d43ff0c18 1110 {
mbed_official 146:f64d43ff0c18 1111 return BR_SIM_SDID_SUBFAMID;
mbed_official 146:f64d43ff0c18 1112 }
mbed_official 146:f64d43ff0c18 1113 #endif
mbed_official 146:f64d43ff0c18 1114
mbed_official 146:f64d43ff0c18 1115 #if FSL_FEATURE_SIM_SDID_HAS_SERIESID
mbed_official 146:f64d43ff0c18 1116 /*!
mbed_official 146:f64d43ff0c18 1117 * @brief Gets the Kinetis SeriesID in the System Device ID register (SIM_SDID).
mbed_official 146:f64d43ff0c18 1118 *
mbed_official 146:f64d43ff0c18 1119 * This function gets the Kinetis Series ID in System Device ID register.
mbed_official 146:f64d43ff0c18 1120 *
mbed_official 146:f64d43ff0c18 1121 * @return id Kinetis Series ID
mbed_official 146:f64d43ff0c18 1122 */
mbed_official 146:f64d43ff0c18 1123 static inline uint32_t sim_get_series_id(void)
mbed_official 146:f64d43ff0c18 1124 {
mbed_official 146:f64d43ff0c18 1125 return BR_SIM_SDID_SERIESID;
mbed_official 146:f64d43ff0c18 1126 }
mbed_official 146:f64d43ff0c18 1127 #endif
mbed_official 146:f64d43ff0c18 1128
mbed_official 146:f64d43ff0c18 1129 /*!
mbed_official 146:f64d43ff0c18 1130 * @brief Gets the Kinetis Fam ID in System Device ID register (SIM_SDID).
mbed_official 146:f64d43ff0c18 1131 *
mbed_official 146:f64d43ff0c18 1132 * This function gets the Kinetis Fam ID in System Device ID register.
mbed_official 146:f64d43ff0c18 1133 *
mbed_official 146:f64d43ff0c18 1134 * @return id Kinetis Fam ID
mbed_official 146:f64d43ff0c18 1135 */
mbed_official 146:f64d43ff0c18 1136 static inline uint32_t sim_get_fam_id(void)
mbed_official 146:f64d43ff0c18 1137 {
mbed_official 146:f64d43ff0c18 1138 return BR_SIM_SDID_FAMID;
mbed_official 146:f64d43ff0c18 1139 }
mbed_official 146:f64d43ff0c18 1140
mbed_official 146:f64d43ff0c18 1141 /*!
mbed_official 146:f64d43ff0c18 1142 * @brief Gets the Kinetis Pincount ID in System Device ID register (SIM_SDID).
mbed_official 146:f64d43ff0c18 1143 *
mbed_official 146:f64d43ff0c18 1144 * This function gets the Kinetis Pincount ID in System Device ID register.
mbed_official 146:f64d43ff0c18 1145 *
mbed_official 146:f64d43ff0c18 1146 * @return id Kinetis Pincount ID
mbed_official 146:f64d43ff0c18 1147 */
mbed_official 146:f64d43ff0c18 1148 static inline uint32_t sim_get_pin_id(void)
mbed_official 146:f64d43ff0c18 1149 {
mbed_official 146:f64d43ff0c18 1150 return BR_SIM_SDID_PINID;
mbed_official 146:f64d43ff0c18 1151 }
mbed_official 146:f64d43ff0c18 1152
mbed_official 146:f64d43ff0c18 1153 /*!
mbed_official 146:f64d43ff0c18 1154 * @brief Gets the Kinetis Revision ID in the System Device ID register (SIM_SDID).
mbed_official 146:f64d43ff0c18 1155 *
mbed_official 146:f64d43ff0c18 1156 * This function gets the Kinetis Revision ID in System Device ID register.
mbed_official 146:f64d43ff0c18 1157 *
mbed_official 146:f64d43ff0c18 1158 * @return id Kinetis Revision ID
mbed_official 146:f64d43ff0c18 1159 */
mbed_official 146:f64d43ff0c18 1160 static inline uint32_t sim_get_rev_id(void)
mbed_official 146:f64d43ff0c18 1161 {
mbed_official 146:f64d43ff0c18 1162 return BR_SIM_SDID_REVID;
mbed_official 146:f64d43ff0c18 1163 }
mbed_official 146:f64d43ff0c18 1164
mbed_official 146:f64d43ff0c18 1165 #if FSL_FEATURE_SIM_SDID_HAS_DIEID
mbed_official 146:f64d43ff0c18 1166 /*!
mbed_official 146:f64d43ff0c18 1167 * @brief Gets the Kinetis Die ID in the System Device ID register (SIM_SDID).
mbed_official 146:f64d43ff0c18 1168 *
mbed_official 146:f64d43ff0c18 1169 * This function gets the Kinetis Die ID in System Device ID register.
mbed_official 146:f64d43ff0c18 1170 *
mbed_official 146:f64d43ff0c18 1171 * @return id Kinetis Die ID
mbed_official 146:f64d43ff0c18 1172 */
mbed_official 146:f64d43ff0c18 1173 static inline uint32_t sim_get_die_id(void)
mbed_official 146:f64d43ff0c18 1174 {
mbed_official 146:f64d43ff0c18 1175 return BR_SIM_SDID_DIEID;
mbed_official 146:f64d43ff0c18 1176 }
mbed_official 146:f64d43ff0c18 1177 #endif
mbed_official 146:f64d43ff0c18 1178
mbed_official 146:f64d43ff0c18 1179 #if FSL_FEATURE_SIM_SDID_HAS_SRAMSIZE
mbed_official 146:f64d43ff0c18 1180 /*!
mbed_official 146:f64d43ff0c18 1181 * @brief Gets the Kinetis SRAM size in the System Device ID register (SIM_SDID).
mbed_official 146:f64d43ff0c18 1182 *
mbed_official 146:f64d43ff0c18 1183 * This function gets the Kinetis SRAM Size in System Device ID register.
mbed_official 146:f64d43ff0c18 1184 *
mbed_official 146:f64d43ff0c18 1185 * @return id Kinetis SRAM Size
mbed_official 146:f64d43ff0c18 1186 */
mbed_official 146:f64d43ff0c18 1187 static inline uint32_t sim_get_sram_size(void)
mbed_official 146:f64d43ff0c18 1188 {
mbed_official 146:f64d43ff0c18 1189 return BR_SIM_SDID_SRAMSIZE;
mbed_official 146:f64d43ff0c18 1190 }
mbed_official 146:f64d43ff0c18 1191 #endif
mbed_official 146:f64d43ff0c18 1192
mbed_official 146:f64d43ff0c18 1193 #if FSL_FEATURE_SIM_FCFG_HAS_NVMSIZE
mbed_official 146:f64d43ff0c18 1194 /*!
mbed_official 146:f64d43ff0c18 1195 * @brief Gets the FlexNVM size in the Flash Configuration Register 1 (SIM_FCFG).
mbed_official 146:f64d43ff0c18 1196 *
mbed_official 146:f64d43ff0c18 1197 * This function gets the FlexNVM size in the Flash Configuration Register 1.
mbed_official 146:f64d43ff0c18 1198 *
mbed_official 146:f64d43ff0c18 1199 * @return size FlexNVM Size
mbed_official 146:f64d43ff0c18 1200 */
mbed_official 146:f64d43ff0c18 1201 static inline uint32_t sim_get_nvm_size(void)
mbed_official 146:f64d43ff0c18 1202 {
mbed_official 146:f64d43ff0c18 1203 return BR_SIM_FCFG1_NVMSIZE;
mbed_official 146:f64d43ff0c18 1204 }
mbed_official 146:f64d43ff0c18 1205 #endif
mbed_official 146:f64d43ff0c18 1206
mbed_official 146:f64d43ff0c18 1207 /*!
mbed_official 146:f64d43ff0c18 1208 * @brief Gets the program flash size in the Flash Configuration Register 1 (SIM_FCFG).
mbed_official 146:f64d43ff0c18 1209 *
mbed_official 146:f64d43ff0c18 1210 * This function gets the program flash size in the Flash Configuration Register 1.
mbed_official 146:f64d43ff0c18 1211 *
mbed_official 146:f64d43ff0c18 1212 * @return size Program flash Size
mbed_official 146:f64d43ff0c18 1213 */
mbed_official 146:f64d43ff0c18 1214 static inline uint32_t sim_get_pf_size(void)
mbed_official 146:f64d43ff0c18 1215 {
mbed_official 146:f64d43ff0c18 1216 return BR_SIM_FCFG1_PFSIZE;
mbed_official 146:f64d43ff0c18 1217 }
mbed_official 146:f64d43ff0c18 1218
mbed_official 146:f64d43ff0c18 1219 #if FSL_FEATURE_SIM_FCFG_HAS_EESIZE
mbed_official 146:f64d43ff0c18 1220 /*!
mbed_official 146:f64d43ff0c18 1221 * @brief Gets the EEProm size in the Flash Configuration Register 1 (SIM_FCFG).
mbed_official 146:f64d43ff0c18 1222 *
mbed_official 146:f64d43ff0c18 1223 * This function gets the EEProm size in the Flash Configuration Register 1.
mbed_official 146:f64d43ff0c18 1224 *
mbed_official 146:f64d43ff0c18 1225 * @return size EEProm Size
mbed_official 146:f64d43ff0c18 1226 */
mbed_official 146:f64d43ff0c18 1227 static inline uint32_t sim_get_eeprom_size(void)
mbed_official 146:f64d43ff0c18 1228 {
mbed_official 146:f64d43ff0c18 1229 return BR_SIM_FCFG1_EESIZE;
mbed_official 146:f64d43ff0c18 1230 }
mbed_official 146:f64d43ff0c18 1231 #endif
mbed_official 146:f64d43ff0c18 1232
mbed_official 146:f64d43ff0c18 1233 #if FSL_FEATURE_SIM_FCFG_HAS_DEPART
mbed_official 146:f64d43ff0c18 1234 /*!
mbed_official 146:f64d43ff0c18 1235 * @brief Gets the FlexNVM partition in the Flash Configuration Register 1 (SIM_FCFG).
mbed_official 146:f64d43ff0c18 1236 *
mbed_official 146:f64d43ff0c18 1237 * This function gets the FlexNVM partition in the Flash Configuration Register 1
mbed_official 146:f64d43ff0c18 1238 *
mbed_official 146:f64d43ff0c18 1239 * @return setting FlexNVM partition setting
mbed_official 146:f64d43ff0c18 1240 */
mbed_official 146:f64d43ff0c18 1241 static inline uint32_t sim_get_depart(void)
mbed_official 146:f64d43ff0c18 1242 {
mbed_official 146:f64d43ff0c18 1243 return BR_SIM_FCFG1_DEPART;
mbed_official 146:f64d43ff0c18 1244 }
mbed_official 146:f64d43ff0c18 1245 #endif
mbed_official 146:f64d43ff0c18 1246
mbed_official 146:f64d43ff0c18 1247 #if FSL_FEATURE_SIM_FCFG_HAS_FLASHDOZE
mbed_official 146:f64d43ff0c18 1248 /*!
mbed_official 146:f64d43ff0c18 1249 * @brief Sets the Flash Doze in the Flash Configuration Register 1 (SIM_FCFG).
mbed_official 146:f64d43ff0c18 1250 *
mbed_official 146:f64d43ff0c18 1251 * This function sets the Flash Doze in the Flash Configuration Register 1.
mbed_official 146:f64d43ff0c18 1252 *
mbed_official 146:f64d43ff0c18 1253 * @param setting Flash Doze setting
mbed_official 146:f64d43ff0c18 1254 */
mbed_official 146:f64d43ff0c18 1255 static inline void sim_set_flashdoze(uint32_t setting)
mbed_official 146:f64d43ff0c18 1256 {
mbed_official 146:f64d43ff0c18 1257 BW_SIM_FCFG1_FLASHDOZE(setting);
mbed_official 146:f64d43ff0c18 1258 }
mbed_official 146:f64d43ff0c18 1259
mbed_official 146:f64d43ff0c18 1260 /*!
mbed_official 146:f64d43ff0c18 1261 * @brief Gets the Flash Doze in the Flash Configuration Register 1 (SIM_FCFG).
mbed_official 146:f64d43ff0c18 1262 *
mbed_official 146:f64d43ff0c18 1263 * This function gets the Flash Doze in the Flash Configuration Register 1.
mbed_official 146:f64d43ff0c18 1264 *
mbed_official 146:f64d43ff0c18 1265 * @return setting Flash Doze setting
mbed_official 146:f64d43ff0c18 1266 */
mbed_official 146:f64d43ff0c18 1267 static inline uint32_t sim_get_flashdoze(void)
mbed_official 146:f64d43ff0c18 1268 {
mbed_official 146:f64d43ff0c18 1269 return BR_SIM_FCFG1_FLASHDOZE;
mbed_official 146:f64d43ff0c18 1270 }
mbed_official 146:f64d43ff0c18 1271 #endif
mbed_official 146:f64d43ff0c18 1272
mbed_official 146:f64d43ff0c18 1273 #if FSL_FEATURE_SIM_FCFG_HAS_FLASHDIS
mbed_official 146:f64d43ff0c18 1274 /*!
mbed_official 146:f64d43ff0c18 1275 * @brief Sets the Flash disable setting in the Flash Configuration Register 1 (SIM_FCFG).
mbed_official 146:f64d43ff0c18 1276 *
mbed_official 146:f64d43ff0c18 1277 * This function sets the Flash disable setting in the Flash Configuration Register 1.
mbed_official 146:f64d43ff0c18 1278 *
mbed_official 146:f64d43ff0c18 1279 * @param setting Flash disable setting
mbed_official 146:f64d43ff0c18 1280 */
mbed_official 146:f64d43ff0c18 1281 static inline void sim_set_flashdis(uint32_t setting)
mbed_official 146:f64d43ff0c18 1282 {
mbed_official 146:f64d43ff0c18 1283 BW_SIM_FCFG1_FLASHDIS(setting);
mbed_official 146:f64d43ff0c18 1284 }
mbed_official 146:f64d43ff0c18 1285
mbed_official 146:f64d43ff0c18 1286 /*!
mbed_official 146:f64d43ff0c18 1287 * @brief Gets the Flash disable setting in the Flash Configuration Register 1 (SIM_FCFG).
mbed_official 146:f64d43ff0c18 1288 *
mbed_official 146:f64d43ff0c18 1289 * This function gets the Flash disable setting in the Flash Configuration Register 1.
mbed_official 146:f64d43ff0c18 1290 *
mbed_official 146:f64d43ff0c18 1291 * @return setting Flash disable setting
mbed_official 146:f64d43ff0c18 1292 */
mbed_official 146:f64d43ff0c18 1293 static inline uint32_t sim_get_flashdis(void)
mbed_official 146:f64d43ff0c18 1294 {
mbed_official 146:f64d43ff0c18 1295 return BR_SIM_FCFG1_FLASHDIS;
mbed_official 146:f64d43ff0c18 1296 }
mbed_official 146:f64d43ff0c18 1297 #endif
mbed_official 146:f64d43ff0c18 1298
mbed_official 146:f64d43ff0c18 1299 #if FSL_FEATURE_SIM_FCFG_HAS_MAXADDR0
mbed_official 146:f64d43ff0c18 1300 /*!
mbed_official 146:f64d43ff0c18 1301 * @brief Gets the Flash maximum address block 0 in the Flash Configuration Register 1 (SIM_FCFG).
mbed_official 146:f64d43ff0c18 1302 *
mbed_official 146:f64d43ff0c18 1303 * This function gets the Flash maximum block 0 in Flash Configuration Register 2.
mbed_official 146:f64d43ff0c18 1304 *
mbed_official 146:f64d43ff0c18 1305 * @return address Flash maximum block 0 address
mbed_official 146:f64d43ff0c18 1306 */
mbed_official 146:f64d43ff0c18 1307 static inline uint32_t sim_get_maxaddr0(void)
mbed_official 146:f64d43ff0c18 1308 {
mbed_official 146:f64d43ff0c18 1309 return BR_SIM_FCFG2_MAXADDR0;
mbed_official 146:f64d43ff0c18 1310 }
mbed_official 146:f64d43ff0c18 1311 #endif
mbed_official 146:f64d43ff0c18 1312
mbed_official 146:f64d43ff0c18 1313 #if FSL_FEATURE_SIM_FCFG_HAS_MAXADDR1
mbed_official 146:f64d43ff0c18 1314 /*!
mbed_official 146:f64d43ff0c18 1315 * @brief Gets the Flash maximum address block 1 in Flash Configuration Register 2.
mbed_official 146:f64d43ff0c18 1316 *
mbed_official 146:f64d43ff0c18 1317 * This function gets the Flash maximum block 1 in Flash Configuration Register 1.
mbed_official 146:f64d43ff0c18 1318 *
mbed_official 146:f64d43ff0c18 1319 * @return address Flash maximum block 0 address
mbed_official 146:f64d43ff0c18 1320 */
mbed_official 146:f64d43ff0c18 1321 static inline uint32_t sim_get_maxaddr1(void)
mbed_official 146:f64d43ff0c18 1322 {
mbed_official 146:f64d43ff0c18 1323 return BR_SIM_FCFG2_MAXADDR1;
mbed_official 146:f64d43ff0c18 1324 }
mbed_official 146:f64d43ff0c18 1325 #endif
mbed_official 146:f64d43ff0c18 1326
mbed_official 146:f64d43ff0c18 1327 #if FSL_FEATURE_SIM_FCFG_HAS_MAXADDR01
mbed_official 146:f64d43ff0c18 1328 /*!
mbed_official 146:f64d43ff0c18 1329 * @brief Gets the Flash maximum address block 0 in the Flash Configuration Register 1 (SIM_FCFG).
mbed_official 146:f64d43ff0c18 1330 *
mbed_official 146:f64d43ff0c18 1331 * This function gets the Flash maximum block 0 in Flash Configuration Register 2.
mbed_official 146:f64d43ff0c18 1332 *
mbed_official 146:f64d43ff0c18 1333 * @return address Flash maximum block 0 address
mbed_official 146:f64d43ff0c18 1334 */
mbed_official 146:f64d43ff0c18 1335 static inline uint32_t sim_get_maxaddr01(void)
mbed_official 146:f64d43ff0c18 1336 {
mbed_official 146:f64d43ff0c18 1337 return BR_SIM_FCFG2_MAXADDR01;
mbed_official 146:f64d43ff0c18 1338 }
mbed_official 146:f64d43ff0c18 1339 #endif
mbed_official 146:f64d43ff0c18 1340
mbed_official 146:f64d43ff0c18 1341 #if FSL_FEATURE_SIM_FCFG_HAS_MAXADDR23
mbed_official 146:f64d43ff0c18 1342 /*!
mbed_official 146:f64d43ff0c18 1343 * @brief Gets the Flash maximum address block 1 in the Flash Configuration Register 2.
mbed_official 146:f64d43ff0c18 1344 *
mbed_official 146:f64d43ff0c18 1345 * This function gets the Flash maximum block 1 in Flash Configuration Register 1.
mbed_official 146:f64d43ff0c18 1346 *
mbed_official 146:f64d43ff0c18 1347 * @return address Flash maximum block 0 address
mbed_official 146:f64d43ff0c18 1348 */
mbed_official 146:f64d43ff0c18 1349 static inline uint32_t sim_get_maxaddr23(void)
mbed_official 146:f64d43ff0c18 1350 {
mbed_official 146:f64d43ff0c18 1351 return BR_SIM_FCFG2_MAXADDR23;
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 146:f64d43ff0c18 1361 * @return status program flash status
mbed_official 146:f64d43ff0c18 1362 */
mbed_official 146:f64d43ff0c18 1363 static inline uint32_t sim_get_pflsh(void)
mbed_official 146:f64d43ff0c18 1364 {
mbed_official 146:f64d43ff0c18 1365 return BR_SIM_FCFG2_PFLSH;
mbed_official 146:f64d43ff0c18 1366 }
mbed_official 146:f64d43ff0c18 1367 #endif
mbed_official 146:f64d43ff0c18 1368
mbed_official 146:f64d43ff0c18 1369 /*@}*/
mbed_official 146:f64d43ff0c18 1370
mbed_official 146:f64d43ff0c18 1371 #if defined(__cplusplus)
mbed_official 146:f64d43ff0c18 1372 }
mbed_official 146:f64d43ff0c18 1373 #endif /* __cplusplus*/
mbed_official 146:f64d43ff0c18 1374
mbed_official 146:f64d43ff0c18 1375 /*! @}*/
mbed_official 146:f64d43ff0c18 1376
mbed_official 146:f64d43ff0c18 1377 #endif /* __FSL_SIM_HAL_H__*/
mbed_official 146:f64d43ff0c18 1378 /*******************************************************************************
mbed_official 146:f64d43ff0c18 1379 * EOF
mbed_official 146:f64d43ff0c18 1380 ******************************************************************************/
mbed_official 146:f64d43ff0c18 1381