2014-08-28 16:56:48 +08:00
|
|
|
#ifndef __DDS_H
|
|
|
|
#define __DDS_H
|
|
|
|
|
2015-03-12 20:14:06 +08:00
|
|
|
#include <hw/common.h>
|
2015-04-11 21:32:01 +08:00
|
|
|
#include <generated/mem.h>
|
2015-03-12 20:14:06 +08:00
|
|
|
|
|
|
|
#define DDS_READ(addr) \
|
2015-04-11 21:32:01 +08:00
|
|
|
MMPTR(DDS_BASE + (addr)*4)
|
2015-03-12 20:14:06 +08:00
|
|
|
|
|
|
|
#define DDS_WRITE(addr, data) \
|
2015-04-11 21:32:01 +08:00
|
|
|
MMPTR(DDS_BASE + (addr)*4) = data
|
2015-03-12 20:14:06 +08:00
|
|
|
|
|
|
|
#define DDS_FTW0 0x0a
|
|
|
|
#define DDS_FTW1 0x0b
|
|
|
|
#define DDS_FTW2 0x0c
|
|
|
|
#define DDS_FTW3 0x0d
|
|
|
|
#define DDS_POW0 0x0e
|
|
|
|
#define DDS_POW1 0x0f
|
|
|
|
#define DDS_GPIO 0x41
|
|
|
|
|
2014-08-28 16:56:48 +08:00
|
|
|
void dds_init(void);
|
2014-11-21 04:32:56 +08:00
|
|
|
void dds_phase_clear_en(int channel, int phase_clear_en);
|
|
|
|
void dds_program(long long int timestamp, int channel,
|
2014-12-09 13:50:33 +08:00
|
|
|
unsigned int ftw, unsigned int pow, unsigned int sysclk_per_microcycle,
|
2014-11-21 04:32:56 +08:00
|
|
|
int rt_fud, int phase_tracking);
|
2014-08-28 16:56:48 +08:00
|
|
|
|
|
|
|
#endif /* __DDS_H */
|