added prescaler for 16 bit pwm in LPC1347 target
Fork of mbed-dev by
targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32ZG_STK3200/device_peripherals.h@54:2a2065e67ef6, 2016-01-28 (annotated)
- Committer:
- mbed_official
- Date:
- Thu Jan 28 18:15:10 2016 +0000
- Revision:
- 54:2a2065e67ef6
- Parent:
- 0:9b334a45a8ff
- 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?
User | Revision | Line number | New contents of line |
---|---|---|---|
bogdanm | 0:9b334a45a8ff | 1 | /***************************************************************************//** |
bogdanm | 0:9b334a45a8ff | 2 | * @file device_peripheral.h |
bogdanm | 0:9b334a45a8ff | 3 | ******************************************************************************* |
bogdanm | 0:9b334a45a8ff | 4 | * @section License |
bogdanm | 0:9b334a45a8ff | 5 | * <b>(C) Copyright 2015 Silicon Labs, http://www.silabs.com</b> |
bogdanm | 0:9b334a45a8ff | 6 | ******************************************************************************* |
bogdanm | 0:9b334a45a8ff | 7 | * |
bogdanm | 0:9b334a45a8ff | 8 | * Permission is granted to anyone to use this software for any purpose, |
bogdanm | 0:9b334a45a8ff | 9 | * including commercial applications, and to alter it and redistribute it |
bogdanm | 0:9b334a45a8ff | 10 | * freely, subject to the following restrictions: |
bogdanm | 0:9b334a45a8ff | 11 | * |
bogdanm | 0:9b334a45a8ff | 12 | * 1. The origin of this software must not be misrepresented; you must not |
bogdanm | 0:9b334a45a8ff | 13 | * claim that you wrote the original software. |
bogdanm | 0:9b334a45a8ff | 14 | * 2. Altered source versions must be plainly marked as such, and must not be |
bogdanm | 0:9b334a45a8ff | 15 | * misrepresented as being the original software. |
bogdanm | 0:9b334a45a8ff | 16 | * 3. This notice may not be removed or altered from any source distribution. |
bogdanm | 0:9b334a45a8ff | 17 | * |
bogdanm | 0:9b334a45a8ff | 18 | * DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Silicon Labs has no |
bogdanm | 0:9b334a45a8ff | 19 | * obligation to support this Software. Silicon Labs is providing the |
bogdanm | 0:9b334a45a8ff | 20 | * Software "AS IS", with no express or implied warranties of any kind, |
bogdanm | 0:9b334a45a8ff | 21 | * including, but not limited to, any implied warranties of merchantability |
bogdanm | 0:9b334a45a8ff | 22 | * or fitness for any particular purpose or warranties against infringement |
bogdanm | 0:9b334a45a8ff | 23 | * of any proprietary rights of a third party. |
bogdanm | 0:9b334a45a8ff | 24 | * |
bogdanm | 0:9b334a45a8ff | 25 | * Silicon Labs will not be liable for any consequential, incidental, or |
bogdanm | 0:9b334a45a8ff | 26 | * special damages, or any other relief, or for any claim by any third party, |
bogdanm | 0:9b334a45a8ff | 27 | * arising from your use of this Software. |
bogdanm | 0:9b334a45a8ff | 28 | * |
bogdanm | 0:9b334a45a8ff | 29 | ******************************************************************************/ |
bogdanm | 0:9b334a45a8ff | 30 | #ifndef MBED_DEVICE_PERIPHERALS_H |
bogdanm | 0:9b334a45a8ff | 31 | #define MBED_DEVICE_PERIPHERALS_H |
bogdanm | 0:9b334a45a8ff | 32 | |
bogdanm | 0:9b334a45a8ff | 33 | /* us ticker */ |
bogdanm | 0:9b334a45a8ff | 34 | #define US_TICKER_TIMER TIMER1 |
bogdanm | 0:9b334a45a8ff | 35 | #define US_TICKER_TIMER_CLOCK cmuClock_TIMER1 |
bogdanm | 0:9b334a45a8ff | 36 | #define US_TICKER_TIMER_IRQ TIMER1_IRQn |
bogdanm | 0:9b334a45a8ff | 37 | |
bogdanm | 0:9b334a45a8ff | 38 | /* PWM */ |
bogdanm | 0:9b334a45a8ff | 39 | #define PWM_TIMER TIMER0 |
bogdanm | 0:9b334a45a8ff | 40 | #define PWM_TIMER_CLOCK cmuClock_TIMER0 |
bogdanm | 0:9b334a45a8ff | 41 | #define PWM_ROUTE TIMER_ROUTE_LOCATION_LOC0 |
bogdanm | 0:9b334a45a8ff | 42 | |
bogdanm | 0:9b334a45a8ff | 43 | /* Clocks */ |
bogdanm | 0:9b334a45a8ff | 44 | |
bogdanm | 0:9b334a45a8ff | 45 | /* Clock definitions */ |
bogdanm | 0:9b334a45a8ff | 46 | #define LFXO 0 |
bogdanm | 0:9b334a45a8ff | 47 | #define HFXO 1 |
bogdanm | 0:9b334a45a8ff | 48 | #define LFRCO 2 |
bogdanm | 0:9b334a45a8ff | 49 | #define HFRCO 3 |
bogdanm | 0:9b334a45a8ff | 50 | #if !defined(_EFM32_GECKO_FAMILY) |
bogdanm | 0:9b334a45a8ff | 51 | #define ULFRCO 4 |
bogdanm | 0:9b334a45a8ff | 52 | #endif |
bogdanm | 0:9b334a45a8ff | 53 | |
bogdanm | 0:9b334a45a8ff | 54 | /* Low Energy peripheral clock source. |
bogdanm | 0:9b334a45a8ff | 55 | * Options: |
bogdanm | 0:9b334a45a8ff | 56 | * * LFXO: external crystal, please define frequency. |
bogdanm | 0:9b334a45a8ff | 57 | * * LFRCO: internal RC oscillator (32.768kHz) |
bogdanm | 0:9b334a45a8ff | 58 | * * ULFRCO: internal ultra-low power RC oscillator (available down to EM3) (1kHz) |
bogdanm | 0:9b334a45a8ff | 59 | */ |
bogdanm | 0:9b334a45a8ff | 60 | #define LOW_ENERGY_CLOCK_SOURCE LFXO |
bogdanm | 0:9b334a45a8ff | 61 | |
bogdanm | 0:9b334a45a8ff | 62 | /** Core clock source. |
bogdanm | 0:9b334a45a8ff | 63 | * Options: |
bogdanm | 0:9b334a45a8ff | 64 | * * HFXO: external crystal, please define frequency. |
bogdanm | 0:9b334a45a8ff | 65 | * * HFRCO: High-frequency internal RC oscillator. Please select band as well. |
bogdanm | 0:9b334a45a8ff | 66 | */ |
bogdanm | 0:9b334a45a8ff | 67 | #define CORE_CLOCK_SOURCE HFXO |
bogdanm | 0:9b334a45a8ff | 68 | |
bogdanm | 0:9b334a45a8ff | 69 | /** HFRCO frequency band |
bogdanm | 0:9b334a45a8ff | 70 | * Options: |
mbed_official | 54:2a2065e67ef6 | 71 | * * _CMU_HFRCOCTRL_BAND_21MHZ |
mbed_official | 54:2a2065e67ef6 | 72 | * * _CMU_HFRCOCTRL_BAND_14MHZ |
mbed_official | 54:2a2065e67ef6 | 73 | * * _CMU_HFRCOCTRL_BAND_11MHZ |
mbed_official | 54:2a2065e67ef6 | 74 | * * _CMU_HFRCOCTRL_BAND_7MHZ |
mbed_official | 54:2a2065e67ef6 | 75 | * * _CMU_HFRCOCTRL_BAND_1MHZ |
bogdanm | 0:9b334a45a8ff | 76 | */ |
mbed_official | 54:2a2065e67ef6 | 77 | #define HFRCO_FREQUENCY _CMU_HFRCOCTRL_BAND_21MHZ |
bogdanm | 0:9b334a45a8ff | 78 | |
bogdanm | 0:9b334a45a8ff | 79 | #define LFXO_FREQUENCY 32768 |
bogdanm | 0:9b334a45a8ff | 80 | #define HFXO_FREQUENCY 24000000 |
bogdanm | 0:9b334a45a8ff | 81 | |
bogdanm | 0:9b334a45a8ff | 82 | #if (LOW_ENERGY_CLOCK_SOURCE == LFXO) |
bogdanm | 0:9b334a45a8ff | 83 | #define LOW_ENERGY_CLOCK_FREQUENCY LFXO_FREQUENCY |
bogdanm | 0:9b334a45a8ff | 84 | #elif (LOW_ENERGY_CLOCK_SOURCE == LFRCO) |
bogdanm | 0:9b334a45a8ff | 85 | #define LOW_ENERGY_CLOCK_FREQUENCY 32768 |
bogdanm | 0:9b334a45a8ff | 86 | #elif (LOW_ENERGY_CLOCK_SOURCE == ULFRCO) |
bogdanm | 0:9b334a45a8ff | 87 | #define LOW_ENERGY_CLOCK_FREQUENCY 1000 |
bogdanm | 0:9b334a45a8ff | 88 | #else |
bogdanm | 0:9b334a45a8ff | 89 | #error "Unknown Low Energy Clock selection" |
bogdanm | 0:9b334a45a8ff | 90 | #endif |
bogdanm | 0:9b334a45a8ff | 91 | |
bogdanm | 0:9b334a45a8ff | 92 | #endif |