summaryrefslogtreecommitdiff
path: root/software/hhd70dongle/hhd70dongle.c
diff options
context:
space:
mode:
authorBernhard Tittelbach <xro@realraum.at>2012-05-17 06:14:33 +0000
committerBernhard Tittelbach <xro@realraum.at>2012-05-17 06:14:33 +0000
commitd8deaecc0cef3db0b57282bb7038cbf59d7a4f77 (patch)
tree710fb48f93adb2b15a3c4cf8fa809fef1f328411 /software/hhd70dongle/hhd70dongle.c
parentmake SPI work by understanding how it actually works (diff)
make SPI work by correcting register typo ;-)
git-svn-id: https://svn.spreadspace.org/mur.sat@420 7de4ea59-55d0-425e-a1af-a3118ea81d4c
Diffstat (limited to 'software/hhd70dongle/hhd70dongle.c')
-rw-r--r--software/hhd70dongle/hhd70dongle.c18
1 files changed, 16 insertions, 2 deletions
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);