![]() |
Synergy Software Package User's Manual
|
Driver for Low Voltage Detection. More...
Data Structures | |
| struct | lvd_instance_ctrl_t |
| struct | lvd_extend_t |
Enumerations | |
| enum | lvd_sample_clock_t { LVD_SAMPLE_CLOCK_LOCO_DIV_2 = 0, LVD_SAMPLE_CLOCK_LOCO_DIV_4 = 1, LVD_SAMPLE_CLOCK_LOCO_DIV_8 = 2, LVD_SAMPLE_CLOCK_LOCO_DIV_16 = 3, LVD_SAMPLE_CLOCK_DISABLED = -1 } |
| enum | lvd_negation_delay_t { LVD_NEGATION_DELAY_FROM_VOLTAGE = 0, LVD_NEGATION_DELAY_FROM_RESET = 1 } |
Functions | |
| ssp_err_t | R_LVD_Open (lvd_ctrl_t *const p_api_ctrl, lvd_cfg_t const *const p_cfg) |
| Initializes a low voltage detection driver according to the passed in configuration structure. Enables an LVD peripheral based on configuration structure. More... | |
| ssp_err_t | R_LVD_Close (lvd_ctrl_t *const p_api_ctrl) |
| Disables the LVD peripheral. Closes the driver instance. More... | |
| ssp_err_t | R_LVD_StatusGet (lvd_ctrl_t *const p_api_ctrl, lvd_status_t *p_lvd_status) |
| Get the current state of the monitor, (threshold crossing detected, voltage currently within range) More... | |
| ssp_err_t | R_LVD_StatusClear (lvd_ctrl_t *const p_api_ctrl) |
| Clears the latched status of the monitor. More... | |
| ssp_err_t | R_LVD_VersionGet (ssp_version_t *const p_version) |
| Returns the LVD driver version based on compile time macros. More... | |
Driver for Low Voltage Detection.
Implementation of the LVD API.For a detailed description see the Low Voltage Detection Interface.
This module implements the following interface: Low Voltage Detection Interface.
| enum lvd_negation_delay_t |
Negation of LVD signal follows reset or voltage in range
| enum lvd_sample_clock_t |
Sample clock divider, use LVD_SAMPLE_CLOCK_DISABLED to disable digital filtering
| ssp_err_t R_LVD_Close | ( | lvd_ctrl_t *const | p_api_ctrl | ) |
Disables the LVD peripheral. Closes the driver instance.
| SSP_SUCCESS | Successful |
| SSP_ERR_ASSERTION | Pointers passed as function argument is NULL or the monitor number is invalid. |
| SSP_ERR_NOT_OPEN | Driver is not open. |
Disable voltage monitor comparison result output
Disable reset/interrupt event
Clear low voltage detection flag LVDnSR.DET = 0
Disable digital filtering
Disable voltage monitor
| ssp_err_t R_LVD_Open | ( | lvd_ctrl_t *const | p_api_ctrl, |
| lvd_cfg_t const *const | p_cfg | ||
| ) |
Initializes a low voltage detection driver according to the passed in configuration structure. Enables an LVD peripheral based on configuration structure.
| SSP_SUCCESS | Successful |
| SSP_ERR_ASSERTION | One or more pointers passed as function argument point to NULL or the Requested configuration, detection, voltage, monitor number or sample clock configuration of a voltage monitor is invalid. |
| SSP_ERR_IN_USE | Unable to acquire the hardware lock. |
| SSP_ERR_INVALID_MODE | MOCO must be running for LVD_NEGATION_DELAY_FROM_RESET negation delay option |
Verify channel is not already used
Select the detection voltage by setting the LVDLVLR.LVDnLVL[m:0] bits.
Enable voltage detection LVCMPCR.LVDnE = 1
Configure the digital filter.
Configure LVD monitor detection response.
Enable output of the results of comparison by voltage monitor LVDnCR0.CMPE = 1
Mark driver as opened by initializing it to "LVD" in its ASCII equivalent.
| ssp_err_t R_LVD_StatusClear | ( | lvd_ctrl_t *const | p_api_ctrl | ) |
Clears the latched status of the monitor.
| SSP_SUCCESS | Successful |
| SSP_ERR_ASSERTION | Pointers passed as function argument point to NULL, invalid LVD monitor number |
| SSP_ERR_NOT_OPEN | Driver is not open, status will not be valid |
Clears the latched status of the monitor
| ssp_err_t R_LVD_StatusGet | ( | lvd_ctrl_t *const | p_api_ctrl, |
| lvd_status_t * | p_lvd_status | ||
| ) |
Get the current state of the monitor, (threshold crossing detected, voltage currently within range)
| SSP_SUCCESS | Successful |
| SSP_ERR_ASSERTION | One or more pointers passed as function argument point to NULL, invalid LVD monitor number |
| SSP_ERR_NOT_OPEN | Driver is not open, status will not be valid |
Get the current state of the monitor
| ssp_err_t R_LVD_VersionGet | ( | ssp_version_t *const | p_version | ) |
Returns the LVD driver version based on compile time macros.
| SSP_SUCCESS | Successful |
| SSP_ERR_ASSERTION | p_version was NULL |