Mirror of CollapseOS
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

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