test.c | raw changeset files shortlog |
1.1 --- a/test.c Sun Feb 10 18:50:31 2013 +0000 1.2 +++ b/test.c Sun Feb 10 20:12:04 2013 +0000 1.3 @@ -143,65 +143,6 @@ 1.4 return result; 1.5 } 1.6 1.7 -void spi_send(uint8_t v) 1.8 -{ 1.9 - uint8_t mask; 1.10 - 1.11 - OUT(MAX_MOSI); 1.12 - 1.13 - for (mask = 0x80; mask; mask >>= 1) 1.14 - { 1.15 - if (v & mask) 1.16 - { 1.17 - printf("1"); 1.18 - SET(MAX_MOSI); 1.19 - } 1.20 - else 1.21 - { 1.22 - printf("0"); 1.23 - CLR(MAX_MOSI); 1.24 - } 1.25 - 1.26 - nanosleep(&tDS, NULL); 1.27 - 1.28 - SET(MAX_SCLK); 1.29 - nanosleep(&tCH, NULL); 1.30 - CLR(MAX_SCLK); 1.31 - nanosleep(&tDO, NULL); 1.32 - } 1.33 - 1.34 - printf("\n"); 1.35 -} 1.36 - 1.37 -uint8_t spi_recv() 1.38 -{ 1.39 - uint8_t mask, result = 0; 1.40 - 1.41 - IN(MAX_MOSI); 1.42 - 1.43 - for (mask = 0x80; mask; mask >>= 1) 1.44 - { 1.45 - nanosleep(&tON, NULL); 1.46 - 1.47 - SET(MAX_SCLK); 1.48 - 1.49 - if (PIN(MAX_MOSI)) 1.50 - { 1.51 - printf("1"); 1.52 - result |= mask; 1.53 - } 1.54 - else 1.55 - printf("0"); 1.56 - 1.57 - nanosleep(&tCH, NULL); 1.58 - CLR(MAX_SCLK); 1.59 - nanosleep(&tDO, NULL); 1.60 - } 1.61 - 1.62 - printf("\n"); 1.63 - return result; 1.64 -} 1.65 - 1.66 void reset() 1.67 { 1.68 SET(MAX_RESET);