将mstStartup和slvStartup代码合二为一;增加mtime的驱动代码
This commit is contained in:
38
tb/sw/src/clint.h
Normal file
38
tb/sw/src/clint.h
Normal file
@@ -0,0 +1,38 @@
|
||||
#ifndef __CLINT_H__
|
||||
#define __CLINT_H__
|
||||
|
||||
|
||||
|
||||
|
||||
#define CLINT_MTIME_TICK_PERIOD 4 //ns
|
||||
|
||||
|
||||
#define CLINT_BASE (0x2000000)
|
||||
#define CLINT_MTIME_LOW (0xBFF8)
|
||||
#define CLINT_MTIME_HIGH (0xBFFC)
|
||||
#define CLINT_MTIMECMP_LOW (0x4000)
|
||||
#define CLINT_MTIMECMP_HIGH (0x4004)
|
||||
|
||||
|
||||
#ifndef __ASSEMBLER__
|
||||
|
||||
#include "stdint.h"
|
||||
extern volatile const uint32_t * const mtime_high;
|
||||
extern volatile const uint32_t * const mtime_low;
|
||||
extern volatile uint32_t * const mtimecmp_high;
|
||||
extern volatile uint32_t * const mtimecmp_low;
|
||||
|
||||
extern volatile uint32_t mtimer_int_flag;
|
||||
|
||||
uint64_t read_timer(void);
|
||||
void set_mtimecmp(uint64_t value) ;
|
||||
void enable_mtimer_int();
|
||||
void disable_mtimer_int();
|
||||
void set_mtimer(uint32_t delta_t);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user