summaryrefslogtreecommitdiff
path: root/software/hhd70dongle/c1101lib.c
diff options
context:
space:
mode:
authorChristian Pointner <equinox@mur.at>2013-02-05 21:06:18 +0000
committerChristian Pointner <equinox@mur.at>2013-02-05 21:06:18 +0000
commitd4b95678b1e35f407afeabe6b0f7f85b36d9bce4 (patch)
tree4d5069c1cd8de215ddce45f774572c2fb55069ad /software/hhd70dongle/c1101lib.c
parentbeacon is now continous (diff)
using stdio
git-svn-id: https://svn.spreadspace.org/mur.sat@666 7de4ea59-55d0-425e-a1af-a3118ea81d4c
Diffstat (limited to 'software/hhd70dongle/c1101lib.c')
-rw-r--r--software/hhd70dongle/c1101lib.c34
1 files changed, 13 insertions, 21 deletions
diff --git a/software/hhd70dongle/c1101lib.c b/software/hhd70dongle/c1101lib.c
index cdc1270..d943048 100644
--- a/software/hhd70dongle/c1101lib.c
+++ b/software/hhd70dongle/c1101lib.c
@@ -57,14 +57,6 @@
//static RingBuffer_t SPItoUSB_Buffer;
//static uint8_t SPItoUSB_Buffer_Data[8];
-/** LUFA CDC Class driver interface configuration and state information. This structure is
- * passed to all CDC Class driver functions, so that multiple instances of the same class
- * within a device can be differentiated from one another.
- */
-extern USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface;
-/* ###### end LUFA CDC-ACM specific definitions ###### */
-
-
int16_t c1101_spi_write_byte_ok_get_status(char data)
{
@@ -141,12 +133,12 @@ void c1101_spi_dump_registers_to_usb(void)
hhd70_c1101_wait_chip_rdy();
if (c1101_spi_write_byte_ok_get_status(0xC0) < 0)
return;
- CDC_Device_SendString(&VirtualSerial_CDC_Interface,"dump all 46 registers:\r\n");
+ printf("dump all 46 registers:\r\n");
for (c=0; c<47; c++)
{
debug_sprint_int16hex(debug_sb, hhd70_spi_read_byte());
- CDC_Device_SendString(&VirtualSerial_CDC_Interface, debug_sb);
- CDC_Device_SendString(&VirtualSerial_CDC_Interface, "\r\n");
+ printf("%s", debug_sb);
+ printf("\r\n");
}
hhd70_spi_cs_disable();
}
@@ -456,13 +448,13 @@ void c1101_handleMARCStatusByte(char sb)
if (sb == 0x11)
{
c1101_spi_strobe_command(SPIC1101_ADDR_SFRX);
- CDC_Device_SendString(&VirtualSerial_CDC_Interface,"RX fifo flushed\r\n");
+ printf("RX fifo flushed\r\n");
}
//on TXFifo Overflow, Flush TX Fifo
else if (sb == 0x16)
{
c1101_spi_strobe_command(SPIC1101_ADDR_SFTX);
- CDC_Device_SendString(&VirtualSerial_CDC_Interface,"TX fifo flushed\r\n");
+ printf("TX fifo flushed\r\n");
}
}
@@ -472,13 +464,13 @@ void c1101_handleStatusByte(char sb)
if (SPIC1101_SB_RXFIFO_OVERFLOW(sb))
{
c1101_spi_strobe_command(SPIC1101_ADDR_SFRX);
- CDC_Device_SendString(&VirtualSerial_CDC_Interface,"RX fifo flushed\r\n");
+ printf("RX fifo flushed\r\n");
}
//on TXFifo Overflow, Flush TX Fifo
if (SPIC1101_SB_TXFIFO_OVERFLOW(sb))
{
c1101_spi_strobe_command(SPIC1101_ADDR_SFTX);
- CDC_Device_SendString(&VirtualSerial_CDC_Interface,"TX fifo flushed\r\n");
+ printf("TX fifo flushed\r\n");
}
}
@@ -500,10 +492,10 @@ char c1101_getMARCState(void)
sb &= 0x1F;
//debug start
char debug_sb[6];
- CDC_Device_SendString(&VirtualSerial_CDC_Interface,"c1101 MARCSate:\r\n");
+ printf("c1101 MARCSate:\r\n");
debug_sprint_int16hex(debug_sb, sb);
- CDC_Device_SendString(&VirtualSerial_CDC_Interface,debug_sb);
- CDC_Device_SendString(&VirtualSerial_CDC_Interface,"\r\n");
+ printf("%s", debug_sb);
+ printf("\r\n");
//debug end
return sb;
}
@@ -736,9 +728,9 @@ void c1101_recieveData(void)
num_leave_in_fifo = (recv_data[0] - num_recv_total < 64)? 0 : 1;
} while (num_recv > 0);
recv_data[num_recv_total]=0;
- CDC_Device_SendString(&VirtualSerial_CDC_Interface,"RX: Data Recieved: ");
- CDC_Device_SendString(&VirtualSerial_CDC_Interface,recv_data);
- CDC_Device_SendString(&VirtualSerial_CDC_Interface,"\r\n");
+ printf("RX: Data Recieved: ");
+ printf("%s", recv_data);
+ printf("\r\n");
c1101_getStatus(); // get status and handle possiblble RX Fifo Overflow
}