ibex_demo/include/soc_peripherals.h

36 lines
662 B
C

#ifndef __SOC_PERIPHERALS_H
#define __SOC_PERIPHERALS_H
#include "xilinx_uartlite.h"
#include "xilinx_gpio.h"
#include "xilinx_timer.h"
#include "ibex_system.h"
// Peripheral defines
#define UART0_BASE 0x40010000
#define GPIO0_BASE 0x40000000
#define TIMER0_BASE 0x40020000
// SoC config
#define SYS_CLK_FREQ 48000000
#define SYS_TICK_RATE 1000
// Peripherals
extern __IO xilinx_uartlite_t *UART0;
extern __IO xilinx_gpio_t *GPIO0;
extern __IO xilinx_timer_t *TIMER0;
// SysTick
extern volatile uint32_t SysTick;
static inline uint32_t GetTick() {
return SysTick;
}
static inline uint32_t GetCoreClock() {
return SYS_CLK_FREQ;
}
#endif