mbed library sources. Supersedes mbed-src.

Fork of mbed-dev by mbed official

Committer:
fwndz
Date:
Thu Dec 22 05:12:40 2016 +0000
Revision:
153:9398a535854b
Parent:
149:156823d33999
device target maximize

Who changed what in which revision?

UserRevisionLine numberNew contents of line
<> 144:ef7eb2e8f9f7 1
<> 144:ef7eb2e8f9f7 2 # LF Clock configuration using mbed configuration system
<> 144:ef7eb2e8f9f7 3
<> 144:ef7eb2e8f9f7 4 In order to provide the configuration for a low frequency (LF) clock, add a description of the LF clock inside a mbed configuration JSON file.
<> 144:ef7eb2e8f9f7 5 For example at application level the description might be added in a mbed_app.json file and on target level the description might be added in the hal/target.json file.
<> 144:ef7eb2e8f9f7 6 LF clock source configuration is used for MCU startup initialization and the BLE SoftDevice LF clock configuration (if BLE libraries is used). Advanced configurations are used only for the BLE SoftDevice LF clock configuration.
<> 144:ef7eb2e8f9f7 7
<> 144:ef7eb2e8f9f7 8
<> 144:ef7eb2e8f9f7 9 ## Usage:
<> 144:ef7eb2e8f9f7 10
<> 144:ef7eb2e8f9f7 11 1. Clock source
<> 144:ef7eb2e8f9f7 12
<> 144:ef7eb2e8f9f7 13 Default clock source is XTAL oscillator. It is defined at the target level configuration as the target.lf_clock_src key.
<> 144:ef7eb2e8f9f7 14 There are three options that can be configured as the clock source:
<> 144:ef7eb2e8f9f7 15 - NRF_LF_SRC_XTAL
<> 144:ef7eb2e8f9f7 16 - NRF_LF_SRC_RC
<> 144:ef7eb2e8f9f7 17 - NRF_LF_SRC_SYNTH
<> 144:ef7eb2e8f9f7 18
<> 144:ef7eb2e8f9f7 19 In order to override this configuration use targed_override section in configuration file (e.g mbed_app.json)
<> 144:ef7eb2e8f9f7 20
<> 144:ef7eb2e8f9f7 21 ```json
<> 144:ef7eb2e8f9f7 22 {
<> 144:ef7eb2e8f9f7 23 "target_overrides": {
<> 144:ef7eb2e8f9f7 24 "*": {
<> 144:ef7eb2e8f9f7 25 "target.lf_clock_src": "NRF_LF_SRC_XTAL"
<> 144:ef7eb2e8f9f7 26 }
<> 144:ef7eb2e8f9f7 27 }
<> 144:ef7eb2e8f9f7 28 }
<> 144:ef7eb2e8f9f7 29 ```
<> 144:ef7eb2e8f9f7 30
<> 144:ef7eb2e8f9f7 31 2a. Advanced configuration of the LFCLK RC oscillator:
<> 144:ef7eb2e8f9f7 32
<> 144:ef7eb2e8f9f7 33 ```json
<> 144:ef7eb2e8f9f7 34 {
<> 144:ef7eb2e8f9f7 35 "config": {
<> 144:ef7eb2e8f9f7 36 "lf_clock_rc_calib_timer_interval": {
<> 144:ef7eb2e8f9f7 37 "value": 16,
<> 144:ef7eb2e8f9f7 38 "macro_name": "MBED_CONF_NORDIC_NRF_LF_CLOCK_CALIB_TIMER_INTERVAL"
<> 144:ef7eb2e8f9f7 39 },
<> 144:ef7eb2e8f9f7 40 "lf_clock_rc_calib_mode_config": {
<> 144:ef7eb2e8f9f7 41 "value": 1,
<> 144:ef7eb2e8f9f7 42 "macro_name": "MBED_CONF_NORDIC_NRF_LF_CLOCK_CALIB_MODE_CONFIG"
<> 144:ef7eb2e8f9f7 43 }
<> 144:ef7eb2e8f9f7 44 }
<> 144:ef7eb2e8f9f7 45 }
<> 144:ef7eb2e8f9f7 46
<> 144:ef7eb2e8f9f7 47 ```
<> 144:ef7eb2e8f9f7 48
<> 144:ef7eb2e8f9f7 49 "lf_clock_rc_calib_timer_interval" - Calibration timer interval in 250 ms. It is equivalent to nrf_clock_lf_cfg_t::rc_ctiv.
<> 144:ef7eb2e8f9f7 50 This item generates macro MBED_CONF_NORDIC_NRF_LF_CLOCK_CALIB_TIMER_INTERVAL.
<> 144:ef7eb2e8f9f7 51 By default, such configuration is set to 16.
<> 144:ef7eb2e8f9f7 52
<> 144:ef7eb2e8f9f7 53 "lf_clock_rc_calib_mode_config" - This value configures how often the RC oscillator will be calibrated, in number of calibration intervals.
<> 144:ef7eb2e8f9f7 54 It is equivalent to nrf_clock_lf_cfg_t::rc_temp_ctiv.
<> 144:ef7eb2e8f9f7 55 For further information, see the documentation for the [API of a SoftDevice 13x version 2.0.0](http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v2.0.0/structnrf__clock__lf__cfg__t.html)
<> 144:ef7eb2e8f9f7 56 This item generates macro MBED_CONF_NORDIC_NRF_LF_CLOCK_CALIB_MODE_CONFIG.
<> 144:ef7eb2e8f9f7 57 By default, such configuration is set to 1.
<> 144:ef7eb2e8f9f7 58
<> 144:ef7eb2e8f9f7 59 2b. Advanced configuration of the LFCLK XTAL oscillator:
<> 144:ef7eb2e8f9f7 60
<> 144:ef7eb2e8f9f7 61 Accuracy of the clock source can be set. In order to do so macro MBED_CONF_NORDIC_LF_CLOCK_XTAL_ACCURACY should been provided (e.g. in mbed_app.json).
<> 144:ef7eb2e8f9f7 62 By default such configuration is set to NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM.
<> 144:ef7eb2e8f9f7 63 For further information, see the documentation for the [API of a SoftDevice 13x version 2.0.0](https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s132.api.v2.0.0%2Fgroup___n_r_f___s_d_m___d_e_f_i_n_e_s.html)
<> 144:ef7eb2e8f9f7 64
<> 144:ef7eb2e8f9f7 65 ```json
<> 144:ef7eb2e8f9f7 66 {
<> 144:ef7eb2e8f9f7 67 "config": {
<> 144:ef7eb2e8f9f7 68 "lf_clock_xtal_accuracy": {
<> 144:ef7eb2e8f9f7 69 "value": "NRF_CLOCK_LF_XTAL_ACCURACY_250_PPM",
<> 144:ef7eb2e8f9f7 70 "macro_name": "MBED_CONF_NORDIC_LF_CLOCK_XTAL_ACCURACY"
<> 144:ef7eb2e8f9f7 71 }
<> 144:ef7eb2e8f9f7 72 }
<> 144:ef7eb2e8f9f7 73 }
<> 144:ef7eb2e8f9f7 74
<> 144:ef7eb2e8f9f7 75 ```
<> 144:ef7eb2e8f9f7 76
<> 144:ef7eb2e8f9f7 77
<> 144:ef7eb2e8f9f7 78
<> 144:ef7eb2e8f9f7 79 2c. Advance configuration of the LFCLK Synthesized from HFCLK:
<> 144:ef7eb2e8f9f7 80
<> 144:ef7eb2e8f9f7 81 Accuracy of the clock source can be set. In order to do so macro MBED_CONF_NORDIC_LF_CLOCK_SYNTH_ACCURACY should been provided (e.g. in mbed_app.json).
<> 144:ef7eb2e8f9f7 82 By default, such configuration is set to NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM.
<> 144:ef7eb2e8f9f7 83 For further information, see the documentation for the [API of a SoftDevice 13x version 2.0.0](https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s132.api.v2.0.0%2Fgroup___n_r_f___s_d_m___d_e_f_i_n_e_s.html)
<> 144:ef7eb2e8f9f7 84
<> 144:ef7eb2e8f9f7 85 ```json
<> 144:ef7eb2e8f9f7 86 {
<> 144:ef7eb2e8f9f7 87 "config": {
<> 144:ef7eb2e8f9f7 88 "lf_clock_synth_accuracy": {
<> 144:ef7eb2e8f9f7 89 "value": "NRF_CLOCK_LF_SYNTH_ACCURACY_250_PPM",
<> 144:ef7eb2e8f9f7 90 "macro_name": "MBED_CONF_NORDIC_LF_CLOCK_XTAL_ACCURACY"
<> 144:ef7eb2e8f9f7 91 }
<> 144:ef7eb2e8f9f7 92 }
<> 144:ef7eb2e8f9f7 93 }
<> 144:ef7eb2e8f9f7 94
<> 144:ef7eb2e8f9f7 95 ```
<> 144:ef7eb2e8f9f7 96
<> 144:ef7eb2e8f9f7 97