Loading...
Searching...
No Matches
furi_hal_cortex.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <stdint.h>
9#include <stdbool.h>
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
16typedef struct {
17 uint32_t start;
18 uint32_t value;
20
24
29void furi_hal_cortex_delay_us(uint32_t microseconds);
30
36
44
52
58
59typedef enum {
60 FuriHalCortexComp0,
61 FuriHalCortexComp1,
62 FuriHalCortexComp2,
63 FuriHalCortexComp3,
64} FuriHalCortexComp;
65
66typedef enum {
67 FuriHalCortexCompSizeWord = 0b10,
68 FuriHalCortexCompSizeHalfWord = 0b01,
69 FuriHalCortexCompSizeByte = 0b00,
70} FuriHalCortexCompSize;
71
72typedef enum {
73 FuriHalCortexCompFunctionPC = 0b100,
74 FuriHalCortexCompFunctionRead = 0b101,
75 FuriHalCortexCompFunctionWrite = 0b110,
76 FuriHalCortexCompFunctionReadWrite = 0b110,
77} FuriHalCortexCompFunction;
78
94 FuriHalCortexComp comp,
95 FuriHalCortexCompFunction function,
96 uint32_t value,
97 uint32_t mask,
98 FuriHalCortexCompSize size);
99
104void furi_hal_cortex_comp_reset(FuriHalCortexComp comp);
105
106#ifdef __cplusplus
107}
108#endif
void furi_hal_cortex_comp_reset(FuriHalCortexComp comp)
Reset DWT comparator.
Definition furi_hal_cortex.c:89
FuriHalCortexTimer furi_hal_cortex_timer_get(uint32_t timeout_us)
Get Timer.
Definition furi_hal_cortex.c:31
void furi_hal_cortex_timer_wait(FuriHalCortexTimer cortex_timer)
Wait for timer expire.
Definition furi_hal_cortex.c:44
bool furi_hal_cortex_timer_is_expired(FuriHalCortexTimer cortex_timer)
Check if timer expired.
Definition furi_hal_cortex.c:40
uint32_t furi_hal_cortex_instructions_per_microsecond(void)
Get instructions per microsecond count.
Definition furi_hal_cortex.c:27
void furi_hal_cortex_comp_enable(FuriHalCortexComp comp, FuriHalCortexCompFunction function, uint32_t value, uint32_t mask, FuriHalCortexCompSize size)
Enable DWT comparator.
Definition furi_hal_cortex.c:55
void furi_hal_cortex_delay_us(uint32_t microseconds)
Microseconds delay.
Definition furi_hal_cortex.c:17
void furi_hal_cortex_init_early(void)
Early init stage for cortex.
Definition furi_hal_cortex.c:8
Cortex timer provides high precision low level expiring timer.
Definition furi_hal_cortex.h:16