Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BYTE spi_io(BYTE spi){
- BYTE i=8;
- register BYTE portf = PORTF;
- RS232_TRANSMIT(spi);
- do{
- portf &= 0b11101111;
- PORTF = portf;
- if(spi&0x80) {
- portf |= 0b10000000;
- }else{
- portf &= 0b01111111;
- }
- PORTF = portf;
- spi=spi<<1;
- if(PINF & 0x40) {
- spi |= 1;
- }
- portf |= 0b00010000;
- PORTF = portf;
- }while(--i);
- RS232_TRANSMIT(spi);
- RS232_TRANSMIT(' ');
- return spi;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement