From d8deaecc0cef3db0b57282bb7038cbf59d7a4f77 Mon Sep 17 00:00:00 2001 From: Bernhard Tittelbach Date: Thu, 17 May 2012 06:14:33 +0000 Subject: make SPI work by correcting register typo ;-) git-svn-id: https://svn.spreadspace.org/mur.sat@420 7de4ea59-55d0-425e-a1af-a3118ea81d4c --- software/hhd70dongle/hhd70dongle.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'software/hhd70dongle/hhd70dongle.c') diff --git a/software/hhd70dongle/hhd70dongle.c b/software/hhd70dongle/hhd70dongle.c index 3d7fa95..c221ffc 100644 --- a/software/hhd70dongle/hhd70dongle.c +++ b/software/hhd70dongle/hhd70dongle.c @@ -47,9 +47,10 @@ uint8_t read_buffer[64]; // buffer for reading usb signals uint8_t write_buffer[64]; // buffer for writing usb signals //TODOs: +// * remove code duplications +// * speed up and simplify code // * make as much use of sleep modes as possible // * use adc noise canceler (i.e. automatic sampling during cpu sleep) -// * define and listen for an usb_hid reset command -> jump to bootload address // * read atmega temp // * safely save state in eeprom (2 memory regions, only use the one with the "written successfully bit" which is written last) @@ -67,7 +68,9 @@ int main(void) //usb_rawhid_send(write_buffer, 23); usb_rawhid_send((uint8_t*)"hhd70dongle ready",17); - + + c1101_init(); + for(;;) { _delay_ms(250); @@ -90,6 +93,17 @@ int main(void) usb_rawhid_send((uint8_t*)"c1101 version:",255); debug_sprint_int16hex(write_buffer, c1101_getVersion()); usb_rawhid_send(write_buffer,255); + _delay_ms(250); + usb_rawhid_send((uint8_t*)"c1101 freq0:",255); + debug_sprint_int16hex(write_buffer, spi_c1101_read_register(SPIC1101_ADDR_FREQ0)); + usb_rawhid_send(write_buffer,255); + usb_rawhid_send((uint8_t*)"c1101 freq1:",255); + debug_sprint_int16hex(write_buffer, spi_c1101_read_register(SPIC1101_ADDR_FREQ1)); + usb_rawhid_send(write_buffer,255); + usb_rawhid_send((uint8_t*)"c1101 freq2:",255); + debug_sprint_int16hex(write_buffer, spi_c1101_read_register(SPIC1101_ADDR_FREQ2)); + usb_rawhid_send(write_buffer,255); + //~ char buf[10]; //~ unsigned int len; //~ spi_read(sizeof(buf),buf,&len); -- cgit v1.2.3