Mirror of CollapseOS
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

18 lignes
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);