The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.
Dependents: hello SerialTestv11 SerialTestv12 Sierpinski ... more
mbed 2
This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.
TARGET_EFM32ZG_STK3200/TARGET_Silicon_Labs/TARGET_EFM32/common/clocking.h@136:ef9c61f8c49f, 2017-02-14 (annotated)
- Committer:
- Kojto
- Date:
- Tue Feb 14 11:24:20 2017 +0000
- Revision:
- 136:ef9c61f8c49f
- Parent:
- 128:9bcdf88f62b0
- Child:
- 161:aa5281ff4a02
Release 136 of the mbed library
Ports for Upcoming Targets
Fixes and Changes
3432: Target STM USBHOST support https://github.com/ARMmbed/mbed-os/pull/3432
3181: NUCLEO_F207ZG extending PeripheralPins.c: all available alternate functions can be used now https://github.com/ARMmbed/mbed-os/pull/3181
3626: NUCLEO_F412ZG : Add USB Device +Host https://github.com/ARMmbed/mbed-os/pull/3626
3628: Fix warnings https://github.com/ARMmbed/mbed-os/pull/3628
3629: STM32: L0 LL layer https://github.com/ARMmbed/mbed-os/pull/3629
3632: IDE Export support for platform VK_RZ_A1H https://github.com/ARMmbed/mbed-os/pull/3632
3642: Missing IRQ pin fix for platform VK_RZ_A1H https://github.com/ARMmbed/mbed-os/pull/3642
3664: Fix ncs36510 sleep definitions https://github.com/ARMmbed/mbed-os/pull/3664
3655: [STM32F4] Modify folder structure https://github.com/ARMmbed/mbed-os/pull/3655
3657: [STM32L4] Modify folder structure https://github.com/ARMmbed/mbed-os/pull/3657
3658: [STM32F3] Modify folder structure https://github.com/ARMmbed/mbed-os/pull/3658
3685: STM32: I2C: reset state machine https://github.com/ARMmbed/mbed-os/pull/3685
3692: uVisor: Standardize available legacy heap and stack https://github.com/ARMmbed/mbed-os/pull/3692
3621: Fix for #2884, LPC824: export to LPCXpresso, target running with wron https://github.com/ARMmbed/mbed-os/pull/3621
3649: [STM32F7] Modify folder structure https://github.com/ARMmbed/mbed-os/pull/3649
3695: Enforce device_name is valid in targets.json https://github.com/ARMmbed/mbed-os/pull/3695
3723: NCS36510: spi_format function bug fix https://github.com/ARMmbed/mbed-os/pull/3723
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
<> | 128:9bcdf88f62b0 | 1 | /***************************************************************************//** |
<> | 128:9bcdf88f62b0 | 2 | * @file clocking.h |
<> | 128:9bcdf88f62b0 | 3 | * @brief Clock selection calculations |
<> | 128:9bcdf88f62b0 | 4 | ******************************************************************************* |
<> | 128:9bcdf88f62b0 | 5 | * @section License |
<> | 128:9bcdf88f62b0 | 6 | * <b>(C) Copyright 2015 Silicon Labs, http://www.silabs.com</b> |
<> | 128:9bcdf88f62b0 | 7 | ******************************************************************************* |
<> | 128:9bcdf88f62b0 | 8 | * |
<> | 128:9bcdf88f62b0 | 9 | * SPDX-License-Identifier: Apache-2.0 |
<> | 128:9bcdf88f62b0 | 10 | * |
<> | 128:9bcdf88f62b0 | 11 | * Licensed under the Apache License, Version 2.0 (the "License"); you may |
<> | 128:9bcdf88f62b0 | 12 | * not use this file except in compliance with the License. |
<> | 128:9bcdf88f62b0 | 13 | * You may obtain a copy of the License at |
<> | 128:9bcdf88f62b0 | 14 | * |
<> | 128:9bcdf88f62b0 | 15 | * http://www.apache.org/licenses/LICENSE-2.0 |
<> | 128:9bcdf88f62b0 | 16 | * |
<> | 128:9bcdf88f62b0 | 17 | * Unless required by applicable law or agreed to in writing, software |
<> | 128:9bcdf88f62b0 | 18 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
<> | 128:9bcdf88f62b0 | 19 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
<> | 128:9bcdf88f62b0 | 20 | * See the License for the specific language governing permissions and |
<> | 128:9bcdf88f62b0 | 21 | * limitations under the License. |
<> | 128:9bcdf88f62b0 | 22 | * |
<> | 128:9bcdf88f62b0 | 23 | ******************************************************************************/ |
<> | 128:9bcdf88f62b0 | 24 | #ifndef MBED_CLOCKING_H |
<> | 128:9bcdf88f62b0 | 25 | #define MBED_CLOCKING_H |
<> | 128:9bcdf88f62b0 | 26 | |
<> | 128:9bcdf88f62b0 | 27 | /* Clock definitions */ |
<> | 128:9bcdf88f62b0 | 28 | #define LFXO 0 |
<> | 128:9bcdf88f62b0 | 29 | #define HFXO 1 |
<> | 128:9bcdf88f62b0 | 30 | #define LFRCO 2 |
<> | 128:9bcdf88f62b0 | 31 | #define HFRCO 3 |
<> | 128:9bcdf88f62b0 | 32 | #if !defined(_EFM32_GECKO_FAMILY) |
<> | 128:9bcdf88f62b0 | 33 | #define ULFRCO 4 |
<> | 128:9bcdf88f62b0 | 34 | #endif |
<> | 128:9bcdf88f62b0 | 35 | |
<> | 128:9bcdf88f62b0 | 36 | /* Low Energy peripheral clock source. |
<> | 128:9bcdf88f62b0 | 37 | * Options: |
<> | 128:9bcdf88f62b0 | 38 | * * LFXO: external crystal, please define frequency. |
<> | 128:9bcdf88f62b0 | 39 | * * LFRCO: internal RC oscillator (32.768kHz) |
<> | 128:9bcdf88f62b0 | 40 | * * ULFRCO: internal ultra-low power RC oscillator (available down to EM3) (1kHz) |
<> | 128:9bcdf88f62b0 | 41 | */ |
<> | 128:9bcdf88f62b0 | 42 | #ifndef LOW_ENERGY_CLOCK_SOURCE |
<> | 128:9bcdf88f62b0 | 43 | #define LOW_ENERGY_CLOCK_SOURCE LFXO |
<> | 128:9bcdf88f62b0 | 44 | #endif |
<> | 128:9bcdf88f62b0 | 45 | |
<> | 128:9bcdf88f62b0 | 46 | /** Core clock source. |
<> | 128:9bcdf88f62b0 | 47 | * Options: |
<> | 128:9bcdf88f62b0 | 48 | * * HFXO: external crystal, please define frequency. |
<> | 128:9bcdf88f62b0 | 49 | * * HFRCO: High-frequency internal RC oscillator. Please select band as well. |
<> | 128:9bcdf88f62b0 | 50 | */ |
<> | 128:9bcdf88f62b0 | 51 | #ifndef CORE_CLOCK_SOURCE |
<> | 128:9bcdf88f62b0 | 52 | #define CORE_CLOCK_SOURCE HFRCO |
<> | 128:9bcdf88f62b0 | 53 | #if defined(_CMU_HFRCOCTRL_BAND_MASK) |
<> | 128:9bcdf88f62b0 | 54 | #define HFRCO_FREQUENCY_ENUM _CMU_HFRCOCTRL_BAND_21MHZ |
<> | 128:9bcdf88f62b0 | 55 | #define HFRCO_FREQUENCY 21000000 |
<> | 128:9bcdf88f62b0 | 56 | #elif defined(_CMU_HFRCOCTRL_FREQRANGE_MASK) |
<> | 128:9bcdf88f62b0 | 57 | #define HFRCO_FREQUENCY_ENUM cmuHFRCOFreq_32M0Hz |
<> | 128:9bcdf88f62b0 | 58 | #define HFRCO_FREQUENCY 32000000 |
<> | 128:9bcdf88f62b0 | 59 | #endif |
<> | 128:9bcdf88f62b0 | 60 | #endif // CORE_CLOCK_SOURCE |
<> | 128:9bcdf88f62b0 | 61 | |
<> | 128:9bcdf88f62b0 | 62 | #if !defined(LFXO_FREQUENCY) && (LOW_ENERGY_CLOCK_SOURCE == LFXO) |
<> | 128:9bcdf88f62b0 | 63 | #error "LFXO frequency is undefined!" |
<> | 128:9bcdf88f62b0 | 64 | #endif |
<> | 128:9bcdf88f62b0 | 65 | |
<> | 128:9bcdf88f62b0 | 66 | #if !defined(HFXO_FREQUENCY) && (CORE_CLOCK_SOURCE == HFXO) |
<> | 128:9bcdf88f62b0 | 67 | #error "HFXO frequency is undefined!" |
<> | 128:9bcdf88f62b0 | 68 | #endif |
<> | 128:9bcdf88f62b0 | 69 | |
<> | 128:9bcdf88f62b0 | 70 | #if (LOW_ENERGY_CLOCK_SOURCE == LFXO) |
<> | 128:9bcdf88f62b0 | 71 | #define LOW_ENERGY_CLOCK_FREQUENCY LFXO_FREQUENCY |
<> | 128:9bcdf88f62b0 | 72 | #elif (LOW_ENERGY_CLOCK_SOURCE == LFRCO) |
<> | 128:9bcdf88f62b0 | 73 | #define LOW_ENERGY_CLOCK_FREQUENCY 32768 |
<> | 128:9bcdf88f62b0 | 74 | #elif (LOW_ENERGY_CLOCK_SOURCE == ULFRCO) |
<> | 128:9bcdf88f62b0 | 75 | #define LOW_ENERGY_CLOCK_FREQUENCY 1000 |
<> | 128:9bcdf88f62b0 | 76 | #else |
<> | 128:9bcdf88f62b0 | 77 | #error "Unknown Low Energy Clock selection" |
<> | 128:9bcdf88f62b0 | 78 | #endif |
<> | 128:9bcdf88f62b0 | 79 | |
<> | 128:9bcdf88f62b0 | 80 | #if( CORE_CLOCK_SOURCE == HFXO) |
<> | 128:9bcdf88f62b0 | 81 | # define REFERENCE_FREQUENCY HFXO_FREQUENCY |
<> | 128:9bcdf88f62b0 | 82 | #elif( CORE_CLOCK_SOURCE == HFRCO) |
<> | 128:9bcdf88f62b0 | 83 | #if !defined(HFRCO_FREQUENCY) |
<> | 128:9bcdf88f62b0 | 84 | # error "HFRCO frequency is not defined!" |
<> | 128:9bcdf88f62b0 | 85 | #else |
<> | 128:9bcdf88f62b0 | 86 | # define REFERENCE_FREQUENCY HFRCO_FREQUENCY |
<> | 128:9bcdf88f62b0 | 87 | #endif |
<> | 128:9bcdf88f62b0 | 88 | #endif |
<> | 128:9bcdf88f62b0 | 89 | |
<> | 128:9bcdf88f62b0 | 90 | #if ( LOW_ENERGY_CLOCK_SOURCE == LFXO ) |
<> | 128:9bcdf88f62b0 | 91 | # define LEUART_USING_LFXO |
<> | 128:9bcdf88f62b0 | 92 | # if ( (defined(CMU_CTRL_HFLE) || defined(CMU_CTRL_WSHFLE) ) && (REFERENCE_FREQUENCY > 24000000) ) |
<> | 128:9bcdf88f62b0 | 93 | # define LEUART_HF_REF_FREQ (REFERENCE_FREQUENCY / 4) |
<> | 128:9bcdf88f62b0 | 94 | # else |
<> | 128:9bcdf88f62b0 | 95 | # define LEUART_HF_REF_FREQ (REFERENCE_FREQUENCY / 2) |
<> | 128:9bcdf88f62b0 | 96 | # endif |
<> | 128:9bcdf88f62b0 | 97 | # define LEUART_LF_REF_FREQ LFXO_FREQUENCY |
<> | 128:9bcdf88f62b0 | 98 | #else |
<> | 128:9bcdf88f62b0 | 99 | # if ( (defined(CMU_CTRL_HFLE) || defined(CMU_CTRL_WSHFLE) ) && (REFERENCE_FREQUENCY > 24000000) ) |
<> | 128:9bcdf88f62b0 | 100 | # define LEUART_REF_FREQ (REFERENCE_FREQUENCY / 4) |
<> | 128:9bcdf88f62b0 | 101 | # else |
<> | 128:9bcdf88f62b0 | 102 | # define LEUART_REF_FREQ (REFERENCE_FREQUENCY / 2) |
<> | 128:9bcdf88f62b0 | 103 | # endif |
<> | 128:9bcdf88f62b0 | 104 | #endif |
<> | 128:9bcdf88f62b0 | 105 | |
<> | 128:9bcdf88f62b0 | 106 | #endif |