Advertisement
DimkaM

Untitled

Dec 2nd, 2020
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. BYTE spi_io(BYTE spi){
  2. BYTE i=8;
  3. register BYTE portf = PORTF;
  4. RS232_TRANSMIT(spi);
  5. do{
  6. portf &= 0b11101111;
  7. PORTF = portf;
  8. if(spi&0x80) {
  9. portf |= 0b10000000;
  10. }else{
  11. portf &= 0b01111111;
  12. }
  13. PORTF = portf;
  14. spi=spi<<1;
  15. if(PINF & 0x40) {
  16. spi |= 1;
  17. }
  18. portf |= 0b00010000;
  19. PORTF = portf;
  20. }while(--i);
  21. RS232_TRANSMIT(spi);
  22. RS232_TRANSMIT(' ');
  23. return spi;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement