X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=atusb%2Fspi.h;fp=atusb%2Fspi.h;h=6e04f4e10e7aaae5bcc3d33420677679c7abea20;hb=dd4bc9ff49b9a7075e579fdd62fd930d27a9a7df;hp=0000000000000000000000000000000000000000;hpb=c164bf7f87f9081fee7e1a186dd7a87a9a020b9e;p=linux-libre-firmware.git diff --git a/atusb/spi.h b/atusb/spi.h new file mode 100644 index 0000000..6e04f4e --- /dev/null +++ b/atusb/spi.h @@ -0,0 +1,30 @@ +/* + * fw/spi.h - ATmega8 family SPI I/O + * + * Written 2011, 2013 by Werner Almesberger + * Copyright 2011, 2013 Werner Almesberger + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + +#ifndef SPI_H +#define SPI_H + +#include + + +void spi_begin(void); +uint8_t spi_io(uint8_t v); +void spi_end(void); +void spi_off(void); +void spi_init(void); + +#define spi_send(v) (void) spi_io(v) +#define spi_recv(v) spi_io(0) + +void spi_recv_block(uint8_t *buf, uint8_t n); + +#endif /* !SPI_H */