123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- #ifndef NRFX_WDT_H__
- #define NRFX_WDT_H__
- #include <nrfx.h>
- #include <hal/nrf_wdt.h>
- #ifdef __cplusplus
- extern "C" {
- #endif
- #if !NRFX_CHECK(NRFX_WDT_CONFIG_NO_IRQ) || defined(__NRFX_DOXYGEN__)
- #define NRFX_WDT_IRQ_CONFIG .interrupt_priority = NRFX_WDT_CONFIG_IRQ_PRIORITY
- #else
- #define NRFX_WDT_IRQ_CONFIG
- #endif
- typedef struct
- {
- nrf_wdt_behaviour_t behaviour;
- uint32_t reload_value;
- #if !NRFX_CHECK(NRFX_WDT_CONFIG_NO_IRQ) || defined(__NRFX_DOXYGEN__)
- uint8_t interrupt_priority;
- #endif
- } nrfx_wdt_config_t;
- typedef void (*nrfx_wdt_event_handler_t)(void);
- typedef nrf_wdt_rr_register_t nrfx_wdt_channel_id;
- #define NRFX_WDT_DEAFULT_CONFIG \
- { \
- .behaviour = (nrf_wdt_behaviour_t)NRFX_WDT_CONFIG_BEHAVIOUR, \
- .reload_value = NRFX_WDT_CONFIG_RELOAD_VALUE, \
- NRFX_WDT_IRQ_CONFIG \
- }
- nrfx_err_t nrfx_wdt_init(nrfx_wdt_config_t const * p_config,
- nrfx_wdt_event_handler_t wdt_event_handler);
- nrfx_err_t nrfx_wdt_channel_alloc(nrfx_wdt_channel_id * p_channel_id);
- void nrfx_wdt_enable(void);
- void nrfx_wdt_feed(void);
- void nrfx_wdt_channel_feed(nrfx_wdt_channel_id channel_id);
- __STATIC_INLINE uint32_t nrfx_wdt_ppi_task_addr(nrf_wdt_task_t task)
- {
- return nrf_wdt_task_address_get(task);
- }
- __STATIC_INLINE uint32_t nrfx_wdt_ppi_event_addr(nrf_wdt_event_t event)
- {
- return nrf_wdt_event_address_get(event);
- }
- void nrfx_wdt_irq_handler(void);
- #ifdef __cplusplus
- }
- #endif
- #endif
|