![]() |
![]() |
|
MSPM0G1X0X_G3X0X Driver Library
1.10.01.05
|
|
Modules | |
| DL_TRNG_INTERRUPT | |
| DL_TRNG_HEALTH_TEST_SUCCESS | |
Data Structures | |
| struct | DL_TRNG_backupConfig |
| Configuration structure to backup TRNG peripheral state before going to STOP/STANDBY mode. Not required after PG 1.0 silicon. Used by DL_TRNG_saveConfiguration. More... | |
Functions | |
| __STATIC_INLINE void | DL_TRNG_enablePower (TRNG_Regs *trng) |
| Enables power on TRNG module. More... | |
| __STATIC_INLINE void | DL_TRNG_disablePower (TRNG_Regs *trng) |
| Disable power on TRNG module. More... | |
| __STATIC_INLINE DL_TRNG_CLOCK_DIVIDE | DL_TRNG_getClockDivider (TRNG_Regs *trng) |
| Get the clock divider on the TRNG module. More... | |
| __STATIC_INLINE void | DL_TRNG_setClockDivider (TRNG_Regs *trng, DL_TRNG_CLOCK_DIVIDE clockDivider) |
| Set the clock divider on the TRNG module. More... | |
| __STATIC_INLINE void | DL_TRNG_reset (TRNG_Regs *trng) |
| Resets the TRNG module. More... | |
| __STATIC_INLINE bool | DL_TRNG_isReset (TRNG_Regs *trng) |
| Returns if TRNG peripheral was reset. More... | |
| __STATIC_INLINE bool | DL_TRNG_isCaptureReady (TRNG_Regs *trng) |
| Returns if the data capture is ready. More... | |
| __STATIC_INLINE bool | DL_TRNG_isCommandDone (TRNG_Regs *trng) |
| Returns if the issued TRNG command is done. More... | |
| __STATIC_INLINE bool | DL_TRNG_isCommandFail (TRNG_Regs *trng) |
| Returns if the issued TRNG command failed. More... | |
| __STATIC_INLINE bool | DL_TRNG_isHealthTestFail (TRNG_Regs *trng) |
| Returns if a health test failed. More... | |
| __STATIC_INLINE void | DL_TRNG_setDecimationRate (TRNG_Regs *trng, DL_TRNG_DECIMATION_RATE decimationRate) |
| Set the decimation rate. More... | |
| __STATIC_INLINE DL_TRNG_DECIMATION_RATE | DL_TRNG_getDecimationRate (TRNG_Regs *trng) |
| Get the decimation rate. More... | |
| __STATIC_INLINE uint8_t | DL_TRNG_getDigitalHealthTestResults (TRNG_Regs *trng) |
| Get the digital health test results. More... | |
| __STATIC_INLINE uint8_t | DL_TRNG_getAnalogHealthTestResults (TRNG_Regs *trng) |
| Get the analog health test results. More... | |
| __STATIC_INLINE uint32_t | DL_TRNG_getCurrentState (TRNG_Regs *trng) |
| Get the current state of the TRNG front end FSM. More... | |
| __STATIC_INLINE uint32_t | DL_TRNG_getIssuedCommand (TRNG_Regs *trng) |
| Get the last accepted command that was issued to the TRNG. More... | |
| __STATIC_INLINE bool | DL_TRNG_isRepetitionTestFail (TRNG_Regs *trng) |
| Indicates if the repetition counter test caused the most recent failure. More... | |
| __STATIC_INLINE bool | DL_TRNG_isAdaptiveTestFail (TRNG_Regs *trng) |
| Indicates if the Adaptive Proportion Test (1,2,3, or 4-bit counters) caused the most recent failure. More... | |
| __STATIC_INLINE void | DL_TRNG_enableInterrupt (TRNG_Regs *trng, uint32_t interruptMask) |
| Enable TRNG interrupt. More... | |
| __STATIC_INLINE void | DL_TRNG_disableInterrupt (TRNG_Regs *trng, uint32_t interruptMask) |
| Disable TRNG interrupt. More... | |
| __STATIC_INLINE uint32_t | DL_TRNG_getEnabledInterrupts (TRNG_Regs *trng, uint32_t interruptMask) |
| Check which TRNG interrupts are enabled. More... | |
| __STATIC_INLINE uint32_t | DL_TRNG_getEnabledInterruptStatus (TRNG_Regs *trng, uint32_t interruptMask) |
| Check interrupt flag of enabled TRNG interrupt. More... | |
| __STATIC_INLINE uint32_t | DL_TRNG_getRawInterruptStatus (TRNG_Regs *trng, uint32_t interruptMask) |
| Check interrupt flag of any TRNG interrupt. More... | |
| __STATIC_INLINE DL_TRNG_IIDX | DL_TRNG_getPendingInterrupt (TRNG_Regs *trng) |
| Get highest priority pending TRNG interrupt. More... | |
| __STATIC_INLINE void | DL_TRNG_clearInterruptStatus (TRNG_Regs *trng, uint32_t interruptMask) |
| Clear pending TRNG interrupt. More... | |
| __STATIC_INLINE void | DL_TRNG_sendCommand (TRNG_Regs *trng, DL_TRNG_CMD cmd) |
| Update control register's command bits to send a TRNG command. More... | |
| __STATIC_INLINE uint32_t | DL_TRNG_getCapture (TRNG_Regs *trng) |
| Get word capture from TRNG. More... | |
| bool | DL_TRNG_saveConfiguration (TRNG_Regs *trng, DL_TRNG_backupConfig *ptr) |
| Save TRNG configuration before entering a power loss state. Only necessary for PG 1.0 silicon. More... | |
| bool | DL_TRNG_restoreConfiguration (TRNG_Regs *trng, DL_TRNG_backupConfig *ptr) |
| Restore TRNG configuration after leaving a power loss state. Upon restoration, if the TRNG was not originally in OFF state, then the TRNG will be set to the normal operating mode. Only necessary for PG 1.0 silicon. More... | |
The True Random Number Generator Driver Library allows full configuration of the MSPM0 TRNG module. The true random number generator (TRNG) block is an entropy source which can be used to generate random bit sequences.
| enum DL_TRNG_IIDX |
| enum DL_TRNG_CMD |
| enum DL_TRNG_CLOCK_DIVIDE |
| enum DL_TRNG_STATE |
| __STATIC_INLINE void DL_TRNG_enablePower | ( | TRNG_Regs * | trng | ) |
Enables power on TRNG module.
| trng | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE void DL_TRNG_disablePower | ( | TRNG_Regs * | trng | ) |
Disable power on TRNG module.
| trng | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE DL_TRNG_CLOCK_DIVIDE DL_TRNG_getClockDivider | ( | TRNG_Regs * | trng | ) |
Get the clock divider on the TRNG module.
| trng | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE void DL_TRNG_setClockDivider | ( | TRNG_Regs * | trng, |
| DL_TRNG_CLOCK_DIVIDE | clockDivider | ||
| ) |
Set the clock divider on the TRNG module.
| trng | Pointer to the register overlay for the peripheral |
| clockDivider | Clock divider value for the TRNG module. One of DL_TRNG_CLOCK_DIVIDE |
| __STATIC_INLINE void DL_TRNG_reset | ( | TRNG_Regs * | trng | ) |
Resets the TRNG module.
| trng | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE bool DL_TRNG_isReset | ( | TRNG_Regs * | trng | ) |
Returns if TRNG peripheral was reset.
| trng | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE bool DL_TRNG_isCaptureReady | ( | TRNG_Regs * | trng | ) |
Returns if the data capture is ready.
| trng | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE bool DL_TRNG_isCommandDone | ( | TRNG_Regs * | trng | ) |
Returns if the issued TRNG command is done.
| trng | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE bool DL_TRNG_isCommandFail | ( | TRNG_Regs * | trng | ) |
Returns if the issued TRNG command failed.
| trng | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE bool DL_TRNG_isHealthTestFail | ( | TRNG_Regs * | trng | ) |
Returns if a health test failed.
| trng | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE void DL_TRNG_setDecimationRate | ( | TRNG_Regs * | trng, |
| DL_TRNG_DECIMATION_RATE | decimationRate | ||
| ) |
Set the decimation rate.
| trng | Pointer to the register overlay for the peripheral |
| decimationRate | Decimation rate to set. One of DL_TRNG_DECIMATION_RATE |
References DL_Common_updateReg().
| __STATIC_INLINE DL_TRNG_DECIMATION_RATE DL_TRNG_getDecimationRate | ( | TRNG_Regs * | trng | ) |
Get the decimation rate.
| [in] | trng | Pointer to the register overlay for the peripheral |
| One | of DL_TRNG_DECIMATION_RATE |
| __STATIC_INLINE uint8_t DL_TRNG_getDigitalHealthTestResults | ( | TRNG_Regs * | trng | ) |
Get the digital health test results.
The test sequence includes eight tests, and each test reports its status in an individual result bit. As each test passes, the corresponding bit is set.
| trng | Pointer to the register overlay for the peripheral |
| DL_TRNG_DIGITAL_HEALTH_TEST_SUCCESS | if all tests passed, otherwise a bitmask of which tests passed |
| __STATIC_INLINE uint8_t DL_TRNG_getAnalogHealthTestResults | ( | TRNG_Regs * | trng | ) |
Get the analog health test results.
| trng | Pointer to the register overlay for the peripheral |
| DL_TRNG_ANALOG_HEALTH_TEST_SUCCESS | if success |
| 0 | if test failed |
| __STATIC_INLINE uint32_t DL_TRNG_getCurrentState | ( | TRNG_Regs * | trng | ) |
Get the current state of the TRNG front end FSM.
This API should be called twice since two reads of the state are required as there is a chance of metastability when reading this register.
| trng | Pointer to the register overlay for the peripheral |
| One | of DL_TRNG_STATE |
| __STATIC_INLINE uint32_t DL_TRNG_getIssuedCommand | ( | TRNG_Regs * | trng | ) |
Get the last accepted command that was issued to the TRNG.
| trng | Pointer to the register overlay for the peripheral |
| One | of DL_TRNG_CMD |
| __STATIC_INLINE bool DL_TRNG_isRepetitionTestFail | ( | TRNG_Regs * | trng | ) |
Indicates if the repetition counter test caused the most recent failure.
| trng | Pointer to the register overlay for the peripheral |
| true | if the repetition test failed |
| false | if the repetition test did not fail |
| __STATIC_INLINE bool DL_TRNG_isAdaptiveTestFail | ( | TRNG_Regs * | trng | ) |
Indicates if the Adaptive Proportion Test (1,2,3, or 4-bit counters) caused the most recent failure.
| trng | Pointer to the register overlay for the peripheral |
| true | if the repetition test failed |
| false | if the repetition test did not fail |
| __STATIC_INLINE void DL_TRNG_enableInterrupt | ( | TRNG_Regs * | trng, |
| uint32_t | interruptMask | ||
| ) |
Enable TRNG interrupt.
| [in] | trng | Pointer to the register overlay for the peripheral |
| [in] | interruptMask | Bit mask of interrupts to check. Bitwise OR of DL_TRNG_INTERRUPT. |
| __STATIC_INLINE void DL_TRNG_disableInterrupt | ( | TRNG_Regs * | trng, |
| uint32_t | interruptMask | ||
| ) |
Disable TRNG interrupt.
| [in] | trng | Pointer to the register overlay for the peripheral |
| [in] | interruptMask | Bit mask of interrupts to check. Bitwise OR of DL_TRNG_INTERRUPT. |
| __STATIC_INLINE uint32_t DL_TRNG_getEnabledInterrupts | ( | TRNG_Regs * | trng, |
| uint32_t | interruptMask | ||
| ) |
Check which TRNG interrupts are enabled.
| [in] | trng | Pointer to the register overlay for the peripheral |
| [in] | interruptMask | Bit mask of interrupts to check. Bitwise OR of DL_TRNG_IIDX. |
| Bitwise | OR of DL_TRNG_INTERRUPT values |
| __STATIC_INLINE uint32_t DL_TRNG_getEnabledInterruptStatus | ( | TRNG_Regs * | trng, |
| uint32_t | interruptMask | ||
| ) |
Check interrupt flag of enabled TRNG interrupt.
Checks if the TRNG interrupt that was previously enabled is pending.
| [in] | trng | Pointer to the register overlay for the peripheral |
| [in] | interruptMask | Bit mask of interrupts to check. Bitwise OR of DL_TRNG_INTERRUPT. |
| __STATIC_INLINE uint32_t DL_TRNG_getRawInterruptStatus | ( | TRNG_Regs * | trng, |
| uint32_t | interruptMask | ||
| ) |
Check interrupt flag of any TRNG interrupt.
Checks if the TRNG interrupt is pending. Interrupt does not have to be previously enabled.
| [in] | trng | Pointer to the register overlay for the peripheral |
| [in] | interruptMask | Bit mask of interrupts to check. Bitwise OR of DL_TRNG_INTERRUPT. |
| __STATIC_INLINE DL_TRNG_IIDX DL_TRNG_getPendingInterrupt | ( | TRNG_Regs * | trng | ) |
Get highest priority pending TRNG interrupt.
Checks if any of the TRNG interrupts are pending. Interrupts do not have to be previously enabled.
| [in] | trng | Pointer to the register overlay for the peripheral |
| One | of DL_TRNG_IIDX |
| __STATIC_INLINE void DL_TRNG_clearInterruptStatus | ( | TRNG_Regs * | trng, |
| uint32_t | interruptMask | ||
| ) |
Clear pending TRNG interrupt.
| [in] | trng | Pointer to the register overlay for the peripheral |
| [in] | interruptMask | Bit mask of interrupts to check. Bitwise OR of DL_TRNG_INTERRUPT. |
| __STATIC_INLINE void DL_TRNG_sendCommand | ( | TRNG_Regs * | trng, |
| DL_TRNG_CMD | cmd | ||
| ) |
Update control register's command bits to send a TRNG command.
| [in] | trng | Pointer to the register overlay for the peripheral |
| [in] | cmd | Command to update the control register with |
References DL_Common_updateReg().
| __STATIC_INLINE uint32_t DL_TRNG_getCapture | ( | TRNG_Regs * | trng | ) |
Get word capture from TRNG.
Gets the captured data from the decimation block.
| [in] | trng | Pointer to the register overlay for the peripheral |
| TRNG | capture value |
References DL_TRNG_restoreConfiguration(), and DL_TRNG_saveConfiguration().
| bool DL_TRNG_saveConfiguration | ( | TRNG_Regs * | trng, |
| DL_TRNG_backupConfig * | ptr | ||
| ) |
Save TRNG configuration before entering a power loss state. Only necessary for PG 1.0 silicon.
| [in] | trng | Pointer to the register overlay for the peripheral |
| [in] | ptr | Configuration backup setup structure. See DL_TRNG_backupConfig. |
| FALSE | if a configuration already exists in ptr (will not be overwritten). TRUE if a configuration was successfully saved |
Referenced by DL_TRNG_getCapture().
| bool DL_TRNG_restoreConfiguration | ( | TRNG_Regs * | trng, |
| DL_TRNG_backupConfig * | ptr | ||
| ) |
Restore TRNG configuration after leaving a power loss state. Upon restoration, if the TRNG was not originally in OFF state, then the TRNG will be set to the normal operating mode. Only necessary for PG 1.0 silicon.
| [in] | trng | Pointer to the register overlay for the peripheral |
| [in] | ptr | Configuration backup setup structure. See DL_TRNG_backupConfig. |
| FALSE | if a configuration does not exist in ptr (will not be loaded). TRUE if a configuration successfully loaded |
Referenced by DL_TRNG_getCapture().