buttons.h 751 B

123456789101112131415161718192021222324252627282930313233343536
  1. // TODO: add copyright
  2. //
  3. //
  4. #include <stdint.h>
  5. #include "config.h"
  6. typedef struct {
  7. uint32_t inc_f1;
  8. uint32_t dec_f1;
  9. uint32_t inc_d1;
  10. uint32_t dec_d1;
  11. uint32_t inc_d2;
  12. uint32_t dec_d2;
  13. uint32_t inc_ph2;
  14. uint32_t dec_ph2;
  15. uint32_t inc_f3;
  16. uint32_t dec_f3;
  17. uint32_t inc_d3;
  18. uint32_t dec_d3;
  19. uint32_t inc_ph3;
  20. uint32_t dec_ph3;
  21. uint32_t inc_n3;
  22. uint32_t dec_n3;
  23. } button_regs_t __attribute__((packed,aligned(4)));
  24. typedef struct {
  25. union {
  26. uint32_t data[16];
  27. button_regs_t regs;
  28. };
  29. } wb_mailbox_button_regs_t __attribute__((packed,aligned(4)));
  30. // READONLY
  31. static volatile wb_mailbox_button_regs_t * const mailbox_button_regs = (void*)(MAILBOX_BUTTONS_BASE);