ui.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* Motenpoche
  2. *
  3. * (c) 2023 Daniele Lacamera <root@danielinux.net>
  4. *
  5. *
  6. * Motenpoche is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * Motenpoche is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
  19. *
  20. */
  21. #ifndef UI_H_INCLUDED
  22. #define UI_H_INCLUDED
  23. #include "hardware/i2c.h"
  24. #include "fsm.h"
  25. #define UI_EV_SCROLL_UP (1 << 0)
  26. #define UI_EV_SCROLL_DN (1 << 1)
  27. #define UI_EV_KEY_PRESS (1 << 2)
  28. #define UI_EV_BUTTON_OK (1 << 3)
  29. #define UI_EV_BUTTON_BACK (1 << 4)
  30. void ui_init(i2c_inst_t *i2c);
  31. void ui_task(void);
  32. void ui_event_cb(enum vault_state old_st, enum vault_state st);
  33. void ui_event(uint32_t ev);
  34. void ui_key_button(void);
  35. void ui_back_button(void);
  36. void ui_confirm_button(void);
  37. void ui_rot_up(void);
  38. void ui_rot_down(void);
  39. #endif