Skip to content

Commit

Permalink
All current calls replicated with instruction call
Browse files Browse the repository at this point in the history
  • Loading branch information
chiranthsiddappa committed Apr 18, 2014
1 parent f3ec254 commit dddd07d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
20 changes: 20 additions & 0 deletions AD9912_sketch/AD9912.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,23 @@ uint64_t AD9912::instruction(short command, uint16_t address, char bytes, uint64
pinMode(_SPIMOSI, OUTPUT);
return return_data;
}

uint16_t AD9912::DAC_read() {
uint16_t data;
data = AD9912::instruction(0x1, 0x40C, 2, 0x0);
return data;
}

void AD9912::DAC_write(uint16_t DAC_val) {
AD9912::instruction(0x0, 0x40C, 2, DAC_val);
}

uint64_t AD9912::FTW_read() {
uint64_t FTW;
FTW = AD9912::instruction(0x1, 0x1AB, 6, 0x0);
return FTW;
}

void AD9912::FTW_write(uint64_t FTW) {
AD9912::instruction(0x0, 0x1AB, 6, FTW);
}
4 changes: 4 additions & 0 deletions AD9912_sketch/AD9912.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ class AD9912 {
void init(uint SPICS, uint SPISCK, uint SPIMOSI, uint SPIMISO, uint IO_update );
uint16_t read_PartID();
uint64_t instruction(short command, uint16_t address, char bytes, uint64_t data);
uint16_t DAC_read();
void DAC_write(uint16_t DAC_val);
uint64_t FTW_read();
void FTW_write(uint64_t FTW);
private:
// global type variables
uint _SPISCK;
Expand Down

0 comments on commit dddd07d

Please sign in to comment.