Toggle navigation
Documentation
The friendly Operating System for the Internet of Things
Loading...
Searching...
No Matches
clk.h
Go to the documentation of this file.
1
/*
2
* SPDX-FileCopyrightText: 2021 Inria
3
* SPDX-License-Identifier: LGPL-2.1-only
4
*/
5
6
#pragma once
7
16
17
#include <
assert.h
>
18
#include <stdint.h>
19
#include "periph_conf.h"
20
21
#ifdef __cplusplus
22
extern
"C"
{
23
#endif
24
30
static
inline
uint32_t
coreclk
(
void
) {
31
#if defined(CLOCK_CORECLOCK)
32
return
CLOCK_CORECLOCK
;
33
#else
34
extern
uint32_t cpu_coreclk;
35
assert
(cpu_coreclk != 0);
36
return
cpu_coreclk;
37
#endif
38
}
39
40
#ifdef __cplusplus
41
}
42
#endif
43
CLOCK_CORECLOCK
#define CLOCK_CORECLOCK
Clock configuration.
Definition
periph_cpu.h:28
assert.h
POSIX.1-2008 compliant version of the assert macro.
assert
#define assert(cond)
abort the program if assertion is false
Definition
assert.h:143
coreclk
static uint32_t coreclk(void)
Get the current system core clock frequency in Hz.
Definition
clk.h:30
Generated on Sat Jul 25 2026 20:51:22 by
1.13.2