![]() |
Synergy Software Package User's Manual
|
Driver for the Independent Watchdog Timer (IWDT). More...
Data Structures | |
| struct | iwdt_instance_ctrl_t |
Functions | |
| ssp_err_t | R_IWDT_Open (wdt_ctrl_t *const p_api_ctrl, wdt_cfg_t const *const p_cfg) |
| Register the IWDT NMI callback. More... | |
| ssp_err_t | R_IWDT_CfgGet (wdt_ctrl_t *const p_api_ctrl, wdt_cfg_t *const p_cfg) |
| Read the configuration of the IWDT. Implements wdt_api_t::cfgGet. More... | |
| ssp_err_t | R_IWDT_Refresh (wdt_ctrl_t *const p_api_ctrl) |
| Refresh the Independent Watchdog Timer. Implements wdt_api_t::refresh. More... | |
| ssp_err_t | R_IWDT_StatusGet (wdt_ctrl_t *const p_api_ctrl, wdt_status_t *const p_status) |
| Read the IWDT status flags. More... | |
| ssp_err_t | R_IWDT_StatusClear (wdt_ctrl_t *const p_api_ctrl, const wdt_status_t status) |
| Clear the IWDT status and error flags. Implements wdt_api_t::statusClear. More... | |
| ssp_err_t | R_IWDT_CounterGet (wdt_ctrl_t *const p_api_ctrl, uint32_t *const p_count) |
| Read the current count value of the IWDT. Implements wdt_api_t::counterGet. More... | |
| ssp_err_t | R_IWDT_TimeoutGet (wdt_ctrl_t *const p_api_ctrl, wdt_timeout_values_t *const p_timeout) |
| Read timeout information for the watchdog timer. Implements wdt_api_t::timeoutGet. More... | |
| ssp_err_t | R_IWDT_VersionGet (ssp_version_t *const p_data) |
| Return IWDT HAL driver version. Implements wdt_api_t::versionGet. More... | |
Driver for the Independent Watchdog Timer (IWDT).
This module supports the Independent Watchdog Timer (IWDT). It implements the WDT Interface. Extends WDT_API HAL layer drivers for interfacing with the Independent Watchdog Timer (IWDT) peripheral.
The IWDT HAL APIs provide the ability to refresh the independent watchdog, read the timer value and read and clear status flags. When used in NMI output mode the callback to be called by the NMI ISR can be registered.
| ssp_err_t R_IWDT_CfgGet | ( | wdt_ctrl_t *const | p_api_ctrl, |
| wdt_cfg_t *const | p_cfg | ||
| ) |
Read the configuration of the IWDT. Implements wdt_api_t::cfgGet.
| SSP_SUCCESS | IWDT configuration successfully read. |
| SSP_ERR_ASSERTION | Null Pointer. |
| SSP_ERR_INVALID_ARGUMENT | One or more configuration options is invalid. |
Get timeout value from OFS0 register.
| ssp_err_t R_IWDT_CounterGet | ( | wdt_ctrl_t *const | p_api_ctrl, |
| uint32_t *const | p_count | ||
| ) |
Read the current count value of the IWDT. Implements wdt_api_t::counterGet.
| SSP_SUCCESS | IWDT current count successfully read. |
| SSP_ERR_ASSERTION | Null pointer passed as a parameter. |
| SSP_ERR_NOT_OPEN | The driver has not been opened. Perform R_IWDT_Open() first. |
| ssp_err_t R_IWDT_Open | ( | wdt_ctrl_t *const | p_api_ctrl, |
| wdt_cfg_t const *const | p_cfg | ||
| ) |
Register the IWDT NMI callback.
| SSP_SUCCESS | IWDT NMI callback successfully configured. |
| SSP_ERR_ASSERTION | Null Pointer. |
| SSP_ERR_INVALID_MODE | An attempt to open the IWDT when the OFS0 register is not configured for auto-start mode. |
| SSP_ERR_HW_LOCKED | IWDT module has already been called. |
g_iwdt_version is accessed by the ASSERT macro only and so compiler toolchain can issue a warning that it is not accessed. The code below eliminates this warning and also ensures these data structures are not optimized away.
Eliminate toolchain warning when NMI output is not being used.
Lock the IWDT Hardware Resource
Initialize global pointer to WDT for NMI callback use.
Check for NMI output mode
NMI output mode
Enable the IWDT underflow/refresh error interrupt (will generate an NMI).
| ssp_err_t R_IWDT_Refresh | ( | wdt_ctrl_t *const | p_api_ctrl | ) |
Refresh the Independent Watchdog Timer. Implements wdt_api_t::refresh.
| SSP_SUCCESS | IWDT successfully refreshed. |
| SSP_ERR_NOT_OPEN | The driver has not been opened. Perform R_IWDT_Open() first. |
| ssp_err_t R_IWDT_StatusClear | ( | wdt_ctrl_t *const | p_api_ctrl, |
| const wdt_status_t | status | ||
| ) |
Clear the IWDT status and error flags. Implements wdt_api_t::statusClear.
| SSP_SUCCESS | IWDT flag(s) successfully cleared. |
| SSP_ERR_ASSERTION | Null pointer as a parameter. |
| SSP_ERR_NOT_OPEN | The driver has not been opened. Perform R_IWDT_Open() first. |
Write zero to clear flags
| ssp_err_t R_IWDT_StatusGet | ( | wdt_ctrl_t *const | p_api_ctrl, |
| wdt_status_t *const | p_status | ||
| ) |
Read the IWDT status flags.
Indicates both status and error conditions.
| SSP_SUCCESS | IWDT status successfully read. |
| SSP_ERR_ASSERTION | Null pointer as a parameter. |
| SSP_ERR_NOT_OPEN | The driver has not been opened. Perform R_IWDT_Open() first. |
| ssp_err_t R_IWDT_TimeoutGet | ( | wdt_ctrl_t *const | p_api_ctrl, |
| wdt_timeout_values_t *const | p_timeout | ||
| ) |
Read timeout information for the watchdog timer. Implements wdt_api_t::timeoutGet.
| SSP_SUCCESS | WDT successfully refreshed. |
| SSP_ERR_ASSERTION | Null Pointer. |
| SSP_ERR_ABORTED | Invalid clock divider for this watchdog |
| ssp_err_t R_IWDT_VersionGet | ( | ssp_version_t *const | p_data | ) |
Return IWDT HAL driver version. Implements wdt_api_t::versionGet.
| SSP_SUCCESS | Call successful. |
| SSP_ERR_ASSERTION | Null pointer passed as a parameter. |