mbed library sources. Supersedes mbed-src.

Fork of mbed-dev by mbed official

Committer:
mbed_official
Date:
Thu Jan 28 18:15:10 2016 +0000
Revision:
54:2a2065e67ef6
Parent:
50:a417edff4437
Child:
144:ef7eb2e8f9f7
Synchronized with git revision b5816d872d02a7420c05be91bea5f898b88d2e56

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

[Silicon Labs] Fix support for the RC oscillator

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 50:a417edff4437 1 /***************************************************************************//**
mbed_official 50:a417edff4437 2 * @file device_peripherals.h
mbed_official 50:a417edff4437 3 *******************************************************************************
mbed_official 50:a417edff4437 4 * @section License
mbed_official 50:a417edff4437 5 * <b>(C) Copyright 2015 Silicon Labs, http://www.silabs.com</b>
mbed_official 50:a417edff4437 6 *******************************************************************************
mbed_official 50:a417edff4437 7 *
mbed_official 50:a417edff4437 8 * Permission is granted to anyone to use this software for any purpose,
mbed_official 50:a417edff4437 9 * including commercial applications, and to alter it and redistribute it
mbed_official 50:a417edff4437 10 * freely, subject to the following restrictions:
mbed_official 50:a417edff4437 11 *
mbed_official 50:a417edff4437 12 * 1. The origin of this software must not be misrepresented; you must not
mbed_official 50:a417edff4437 13 * claim that you wrote the original software.
mbed_official 50:a417edff4437 14 * 2. Altered source versions must be plainly marked as such, and must not be
mbed_official 50:a417edff4437 15 * misrepresented as being the original software.
mbed_official 50:a417edff4437 16 * 3. This notice may not be removed or altered from any source distribution.
mbed_official 50:a417edff4437 17 *
mbed_official 50:a417edff4437 18 * DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Silicon Labs has no
mbed_official 50:a417edff4437 19 * obligation to support this Software. Silicon Labs is providing the
mbed_official 50:a417edff4437 20 * Software "AS IS", with no express or implied warranties of any kind,
mbed_official 50:a417edff4437 21 * including, but not limited to, any implied warranties of merchantability
mbed_official 50:a417edff4437 22 * or fitness for any particular purpose or warranties against infringement
mbed_official 50:a417edff4437 23 * of any proprietary rights of a third party.
mbed_official 50:a417edff4437 24 *
mbed_official 50:a417edff4437 25 * Silicon Labs will not be liable for any consequential, incidental, or
mbed_official 50:a417edff4437 26 * special damages, or any other relief, or for any claim by any third party,
mbed_official 50:a417edff4437 27 * arising from your use of this Software.
mbed_official 50:a417edff4437 28 *
mbed_official 50:a417edff4437 29 ******************************************************************************/
mbed_official 50:a417edff4437 30 #ifndef MBED_DEVICE_PERIPHERALS_H
mbed_official 50:a417edff4437 31 #define MBED_DEVICE_PERIPHERALS_H
mbed_official 50:a417edff4437 32
mbed_official 50:a417edff4437 33 /* us ticker */
mbed_official 50:a417edff4437 34 #define US_TICKER_TIMER TIMER0
mbed_official 54:2a2065e67ef6 35 #define US_TICKER_TIMER_CLOCK cmuClock_TIMER0
mbed_official 50:a417edff4437 36 #define US_TICKER_TIMER_IRQ TIMER0_IRQn
mbed_official 50:a417edff4437 37
mbed_official 50:a417edff4437 38 /* PWM */
mbed_official 50:a417edff4437 39 #define PWM_TIMER TIMER1
mbed_official 50:a417edff4437 40 #define PWM_TIMER_CLOCK cmuClock_TIMER1
mbed_official 50:a417edff4437 41 #define PWM_ROUTE TIMER_ROUTE_LOCATION_LOC1
mbed_official 50:a417edff4437 42
mbed_official 50:a417edff4437 43 /* Clocks */
mbed_official 50:a417edff4437 44
mbed_official 50:a417edff4437 45 /* Clock definitions */
mbed_official 50:a417edff4437 46 #define LFXO 0
mbed_official 50:a417edff4437 47 #define HFXO 1
mbed_official 50:a417edff4437 48 #define LFRCO 2
mbed_official 50:a417edff4437 49 #define HFRCO 3
mbed_official 50:a417edff4437 50 #define ULFRCO 4
mbed_official 50:a417edff4437 51
mbed_official 50:a417edff4437 52
mbed_official 50:a417edff4437 53 /* Low Energy peripheral clock source.
mbed_official 50:a417edff4437 54 * Options:
mbed_official 54:2a2065e67ef6 55 * * LFXO: external crystal, please define frequency.
mbed_official 54:2a2065e67ef6 56 * * LFRCO: internal RC oscillator (32.768kHz)
mbed_official 54:2a2065e67ef6 57 * * ULFRCO: internal ultra-low power RC oscillator (available down to EM3) (1kHz)
mbed_official 50:a417edff4437 58 */
mbed_official 54:2a2065e67ef6 59 #define LOW_ENERGY_CLOCK_SOURCE LFXO
mbed_official 50:a417edff4437 60
mbed_official 50:a417edff4437 61 /** Core clock source.
mbed_official 50:a417edff4437 62 * Options:
mbed_official 54:2a2065e67ef6 63 * * HFXO: external crystal, please define frequency.
mbed_official 54:2a2065e67ef6 64 * * HFRCO: High-frequency internal RC oscillator. Please select frequency as well.
mbed_official 50:a417edff4437 65 */
mbed_official 54:2a2065e67ef6 66 #define CORE_CLOCK_SOURCE HFXO
mbed_official 50:a417edff4437 67
mbed_official 54:2a2065e67ef6 68 /** HFRCO frequency selection
mbed_official 54:2a2065e67ef6 69 * Options:
mbed_official 54:2a2065e67ef6 70 * ** HFRCO_FREQUENCY_ENUM ** HFRCO_FREQUENCY **
mbed_official 54:2a2065e67ef6 71 * * cmuHFRCOFreq_1M0Hz == 1000000 *
mbed_official 54:2a2065e67ef6 72 * * cmuHFRCOFreq_2M0Hz == 2000000 *
mbed_official 54:2a2065e67ef6 73 * * cmuHFRCOFreq_4M0Hz == 4000000 *
mbed_official 54:2a2065e67ef6 74 * * cmuHFRCOFreq_7M0Hz == 7000000 *
mbed_official 54:2a2065e67ef6 75 * * cmuHFRCOFreq_13M0Hz == 13000000 *
mbed_official 54:2a2065e67ef6 76 * * cmuHFRCOFreq_16M0Hz == 16000000 *
mbed_official 54:2a2065e67ef6 77 * * cmuHFRCOFreq_19M0Hz == 19000000 *
mbed_official 54:2a2065e67ef6 78 * * cmuHFRCOFreq_26M0Hz == 26000000 *
mbed_official 54:2a2065e67ef6 79 * * cmuHFRCOFreq_32M0Hz == 32000000 *
mbed_official 54:2a2065e67ef6 80 * * cmuHFRCOFreq_38M0Hz == 38000000 *
mbed_official 54:2a2065e67ef6 81 * *********************************************
mbed_official 54:2a2065e67ef6 82 */
mbed_official 54:2a2065e67ef6 83
mbed_official 54:2a2065e67ef6 84 /* Make sure the settings of HFRCO_FREQUENCY and HFRCO_FREQUENCY_ENUM match, or timings will be faulty! */
mbed_official 54:2a2065e67ef6 85 #define HFRCO_FREQUENCY_ENUM cmuHFRCOFreq_19M0Hz
mbed_official 54:2a2065e67ef6 86 #define HFRCO_FREQUENCY 19000000
mbed_official 50:a417edff4437 87
mbed_official 54:2a2065e67ef6 88 #define LFXO_FREQUENCY 32768
mbed_official 54:2a2065e67ef6 89 #define HFXO_FREQUENCY 40000000
mbed_official 50:a417edff4437 90
mbed_official 50:a417edff4437 91 #if (LOW_ENERGY_CLOCK_SOURCE == LFXO)
mbed_official 54:2a2065e67ef6 92 #define LOW_ENERGY_CLOCK_FREQUENCY LFXO_FREQUENCY
mbed_official 50:a417edff4437 93 #elif (LOW_ENERGY_CLOCK_SOURCE == LFRCO)
mbed_official 54:2a2065e67ef6 94 #define LOW_ENERGY_CLOCK_FREQUENCY 32768
mbed_official 50:a417edff4437 95 #elif (LOW_ENERGY_CLOCK_SOURCE == ULFRCO)
mbed_official 54:2a2065e67ef6 96 #define LOW_ENERGY_CLOCK_FREQUENCY 1000
mbed_official 50:a417edff4437 97 #else
mbed_official 50:a417edff4437 98 #error "Unknown Low Energy Clock selection"
mbed_official 50:a417edff4437 99 #endif
mbed_official 50:a417edff4437 100
mbed_official 50:a417edff4437 101 #endif