NEORV32 Software Framework Documentation
The NEORV32 RISC-V Processor
Loading...
Searching...
No Matches
neorv32_mtime.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_mtime_h
19#define neorv32_mtime_h
20
21#include <stdint.h>
22
23
24/**********************************************************************/
29typedef volatile struct __attribute__((packed,aligned(4))) {
30 uint32_t TIME_LO;
31 uint32_t TIME_HI;
32 uint32_t TIMECMP_LO;
33 uint32_t TIMECMP_HI;
35
37#define NEORV32_MTIME ((neorv32_mtime_t*) (NEORV32_MTIME_BASE))
41/**********************************************************************/
46void neorv32_mtime_set_time(uint64_t time);
47uint64_t neorv32_mtime_get_time(void);
48void neorv32_mtime_set_timecmp(uint64_t timecmp);
49uint64_t neorv32_mtime_get_timecmp(void);
50void neorv32_mtime_set_unixtime(uint64_t unixtime);
51uint64_t neorv32_mtime_get_unixtime(void);
54#endif // neorv32_mtime_h
void neorv32_mtime_set_unixtime(uint64_t unixtime)
Definition neorv32_mtime.c:127
void neorv32_mtime_set_time(uint64_t time)
Definition neorv32_mtime.c:44
uint64_t neorv32_mtime_get_unixtime(void)
Definition neorv32_mtime.c:138
void neorv32_mtime_set_timecmp(uint64_t timecmp)
Definition neorv32_mtime.c:93
int neorv32_mtime_available(void)
Definition neorv32_mtime.c:26
uint64_t neorv32_mtime_get_timecmp(void)
Definition neorv32_mtime.c:111
uint64_t neorv32_mtime_get_time(void)
Definition neorv32_mtime.c:64
Definition neorv32_mtime.h:29
uint32_t TIME_HI
Definition neorv32_mtime.h:31
uint32_t TIMECMP_LO
Definition neorv32_mtime.h:32
uint32_t TIME_LO
Definition neorv32_mtime.h:30
uint32_t TIMECMP_HI
Definition neorv32_mtime.h:33