Mirror of CollapseOS
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

18 rindas
402B

  1. #include "emul.h"
  2. /* Emulates a SPI relay designed for the RC2014, enabled by poking on the CTL
  3. port, then allowing a SPI exchange by writing to, then reading from, the
  4. data port.
  5. */
  6. typedef struct {
  7. bool selected;
  8. byte resp;
  9. EXCH spixfn;
  10. } SPI;
  11. void spi_init(SPI *spi, EXCH spixfn);
  12. void spi_ctl_wr(SPI *spi, byte val);
  13. void spi_wr(SPI *spi, byte val);
  14. byte spi_rd(SPI *spi);