Supplemental Calibration Library Reference Function Documentation

 

Calibrate_Clock_Initialize

void Calibrate_Clock_Initialize()

 

Location: calibrate_clock.h:138

 

Initialize the system to support the clock calibration, consisting of the 48 MHz XTAL oscillator and RC oscillator.

 

 

Example Code for Calibrate_Clock_Initialize

    // Initialize the internal oscillator and sets standby clock source to internal

    // 32 kHz oscillator.

    Calibrate_Clock_Initialize();

 

Calibrate_Clock_32K_RCOSC

unsigned int Calibrate_Clock_32K_RCOSC(uint32_t target, CalClock_Type * final_results)

 

Location: calibrate_clock.h:149

 

Used to calibrate the 32K RC oscillator to a specified frequency.

 


Returns:
status code indicating whether the RCOSC calibration has succeeded.

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

 

Used to calibrate the startup oscillator to a specified frequency.

 


Returns:
Status code indicating whether the clock calibration has succeeded.

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

 

Used to determine if the specified crystal can oscillate correctly.

 


Returns:
Status code indicating whether the selected crystal is oscillating correctly. 1 indicates success, 0 indicates failure.

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:122

 

Initialize the system to support power supply calibration.

 

  1. Changes settings in all power supply control registers to their default values.
  2. Sets the system clock source to RFCLK/3 (16 MHz).
  3. 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_Initialize();

 

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:137

 

Calibrate the radio front-end power supply (VDDRF).

 


Returns:
Status code indicating whether the calibration has succeeded

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]),

                TARGET_VDDRF_1100,

                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:155

 

Calibrate the interfaces power supply (VDDIF).

 


Returns:
Status code indicating whether the calibration has succeeded

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]),

                TARGET_VDDIF_1800,

                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:173

 

Calibrate the flash power supply (VDDFLASH).

 


Returns:
Status code indicating whether the calibration has succeeded

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:189

 

Calibrate the radio power amplifier power supply (VDDPA).

 


Returns:
Status code indicating whether the calibration has succeeded

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]),

                TARGET_VDDPA_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_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:207

 

Calibrate the DC-DC converter (DCDC).

 


Returns:
Status code indicating whether the calibration has succeeded

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]),

                TARGET_DCDC_1200,

                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:223

 

Calibrate the digital core voltage power supply (VDDC).

 


Returns:
Status code indicating whether the calibration has succeeded

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]),

                TARGET_VDDC_1150,

                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:239

 

Calibrate the digital memory voltage (VDDM)

 


Returns:
Status code indicating whether the calibration has succeeded

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]),

                TARGET_VDDM_1150,

                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)