HPM SDK
HPMicro Software Development Kit
hpm_mono_drv.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2021 HPMicro
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 #ifndef HPM_MONO_DRV_H
9 #define HPM_MONO_DRV_H
10 
11 #include "hpm_common.h"
12 #include "hpm_mono_regs.h"
13 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
34 static inline uint64_t mono_get_counter(MONO_Type *ptr)
35 {
36  return (uint64_t)(((uint64_t)(ptr->MONOH) << 32)
37  | (uint64_t)(ptr->MONOL));
38 }
39 
45 static inline void mono_update(MONO_Type *ptr)
46 {
47  ptr->MONOL = 1;
48 }
49 
50 #ifdef __cplusplus
51 }
52 #endif
56 #endif /* HPM_MONO_DRV_H */
57 
static void mono_update(MONO_Type *ptr)
Update MONO counter by 1.
Definition: hpm_mono_drv.h:45
static uint64_t mono_get_counter(MONO_Type *ptr)
Get counter.
Definition: hpm_mono_drv.h:34
Definition: hpm_mono_regs.h:12
__RW uint32_t MONOL
Definition: hpm_mono_regs.h:13
__RW uint32_t MONOH
Definition: hpm_mono_regs.h:14