Toggle navigation
Documentation
The friendly Operating System for the Internet of Things
config.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2020 Inria
3
*
4
* This file is subject to the terms and conditions of the GNU Lesser General
5
* Public License v2.1. See the file LICENSE in the top level directory for more
6
* details.
7
*/
8
9
#pragma once
10
22
#include "board.h"
23
#include "periph_conf.h"
24
25
#include "
ztimer.h
"
26
27
#ifdef __cplusplus
28
extern
"C"
{
29
#endif
30
31
/*
32
* @brief Use periph_timer as the base timer for ZTIMER_USEC
33
*/
34
#define CONFIG_ZTIMER_USEC_TYPE_PERIPH_TIMER (1)
35
36
/* for ZTIMER_USEC, use xtimer configuration if available and no ztimer
37
* specific configuration is set. */
38
#if CONFIG_ZTIMER_USEC_TYPE_PERIPH_TIMER
39
# ifndef CONFIG_ZTIMER_USEC_DEV
40
# ifdef XTIMER_DEV
41
# define CONFIG_ZTIMER_USEC_DEV XTIMER_DEV
42
# endif
43
# endif
44
# ifndef CONFIG_ZTIMER_USEC_BASE_FREQ
45
# ifdef XTIMER_HZ
46
# define CONFIG_ZTIMER_USEC_BASE_FREQ XTIMER_HZ
47
# endif
48
# endif
49
# ifndef CONFIG_ZTIMER_USEC_WIDTH
50
# ifdef XTIMER_WIDTH
51
# define CONFIG_ZTIMER_USEC_WIDTH XTIMER_WIDTH
52
# endif
53
# endif
54
#endif
55
59
#ifndef CONFIG_ZTIMER_USEC_DEV
60
#define CONFIG_ZTIMER_USEC_DEV (TIMER_DEV(0))
61
#endif
62
66
#ifndef CONFIG_ZTIMER_LPTIMER_WIDTH
67
#define CONFIG_ZTIMER_LPTIMER_WIDTH (32)
68
#endif
69
79
#ifndef CONFIG_ZTIMER_USEC_MIN
80
#define CONFIG_ZTIMER_USEC_MIN (10)
81
#endif
82
86
#ifndef CONFIG_ZTIMER_USEC_WIDTH
87
# if (TIMER_0_MAX_VALUE) == 0xffff
88
# define CONFIG_ZTIMER_USEC_WIDTH (16)
89
# elif (TIMER_0_MAX_VALUE) == 0xffffffUL
90
# define CONFIG_ZTIMER_USEC_WIDTH (24)
91
# else
92
# define CONFIG_ZTIMER_USEC_WIDTH (32)
93
# endif
94
#endif
95
99
#ifndef CONFIG_ZTIMER_USEC_BASE_FREQ
100
#define CONFIG_ZTIMER_USEC_BASE_FREQ (1000000LU)
101
#endif
102
106
#ifdef MODULE_ZTIMER_PERIPH_RTT
107
# define CONFIG_ZTIMER_MSEC_BASE_FREQ (RTT_FREQUENCY)
108
# else
109
# define CONFIG_ZTIMER_MSEC_BASE_FREQ (CONFIG_ZTIMER_USEC_BASE_FREQ)
110
#endif
/* MODULE_ZTIMER_PERIPH_RTT */
111
115
#ifndef CONFIG_ZTIMER_TIMER_BLOCK_PM_MODE
116
# ifdef CONFIG_ZTIMER_USEC_REQUIRED_PM_MODE
117
# define CONFIG_ZTIMER_TIMER_BLOCK_PM_MODE CONFIG_ZTIMER_USEC_REQUIRED_PM_MODE
118
# else
119
# define CONFIG_ZTIMER_TIMER_BLOCK_PM_MODE ZTIMER_CLOCK_NO_REQUIRED_PM_MODE
120
# endif
121
#endif
122
126
#ifndef CONFIG_ZTIMER_LPTIMER_BLOCK_PM_MODE
127
# define CONFIG_ZTIMER_LPTIMER_BLOCK_PM_MODE ZTIMER_CLOCK_NO_REQUIRED_PM_MODE
128
#endif
129
133
#ifndef CONFIG_ZTIMER_RTT_BLOCK_PM_MODE
134
# ifdef CONFIG_ZTIMER_MSEC_REQUIRED_PM_MODE
135
# define CONFIG_ZTIMER_RTT_BLOCK_PM_MODE CONFIG_ZTIMER_MSEC_REQUIRED_PM_MODE
136
# else
137
# define CONFIG_ZTIMER_RTT_BLOCK_PM_MODE ZTIMER_CLOCK_NO_REQUIRED_PM_MODE
138
# endif
139
#endif
140
144
#ifndef CONFIG_ZTIMER_RTC_BLOCK_PM_MODE
145
# ifdef CONFIG_ZTIMER_SEC_REQUIRED_PM_MODE
146
# define CONFIG_ZTIMER_RTC_BLOCK_PM_MODE CONFIG_ZTIMER_SEC_REQUIRED_PM_MODE
147
# else
148
# define CONFIG_ZTIMER_RTC_BLOCK_PM_MODE ZTIMER_CLOCK_NO_REQUIRED_PM_MODE
149
# endif
150
#endif
151
161
#ifndef CONFIG_ZTIMER_USEC_ADJUST_CLOCK_START
162
#define CONFIG_ZTIMER_USEC_ADJUST_CLOCK_START 0
163
#endif
164
172
#ifndef CONFIG_ZTIMER_USEC_ADJUST_SET
173
#define CONFIG_ZTIMER_USEC_ADJUST_SET 0
174
#endif
175
186
#ifndef CONFIG_ZTIMER_USEC_ADJUST_SLEEP
187
#define CONFIG_ZTIMER_USEC_ADJUST_SLEEP 0
188
#endif
189
197
#ifndef CONFIG_ZTIMER_AUTO_ADJUST_SETTLE
198
#define CONFIG_ZTIMER_AUTO_ADJUST_SETTLE 0
199
#endif
200
201
#ifdef __cplusplus
202
}
203
#endif
204
ztimer.h
ztimer API
Generated on Sat Jun 28 2025 19:41:33 by
1.9.1