rtt_arch.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Gunar Schorcht
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
9 #pragma once
10 
42 #include "periph/rtt.h"
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
51 #define RTT_HW_COUNTER_MAX ((1ULL << 48) - 1)
52 
56 typedef struct {
60  void (*init)(void);
61 
66  uint64_t (*get_counter)(void);
67 
74  void (*set_alarm)(uint32_t alarm, rtt_cb_t cb, void *arg);
75 
79  void (*clear_alarm)(void);
80 
84  void (*save_counter)(void);
85 
91  void (*restore_counter)(bool in_init);
92 
96  void (*poweron)(void);
97 
101  void (*poweroff)(void);
102 
104 
110 uint64_t rtt_pm_sleep_enter(unsigned mode);
111 
116 void rtt_pm_sleep_exit(uint32_t cause);
117 
118 #ifdef __cplusplus
119 }
120 #endif
121 
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:56