update to tilelink2

This commit is contained in:
Howard Mao
2017-04-20 17:44:05 -07:00
parent 2fecb10cfc
commit 27bd063441
11 changed files with 117 additions and 164 deletions

View File

@@ -1,16 +1,16 @@
#define PWM_PERIOD 0x2000
#define PWM_DUTY 0x2008
#define PWM_ENABLE 0x2010
#define PWM_DUTY 0x2004
#define PWM_ENABLE 0x2008
static inline void write_reg(unsigned long addr, unsigned long data)
static inline void write_reg(unsigned long addr, unsigned int data)
{
volatile unsigned long *ptr = (volatile unsigned long *) addr;
volatile unsigned int *ptr = (volatile unsigned int *) addr;
*ptr = data;
}
static inline unsigned long read_reg(unsigned long addr)
{
volatile unsigned long *ptr = (volatile unsigned long *) addr;
volatile unsigned int *ptr = (volatile unsigned int *) addr;
return *ptr;
}