Data Fields
PowerMSP432_PerfLevel Struct Reference

Structure defining a performance level. More...

#include <PowerMSP432.h>

Data Fields

unsigned int activeState
 The active state for the device. More...
 
unsigned int VCORE
 The core voltage level. More...
 
unsigned int clockSource
 The clock source for this performance level. More...
 
unsigned int DCORESEL
 The DCO frequency range selection. More...
 
unsigned int SELM
 The MCLK source. More...
 
unsigned int DIVM
 The MCLK source divider. More...
 
unsigned int SELS
 The HSMCLK and SMCLK source. More...
 
unsigned int DIVHS
 The HSMCLK source divider. More...
 
unsigned int DIVS
 The SMCLK source divider. More...
 
unsigned int SELB
 The BCLK source. More...
 
unsigned int SELA
 The ACLK source. More...
 
unsigned int DIVA
 The ACLK source divider. More...
 
unsigned int flashWaitStates
 The number of Flash wait-states to be used for this performance level. More...
 
bool enableFlashBuffer
 Boolean specifying if Flash read buffering should be enabled for this performance level. More...
 
unsigned int MCLK
 The expected MCLK frequency for this performance level, in Hz. More...
 
unsigned int HSMCLK
 The expected HSMCLK frequency for this performance level, in Hz. More...
 
unsigned int SMCLK
 The expected SMCLK frequency for this performance level, in Hz. More...
 
unsigned int BCLK
 The BCLK frequency for this performance level. Currently only 32768 Hz is supported. More...
 
unsigned int ACLK
 The ACLK frequency for this performance level. Currently only 32768 Hz is supported. More...
 

Detailed Description

Structure defining a performance level.

The MCU performance level can be set with Power_setPerformanceLevel(). A performance level is defined by this PowerMSP432_PerfLevel structure.

The Power driver currently supports four pre-defined performance levels:

Level MCLK (MHz) HSMCLK (MHz) SMCLK (MHz) ACLK (Hz)
----- ---------- ------------ ----------- ---------
0 12 3 3 32768
1 24 6 6 32768
2 48 24 12 32768
3 48 48 24 32768

Up to four optional 'custom' performance levels can be defined by the user. Performance levels are designated by an index, starting with zero. Any custom performance levels will be indexed following the last pre-defined level. For example, if there are 4 pre-defined levels, they will have indices from '0' to '3'. If there are custom levels defined, they will be indexed starting with '4'.

Eight performance level constraints are supported, one for each of the four pre-defined levels:

plus four for the optional custom performance levels:

The parameters that are used to define a performance level are shown below.

Warning
There is very limited runtime error checking of the different parameters, and no checking that the ratios and parameter combinations do not result in an invalid device configuration (which could overclock or damage the device). It is therefore critical that the user ensures the values specified for a custom performance level are correct.

To define custom performance levels the user must add an array of PowerMSP432_PerfLevel structures to their board file, and then reference this array in the PowerMSP432_config structure. An example is shown below.

First, if not already included in the board file, add the includes of cs.h and pcm.h

#include <ti/devices/msp432p4xx/driverlib/cs.h>
#include <ti/devices/msp432p4xx/driverlib/pcm.h>

Next, add an array with two new performance levels:

PowerMSP432_PerfLevel myPerfLevels[] = {
{ .activeState = PCM_AM_DCDC_VCORE0,
.VCORE = 0,
.DCORESEL = CS_DCO_FREQUENCY_12,
.SELM = CS_HFXTCLK_SELECT,
.DIVM = CS_CLOCK_DIVIDER_4,
.SELS = CS_HFXTCLK_SELECT,
.DIVHS = CS_CLOCK_DIVIDER_16,
.DIVS = CS_CLOCK_DIVIDER_16,
.SELB = CS_LFXTCLK_SELECT,
.SELA = CS_LFXTCLK_SELECT,
.DIVA = CS_CLOCK_DIVIDER_1,
.flashWaitStates = 0,
.enableFlashBuffer = false,
.MCLK = 12000000,
.HSMCLK = 3000000,
.SMCLK = 3000000,
.BCLK = 32768,
.ACLK = 32768
},
{ .activeState = PCM_AM_DCDC_VCORE0,
.VCORE = 0,
.DCORESEL = CS_DCO_FREQUENCY_24,
.SELM = CS_DCOCLK_SELECT,
.DIVM = CS_CLOCK_DIVIDER_1,
.SELS = CS_DCOCLK_SELECT,
.DIVHS = CS_CLOCK_DIVIDER_4,
.DIVS = CS_CLOCK_DIVIDER_4,
.SELB = CS_REFOCLK_SELECT,
.SELA = CS_REFOCLK_SELECT,
.DIVA = CS_CLOCK_DIVIDER_1,
.flashWaitStates = 1,
.enableFlashBuffer = true,
.MCLK = 24000000,
.HSMCLK = 6000000,
.SMCLK = 6000000,
.BCLK = 32768,
.ACLK = 32768
},
};

Then, update the PowerMSP432_config structure to 1) reference the new custom levels, and 2) as appropriate, enable extended performance scaling support, and define the relevant extended configuration parameters. In the first custom perf level shown above the HFXT and LFXT crystals are used as clock sources, so for this example the extended support parameters need to be specfied.

The code below shows additions to the PowerMSP432_config structure for this example. The first two additions to PowerMSP432_config reference the array of custom perf levels, and indicate the number of custom levels. The third addition enables extended support for crystals. The remaining parameters define crystal settings, plus an application-provided ISR function for handling any Clock System fault interrupts.

const PowerMSP432_ConfigV1 PowerMSP432_config = {
...
.customPerfLevels = myPerfLevels,
.numCustom = sizeof(myPerfLevels) / sizeof(PowerMSP432_PerfLevel),
.useExtendedPerf = true,
.HFXTFREQ = CS_48MHZ,
.configurePinHFXT = true,
.bypassHFXT = false,
.configurePinLFXT = true,
.bypassLFXT = false,
.LFXTDRIVE = CS_LFXT_DRIVE3,
.enableInterruptsCS = true,
.priorityInterruptsCS = ~0,
.isrCS = &isrCS
};

Field Documentation

§ activeState

unsigned int PowerMSP432_PerfLevel::activeState

The active state for the device.

The states are identified by the enumerations in pcm.h. The supported active states are: PCM_AM_LDO_VCORE0, PM_AM_LDO_VCORE1, PCM_AM_DCDC_VCORE0, PCM_AM_DCDC_VCORE1. Usage of DCDC states requires that the DCDC is available for the device and board configuration.

§ VCORE

unsigned int PowerMSP432_PerfLevel::VCORE

The core voltage level.

The supported levels are '0' indicating VCORE0, and '1' indicating VCORE1.

§ clockSource

unsigned int PowerMSP432_PerfLevel::clockSource

The clock source for this performance level.

This configuration parameter is not currently used.

§ DCORESEL

unsigned int PowerMSP432_PerfLevel::DCORESEL

The DCO frequency range selection.

The nominal DCO frequency is specified via an enumerated value defined in cs.h, for example: CS_DCO_FREQUENCY_12, CS_DCO_FREQUENCY_24, etc.

§ SELM

unsigned int PowerMSP432_PerfLevel::SELM

The MCLK source.

The source is specified via an enumerated value from cs.h, for example: CS_DCOCLK_SELECT, CS_HFXTCLK_SELECT, etc.

§ DIVM

unsigned int PowerMSP432_PerfLevel::DIVM

The MCLK source divider.

The divide value is specified via an enumerated value from cs.h, for example: CS_CLOCKDIVIDER_1, CS_CLOCKDIVIDER_2, etc.

§ SELS

unsigned int PowerMSP432_PerfLevel::SELS

The HSMCLK and SMCLK source.

The source is specified via an enumerated value from cs.h, for example: CS_DCOCLK_SELECT, CS_HFXTCLK_SELECT, etc.

§ DIVHS

unsigned int PowerMSP432_PerfLevel::DIVHS

The HSMCLK source divider.

The divide value is specified via an enumerated value from cs.h, for example: CS_CLOCKDIVIDER_1, CS_CLOCKDIVIDER_2, etc.

§ DIVS

unsigned int PowerMSP432_PerfLevel::DIVS

The SMCLK source divider.

The divide value is specified via an enumerated value from cs.h, for example: CS_CLOCKDIVIDER_1, CS_CLOCKDIVIDER_2, etc.

§ SELB

unsigned int PowerMSP432_PerfLevel::SELB

The BCLK source.

The source is specified via an enumerated value from cs.h, for example: CS_REFOCLK_SELECT, CS_DCOCLK_SELECT, etc.

§ SELA

unsigned int PowerMSP432_PerfLevel::SELA

The ACLK source.

The source is specified via an enumerated value from cs.h, for example: CS_REFOCLK_SELECT, CS_DCOCLK_SELECT, etc.

§ DIVA

unsigned int PowerMSP432_PerfLevel::DIVA

The ACLK source divider.

The divide value is specified via an enumerated value from cs.h, for example: CS_CLOCKDIVIDER_1, CS_CLOCKDIVIDER_2, etc.

§ flashWaitStates

unsigned int PowerMSP432_PerfLevel::flashWaitStates

The number of Flash wait-states to be used for this performance level.

The number of wait-states is specified as a positive integer value.

§ enableFlashBuffer

bool PowerMSP432_PerfLevel::enableFlashBuffer

Boolean specifying if Flash read buffering should be enabled for this performance level.

If 'true', buffering will be enabled; if 'false', buffering will be disabled.

§ MCLK

unsigned int PowerMSP432_PerfLevel::MCLK

The expected MCLK frequency for this performance level, in Hz.

Note that this is an informational value; it is the expected MCLK frequency given the DCO frequency and source dividers specified above.

§ HSMCLK

unsigned int PowerMSP432_PerfLevel::HSMCLK

The expected HSMCLK frequency for this performance level, in Hz.

Note that this is an informational value; it is the expected HSMCLK frequency given the DCO frequency and source dividers specified above.

§ SMCLK

unsigned int PowerMSP432_PerfLevel::SMCLK

The expected SMCLK frequency for this performance level, in Hz.

Note that this is an informational value; it is the expected SMCLK frequency given the DCO frequency and source dividers specified above.

§ BCLK

unsigned int PowerMSP432_PerfLevel::BCLK

The BCLK frequency for this performance level. Currently only 32768 Hz is supported.

§ ACLK

unsigned int PowerMSP432_PerfLevel::ACLK

The ACLK frequency for this performance level. Currently only 32768 Hz is supported.


The documentation for this struct was generated from the following file:
© Copyright 1995-2018, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale