Trimming Support Function Documentation

 

Sys_Trim_LoadTrims

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

 

Location: trim.h:298

 

Load trim values from the specified memory location.

 


Returns:
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);

 

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

 

Sys_Trim_LoadSingleTrim

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

 

Location: trim.h:316

 

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. target_name Voltage regulator or oscillator to load trim values for. target_value1 Main trim target value target_value2 Secondary trim target value used on some regulators.
Returns:
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);


Returns:
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);

 

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.

 

Sys_Trim_VerifyTrims

uint32_t Sys_Trim_VerifyTrims(TRIM_Type * trim_region)

 

Location: trim.h:328

 

Verify if the trims memory is populated correctly.

 


Returns:
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);

 

Parameters

Direction Name Description

in

trim_region

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

 

Sys_Trim_CheckCRC

uint32_t Sys_Trim_CheckCRC(TRIM_Type * trim_region)

 

Location: trim.h:338

 

Check if the CRC for the indicated region is valid.

 


Returns:
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);

 

Parameters

Direction Name Description

in

trim_region

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

 

Sys_Trim_GetTrim

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

 

Location: trim.h:350

 

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

 


Returns:
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);

 

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.

 

Sys_Trim_LoadBandgap

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

 

Location: trim.h:365

 

Load target trim value, if present.

 


Returns:
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_V, TARGET_BANDGAP_I);

 

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.

 

Sys_Trim_LoadDCDC

uint32_t Sys_Trim_LoadDCDC(TRIM_Type * trim_values, uint32_t target)

 

Location: trim.h:378

 

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

 


Returns:
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);

 

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.

 

Sys_Trim_LoadVDDC

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

 

Location: trim.h:390

 

Load target trim value, if present.

 


Returns:
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_1150, TARGET_VDDC_STANDBY);

 

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.

 

Sys_Trim_LoadVDDM

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

 

Location: trim.h:403

 

Load target trim value, if present.

 


Returns:
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_1150, TARGET_VDDM_STANDBY);

 

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.

 

Sys_Trim_LoadVDDPA

uint32_t Sys_Trim_LoadVDDPA(TRIM_Type * trim_values, uint32_t target)

 

Location: trim.h:415

 

Load target trim value, if present.

 


Returns:
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_1600, TARGET_VDDPA_MIN_1100);

 

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.

 

Sys_Trim_LoadVDDRF

uint32_t Sys_Trim_LoadVDDRF(TRIM_Type * trim_values, uint32_t target)

 

Location: trim.h:426

 

Load target trim value, if present.

 


Returns:
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);

 

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.

 

Sys_Trim_LoadCustom

uint32_t Sys_Trim_LoadCustom()

 

Location: trim.h:434

 

Load custom trim values from NVR6.

 


Returns:
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)

 

Location: trim.h:462

 

Load target trim value, if present.

 


Returns:
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);

 

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.

 

Sys_Trim_LoadRCOSC

uint32_t Sys_Trim_LoadRCOSC(TRIM_Type * trim_values, uint32_t target)

 

Location: trim.h:473

 

Load target trim value, if present.

 


Returns:
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);

 

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.

 

Sys_Trim_LoadRCOSC32

uint32_t Sys_Trim_LoadRCOSC32(TRIM_Type * trim_values, uint32_t target)

 

Location: trim.h:484

 

Load target trim value, if present.

 


Returns:
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);

 

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.

 

Sys_Trim_LoadThermistor

uint32_t Sys_Trim_LoadThermistor(TRIM_Type * trim_values, uint16_t target)

 

Location: trim.h:495

 

Load target trim value, if present.

 


Returns:
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);

 

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.

 

Sys_Trim_GetLSADTrim

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

 

Location: trim.h:509

 

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

 

lsadload


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

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);

 

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.