Mirror of CollapseOS
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

28 satır
685B

  1. #include <stdint.h>
  2. #include <stdbool.h>
  3. /* Extremely simplified Zilog SIO */
  4. typedef struct {
  5. // Write registers WR7:0
  6. uint8_t wr[7];
  7. // Read registers RR2:0
  8. uint8_t rr[2];
  9. uint8_t rx;
  10. uint8_t tx;
  11. // Set to true when writing a byte while SIO is enabled and set back to
  12. // false when sio_has_irq() is false.
  13. bool in_int;
  14. } SIO;
  15. void sio_init(SIO *sio);
  16. bool sio_has_irq(SIO *sio);
  17. bool sio_hasrx(SIO *sio);
  18. bool sio_hastx(SIO *sio);
  19. uint8_t sio_read(SIO *sio);
  20. void sio_write(SIO *sio, uint8_t val);
  21. uint8_t sio_actl_rd(SIO *sio);
  22. void sio_actl_wr(SIO *sio, uint8_t val);
  23. uint8_t sio_adata_rd(SIO *sio);
  24. void sio_adata_wr(SIO *sio, uint8_t val);