QlightRead Project  1.23

/home/ron/Desktop/Downloads/project/QlightRead_hw/libat90usbxx2.c

Go to the documentation of this file.
00001 
00039 #include "libat90usbxx2.h"
00040 
00051 SINT8 g_init(void) {
00052 
00053         uC_init();
00054         SPI_init();
00055         USB_init();
00056         USART_init();
00057         
00058         sei(); // enable global interrupts 
00059 
00060         return 0;
00061 }
00062 
00073 UINT16 process12SPIvalue(void) {
00074         UINT8 tmp;
00075         UINT16 value;
00076         SET_CS();
00077         if(SPIclkenable()!=0) {
00078                 /* error while sending clock */
00079         }
00080         tmp = getSPIvalue();
00081 
00082         value = ((((UINT16) tmp)<<7) & 0x0F80);
00083 
00084         if(SPIclkenable()!=0) {
00085                 /* error while sending clock */
00086         }
00087         tmp = getSPIvalue();
00088         value |= ((((UINT16) tmp)>>1) & 0x007F);
00089         _SET_CS();
00090 
00091         return value;
00092 }
00093 
00104 SINT8 send_usb_host(UINT16 *value){
00105         if (write_EndPoint(*value)!=0){
00106                 return -1;
00107         }
00108         return 0;
00109 }
00110 
00111 
 All Data Structures Files Functions Variables Defines