mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

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

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

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

Import librarymbed

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

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

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

Extended #476, which does not break ethernet for K64F

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 324:406fd2029f23 1 /*
mbed_official 324:406fd2029f23 2 * Copyright (c) 2013 - 2014, Freescale Semiconductor, Inc.
mbed_official 324:406fd2029f23 3 * All rights reserved.
mbed_official 324:406fd2029f23 4 *
mbed_official 324:406fd2029f23 5 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 324:406fd2029f23 6 * are permitted provided that the following conditions are met:
mbed_official 324:406fd2029f23 7 *
mbed_official 324:406fd2029f23 8 * o Redistributions of source code must retain the above copyright notice, this list
mbed_official 324:406fd2029f23 9 * of conditions and the following disclaimer.
mbed_official 324:406fd2029f23 10 *
mbed_official 324:406fd2029f23 11 * o Redistributions in binary form must reproduce the above copyright notice, this
mbed_official 324:406fd2029f23 12 * list of conditions and the following disclaimer in the documentation and/or
mbed_official 324:406fd2029f23 13 * other materials provided with the distribution.
mbed_official 324:406fd2029f23 14 *
mbed_official 324:406fd2029f23 15 * o Neither the name of Freescale Semiconductor, Inc. nor the names of its
mbed_official 324:406fd2029f23 16 * contributors may be used to endorse or promote products derived from this
mbed_official 324:406fd2029f23 17 * software without specific prior written permission.
mbed_official 324:406fd2029f23 18 *
mbed_official 324:406fd2029f23 19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
mbed_official 324:406fd2029f23 20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
mbed_official 324:406fd2029f23 21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 324:406fd2029f23 22 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
mbed_official 324:406fd2029f23 23 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
mbed_official 324:406fd2029f23 24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
mbed_official 324:406fd2029f23 25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
mbed_official 324:406fd2029f23 26 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
mbed_official 324:406fd2029f23 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
mbed_official 324:406fd2029f23 28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 324:406fd2029f23 29 */
mbed_official 324:406fd2029f23 30 #if !defined(__FSL_RCM_HAL_H__)
mbed_official 324:406fd2029f23 31 #define __FSL_RCM_HAL_H__
mbed_official 324:406fd2029f23 32
mbed_official 324:406fd2029f23 33 #include <stdint.h>
mbed_official 324:406fd2029f23 34 #include <stdbool.h>
mbed_official 324:406fd2029f23 35 #include <assert.h>
mbed_official 324:406fd2029f23 36 #include "fsl_device_registers.h"
mbed_official 324:406fd2029f23 37 #include "fsl_rcm_features.h"
mbed_official 324:406fd2029f23 38
mbed_official 324:406fd2029f23 39 /*! @addtogroup rcm_hal*/
mbed_official 324:406fd2029f23 40 /*! @{*/
mbed_official 324:406fd2029f23 41
mbed_official 324:406fd2029f23 42 /*! @file fsl_rcm_hal.h */
mbed_official 324:406fd2029f23 43
mbed_official 324:406fd2029f23 44 /*******************************************************************************
mbed_official 324:406fd2029f23 45 * Definitions
mbed_official 324:406fd2029f23 46 ******************************************************************************/
mbed_official 324:406fd2029f23 47
mbed_official 324:406fd2029f23 48 /*! @brief System Reset Source Name definitions */
mbed_official 324:406fd2029f23 49 typedef enum _rcm_source_names {
mbed_official 324:406fd2029f23 50 kRcmWakeup, /* low-leakage wakeup reset */
mbed_official 324:406fd2029f23 51 kRcmLowVoltDetect, /* low voltage detect reset */
mbed_official 324:406fd2029f23 52 kRcmLossOfClk, /* loss of clock reset */
mbed_official 324:406fd2029f23 53 kRcmLossOfLock, /* loss of lock reset */
mbed_official 324:406fd2029f23 54 kRcmWatchDog, /* watch dog reset */
mbed_official 324:406fd2029f23 55 kRcmExternalPin, /* external pin reset */
mbed_official 324:406fd2029f23 56 kRcmPowerOn, /* power on reset */
mbed_official 324:406fd2029f23 57 kRcmJtag, /* JTAG generated reset */
mbed_official 324:406fd2029f23 58 kRcmCoreLockup, /* core lockup reset */
mbed_official 324:406fd2029f23 59 kRcmSoftware, /* software reset */
mbed_official 324:406fd2029f23 60 kRcmSystem, /* system reset request bit set reset */
mbed_official 324:406fd2029f23 61 kRcmEzport, /* EzPort reset */
mbed_official 324:406fd2029f23 62 kRcmStopModeAckErr, /* stop mode ack error reset */
mbed_official 324:406fd2029f23 63 kRcmSrcNameMax
mbed_official 324:406fd2029f23 64 } rcm_source_names_t;
mbed_official 324:406fd2029f23 65
mbed_official 324:406fd2029f23 66 /*! @brief Reset pin filter select in Run and Wait modes */
mbed_official 324:406fd2029f23 67 typedef enum _rcm_filter_run_wait_modes {
mbed_official 324:406fd2029f23 68 kRcmFilterDisabled, /* all filtering disabled */
mbed_official 324:406fd2029f23 69 kRcmFilterBusClk, /* Bus clock filter enabled */
mbed_official 324:406fd2029f23 70 kRcmFilterLpoClk, /* LPO clock filter enabled */
mbed_official 324:406fd2029f23 71 kRcmFilterReserverd /* reserved setting */
mbed_official 324:406fd2029f23 72 } rcm_filter_run_wait_modes_t;
mbed_official 324:406fd2029f23 73
mbed_official 324:406fd2029f23 74 /*******************************************************************************
mbed_official 324:406fd2029f23 75 * API
mbed_official 324:406fd2029f23 76 ******************************************************************************/
mbed_official 324:406fd2029f23 77
mbed_official 324:406fd2029f23 78 /*!
mbed_official 324:406fd2029f23 79 * @brief Gets the reset source status.
mbed_official 324:406fd2029f23 80 *
mbed_official 324:406fd2029f23 81 * This function gets the current reset source status for a specified source.
mbed_official 324:406fd2029f23 82 *
mbed_official 324:406fd2029f23 83 * @param baseAddr Register base address of RCM
mbed_official 324:406fd2029f23 84 * @param srcName reset source name
mbed_official 324:406fd2029f23 85 * @return status true or false for specified reset source
mbed_official 324:406fd2029f23 86 */
mbed_official 324:406fd2029f23 87 bool RCM_HAL_GetSrcStatusCmd(uint32_t baseAddr, rcm_source_names_t srcName);
mbed_official 324:406fd2029f23 88
mbed_official 324:406fd2029f23 89 /*!
mbed_official 324:406fd2029f23 90 * @brief Sets the reset pin filter in stop mode.
mbed_official 324:406fd2029f23 91 *
mbed_official 324:406fd2029f23 92 * This function sets the reset pin filter enable setting in stop mode.
mbed_official 324:406fd2029f23 93 *
mbed_official 324:406fd2029f23 94 * @param baseAddr Register base address of RCM
mbed_official 324:406fd2029f23 95 * @param enable enable or disable the filter in stop mode
mbed_official 324:406fd2029f23 96 */
mbed_official 324:406fd2029f23 97 static inline void RCM_HAL_SetFilterStopModeCmd(uint32_t baseAddr, bool enable)
mbed_official 324:406fd2029f23 98 {
mbed_official 324:406fd2029f23 99 BW_RCM_RPFC_RSTFLTSS(baseAddr, enable);
mbed_official 324:406fd2029f23 100 }
mbed_official 324:406fd2029f23 101
mbed_official 324:406fd2029f23 102 /*!
mbed_official 324:406fd2029f23 103 * @brief Gets the reset pin filter in stop mode.
mbed_official 324:406fd2029f23 104 *
mbed_official 324:406fd2029f23 105 * This function gets the reset pin filter enable setting in stop mode.
mbed_official 324:406fd2029f23 106 *
mbed_official 324:406fd2029f23 107 * @param baseAddr Register base address of RCM
mbed_official 324:406fd2029f23 108 * @return enable true/false to enable or disable the filter in stop mode
mbed_official 324:406fd2029f23 109 */
mbed_official 324:406fd2029f23 110 static inline bool RCM_HAL_GetFilterStopModeCmd(uint32_t baseAddr)
mbed_official 324:406fd2029f23 111 {
mbed_official 324:406fd2029f23 112 return (bool)BR_RCM_RPFC_RSTFLTSS(baseAddr);
mbed_official 324:406fd2029f23 113 }
mbed_official 324:406fd2029f23 114
mbed_official 324:406fd2029f23 115 /*!
mbed_official 324:406fd2029f23 116 * @brief Sets the reset pin filter in run and wait mode.
mbed_official 324:406fd2029f23 117 *
mbed_official 324:406fd2029f23 118 * This function sets the reset pin filter enable setting in run/wait mode.
mbed_official 324:406fd2029f23 119 *
mbed_official 324:406fd2029f23 120 * @param baseAddr Register base address of RCM
mbed_official 324:406fd2029f23 121 * @param mode to be set for reset filter in run/wait mode
mbed_official 324:406fd2029f23 122 */
mbed_official 324:406fd2029f23 123 static inline void RCM_HAL_SetFilterRunWaitMode(uint32_t baseAddr, rcm_filter_run_wait_modes_t mode)
mbed_official 324:406fd2029f23 124 {
mbed_official 324:406fd2029f23 125 BW_RCM_RPFC_RSTFLTSRW(baseAddr, mode);
mbed_official 324:406fd2029f23 126 }
mbed_official 324:406fd2029f23 127
mbed_official 324:406fd2029f23 128 /*!
mbed_official 324:406fd2029f23 129 * @brief Gets the reset pin filter for stop mode.
mbed_official 324:406fd2029f23 130 *
mbed_official 324:406fd2029f23 131 * This function gets the reset pin filter enable setting for stop mode.
mbed_official 324:406fd2029f23 132 *
mbed_official 324:406fd2029f23 133 * @param baseAddr Register base address of RCM
mbed_official 324:406fd2029f23 134 * @return mode for reset filter in run/wait mode
mbed_official 324:406fd2029f23 135 */
mbed_official 324:406fd2029f23 136 static inline rcm_filter_run_wait_modes_t RCM_HAL_GetFilterRunWaitMode(uint32_t baseAddr)
mbed_official 324:406fd2029f23 137 {
mbed_official 324:406fd2029f23 138 return (rcm_filter_run_wait_modes_t)BR_RCM_RPFC_RSTFLTSRW(baseAddr);
mbed_official 324:406fd2029f23 139 }
mbed_official 324:406fd2029f23 140
mbed_official 324:406fd2029f23 141 /*!
mbed_official 324:406fd2029f23 142 * @brief Sets the reset pin filter width.
mbed_official 324:406fd2029f23 143 *
mbed_official 324:406fd2029f23 144 * This function sets the reset pin filter width.
mbed_official 324:406fd2029f23 145 *
mbed_official 324:406fd2029f23 146 * @param baseAddr Register base address of RCM
mbed_official 324:406fd2029f23 147 * @param width to be set for reset filter width
mbed_official 324:406fd2029f23 148 */
mbed_official 324:406fd2029f23 149 static inline void RCM_HAL_SetFilterWidth(uint32_t baseAddr, uint32_t width)
mbed_official 324:406fd2029f23 150 {
mbed_official 324:406fd2029f23 151 BW_RCM_RPFW_RSTFLTSEL(baseAddr, width);
mbed_official 324:406fd2029f23 152 }
mbed_official 324:406fd2029f23 153
mbed_official 324:406fd2029f23 154 /*!
mbed_official 324:406fd2029f23 155 * @brief Gets the reset pin filter for stop mode.
mbed_official 324:406fd2029f23 156 *
mbed_official 324:406fd2029f23 157 * This function gets the reset pin filter width.
mbed_official 324:406fd2029f23 158 *
mbed_official 324:406fd2029f23 159 * @param baseAddr Register base address of RCM
mbed_official 324:406fd2029f23 160 * @return width reset filter width
mbed_official 324:406fd2029f23 161 */
mbed_official 324:406fd2029f23 162 static inline uint32_t RCM_HAL_GetFilterWidth(uint32_t baseAddr)
mbed_official 324:406fd2029f23 163 {
mbed_official 324:406fd2029f23 164 return (uint32_t)BR_RCM_RPFW_RSTFLTSEL(baseAddr);
mbed_official 324:406fd2029f23 165 }
mbed_official 324:406fd2029f23 166
mbed_official 324:406fd2029f23 167 /*!
mbed_official 324:406fd2029f23 168 * @brief Gets the EZP_MS_B pin assert status.
mbed_official 324:406fd2029f23 169 *
mbed_official 324:406fd2029f23 170 * This function gets the easy port mode status (EZP_MS_B) pin assert status.
mbed_official 324:406fd2029f23 171 *
mbed_official 324:406fd2029f23 172 * @param baseAddr Register base address of RCM
mbed_official 324:406fd2029f23 173 * @return status true - asserted, false - reasserted
mbed_official 324:406fd2029f23 174 */
mbed_official 324:406fd2029f23 175 static inline bool RCM_HAL_GetEasyPortModeStatusCmd(uint32_t baseAddr)
mbed_official 324:406fd2029f23 176 {
mbed_official 324:406fd2029f23 177 return (bool)BR_RCM_MR_EZP_MS(baseAddr);
mbed_official 324:406fd2029f23 178 }
mbed_official 324:406fd2029f23 179
mbed_official 324:406fd2029f23 180 #if defined(__cplusplus)
mbed_official 324:406fd2029f23 181 extern "C" {
mbed_official 324:406fd2029f23 182 #endif /* __cplusplus*/
mbed_official 324:406fd2029f23 183
mbed_official 324:406fd2029f23 184 /*! @name Reset Control Module APIs*/
mbed_official 324:406fd2029f23 185 /*@{*/
mbed_official 324:406fd2029f23 186
mbed_official 324:406fd2029f23 187 /*@}*/
mbed_official 324:406fd2029f23 188
mbed_official 324:406fd2029f23 189 #if defined(__cplusplus)
mbed_official 324:406fd2029f23 190 }
mbed_official 324:406fd2029f23 191 #endif /* __cplusplus*/
mbed_official 324:406fd2029f23 192
mbed_official 324:406fd2029f23 193 /*! @}*/
mbed_official 324:406fd2029f23 194
mbed_official 324:406fd2029f23 195 #endif /* __FSL_RCM_HAL_H__*/
mbed_official 324:406fd2029f23 196 /*******************************************************************************
mbed_official 324:406fd2029f23 197 * EOF
mbed_official 324:406fd2029f23 198 ******************************************************************************/
mbed_official 324:406fd2029f23 199