This section defines the API for the LVD (Low Voltage Detection) Driver.
More...
|
| enum | lvd_threshold_t {
LVD_THRESHOLD_MONITOR_1_LEVEL_0 = 0x0UL,
LVD_THRESHOLD_MONITOR_1_LEVEL_1 = 0x1UL,
LVD_THRESHOLD_MONITOR_1_LEVEL_2 = 0x2UL,
LVD_THRESHOLD_MONITOR_1_LEVEL_3 = 0x3UL,
LVD_THRESHOLD_MONITOR_1_LEVEL_4 = 0x4UL,
LVD_THRESHOLD_MONITOR_1_LEVEL_5 = 0x5UL,
LVD_THRESHOLD_MONITOR_1_LEVEL_6 = 0x6UL,
LVD_THRESHOLD_MONITOR_1_LEVEL_7 = 0x7UL,
LVD_THRESHOLD_MONITOR_1_LEVEL_8 = 0x8UL,
LVD_THRESHOLD_MONITOR_1_LEVEL_9 = 0x9UL,
LVD_THRESHOLD_MONITOR_1_LEVEL_A = 0xAUL,
LVD_THRESHOLD_MONITOR_1_LEVEL_B = 0xBUL,
LVD_THRESHOLD_MONITOR_1_LEVEL_C = 0xCUL,
LVD_THRESHOLD_MONITOR_1_LEVEL_D = 0xDUL,
LVD_THRESHOLD_MONITOR_1_LEVEL_E = 0xEUL,
LVD_THRESHOLD_MONITOR_1_LEVEL_F = 0xFUL,
LVD_THRESHOLD_MONITOR_1_LEVEL_11 = 0x11UL,
LVD_THRESHOLD_MONITOR_1_LEVEL_12 = 0x12UL,
LVD_THRESHOLD_MONITOR_1_LEVEL_13 = 0x13UL,
LVD_THRESHOLD_MONITOR_2_LEVEL_0 = 0x0UL,
LVD_THRESHOLD_MONITOR_2_LEVEL_1 = 0x1UL,
LVD_THRESHOLD_MONITOR_2_LEVEL_2 = 0x2UL,
LVD_THRESHOLD_MONITOR_2_LEVEL_3 = 0x3UL,
LVD_THRESHOLD_MONITOR_2_LEVEL_5 = 0x5UL,
LVD_THRESHOLD_MONITOR_2_LEVEL_6 = 0x6UL,
LVD_THRESHOLD_MONITOR_2_LEVEL_7 = 0x7UL
} |
| |
| enum | lvd_response_t { LVD_RESPONSE_NMI,
LVD_RESPONSE_INTERRUPT,
LVD_RESPONSE_RESET,
LVD_RESPONSE_NONE
} |
| |
| enum | lvd_voltage_slope_t { LVD_VOLTAGE_SLOPE_RISING = 0,
LVD_VOLTAGE_SLOPE_FALLING = 1,
LVD_VOLTAGE_SLOPE_BOTH = 2
} |
| |
| enum | lvd_threshold_crossing_t { LVD_THRESHOLD_CROSSING_NOT_DETECTED = 0,
LVD_THRESHOLD_CROSSING_DETECTED = 1
} |
| |
| enum | lvd_current_state_t { LVD_CURRENT_STATE_BELOW_THRESHOLD = 0,
LVD_CURRENT_STATE_ABOVE_THRESHOLD = 1
} |
| |
This section defines the API for the LVD (Low Voltage Detection) Driver.
The LVD driver provides functions for configuring the LVD hardware peripheral.
The process of configuring and enabling a Low Voltage Detection monitor has very specific timing constraints and register write ordering. Because of these constraints, the entire process of configuring and enabling a voltage monitor is most effectively performed by a single function. The API function configure performs configuration and enables the monitor in order to properly enforce the timing and register write ordering constraints.
The LVD driver configures all of the settings of the available configurable LVD monitors.
The settings include:
- voltage_threshold: Determines the voltage detection threshold (i.e. 2.99 Volts).
- sample_clock_divisor: Determines the sample clock rate of the digital filter, based on division of the LOCO clock. Also disables or enables the digital filter if available on the MCU.
- detection_response: Determines which event will occur, reset, interrupt, non-maskable interrupt, or no response, when the voltage threshold is crossed
- voltage_slope: Choose either rising or falling voltage as the trigger for a voltage detection interrupt.
- negation_delay: Determine whether timing of the negation of the voltage event is based upon the reset event or based on the voltage event itself.
- p_callback: Address of user defined function to be called when the voltage event interrupt occurs.
- Note
- Low Voltage Monitor 0 (LVD0) is not configurable at runtime but can be configured by changing the OFS1 register value on the BSP Properties tab of the Synergy Project Configurator in the e2 studio ISDE.
-
Digital filter is not to be used with standby modes. If software standby or deep standby mode is to be used, the digital filter should be disabled.
For details about the implementation of the driver functions see section LVD.
◆ LVD_API_VERSION_MAJOR
| #define LVD_API_VERSION_MAJOR (2U) |
Register definitions, common services and error codes.
◆ lvd_ctrl_t
LVD control block. Allocate an instance specific control block to pass into the LVD API calls.
- Implemented as
-
◆ lvd_current_state_t
Instantaneous status of VCC (above or below threshold)
| Enumerator |
|---|
| LVD_CURRENT_STATE_BELOW_THRESHOLD | VCC < threshold.
|
| LVD_CURRENT_STATE_ABOVE_THRESHOLD | VCC >= threshold or monitor is disabled.
|
◆ lvd_response_t
Response types to a threshold crossing event, interrupt, reset, NMI...
| Enumerator |
|---|
| LVD_RESPONSE_NMI | Non-maskable interrupt.
|
| LVD_RESPONSE_INTERRUPT | Maskable interrupt.
|
| LVD_RESPONSE_RESET | Reset.
|
| LVD_RESPONSE_NONE | No response, status must be requested via statusGet function.
|
◆ lvd_threshold_crossing_t
Threshold crossing detection (latched)
| Enumerator |
|---|
| LVD_THRESHOLD_CROSSING_NOT_DETECTED | Threshold crossing has not been detected.
|
| LVD_THRESHOLD_CROSSING_DETECTED | Threshold crossing has been detected.
|
◆ lvd_threshold_t
Voltage detection level The thresholds supported by each MCU is in the MCU User's Manual as well as in the r_lvd module description on the threads tab of the Synergy project.
| Enumerator |
|---|
| LVD_THRESHOLD_MONITOR_1_LEVEL_0 | 4.29V (Vdet1_0)
|
| LVD_THRESHOLD_MONITOR_1_LEVEL_1 | 4.14V (Vdet1_1)
|
| LVD_THRESHOLD_MONITOR_1_LEVEL_2 | 4.02V (Vdet1_2)
|
| LVD_THRESHOLD_MONITOR_1_LEVEL_3 | 3.84V (Vdet1_3)
|
| LVD_THRESHOLD_MONITOR_1_LEVEL_4 | 3.10V (Vdet1_4)
|
| LVD_THRESHOLD_MONITOR_1_LEVEL_5 | 3.00V (Vdet1_5)
|
| LVD_THRESHOLD_MONITOR_1_LEVEL_6 | 2.90V (Vdet1_6)
|
| LVD_THRESHOLD_MONITOR_1_LEVEL_7 | 2.79V (Vdet1_7)
|
| LVD_THRESHOLD_MONITOR_1_LEVEL_8 | 2.68V (Vdet1_8)
|
| LVD_THRESHOLD_MONITOR_1_LEVEL_9 | 2.58V (Vdet1_9)
|
| LVD_THRESHOLD_MONITOR_1_LEVEL_A | 2.48V (Vdet1_A)
|
| LVD_THRESHOLD_MONITOR_1_LEVEL_B | 2.20V (Vdet1_B)
|
| LVD_THRESHOLD_MONITOR_1_LEVEL_C | 1.96V (Vdet1_C)
|
| LVD_THRESHOLD_MONITOR_1_LEVEL_D | 1.86V (Vdet1_D)
|
| LVD_THRESHOLD_MONITOR_1_LEVEL_E | 1.75V (Vdet1_E)
|
| LVD_THRESHOLD_MONITOR_1_LEVEL_F | 1.65V (Vdet1_F)
|
| LVD_THRESHOLD_MONITOR_1_LEVEL_11 | 2.99V (Vdet1_11)
|
| LVD_THRESHOLD_MONITOR_1_LEVEL_12 | 2.92V (Vdet1_12)
|
| LVD_THRESHOLD_MONITOR_1_LEVEL_13 | 2.85V (Vdet1_13)
|
| LVD_THRESHOLD_MONITOR_2_LEVEL_0 | 4.29V (Vdet2_0)
|
| LVD_THRESHOLD_MONITOR_2_LEVEL_1 | 4.14V (Vdet2_1)
|
| LVD_THRESHOLD_MONITOR_2_LEVEL_2 | 4.02V (Vdet2_2)
|
| LVD_THRESHOLD_MONITOR_2_LEVEL_3 | 3.84V (Vdet2_3)
|
| LVD_THRESHOLD_MONITOR_2_LEVEL_5 | 2.99V (Vdet2_5)
|
| LVD_THRESHOLD_MONITOR_2_LEVEL_6 | 2.92V (Vdet2_6)
|
| LVD_THRESHOLD_MONITOR_2_LEVEL_7 | 2.85V (Vdet2_7)
|
◆ lvd_voltage_slope_t
Voltage slope, rising, falling, or both
| Enumerator |
|---|
| LVD_VOLTAGE_SLOPE_RISING | When VCC >= Vdet2 (rise) is detected.
|
| LVD_VOLTAGE_SLOPE_FALLING | When VCC < Vdet2 (drop) is detected.
|
| LVD_VOLTAGE_SLOPE_BOTH | When drop and rise are detected.
|