RA Flexible Software Package Documentation  Release v5.2.0

 
LVD

Functions

fsp_err_t R_LVD_Open (lvd_ctrl_t *const p_api_ctrl, lvd_cfg_t const *const p_cfg)
 
fsp_err_t R_LVD_StatusGet (lvd_ctrl_t *const p_api_ctrl, lvd_status_t *p_lvd_status)
 
fsp_err_t R_LVD_StatusClear (lvd_ctrl_t *const p_api_ctrl)
 
fsp_err_t R_LVD_CallbackSet (lvd_ctrl_t *const p_api_ctrl, void(*p_callback)(lvd_callback_args_t *), void const *const p_context, lvd_callback_args_t *const p_callback_memory)
 
fsp_err_t R_LVD_Close (lvd_ctrl_t *const p_api_ctrl)
 

Detailed Description

Data Structures

struct  lvd_instance_ctrl_t
 

Data Structure Documentation

◆ lvd_instance_ctrl_t

struct lvd_instance_ctrl_t

LVD instance control structure

Function Documentation

◆ R_LVD_Open()

fsp_err_t R_LVD_Open ( lvd_ctrl_t *const  p_api_ctrl,
lvd_cfg_t const *const  p_cfg 
)

Initializes a voltage monitor and detector according to the passed-in configuration structure.

Parameters
[in]p_api_ctrlPointer to the control structure for the driver instance
[in]p_cfgPointer to the configuration structure for the driver instance
Note
Digital filter is not to be used with standby modes.
Startup time can take on the order of milliseconds for some configurations.

Example:

fsp_err_t err = R_LVD_Open(&g_lvd_ctrl, &g_lvd_cfg);
Return values
FSP_SUCCESSSuccessful
FSP_ERR_ASSERTIONRequested configuration was invalid
FSP_ERR_ALREADY_OPENThe instance was already opened
FSP_ERR_IN_USEAnother instance is already using the desired monitor
FSP_ERR_UNSUPPORTEDDigital filter was enabled on a device that does not support it

◆ R_LVD_StatusGet()

fsp_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 above or below threshold).

Parameters
[in]p_api_ctrlPointer to the control structure for the driver instance
[out]p_lvd_statusPointer to status structure

Example:

err = R_LVD_StatusGet(&g_lvd_ctrl, &status);
Return values
FSP_SUCCESSSuccessful
FSP_ERR_ASSERTIONAn argument was NULL
FSP_ERR_NOT_OPENDriver is not open

◆ R_LVD_StatusClear()

fsp_err_t R_LVD_StatusClear ( lvd_ctrl_t *const  p_api_ctrl)

Clears the latched status of the monitor.

Parameters
[in]p_api_ctrlPointer to the control structure for the driver instance
Return values
FSP_SUCCESSSuccessful
FSP_ERR_ASSERTIONAn argument was NULL
FSP_ERR_NOT_OPENDriver is not open

◆ R_LVD_CallbackSet()

fsp_err_t R_LVD_CallbackSet ( lvd_ctrl_t *const  p_api_ctrl,
void(*)(lvd_callback_args_t *)  p_callback,
void const *const  p_context,
lvd_callback_args_t *const  p_callback_memory 
)

Updates the user callback and has option of providing memory for callback structure. Implements lvd_api_t::callbackSet

Return values
FSP_SUCCESSCallback updated successfully.
FSP_ERR_ASSERTIONA required pointer is NULL.
FSP_ERR_NOT_OPENThe control block has not been opened.
FSP_ERR_NO_CALLBACK_MEMORYp_callback is non-secure and p_callback_memory is either secure or NULL.

◆ R_LVD_Close()

fsp_err_t R_LVD_Close ( lvd_ctrl_t *const  p_api_ctrl)

Disables the LVD peripheral. Closes the driver instance.

Parameters
[in]p_api_ctrlPointer to the control block structure for the driver instance
Return values
FSP_SUCCESSSuccessful
FSP_ERR_ASSERTIONAn argument was NULL
FSP_ERR_NOT_OPENDriver is not open