NEORV32 Software Framework Documentation
The NEORV32 RISC-V Processor
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#include <stdint.h>
22
23
24/**********************************************************************/
29typedef volatile struct __attribute__((packed,aligned(4))) {
30 uint32_t CTRL;
31 uint32_t THRES;
32 const uint32_t COUNT;
34
36#define NEORV32_GPTMR ((neorv32_gptmr_t*) (NEORV32_GPTMR_BASE))
37
52/**********************************************************************/
57void neorv32_gptmr_setup(int prsc, uint32_t threshold, int cont_mode);
58void neorv32_gptmr_disable(void);
59void neorv32_gptmr_enable(void);
60void neorv32_gptmr_irq_ack(void);
64#endif // neorv32_gptmr_h
NEORV32_GPTMR_CTRL_enum
Definition neorv32_gptmr.h:39
@ GPTMR_CTRL_PRSC2
Definition neorv32_gptmr.h:43
@ GPTMR_CTRL_PRSC1
Definition neorv32_gptmr.h:42
@ GPTMR_CTRL_IRQ_PND
Definition neorv32_gptmr.h:47
@ GPTMR_CTRL_MODE
Definition neorv32_gptmr.h:44
@ GPTMR_CTRL_IRQ_CLR
Definition neorv32_gptmr.h:46
@ GPTMR_CTRL_EN
Definition neorv32_gptmr.h:40
@ GPTMR_CTRL_PRSC0
Definition neorv32_gptmr.h:41
void neorv32_gptmr_enable(void)
Definition neorv32_gptmr.c:69
void neorv32_gptmr_setup(int prsc, uint32_t threshold, int cont_mode)
Definition neorv32_gptmr.c:44
void neorv32_gptmr_disable(void)
Definition neorv32_gptmr.c:60
void neorv32_gptmr_irq_ack(void)
Definition neorv32_gptmr.c:78
int neorv32_gptmr_available(void)
Definition neorv32_gptmr.c:26
Definition neorv32_gptmr.h:29
const uint32_t COUNT
Definition neorv32_gptmr.h:32
uint32_t CTRL
Definition neorv32_gptmr.h:30
uint32_t THRES
Definition neorv32_gptmr.h:31