RA Flexible Software Package Documentation
Release v5.7.0
|
|
Interface for Low Voltage Detection.
The LVD driver provides functions for configuring the LVD voltage monitors and detectors.
Data Structures | |
struct | lvd_status_t |
struct | lvd_callback_args_t |
struct | lvd_cfg_t |
struct | lvd_api_t |
struct | lvd_instance_t |
Typedefs | |
typedef void | lvd_ctrl_t |
Enumerations | |
enum | lvd_threshold_t |
enum | lvd_response_t |
enum | lvd_voltage_slope_t |
enum | lvd_sample_clock_t |
enum | lvd_negation_delay_t |
enum | lvd_threshold_crossing_t |
enum | lvd_current_state_t |
struct lvd_status_t |
Current state of a voltage monitor.
Data Fields | ||
---|---|---|
lvd_threshold_crossing_t | crossing_detected |
Threshold crossing detection (latched) |
lvd_current_state_t | current_state |
Instantaneous status of monitored voltage (above or below threshold) |
struct lvd_callback_args_t |
LVD callback parameter definition
Data Fields | ||
---|---|---|
uint32_t | monitor_number | Monitor number. |
lvd_current_state_t | current_state | Current state of the voltage monitor. |
void const * | p_context | Placeholder for user data. |
struct lvd_cfg_t |
LVD configuration structure
Data Fields | |
uint32_t | monitor_number |
lvd_threshold_t | voltage_threshold |
lvd_response_t | detection_response |
lvd_voltage_slope_t | voltage_slope |
lvd_negation_delay_t | negation_delay |
lvd_sample_clock_t | sample_clock_divisor |
IRQn_Type | irq |
uint8_t | monitor_ipl |
void(* | p_callback )(lvd_callback_args_t *p_args) |
void const * | p_context |
void const * | p_extend |
uint32_t lvd_cfg_t::monitor_number |
Monitor number, 1, 2, ...
lvd_threshold_t lvd_cfg_t::voltage_threshold |
Threshold for out of range voltage detection
lvd_response_t lvd_cfg_t::detection_response |
Response on detecting a threshold crossing
lvd_voltage_slope_t lvd_cfg_t::voltage_slope |
Direction of voltage crossing that will trigger a detection (Rising Edge, Falling Edge, Both).
lvd_negation_delay_t lvd_cfg_t::negation_delay |
Negation of LVD signal follows reset or voltage in range
lvd_sample_clock_t lvd_cfg_t::sample_clock_divisor |
Sample clock divider, use LVD_SAMPLE_CLOCK_DISABLED to disable digital filtering
IRQn_Type lvd_cfg_t::irq |
Interrupt number.
uint8_t lvd_cfg_t::monitor_ipl |
Interrupt priority level.
void(* lvd_cfg_t::p_callback) (lvd_callback_args_t *p_args) |
User function to be called from interrupt
void const* lvd_cfg_t::p_context |
Placeholder for user data. Passed to the user callback in
void const* lvd_cfg_t::p_extend |
Extension parameter for hardware specific settings
struct lvd_api_t |
LVD driver API structure. LVD driver functions implemented at the HAL layer will adhere to this API.
Data Fields | |
fsp_err_t(* | open )(lvd_ctrl_t *const p_ctrl, lvd_cfg_t const *const p_cfg) |
fsp_err_t(* | statusGet )(lvd_ctrl_t *const p_ctrl, lvd_status_t *p_lvd_status) |
fsp_err_t(* | statusClear )(lvd_ctrl_t *const p_ctrl) |
fsp_err_t(* | callbackSet )(lvd_ctrl_t *const p_ctrl, void(*p_callback)(lvd_callback_args_t *), void const *const p_context, lvd_callback_args_t *const p_callback_memory) |
fsp_err_t(* | close )(lvd_ctrl_t *const p_ctrl) |
fsp_err_t(* lvd_api_t::open) (lvd_ctrl_t *const p_ctrl, lvd_cfg_t const *const p_cfg) |
Initializes a low voltage detection driver according to the passed-in configuration structure.
[in] | p_ctrl | Pointer to control structure for the driver instance |
[in] | p_cfg | Pointer to the configuration structure for the driver instance |
fsp_err_t(* lvd_api_t::statusGet) (lvd_ctrl_t *const p_ctrl, lvd_status_t *p_lvd_status) |
Get the current state of the monitor, (threshold crossing detected, voltage currently above or below threshold). Must be used if the peripheral was initialized with lvd_response_t set to LVD_RESPONSE_NONE.
[in] | p_ctrl | Pointer to the control structure for the driver instance |
[in,out] | p_lvd_status | Pointer to a lvd_status_t structure |
fsp_err_t(* lvd_api_t::statusClear) (lvd_ctrl_t *const p_ctrl) |
Clears the latched status of the monitor. Must be used if the peripheral was initialized with lvd_response_t set to LVD_RESPONSE_NONE.
[in] | p_ctrl | Pointer to the control structure for the driver instance |
fsp_err_t(* lvd_api_t::callbackSet) (lvd_ctrl_t *const p_ctrl, void(*p_callback)(lvd_callback_args_t *), void const *const p_context, lvd_callback_args_t *const p_callback_memory) |
Specify callback function and optional context pointer and working memory pointer.
[in] | p_ctrl | Pointer to the LVD control block. |
[in] | p_callback | Callback function |
[in] | p_context | Pointer to send to callback function |
[in] | p_working_memory | Pointer to volatile memory where callback structure can be allocated. Callback arguments allocated here are only valid during the callback. |
fsp_err_t(* lvd_api_t::close) (lvd_ctrl_t *const p_ctrl) |
Disables the LVD peripheral. Closes the driver instance.
[in] | p_ctrl | Pointer to the control structure for the driver instance |
struct lvd_instance_t |
This structure encompasses everything that is needed to use an instance of this interface.
Data Fields | ||
---|---|---|
lvd_ctrl_t * | p_ctrl | Pointer to the control structure for this instance. |
lvd_cfg_t const * | p_cfg | Pointer to the configuration structure for this interface instance. |
lvd_api_t const * | p_api | Pointer to the API structure for this interface instance. |
typedef void lvd_ctrl_t |
LVD control block. Allocate an instance specific control block to pass into the LVD API calls.
enum lvd_threshold_t |
Register definitions, common services, and error codes. Voltage detection level The thresholds supported by each MCU are in the MCU User's Manual as well as in the r_lvd module description on the stack tab of the RA project.
enum lvd_response_t |
Response types for handling threshold crossing event.
enum lvd_voltage_slope_t |
enum lvd_sample_clock_t |
Sample clock divider, use LVD_SAMPLE_CLOCK_DISABLED to disable digital filtering
enum lvd_negation_delay_t |
Negation delay of LVD reset signal follows reset or voltage in range
enum lvd_current_state_t |