2024-02-22 17:09:35 +01:00
|
|
|
#ifndef _BSP_ACLINT_H
|
|
|
|
#define _BSP_ACLINT_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2024-05-29 20:50:30 +02:00
|
|
|
#include "gen/AClintModule.h"
|
2024-02-22 17:09:35 +01:00
|
|
|
|
|
|
|
#define aclint_t apb3aclint_t
|
|
|
|
|
|
|
|
static void set_aclint_mtime(volatile aclint_t* reg, uint64_t value){
|
|
|
|
set_aclint_mtime_hi(reg, (uint32_t)(value >> 32));
|
|
|
|
set_aclint_mtime_lo(reg, (uint32_t)value);
|
|
|
|
}
|
|
|
|
|
|
|
|
static uint64_t get_aclint_mtime(volatile aclint_t* reg){
|
|
|
|
uint64_t value = ((uint64_t)get_aclint_mtime_hi(reg) << 32) | (uint64_t)get_aclint_mtime_lo(reg);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void set_aclint_mtimecmp(volatile aclint_t* reg, uint64_t value){
|
|
|
|
set_aclint_mtimecmp0hi(reg, (uint32_t)(value >> 32));
|
|
|
|
set_aclint_mtimecmp0lo(reg, (uint32_t)value);
|
|
|
|
}
|
|
|
|
|
|
|
|
static uint64_t get_aclint_mtimecmp(volatile aclint_t* reg){
|
|
|
|
uint64_t value = ((uint64_t)get_aclint_mtimecmp0hi(reg) << 32) | (uint64_t)get_aclint_mtimecmp0lo(reg);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
2024-05-29 20:50:30 +02:00
|
|
|
#endif /* _BSP_ACLINT_H */
|