mbed library sources. With a patch for the can_api

Fork of mbed-dev by mbed official

Committer:
<>
Date:
Fri Oct 28 11:17:30 2016 +0100
Revision:
149:156823d33999
Parent:
targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/clocking.h@144:ef7eb2e8f9f7
This updates the lib to the mbed lib v128

NOTE: This release includes a restructuring of the file and directory locations and thus some
include paths in your code may need updating accordingly.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
<> 144:ef7eb2e8f9f7 1 /***************************************************************************//**
<> 144:ef7eb2e8f9f7 2 * @file clocking.h
<> 144:ef7eb2e8f9f7 3 * @brief Clock selection calculations
<> 144:ef7eb2e8f9f7 4 *******************************************************************************
<> 144:ef7eb2e8f9f7 5 * @section License
<> 144:ef7eb2e8f9f7 6 * <b>(C) Copyright 2015 Silicon Labs, http://www.silabs.com</b>
<> 144:ef7eb2e8f9f7 7 *******************************************************************************
<> 144:ef7eb2e8f9f7 8 *
<> 144:ef7eb2e8f9f7 9 * SPDX-License-Identifier: Apache-2.0
<> 144:ef7eb2e8f9f7 10 *
<> 144:ef7eb2e8f9f7 11 * Licensed under the Apache License, Version 2.0 (the "License"); you may
<> 144:ef7eb2e8f9f7 12 * not use this file except in compliance with the License.
<> 144:ef7eb2e8f9f7 13 * You may obtain a copy of the License at
<> 144:ef7eb2e8f9f7 14 *
<> 144:ef7eb2e8f9f7 15 * http://www.apache.org/licenses/LICENSE-2.0
<> 144:ef7eb2e8f9f7 16 *
<> 144:ef7eb2e8f9f7 17 * Unless required by applicable law or agreed to in writing, software
<> 144:ef7eb2e8f9f7 18 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
<> 144:ef7eb2e8f9f7 19 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<> 144:ef7eb2e8f9f7 20 * See the License for the specific language governing permissions and
<> 144:ef7eb2e8f9f7 21 * limitations under the License.
<> 144:ef7eb2e8f9f7 22 *
<> 144:ef7eb2e8f9f7 23 ******************************************************************************/
<> 144:ef7eb2e8f9f7 24
<> 144:ef7eb2e8f9f7 25 #include "device_peripherals.h"
<> 144:ef7eb2e8f9f7 26
<> 144:ef7eb2e8f9f7 27 #if( CORE_CLOCK_SOURCE == HFXO)
<> 144:ef7eb2e8f9f7 28 # define REFERENCE_FREQUENCY HFXO_FREQUENCY
<> 144:ef7eb2e8f9f7 29 #elif( CORE_CLOCK_SOURCE == HFRCO)
<> 144:ef7eb2e8f9f7 30
<> 144:ef7eb2e8f9f7 31 # if defined _CMU_HFRCOCTRL_BAND_MASK
<> 144:ef7eb2e8f9f7 32 # if( HFRCO_FREQUENCY == _CMU_HFRCOCTRL_BAND_1MHZ)
<> 144:ef7eb2e8f9f7 33 # define REFERENCE_FREQUENCY 1000000
<> 144:ef7eb2e8f9f7 34 # elif(HFRCO_FREQUENCY == _CMU_HFRCOCTRL_BAND_7MHZ)
<> 144:ef7eb2e8f9f7 35 # define REFERENCE_FREQUENCY 7000000
<> 144:ef7eb2e8f9f7 36 # elif(HFRCO_FREQUENCY == _CMU_HFRCOCTRL_BAND_11MHZ)
<> 144:ef7eb2e8f9f7 37 # define REFERENCE_FREQUENCY 7000000
<> 144:ef7eb2e8f9f7 38 # elif(HFRCO_FREQUENCY == _CMU_HFRCOCTRL_BAND_14MHZ)
<> 144:ef7eb2e8f9f7 39 # define REFERENCE_FREQUENCY 14000000
<> 144:ef7eb2e8f9f7 40 # elif(HFRCO_FREQUENCY == _CMU_HFRCOCTRL_BAND_21MHZ)
<> 144:ef7eb2e8f9f7 41 # define REFERENCE_FREQUENCY 21000000
<> 144:ef7eb2e8f9f7 42 # elif(HFRCO_FREQUENCY == _CMU_HFRCOCTRL_BAND_28MHZ)
<> 144:ef7eb2e8f9f7 43 # define REFERENCE_FREQUENCY 28000000
<> 144:ef7eb2e8f9f7 44 # else
<> 144:ef7eb2e8f9f7 45 # define REFERENCE_FREQUENCY 14000000
<> 144:ef7eb2e8f9f7 46 # endif
<> 144:ef7eb2e8f9f7 47 # elif defined _CMU_HFRCOCTRL_FREQRANGE_MASK
<> 144:ef7eb2e8f9f7 48 # define REFERENCE_FREQUENCY HFRCO_FREQUENCY
<> 144:ef7eb2e8f9f7 49 # else
<> 144:ef7eb2e8f9f7 50 # error "HFRCO frequency not defined"
<> 144:ef7eb2e8f9f7 51 # endif
<> 144:ef7eb2e8f9f7 52 #endif
<> 144:ef7eb2e8f9f7 53
<> 144:ef7eb2e8f9f7 54 #if ( LOW_ENERGY_CLOCK_SOURCE == LFXO )
<> 144:ef7eb2e8f9f7 55 # define LEUART_USING_LFXO
<> 144:ef7eb2e8f9f7 56 # if ( (defined(CMU_CTRL_HFLE) || defined(CMU_CTRL_WSHFLE) ) && (REFERENCE_FREQUENCY > 24000000) )
<> 144:ef7eb2e8f9f7 57 # define LEUART_HF_REF_FREQ (REFERENCE_FREQUENCY / 4)
<> 144:ef7eb2e8f9f7 58 # else
<> 144:ef7eb2e8f9f7 59 # define LEUART_HF_REF_FREQ (REFERENCE_FREQUENCY / 2)
<> 144:ef7eb2e8f9f7 60 # endif
<> 144:ef7eb2e8f9f7 61 # define LEUART_LF_REF_FREQ LFXO_FREQUENCY
<> 144:ef7eb2e8f9f7 62 #else
<> 144:ef7eb2e8f9f7 63 # if ( (defined(CMU_CTRL_HFLE) || defined(CMU_CTRL_WSHFLE) ) && (REFERENCE_FREQUENCY > 24000000) )
<> 144:ef7eb2e8f9f7 64 # define LEUART_REF_FREQ (REFERENCE_FREQUENCY / 4)
<> 144:ef7eb2e8f9f7 65 # else
<> 144:ef7eb2e8f9f7 66 # define LEUART_REF_FREQ (REFERENCE_FREQUENCY / 2)
<> 144:ef7eb2e8f9f7 67 # endif
<> 144:ef7eb2e8f9f7 68 #endif
<> 144:ef7eb2e8f9f7 69