NHAL Interface v0.5.0
Hardware Abstraction Layer Interface for Embedded Systems
Loading...
Searching...
No Matches
Functions
nhal_wdt.h File Reference

Hardware Abstraction Layer for Watchdog Timer management. More...

#include <stdint.h>
#include <stddef.h>
#include "nhal_common.h"
#include "nhal_wdt_types.h"

Go to the source code of this file.

Functions

nhal_result_t nhal_wdt_init (struct nhal_wdt_context *ctx)
 Initialize watchdog context.
 
nhal_result_t nhal_wdt_deinit (struct nhal_wdt_context *ctx)
 Deinitialize watchdog context.
 
nhal_result_t nhal_wdt_set_config (struct nhal_wdt_context *ctx, struct nhal_wdt_config *config)
 Set watchdog configuration.
 
nhal_result_t nhal_wdt_get_config (struct nhal_wdt_context *ctx, struct nhal_wdt_config *config)
 Get current watchdog configuration.
 
nhal_result_t nhal_wdt_enable (struct nhal_wdt_context *ctx)
 Start/Enable the watchdog timer.
 
nhal_result_t nhal_wdt_disable (struct nhal_wdt_context *ctx)
 Stop/Disable the watchdog timer (if supported)
 
nhal_result_t nhal_wdt_feed (struct nhal_wdt_context *ctx)
 Feed/Reset the watchdog timer.
 

Detailed Description

Hardware Abstraction Layer for Watchdog Timer management.

This file defines the API for interacting with watchdog timers. It provides functions for initialization, configuration, feeding, and control operations.

The watchdog timer provides system reliability by automatically resetting the system if it is not periodically serviced within the configured timeout period.

Definition in file nhal_wdt.h.

Function Documentation

◆ nhal_wdt_deinit()

nhal_result_t nhal_wdt_deinit ( struct nhal_wdt_context ctx)

Deinitialize watchdog context.

Parameters
ctxPointer to watchdog context structure
Returns
NHAL_OK on success, error code otherwise

◆ nhal_wdt_disable()

nhal_result_t nhal_wdt_disable ( struct nhal_wdt_context ctx)

Stop/Disable the watchdog timer (if supported)

Parameters
ctxPointer to watchdog context structure
Returns
NHAL_OK on success, NHAL_ERR_UNSUPPORTED if not supported

◆ nhal_wdt_enable()

nhal_result_t nhal_wdt_enable ( struct nhal_wdt_context ctx)

Start/Enable the watchdog timer.

Parameters
ctxPointer to watchdog context structure
Returns
NHAL_OK on success, error code otherwise

◆ nhal_wdt_feed()

nhal_result_t nhal_wdt_feed ( struct nhal_wdt_context ctx)

Feed/Reset the watchdog timer.

Parameters
ctxPointer to watchdog context structure
Returns
NHAL_OK on success, error code otherwise

◆ nhal_wdt_get_config()

nhal_result_t nhal_wdt_get_config ( struct nhal_wdt_context ctx,
struct nhal_wdt_config config 
)

Get current watchdog configuration.

Parameters
ctxPointer to watchdog context structure
configPointer to configuration structure to fill
Returns
NHAL_OK on success, error code otherwise

◆ nhal_wdt_init()

nhal_result_t nhal_wdt_init ( struct nhal_wdt_context ctx)

Initialize watchdog context.

Parameters
ctxPointer to watchdog context structure
Returns
NHAL_OK on success, error code otherwise

◆ nhal_wdt_set_config()

nhal_result_t nhal_wdt_set_config ( struct nhal_wdt_context ctx,
struct nhal_wdt_config config 
)

Set watchdog configuration.

Parameters
ctxPointer to watchdog context structure
configPointer to configuration structure
Returns
NHAL_OK on success, error code otherwise