Supplemental Calibration Library Reference Function Documentation
Calibrate_Clock_Initialize
void Calibrate_Clock_Initialize()
Location: calibrate_clock.h:138
| Example Code for Calibrate_Clock_Initialize |
// Initialize the internal oscillator and sets standby clock source to internal // 32 kHz oscillator. |
Calibrate_Clock_32K_RCOSC
unsigned int Calibrate_Clock_32K_RCOSC(uint32_t target, CalClock_Type * final_results)
Location: calibrate_clock.h:149
Returns:
Assumptions
Calibrate_Clock_Initialize() has been called.
| Example Code for Calibrate_Clock_32K_RCOSC |
// Calibrate the interal RC 32768 Hz oscillator. result = Calibrate_Clock_32K_RCOSC(TARGET_RC32K, clock_results); |
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
target |
Number of cycles required to achieve the desired clock frequency in Hz |
|
in |
final_results |
Final trim results |
Calibrate_Clock_Start_OSC
unsigned int Calibrate_Clock_Start_OSC(uint32_t target, CalClock_Type * final_results)
Location: calibrate_clock.h:162
Returns:
Assumptions
Calibrate_Clock_Initialize() has been called.
Assumptions
Standby clock (XTAL32) has been calibrated as close to 32768Hz as possible.
Assumptions
Sets SYSCLK to the RCCLK, not recommended to use while Blue Low Energy is active.
| Example Code for Calibrate_Clock_Start_OSC |
// Calibrate the interal RC start oscillator to 12 MHz. result = Calibrate_Clock_Start_OSC(TARGET_RC12, clock_results); |
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
target |
desired clock frequency in kHz |
|
in |
final_results |
Final trim results |
Calibrate_Clock_CheckXTAL
uint32_t Calibrate_Clock_CheckXTAL(uint32_t xtal, uint32_t gpio)
Location: calibrate_clock.h:174
Returns:
Assumptions
Sets SYSCLK to the RCCLK, not recommended to use while Blue Low Energy is active.
| Example Code for Calibrate_Clock_CheckXTAL |
// Check that the 48MHz crystal is oscillating correctly. result = Calibrate_Clock_CheckXTAL(XTAL_48M, GPIO1); |
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
xtal |
The desired crystal to be checked, use XTAL_[48M | 32K]HZ |
|
in |
gpio |
GPIO that the selected clock will be output on |
Calibrate_Power_Initialize
void Calibrate_Power_Initialize()
Location: calibrate_power.h:128
- Changes settings in all power supply control registers to their default values.
- Sets the system clock source to RFCLK/3 (16 MHz).
- Configures the ADC to enable measurement at 625 Hz
Assumptions
VBAT must be equal to 1.5V if calibrating bandgap.
Example Code for Calibrate_Power_Initialize // Initialze LSAD for measuring voltage rails, turn off automatic compensation
Calibrate_Power_VDDRF
unsigned int Calibrate_Power_VDDRF(unsigned int adc_num, const volatile uint32_t * adc_ptr, uint32_t target, CalPower_Type * final_trim)
Location: calibrate_power.h:143
Returns:
Assumptions
VBG has been calibrated.
Assumptions
Calibrate_Power_Initialize() has been called.
Assumptions
VCC is sufficiently high to trim VDDRF to the desired value. This is because VCC supplies VDDRF.
| Example Code for Calibrate_Power_VDDRF |
// Calibrate VDDRF to 1100 mV. result = Calibrate_Power_VDDRF(LSAD_CALIB_CHANNEL, &(LSAD->DATA_TRIM_CH[LSAD_CALIB_CHANNEL]), pwr_results); |
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
adc_num |
ADC channel number [0-7] |
|
in |
adc_ptr |
Pointer to the ADC data register |
|
in |
target |
Target voltage readback [10*mV] |
|
out |
final_trim |
Result of calibration, trim setting & voltage (mV) |
Calibrate_Power_VDDIF
unsigned int Calibrate_Power_VDDIF(unsigned int adc_num, const volatile uint32_t * adc_ptr, uint32_t target, CalPower_Type * final_trim)
Location: calibrate_power.h:161
Returns:
Assumptions
VBG has been calibrated.
Assumptions
Calibrate_Power_Initialize() has been called.
Assumptions
VDDCP is sufficiently high to trim VDDIF to the desired value. This is because VDDCP supplies VDDIF.
| Example Code for Calibrate_Power_VDDIF |
// Calibrate VDDIF to 1800 mV. result = Calibrate_Power_VDDIF(LSAD_CALIB_CHANNEL, &(LSAD->DATA_TRIM_CH[LSAD_CALIB_CHANNEL]), pwr_results); |
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
adc_num |
ADC channel number [0-7] |
|
in |
adc_ptr |
Pointer to the ADC data register |
|
in |
target |
Target voltage readback [10*mV] |
|
out |
final_trim |
Result of calibration, trim setting & voltage (mV) |
Calibrate_Power_VDDFLASH
unsigned int Calibrate_Power_VDDFLASH(unsigned int adc_num, const volatile uint32_t * adc_ptr, uint32_t target, CalPower_Type * final_trim)
Location: calibrate_power.h:179
Returns:
Assumptions
VBG has been calibrated.
Assumptions
Calibrate_Power_Initialize() has been called.
Assumptions
VDDCP is sufficiently high to trim VDDFLASH to the desired value. This is because VDDCP supplies VDDFLASH.
| Example Code for Calibrate_Power_VDDFLASH |
// Calibrate VDDFLASH to 1600 mV. result = Calibrate_Power_VDDFLASH(LSAD_CALIB_CHANNEL, &(LSAD->DATA_TRIM_CH[LSAD_CALIB_CHANNEL]), TARGET_VDDFLASH_1600, pwr_results); |
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
adc_num |
ADC channel number [0-7] |
|
in |
adc_ptr |
Pointer to the ADC data register |
|
in |
target |
Target voltage readback [10*mV] |
|
out |
final_trim |
Result of calibration, trim setting & voltage (mV) |
Calibrate_Power_VDDPA
unsigned int Calibrate_Power_VDDPA(unsigned int adc_num, const volatile uint32_t * adc_ptr, uint32_t target, CalPower_Type * final_trim)
Location: calibrate_power.h:195
Returns:
Assumptions
VBG has been calibrated.
Assumptions
Calibrate_Power_Initialize() has been called.
| Example Code for Calibrate_Power_VDDPA |
// Calibrate VDDPA to 1600 mV. result = Calibrate_Power_VDDPA(LSAD_CALIB_CHANNEL, &(LSAD->DATA_TRIM_CH[LSAD_CALIB_CHANNEL]), pwr_results); |
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
adc_num |
ADC channel number [0-7] |
|
in |
adc_ptr |
Pointer to the ADC data register |
|
in |
target |
Target voltage readback [10*mV] |
|
out |
final_trim |
Result of calibration, trim setting & voltage (mV) |
Calibrate_Power_DCDC
unsigned int Calibrate_Power_DCDC(unsigned int adc_num, const volatile uint32_t * adc_ptr, uint32_t target, CalPower_Type * final_trim)
Location: calibrate_power.h:213
Returns:
Assumptions
VBG has been calibrated.
Assumptions
User is responsible for selecting LDO or BUCK mode for the DCDC converter
Assumptions
Calibrate_Power_Initialize() has been called.
| Example Code for Calibrate_Power_DCDC |
// Calibrate DCDC to 1200 mV. result = Calibrate_Power_DCDC(LSAD_CALIB_CHANNEL, &(LSAD->DATA_TRIM_CH[LSAD_CALIB_CHANNEL]), pwr_results); |
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
adc_num |
ADC channel number [0-7] |
|
in |
adc_ptr |
Pointer to the ADC data register |
|
in |
target |
Target voltage readback [10*mV] |
|
out |
final_trim |
Result of calibration, trim setting & voltage (mV) |
Calibrate_Power_VDDC
unsigned int Calibrate_Power_VDDC(unsigned int adc_num, const volatile uint32_t * adc_ptr, uint32_t target, CalPower_Type * final_trim)
Location: calibrate_power.h:229
Returns:
Assumptions
VBG has been calibrated.
Assumptions
Calibrate_Power_Initialize() has been called.
| Example Code for Calibrate_Power_VDDC |
// Calibrate VDDC to 1150 mV. result = Calibrate_Power_VDDC(LSAD_CALIB_CHANNEL, &(LSAD->DATA_TRIM_CH[LSAD_CALIB_CHANNEL]), pwr_results); |
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
adc_num |
ADC channel number [0-7] |
|
in |
adc_ptr |
Pointer to the ADC data register |
|
in |
target |
Target voltage readback [10*mV] |
|
out |
final_trim |
Result of calibration, trim setting & voltage (mV) |
Calibrate_Power_VDDM
unsigned int Calibrate_Power_VDDM(unsigned int adc_num, const volatile uint32_t * adc_ptr, uint32_t target, CalPower_Type * final_trim)
Location: calibrate_power.h:245
Returns:
Assumptions
VBG has been calibrated.
Assumptions
Calibrate_Power_Initialize() has been called.
| Example Code for Calibrate_Power_VDDM |
// Calibrate VDDM to 1150 mV. result = Calibrate_Power_VDDM(LSAD_CALIB_CHANNEL, &(LSAD->DATA_TRIM_CH[LSAD_CALIB_CHANNEL]), pwr_results); |
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
adc_num |
ADC channel number [0-7] |
|
in |
adc_ptr |
Pointer to the ADC data register |
|
in |
target |
Target voltage readback [10*mV] |
|
out |
final_trim |
Result of calibration, trim setting & voltage (mV) |