53 lines
995 B
C
53 lines
995 B
C
#ifndef __XILINX_IP_DEFS_H
|
|
#define __XILINX_IP_DEFS_H
|
|
|
|
#include <stdint.h>
|
|
|
|
#define __IO volatile
|
|
|
|
typedef struct {
|
|
__IO uint32_t RX_FIFO;
|
|
__IO uint32_t TX_FIFO;
|
|
__IO uint32_t STAT;
|
|
__IO uint32_t CTRL;
|
|
} UartLite_TypeDef;
|
|
|
|
typedef struct {
|
|
__IO uint32_t DATA;
|
|
__IO uint32_t TRI;
|
|
__IO uint32_t DATA2;
|
|
__IO uint32_t TRI2;
|
|
} GPIO_TypeDef;
|
|
|
|
typedef struct {
|
|
__IO uint32_t TCSR0;
|
|
__IO uint32_t TLR0;
|
|
__IO uint32_t TCR0;
|
|
__IO uint32_t RSVD;
|
|
__IO uint32_t TCSR1;
|
|
__IO uint32_t TLR1;
|
|
__IO uint32_t TCR1;
|
|
} Timer_TypeDef;
|
|
|
|
#define UART0_BASE 0x40010000
|
|
#define GPIO0_BASE 0x40000000
|
|
#define TIMER0_BASE 0x40020000
|
|
|
|
#define SYS_CLK_FREQ 48000000
|
|
#define SYS_TICK_RATE 1000
|
|
|
|
extern __IO UartLite_TypeDef *UART0;
|
|
extern __IO GPIO_TypeDef *GPIO0;
|
|
extern __IO Timer_TypeDef *TIMER0;
|
|
|
|
extern __IO uint32_t SysTick;
|
|
|
|
static inline uint32_t GetTick() {
|
|
return SysTick;
|
|
}
|
|
|
|
static inline uint32_t GetCoreClock() {
|
|
return SYS_CLK_FREQ;
|
|
}
|
|
|
|
#endif |