Mirror of CollapseOS
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

18 řádky
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);