Skip to content

Commit

Permalink
Add support for ADM1178 (Rev. F)
Browse files Browse the repository at this point in the history
Signed-off-by: Dragos Bogdan <[email protected]>
  • Loading branch information
dbogdan committed Dec 8, 2017
1 parent b96c77d commit 86f0614
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ GIT_VERSION=$(shell git describe --always --dirty='*')
include asf/sam/utils/make/Makefile.sam.in

cflags-gnu-y += -D'HW_VERSION=$(HW_VERSION)'
cflags-gnu-y += -D'FW_VERSION=2.15'
cflags-gnu-y += -D'FW_VERSION=2.16'
Binary file modified m1000.bin
Binary file not shown.
12 changes: 9 additions & 3 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,10 @@ void write_ad5122(uint32_t ch, uint8_t r1, uint8_t r2) {
/// write controller register
void write_adm1177(uint8_t* b, uint8_t ct) {
twi_packet_t p;
p.chip = 0x58; // 7b addr of '1177 w/ addr p grounded
if (hwversion[0] == 'D')
p.chip = 0x58;
else
p.chip = 0x72;
p.length = ct;
p.buffer = b;
p.addr_length = 0;
Expand All @@ -309,7 +312,10 @@ void write_adm1177(uint8_t* b, uint8_t ct) {
/// read controller register
void read_adm1177(uint8_t* b, uint8_t ct) {
twi_packet_t p;
p.chip = 0x58;
if (hwversion[0] == 'D')
p.chip = 0x58;
else
p.chip = 0x72;
p.length = ct;
p.buffer = b;
p.addr_length = 0;
Expand Down Expand Up @@ -754,7 +760,7 @@ bool main_setup_handle(void) {
packet_index_send_in = 0;
// so much
tc_write_ra(TC0, 2, 10);
tc_write_rb(TC0, 2, udd_g_ctrlreq.req.wValue-32);
tc_write_rb(TC0, 2, udd_g_ctrlreq.req.wValue-30);
tc_write_rc(TC0, 2, udd_g_ctrlreq.req.wValue);
start_frame = udd_g_ctrlreq.req.wIndex;
sent_out = false;
Expand Down
2 changes: 1 addition & 1 deletion src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ typedef enum chan_mode{
SIMV = 2,
} chan_mode;

uint16_t packets_in[2][1024];
uint16_t packets_in[2][1024+1];
uint16_t packets_out[2][512];

typedef enum ch_params {
Expand Down

0 comments on commit 86f0614

Please sign in to comment.