Trimming Support Function Documentation

 

Sys_Trim_LoadTrims

uint32_t Sys_Trim_LoadTrims(TRIM_Type * trim_region, uint32_t targets_1, uint32_t targets_2)

 

Load trim values from the specified memory location.

 

Location: trim.h:301

 

Parameters

Direction Name Description

in

trim_region

Pointer to section of memory containing trim values, typically base of NVR7.

in

targets_1

uint32_t[6] containing targets in this order: DCDC, VDDRF, VDDIF, VDDFLASH, RC 3MHz, RC 32kHz

in

targets_2

uint32_t[4][2] containing targets in this order: Bandgap voltage | Bandgap current VDDC voltage | VDDC standby voltage VDDM voltage | VDDM standby voltage VDDPA voltage | VDDPA minimum voltage

 


Return


A code indicating whether an error has occurred. Error codes: errors

 

NOTE: Does not work with LSAD gain/offset. Use lsadload Sys_Trim_GetLSADTrim() instead.

NOTE: For detail on input parameters, see trim_args1 & 2 in trim.c

 

Example Code for Sys_Trim_LoadTrims

    // Load all valid default trim values from NVR7 for 

    // power rails and oscillators

    result = Sys_Trim_LoadTrims(trim_region);

 

Sys_Trim_LoadSingleTrim

uint32_t Sys_Trim_LoadSingleTrim(uint32_t target_name, uint32_t target_value1, uint32_t target_value2)

 

Load a trim value for a specific voltage regulator or oscillator.

 

This function attempts to load calibration values from customer trim settings in NVR4, then load manufacturing calibration values from NVR7 if customer calibration values are not found.

 

Location: trim.h:319

 

Parameters

Direction Name Description

in

target_name

Voltage regulator or oscillator to load trim values for.

in

target_value1

Main trim target value

in

target_value2

Secondary trim target value used on some regulators.

 


Return


A code indicating whether an error has occurred. Error codes: errors

 

NOTE: Does not work with LSAD gain/offset. Use lsadload Sys_Trim_GetLSADTrim() instead.

 

Example Code for Sys_Trim_LoadSingleTrim

    // Load all valid default trim values from NVR7 for 

    // power rails and oscillators

    result = Sys_Trim_LoadTrims(trim_region);

 

Sys_Trim_VerifyTrims

uint32_t Sys_Trim_VerifyTrims(TRIM_Type * trim_region)

 

Verify if the trims memory is populated correctly.

 

Location: trim.h:331

 

Parameters

Direction Name Description

in

trim_region

Pointer to section of memory containing trim values, typically base of NVR7.

 


Return


A code indicating whether an error has occurred. Error codes: errors

 

 

Example Code for Sys_Trim_VerifyTrims

    // Verify that the input region contains validly prorammed values.

    result = Sys_Trim_VerifyTrims(trim_region);

 

Sys_Trim_CheckCRC

uint32_t Sys_Trim_CheckCRC(TRIM_Type * trim_region)

 

Check if the CRC for the indicated region is valid.

 

Location: trim.h:341

 

Parameters

Direction Name Description

in

trim_region

Pointer to section of memory containing trim values, typically base of NVR7.

 


Return


A code indicating whether an error has occurred. Error codes: errors

 

 

Example Code for Sys_Trim_CheckCRC

    // Performs a CRC on the data in the region storing the trim settings.

    result = Sys_Trim_CheckCRC(trim_region);

 

Sys_Trim_GetTrim

uint32_t Sys_Trim_GetTrim(uint32_t * addr, uint16_t trim_target, uint32_t record_length, uint16_t * trim_val)

 

Get the trim value requested, check if it is valid.

 

Location: trim.h:353

 

Parameters

Direction Name Description

in

addr

Pointer to address of base of trim record.

in

trim_target

Target voltage/current/clock

in

record_length

Number of records for that trim value.

out

trim_val

Pointer to return retrieved trim value.

 


Return


A code indicating whether an error has occurred. Error codes: errors

 

 

Example Code for Sys_Trim_GetTrim

    // Retrieves a trim setting from the indicated region, if that target exists.

    result = Sys_Trim_GetTrim(trim_region, TARGET_RC12, 4, &trim_voltage);

 

Sys_Trim_LoadBandgap

uint32_t Sys_Trim_LoadBandgap(TRIM_Type * trim_values, uint32_t target_v, uint32_t target_i)

 

Load target trim value, if present.

 

Location: trim.h:368

 

Parameters

Direction Name Description

in

trim_values

Pointer to section of memory containing trim values, typically base of NVR7.

in

target_v

The target voltage trim setting.

in

target_i

The target current trim setting.

 


Return


A code indicating whether an error has occurred. Error codes: errors

 

 

Example Code for Sys_Trim_LoadBandgap

    // Loads the bandgap trim settings from NVR7. 

    result = Sys_Trim_LoadBandgap(trim_region, TARGET_BANDGAP_VTARGET_BANDGAP_I);

 

Sys_Trim_LoadDCDC

uint32_t Sys_Trim_LoadDCDC(TRIM_Type * trim_values, uint32_t target)

 

Load target trim value for current mode (LDO or BUCK).

 

Location: trim.h:381

 

Parameters

Direction Name Description

in

trim_values

Pointer to section of memory containing trim values, typically base of NVR7.

in

target

The target voltage trim setting.

 


Return


A code indicating whether an error has occurred. Error codes: errors

 

 

Example Code for Sys_Trim_LoadDCDC

    // Loads the DC-DC converter trim settings from NVR7 for 1.2 V.

    result = Sys_Trim_LoadDCDC(trim_region, TARGET_DCDC_1200);

 

Sys_Trim_LoadVDDC

uint32_t Sys_Trim_LoadVDDC(TRIM_Type * trim_values, uint32_t target, uint32_t target_standby)

 

Load target trim value, if present.

 

Location: trim.h:393

 

Parameters

Direction Name Description

in

trim_values

Pointer to section of memory containing trim values, typically base of NVR7.

in

target

The target voltage trim setting.

in

target_standby

The target standby voltage trim setting.

 


Return


A code indicating whether an error has occurred. Error codes: errors

 

 

Example Code for Sys_Trim_LoadVDDC

    // Loads the VDDC regulator trim settings from NVR7 for 1.15 V.

    result = Sys_Trim_LoadVDDC(trim_region, TARGET_VDDC_1150TARGET_VDDC_STANDBY);

 

Sys_Trim_LoadVDDM

uint32_t Sys_Trim_LoadVDDM(TRIM_Type * trim_values, uint32_t target, uint32_t target_standby)

 

Load target trim value, if present.

 

Location: trim.h:406

 

Parameters

Direction Name Description

in

trim_values

Pointer to section of memory containing trim values, typically base of NVR7.

in

target

The target voltage trim setting.

in

target_standby

The target standby voltage trim setting.

 


Return


A code indicating whether an error has occurred. Error codes: errors

 

 

Example Code for Sys_Trim_LoadVDDM

    // Loads the VDDM regulator trim settings from NVR7 for 1.15 V.

    result = Sys_Trim_LoadVDDM(trim_region, TARGET_VDDM_1150TARGET_VDDM_STANDBY);

 

Sys_Trim_LoadVDDPA

uint32_t Sys_Trim_LoadVDDPA(TRIM_Type * trim_values, uint32_t target)

 

Load target trim value, if present.

 

Location: trim.h:418

 

Parameters

Direction Name Description

in

trim_values

Pointer to section of memory containing trim values, typically base of NVR7.

in

target

The target voltage trim setting.

 


Return


A code indicating whether an error has occurred. Error codes: errors

 

 

Example Code for Sys_Trim_LoadVDDPA

    // Loads the VDDPA regulator trim settings from NVR7 for 1.6 V.

    result = Sys_Trim_LoadVDDPA(trim_region, TARGET_VDDPA_1600TARGET_VDDPA_MIN_1100);

 

Sys_Trim_LoadVDDRF

uint32_t Sys_Trim_LoadVDDRF(TRIM_Type * trim_values, uint32_t target)

 

Load target trim value, if present.

 

Location: trim.h:429

 

Parameters

Direction Name Description

in

trim_values

Pointer to section of memory containing trim values, typically base of NVR7.

in

target

The target voltage trim setting.

 


Return


A code indicating whether an error has occurred. Error codes: errors

 

 

Example Code for Sys_Trim_LoadVDDRF

    // Loads the VDDRF regulator trim settings from NVR7 for 1.1 V. 

    result = Sys_Trim_LoadVDDRF(trim_region, TARGET_VDDRF_1100);

 

Sys_Trim_LoadCustom

uint32_t Sys_Trim_LoadCustom()

 

Load custom trim values from NVR6.

 

Location: trim.h:437

 


Return


A code indicating whether an error has occurred. Error codes: errors

 

 

Example Code for Sys_Trim_LoadCustom

    // Load all valid custom trim values from NVR6

    result = SYS_TRIM_LOAD_CUSTOM()

 

Sys_Trim_LoadVDDFLASH

uint32_t Sys_Trim_LoadVDDFLASH(TRIM_Type * trim_values, uint32_t target)

 

Load target trim value, if present.

 

Location: trim.h:465

 

Parameters

Direction Name Description

in

trim_values

Pointer to section of memory containing trim values, typically base of NVR7.

in

target

The voltage trim setting desired.

 


Return


A code indicating whether an error has occurred. Error codes: errors

 

 

Example Code for Sys_Trim_LoadVDDFLASH

    // Loads the VDDFLASH regulator trim settings from NVR7 for 1.6 V. 

    result = Sys_Trim_LoadVDDFLASH(trim_region, TARGET_VDDFLASH_1600);

 

Sys_Trim_LoadRCOSC

uint32_t Sys_Trim_LoadRCOSC(TRIM_Type * trim_values, uint32_t target)

 

Load target trim value, if present.

 

Location: trim.h:476

 

Parameters

Direction Name Description

in

trim_values

Pointer to section of memory containing trim values, typically base of NVR7.

in

target

The target clock trim setting.

 


Return


A code indicating whether an error has occurred. Error codes: errors

 

 

Example Code for Sys_Trim_LoadRCOSC

    // Loads the RC Start oscillator trim settings from NVR7 for 12 MHz. 

    result = Sys_Trim_LoadRCOSC(trim_region, TARGET_RC12);

 

Sys_Trim_LoadRCOSC32

uint32_t Sys_Trim_LoadRCOSC32(TRIM_Type * trim_values, uint32_t target)

 

Load target trim value, if present.

 

Location: trim.h:487

 

Parameters

Direction Name Description

in

trim_values

Pointer to section of memory containing trim values, typically base of NVR7.

in

target

The target clock trim setting.

 


Return


A code indicating whether an error has occurred. Error codes: errors

 

 

Example Code for Sys_Trim_LoadRCOSC32

    // Loads the RC 32768Hz oscillator trim settings from NVR7 for 32768 Hz. 

    result = Sys_Trim_LoadRCOSC32(trim_region, TARGET_RC32K);

 

Sys_Trim_LoadThermistor

uint32_t Sys_Trim_LoadThermistor(TRIM_Type * trim_values, uint16_t target)

 

Load target trim value, if present.

 

Location: trim.h:498

 

Parameters

Direction Name Description

in

trim_values

Pointer to section of memory containing trim values, typically base of NVR7.

in

target

The target thermistor trim setting.

 


Return


A code indicating whether an error has occurred. Error codes: errors

 

 

Example Code for Sys_Trim_LoadThermistor

    // Loads the trim settings for the thermistor current source. 

    result = Sys_Trim_LoadThermistor(trim_region, TARGET_THERMISTOR_10);

 

Sys_Trim_GetLSADTrim

uint32_t Sys_Trim_GetLSADTrim(uint32_t * addr, uint32_t * gain, uint32_t * offset)

 

Load LSAD gain and offset value from specified address. Verifies valid values first.

 

Location: trim.h:512

 

Parameters

Direction Name Description

in

addr

Pointer to memory containing offset in the first word, and gain in the second word.

out

gain

Pointer to return gain value.

out

offset

Pointer to return offset value.

 


Return


A code indicating whether an error has occurred. Error codes: errors

 

lsadload

NOTE: Assumes format of LSAD gain and offset storage.

 

Example Code for Sys_Trim_GetLSADTrim

    // Loads gain and offset values for the LSAD module from NVR7.

    result = Sys_Trim_GetLSADTrim(trim_region, &gain, &offset);