NEORV32 - Software Framework Documentation
Loading...
Searching...
No Matches
neorv32_gptmr.h
Go to the documentation of this file.
1// ================================================================================ //
2// The NEORV32 RISC-V Processor - https://github.com/stnolting/neorv32 //
3// Copyright (c) NEORV32 contributors. //
4// Copyright (c) 2020 - 2024 Stephan Nolting. All rights reserved. //
5// Licensed under the BSD-3-Clause license, see LICENSE for details. //
6// SPDX-License-Identifier: BSD-3-Clause //
7// ================================================================================ //
8
18#ifndef neorv32_gptmr_h
19#define neorv32_gptmr_h
20
21/**********************************************************************/
26typedef volatile struct __attribute__((packed,aligned(4))) {
27 uint32_t CTRL;
28 uint32_t THRES;
29 uint32_t COUNT;
30 uint32_t CAPTURE;
32
34#define NEORV32_GPTMR ((neorv32_gptmr_t*) (NEORV32_GPTMR_BASE))
35
54/**********************************************************************/
59void neorv32_gptmr_setup(int prsc, uint32_t threshold, int match_irq);
60void neorv32_gptmr_capture(int rising, int falling, int filter, int capture_irq);
61void neorv32_gptmr_disable(void);
62void neorv32_gptmr_enable(void);
65void neorv32_gptmr_restart(void);
66uint32_t neorv32_gptmr_counter_get(void);
67uint32_t neorv32_gptmr_capture_get(void);
71#endif // neorv32_gptmr_h
NEORV32_GPTMR_CTRL_enum
Definition neorv32_gptmr.h:37
@ GPTMR_CTRL_FILTER
Definition neorv32_gptmr.h:46
@ GPTMR_CTRL_PRSC2
Definition neorv32_gptmr.h:41
@ GPTMR_CTRL_PRSC1
Definition neorv32_gptmr.h:40
@ GPTMR_CTRL_TRIGM
Definition neorv32_gptmr.h:48
@ GPTMR_CTRL_FALL
Definition neorv32_gptmr.h:45
@ GPTMR_CTRL_IRQC
Definition neorv32_gptmr.h:43
@ GPTMR_CTRL_IRQM
Definition neorv32_gptmr.h:42
@ GPTMR_CTRL_RISE
Definition neorv32_gptmr.h:44
@ GPTMR_CTRL_EN
Definition neorv32_gptmr.h:38
@ GPTMR_CTRL_PRSC0
Definition neorv32_gptmr.h:39
@ GPTMR_CTRL_TRIGC
Definition neorv32_gptmr.h:49
void neorv32_gptmr_restart(void)
Definition neorv32_gptmr.c:140
void neorv32_gptmr_capture(int rising, int falling, int filter, int capture_irq)
Definition neorv32_gptmr.c:68
uint32_t neorv32_gptmr_capture_get(void)
Definition neorv32_gptmr.c:162
void neorv32_gptmr_enable(void)
Definition neorv32_gptmr.c:91
void neorv32_gptmr_disable(void)
Definition neorv32_gptmr.c:82
uint32_t neorv32_gptmr_counter_get(void)
Definition neorv32_gptmr.c:151
int neorv32_gptmr_trigger_matched(void)
Definition neorv32_gptmr.c:102
void neorv32_gptmr_setup(int prsc, uint32_t threshold, int match_irq)
Definition neorv32_gptmr.c:45
int neorv32_gptmr_trigger_captured(void)
Definition neorv32_gptmr.c:122
int neorv32_gptmr_available(void)
Definition neorv32_gptmr.c:27
Definition neorv32_gptmr.h:26
uint32_t COUNT
Definition neorv32_gptmr.h:29
uint32_t CTRL
Definition neorv32_gptmr.h:27
uint32_t CAPTURE
Definition neorv32_gptmr.h:30
uint32_t THRES
Definition neorv32_gptmr.h:28