![]() |
Synergy Software Package User's Manual
|
Driver for the Watchdog Timer (WDT). More...
Data Structures | |
| struct | wdt_instance_ctrl_t |
Functions | |
| ssp_err_t | R_WDT_Open (wdt_ctrl_t *const p_api_ctrl, wdt_cfg_t const *const p_cfg) |
| Configure the WDT in register start mode. In auto-start_mode the NMI callback can be registered. Implements wdt_api_t::open. More... | |
| ssp_err_t | R_WDT_CfgGet (wdt_ctrl_t *const p_api_ctrl, wdt_cfg_t *const p_cfg) |
| Read the configuration of the WDT in both register-start and auto-start modes. Implements wdt_api_t::cfgGet. More... | |
| ssp_err_t | R_WDT_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_WDT_Refresh (wdt_ctrl_t *const p_api_ctrl) |
| Refresh the watchdog timer. Implements wdt_api_t::refresh. More... | |
| ssp_err_t | R_WDT_StatusGet (wdt_ctrl_t *const p_api_ctrl, wdt_status_t *const p_status) |
| Read the WDT status flags. Implements wdt_api_t::statusGet. More... | |
| ssp_err_t | R_WDT_StatusClear (wdt_ctrl_t *const p_api_ctrl, const wdt_status_t status) |
| Clear the WDT status and error flags. Implements wdt_api_t::statusClear. More... | |
| ssp_err_t | R_WDT_CounterGet (wdt_ctrl_t *const p_api_ctrl, uint32_t *const p_count) |
| Read the current count value of the WDT. Implements wdt_api_t::counterGet. More... | |
| ssp_err_t | R_WDT_VersionGet (ssp_version_t *const p_data) |
| Return WDT HAL driver version. Implements wdt_api_t::versionGet. More... | |
Driver for the Watchdog Timer (WDT).
This module supports the Watchdog Timer (WDT). It implements the WDT Interface. The WDT HAL APIs provide the ability to configure the operation of the WDT (when used in register start mode), refresh the watchdog, read the timer value and read and clear status flags.
| ssp_err_t R_WDT_CfgGet | ( | wdt_ctrl_t *const | p_api_ctrl, |
| wdt_cfg_t *const | p_cfg | ||
| ) |
Read the configuration of the WDT in both register-start and auto-start modes. Implements wdt_api_t::cfgGet.
| SSP_SUCCESS | WDT successfully configured. |
| SSP_ERR_ASSERTION | Null Pointer. |
| SSP_ERR_NOT_OPEN | Instance control block is not initialized. |
Register-start mode.
Get timeout value from WDTCR register.
| ssp_err_t R_WDT_CounterGet | ( | wdt_ctrl_t *const | p_api_ctrl, |
| uint32_t *const | p_count | ||
| ) |
Read the current count value of the WDT. Implements wdt_api_t::counterGet.
| SSP_SUCCESS | WDT current count successfully read. |
| SSP_ERR_ASSERTION | Null pointer passed as a parameter. |
| SSP_ERR_NOT_OPEN | Instance control block is not initialized. |
Read the WDT status
Get WDT down counter value
| ssp_err_t R_WDT_Open | ( | wdt_ctrl_t *const | p_api_ctrl, |
| wdt_cfg_t const *const | p_cfg | ||
| ) |
Configure the WDT in register start mode. In auto-start_mode the NMI callback can be registered. Implements wdt_api_t::open.
This function should only be called once as WDT configuration registers can only be written to once so subsequent calls will have no effect.
| SSP_SUCCESS | WDT successfully configured. |
| SSP_ERR_ASSERTION | Null Pointer(s). |
| SSP_ERR_INVALID_ARGUMENT | One or more configuration options is invalid. |
| SSP_ERR_INVALID_MODE | An attempt to open the WDT in register-start mode when the OFS0 register is configured for auto-start mode. Or to open the WDT in auto-start mode when the OSF0 is configured for register start mode. |
g_wdt_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 this data structure is not optimised away.
Eliminate toolchain warning when NMI output is not being used.
Check the expected start mode matches the OSF0 configuration.
Lock the IWDT Hardware Resource
Initialize global pointer to WDT for NMI callback use.
Configuration only valid when WDT operating in register-start mode.
Register-start mode.
Register callback with BSP NMI ISR.
Enable the WDT underflow/refresh error interrupt (will generate an NMI).
Start the timer by performing a refresh.
| ssp_err_t R_WDT_Refresh | ( | wdt_ctrl_t *const | p_api_ctrl | ) |
Refresh the watchdog timer. Implements wdt_api_t::refresh.
In addition to refreshing the watchdog counter this function can be used, in register start mode to start the counter.
| SSP_SUCCESS | WDT successfully refreshed. |
| SSP_ERR_NOT_OPEN | Instance control block is not initialized. |
Refresh the WDT Down counter
| ssp_err_t R_WDT_StatusClear | ( | wdt_ctrl_t *const | p_api_ctrl, |
| const wdt_status_t | status | ||
| ) |
Clear the WDT status and error flags. Implements wdt_api_t::statusClear.
| SSP_SUCCESS | WDT flag(s) successfully cleared. |
| SSP_ERR_ASSERTION | Null pointer as a parameter. |
| SSP_ERR_NOT_OPEN | Instance control block is not initialized. |
Write zero to clear flags.
| ssp_err_t R_WDT_StatusGet | ( | wdt_ctrl_t *const | p_api_ctrl, |
| wdt_status_t *const | p_status | ||
| ) |
Read the WDT status flags. Implements wdt_api_t::statusGet.
Indicates both status and error conditions.
| SSP_SUCCESS | WDT status successfully read. |
| SSP_ERR_ASSERTION | Null pointer as a parameter. |
| SSP_ERR_NOT_OPEN | Instance control block is not initialized. |
Read the WDT status
Get the value of refresh or underflow error flag
| ssp_err_t R_WDT_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 timeout value successfully read. |
| SSP_ERR_ASSERTION | Null Pointer. |
| SSP_ERR_ABORTED | Invalid clock divider for this watchdog |
Read the configuration of the WDT
Get the frequency of the clock supplying the WDT
| ssp_err_t R_WDT_VersionGet | ( | ssp_version_t *const | p_data | ) |
Return WDT HAL driver version. Implements wdt_api_t::versionGet.
| SSP_SUCCESS | Version information successfully read. |
| SSP_ERR_ASSERTION | Null pointer passed as a parameter |