Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more
targets/hal/TARGET_Freescale/TARGET_KSDK2_MCUS/TARGET_KL27Z/drivers/fsl_sim.h@147:30b64687e01f, 2016-09-16 (annotated)
- Committer:
- <>
- Date:
- Fri Sep 16 16:24:25 2016 +0100
- Revision:
- 147:30b64687e01f
- Parent:
- 121:7f86b4238bec
This updates the lib to the mbed lib v126
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 121:7f86b4238bec | 1 | /* |
mbed_official | 121:7f86b4238bec | 2 | * Copyright (c) 2015, Freescale Semiconductor, Inc. |
mbed_official | 121:7f86b4238bec | 3 | * All rights reserved. |
mbed_official | 121:7f86b4238bec | 4 | * |
mbed_official | 121:7f86b4238bec | 5 | * Redistribution and use in source and binary forms, with or without modification, |
mbed_official | 121:7f86b4238bec | 6 | * are permitted provided that the following conditions are met: |
mbed_official | 121:7f86b4238bec | 7 | * |
mbed_official | 121:7f86b4238bec | 8 | * o Redistributions of source code must retain the above copyright notice, this list |
mbed_official | 121:7f86b4238bec | 9 | * of conditions and the following disclaimer. |
mbed_official | 121:7f86b4238bec | 10 | * |
mbed_official | 121:7f86b4238bec | 11 | * o Redistributions in binary form must reproduce the above copyright notice, this |
mbed_official | 121:7f86b4238bec | 12 | * list of conditions and the following disclaimer in the documentation and/or |
mbed_official | 121:7f86b4238bec | 13 | * other materials provided with the distribution. |
mbed_official | 121:7f86b4238bec | 14 | * |
mbed_official | 121:7f86b4238bec | 15 | * o Neither the name of Freescale Semiconductor, Inc. nor the names of its |
mbed_official | 121:7f86b4238bec | 16 | * contributors may be used to endorse or promote products derived from this |
mbed_official | 121:7f86b4238bec | 17 | * software without specific prior written permission. |
mbed_official | 121:7f86b4238bec | 18 | * |
mbed_official | 121:7f86b4238bec | 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
mbed_official | 121:7f86b4238bec | 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
mbed_official | 121:7f86b4238bec | 21 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
mbed_official | 121:7f86b4238bec | 22 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR |
mbed_official | 121:7f86b4238bec | 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
mbed_official | 121:7f86b4238bec | 24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
mbed_official | 121:7f86b4238bec | 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
mbed_official | 121:7f86b4238bec | 26 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
mbed_official | 121:7f86b4238bec | 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
mbed_official | 121:7f86b4238bec | 28 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
mbed_official | 121:7f86b4238bec | 29 | */ |
mbed_official | 121:7f86b4238bec | 30 | |
mbed_official | 121:7f86b4238bec | 31 | #ifndef _FSL_SIM_H_ |
mbed_official | 121:7f86b4238bec | 32 | #define _FSL_SIM_H_ |
mbed_official | 121:7f86b4238bec | 33 | |
mbed_official | 121:7f86b4238bec | 34 | #include "fsl_common.h" |
mbed_official | 121:7f86b4238bec | 35 | |
mbed_official | 121:7f86b4238bec | 36 | /*! @addtogroup sim */ |
mbed_official | 121:7f86b4238bec | 37 | /*! @{*/ |
mbed_official | 121:7f86b4238bec | 38 | |
mbed_official | 121:7f86b4238bec | 39 | /*! @file */ |
mbed_official | 121:7f86b4238bec | 40 | |
mbed_official | 121:7f86b4238bec | 41 | /******************************************************************************* |
mbed_official | 121:7f86b4238bec | 42 | * Definitions |
mbed_official | 121:7f86b4238bec | 43 | *******************************************************************************/ |
mbed_official | 121:7f86b4238bec | 44 | |
mbed_official | 121:7f86b4238bec | 45 | /*! @name Driver version */ |
mbed_official | 121:7f86b4238bec | 46 | /*@{*/ |
mbed_official | 121:7f86b4238bec | 47 | #define FSL_SIM_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) /*!< Driver version 2.0.0 */ |
mbed_official | 121:7f86b4238bec | 48 | /*@}*/ |
mbed_official | 121:7f86b4238bec | 49 | |
mbed_official | 121:7f86b4238bec | 50 | #if (defined(FSL_FEATURE_SIM_OPT_HAS_USB_VOLTAGE_REGULATOR) && FSL_FEATURE_SIM_OPT_HAS_USB_VOLTAGE_REGULATOR) |
mbed_official | 121:7f86b4238bec | 51 | /*!@brief USB voltage regulator enable setting. */ |
mbed_official | 121:7f86b4238bec | 52 | enum _sim_usb_volt_reg_enable_mode |
mbed_official | 121:7f86b4238bec | 53 | { |
mbed_official | 121:7f86b4238bec | 54 | kSIM_UsbVoltRegEnable = SIM_SOPT1_USBREGEN_MASK, /*!< Enable voltage regulator. */ |
mbed_official | 121:7f86b4238bec | 55 | kSIM_UsbVoltRegEnableInLowPower = SIM_SOPT1_USBVSTBY_MASK, /*!< Enable voltage regulator in VLPR/VLPW modes. */ |
mbed_official | 121:7f86b4238bec | 56 | kSIM_UsbVoltRegEnableInStop = SIM_SOPT1_USBSSTBY_MASK, /*!< Enable voltage regulator in STOP/VLPS/LLS/VLLS modes. */ |
mbed_official | 121:7f86b4238bec | 57 | kSIM_UsbVoltRegEnableInAllModes = SIM_SOPT1_USBREGEN_MASK | SIM_SOPT1_USBSSTBY_MASK | |
mbed_official | 121:7f86b4238bec | 58 | SIM_SOPT1_USBVSTBY_MASK /*!< Enable voltage regulator in all power modes. */ |
mbed_official | 121:7f86b4238bec | 59 | }; |
mbed_official | 121:7f86b4238bec | 60 | #endif /* (defined(FSL_FEATURE_SIM_OPT_HAS_USB_VOLTAGE_REGULATOR) && FSL_FEATURE_SIM_OPT_HAS_USB_VOLTAGE_REGULATOR) */ |
mbed_official | 121:7f86b4238bec | 61 | |
mbed_official | 121:7f86b4238bec | 62 | /*!@brief Unique ID. */ |
mbed_official | 121:7f86b4238bec | 63 | typedef struct _sim_uid |
mbed_official | 121:7f86b4238bec | 64 | { |
mbed_official | 121:7f86b4238bec | 65 | #if defined(SIM_UIDH) |
mbed_official | 121:7f86b4238bec | 66 | uint32_t H; /*!< UIDH. */ |
mbed_official | 121:7f86b4238bec | 67 | #endif |
mbed_official | 121:7f86b4238bec | 68 | uint32_t MH; /*!< UIDMH. */ |
mbed_official | 121:7f86b4238bec | 69 | uint32_t ML; /*!< UIDML. */ |
mbed_official | 121:7f86b4238bec | 70 | uint32_t L; /*!< UIDL. */ |
mbed_official | 121:7f86b4238bec | 71 | } sim_uid_t; |
mbed_official | 121:7f86b4238bec | 72 | |
mbed_official | 121:7f86b4238bec | 73 | /*!@brief Flash enable mode. */ |
mbed_official | 121:7f86b4238bec | 74 | enum _sim_flash_mode |
mbed_official | 121:7f86b4238bec | 75 | { |
mbed_official | 121:7f86b4238bec | 76 | kSIM_FlashDisableInWait = SIM_FCFG1_FLASHDOZE_MASK, /*!< Disable flash in wait mode. */ |
mbed_official | 121:7f86b4238bec | 77 | kSIM_FlashDisable = SIM_FCFG1_FLASHDIS_MASK /*!< Disable flash in normal mode. */ |
mbed_official | 121:7f86b4238bec | 78 | }; |
mbed_official | 121:7f86b4238bec | 79 | |
mbed_official | 121:7f86b4238bec | 80 | /******************************************************************************* |
mbed_official | 121:7f86b4238bec | 81 | * API |
mbed_official | 121:7f86b4238bec | 82 | ******************************************************************************/ |
mbed_official | 121:7f86b4238bec | 83 | |
mbed_official | 121:7f86b4238bec | 84 | #if defined(__cplusplus) |
mbed_official | 121:7f86b4238bec | 85 | extern "C" { |
mbed_official | 121:7f86b4238bec | 86 | #endif /* __cplusplus*/ |
mbed_official | 121:7f86b4238bec | 87 | |
mbed_official | 121:7f86b4238bec | 88 | #if (defined(FSL_FEATURE_SIM_OPT_HAS_USB_VOLTAGE_REGULATOR) && FSL_FEATURE_SIM_OPT_HAS_USB_VOLTAGE_REGULATOR) |
mbed_official | 121:7f86b4238bec | 89 | /*! |
mbed_official | 121:7f86b4238bec | 90 | * @brief Sets the USB voltage regulator setting. |
mbed_official | 121:7f86b4238bec | 91 | * |
mbed_official | 121:7f86b4238bec | 92 | * This function configures whether the USB voltage regulator is enabled in |
mbed_official | 121:7f86b4238bec | 93 | * normal RUN mode, STOP/VLPS/LLS/VLLS modes and VLPR/VLPW modes. The configurations |
mbed_official | 121:7f86b4238bec | 94 | * are passed in as mask value of \ref _sim_usb_volt_reg_enable_mode. For example, enable |
mbed_official | 121:7f86b4238bec | 95 | * USB voltage regulator in RUN/VLPR/VLPW modes and disable in STOP/VLPS/LLS/VLLS mode, |
mbed_official | 121:7f86b4238bec | 96 | * please use: |
mbed_official | 121:7f86b4238bec | 97 | * |
mbed_official | 121:7f86b4238bec | 98 | * SIM_SetUsbVoltRegulatorEnableMode(kSIM_UsbVoltRegEnable | kSIM_UsbVoltRegEnableInLowPower); |
mbed_official | 121:7f86b4238bec | 99 | * |
mbed_official | 121:7f86b4238bec | 100 | * @param mask USB voltage regulator enable setting. |
mbed_official | 121:7f86b4238bec | 101 | */ |
mbed_official | 121:7f86b4238bec | 102 | void SIM_SetUsbVoltRegulatorEnableMode(uint32_t mask); |
mbed_official | 121:7f86b4238bec | 103 | #endif /* FSL_FEATURE_SIM_OPT_HAS_USB_VOLTAGE_REGULATOR */ |
mbed_official | 121:7f86b4238bec | 104 | |
mbed_official | 121:7f86b4238bec | 105 | /*! |
mbed_official | 121:7f86b4238bec | 106 | * @brief Get the unique identification register value. |
mbed_official | 121:7f86b4238bec | 107 | * |
mbed_official | 121:7f86b4238bec | 108 | * @param uid Pointer to the structure to save the UID value. |
mbed_official | 121:7f86b4238bec | 109 | */ |
mbed_official | 121:7f86b4238bec | 110 | void SIM_GetUniqueId(sim_uid_t *uid); |
mbed_official | 121:7f86b4238bec | 111 | |
mbed_official | 121:7f86b4238bec | 112 | /*! |
mbed_official | 121:7f86b4238bec | 113 | * @brief Set the flash enable mode. |
mbed_official | 121:7f86b4238bec | 114 | * |
mbed_official | 121:7f86b4238bec | 115 | * @param mode The mode to set, see \ref _sim_flash_mode for mode details. |
mbed_official | 121:7f86b4238bec | 116 | */ |
mbed_official | 121:7f86b4238bec | 117 | static inline void SIM_SetFlashMode(uint8_t mode) |
mbed_official | 121:7f86b4238bec | 118 | { |
mbed_official | 121:7f86b4238bec | 119 | SIM->FCFG1 = mode; |
mbed_official | 121:7f86b4238bec | 120 | } |
mbed_official | 121:7f86b4238bec | 121 | |
mbed_official | 121:7f86b4238bec | 122 | #if defined(__cplusplus) |
mbed_official | 121:7f86b4238bec | 123 | } |
mbed_official | 121:7f86b4238bec | 124 | #endif /* __cplusplus*/ |
mbed_official | 121:7f86b4238bec | 125 | |
mbed_official | 121:7f86b4238bec | 126 | /*! @}*/ |
mbed_official | 121:7f86b4238bec | 127 | |
mbed_official | 121:7f86b4238bec | 128 | #endif /* _FSL_SIM_H_ */ |