1 /* 2 * Copyright (c) 2021-2022 HPMicro 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 * 6 */ 7 8 9 #ifndef HPM_MCHTMR_H 10 #define HPM_MCHTMR_H 11 12 typedef struct { 13 __RW uint64_t MTIME; /* 0x0: Machine Time */ 14 __RW uint64_t MTIMECMP; /* 0x8: Machine Time Compare */ 15 } MCHTMR_Type; 16 17 18 /* Bitfield definition for register: MTIME */ 19 /* 20 * MTIME (RW) 21 * 22 * Machine time 23 */ 24 #define MCHTMR_MTIME_MTIME_MASK (0xFFFFFFFFFFFFFFFFULL) 25 #define MCHTMR_MTIME_MTIME_SHIFT (0U) 26 #define MCHTMR_MTIME_MTIME_SET(x) (((uint64_t)(x) << MCHTMR_MTIME_MTIME_SHIFT) & MCHTMR_MTIME_MTIME_MASK) 27 #define MCHTMR_MTIME_MTIME_GET(x) (((uint64_t)(x) & MCHTMR_MTIME_MTIME_MASK) >> MCHTMR_MTIME_MTIME_SHIFT) 28 29 /* Bitfield definition for register: MTIMECMP */ 30 /* 31 * MTIMECMP (RW) 32 * 33 * Machine time compare 34 */ 35 #define MCHTMR_MTIMECMP_MTIMECMP_MASK (0xFFFFFFFFFFFFFFFFULL) 36 #define MCHTMR_MTIMECMP_MTIMECMP_SHIFT (0U) 37 #define MCHTMR_MTIMECMP_MTIMECMP_SET(x) (((uint64_t)(x) << MCHTMR_MTIMECMP_MTIMECMP_SHIFT) & MCHTMR_MTIMECMP_MTIMECMP_MASK) 38 #define MCHTMR_MTIMECMP_MTIMECMP_GET(x) (((uint64_t)(x) & MCHTMR_MTIMECMP_MTIMECMP_MASK) >> MCHTMR_MTIMECMP_MTIMECMP_SHIFT) 39 40 41 42 43 #endif /* HPM_MCHTMR_H */