rtt_arch.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2020 Gunar Schorcht
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
39 #include "periph/rtt.h"
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
48 #define RTT_HW_COUNTER_MAX ((1ULL << 48) - 1)
49 
53 typedef struct {
57  void (*init)(void);
58 
63  uint64_t (*get_counter)(void);
64 
71  void (*set_alarm)(uint32_t alarm, rtt_cb_t cb, void *arg);
72 
76  void (*clear_alarm)(void);
77 
81  void (*save_counter)(void);
82 
88  void (*restore_counter)(bool in_init);
89 
93  void (*poweron)(void);
94 
98  void (*poweroff)(void);
99 
101 
107 uint64_t rtt_pm_sleep_enter(unsigned mode);
108 
113 void rtt_pm_sleep_exit(uint32_t cause);
114 
115 #ifdef __cplusplus
116 }
117 #endif
118 
void(* rtt_cb_t)(void *arg)
Signature for the alarm callback.
Definition: rtt.h:169
Low-level RTT (Real Time Timer) peripheral driver interface definitions.
void rtt_pm_sleep_exit(uint32_t cause)
Called after the power management left light sleep mode.
uint64_t rtt_pm_sleep_enter(unsigned mode)
Called before the power management enters a light or deep sleep mode.
RTT hardware abstraction layer driver.
Definition: rtt_arch.h:53