Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- spi_xfer:
- SPICSR = 0x0f ^ (1 << cn_id)
- for (i=0; i<=N; i++) {
- if (i != N) {
- while (!(SPISR & 0x10)); /* wait TXRDY */
- SPITXDR = data[i];
- }
- if (i != 0) {
- while (!(SPISR & 0x08)); /* wait RXRDY */
- data[i-1] = SPIRXDR;
- }
- }
- SPICSR = 0x0f
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement