Loading...
Searching...
No Matches
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
40#ifndef RTT_ARCH_H
41#define RTT_ARCH_H
42
43#include "periph/rtt.h"
44
45#ifdef __cplusplus
46extern "C" {
47#endif
48
52#define RTT_HW_COUNTER_MAX ((1ULL << 48) - 1)
53
57typedef struct {
61 void (*init)(void);
62
67 uint64_t (*get_counter)(void);
68
75 void (*set_alarm)(uint32_t alarm, rtt_cb_t cb, void *arg);
76
80 void (*clear_alarm)(void);
81
85 void (*save_counter)(void);
86
92 void (*restore_counter)(bool in_init);
93
97 void (*poweron)(void);
98
102 void (*poweroff)(void);
103
105
111uint64_t rtt_pm_sleep_enter(unsigned mode);
112
117void rtt_pm_sleep_exit(uint32_t cause);
118
119#ifdef __cplusplus
120}
121#endif
122
123#endif /* RTT_ARCH_H */
void(* rtt_cb_t)(void *arg)
Signature for the alarm callback.
Definition rtt.h:170
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:57