hw.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * TamaLIB - A hardware agnostic Tamagotchi P1 emulation library
  3. *
  4. * Copyright (C) 2021 Jean-Christophe Rona <jc@rona.fr>
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version 2
  9. * of the License, or (at your option) any later version.
  10. *
  11. * This program 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-1301, USA.
  19. */
  20. #ifndef _HW_H_
  21. #define _HW_H_
  22. #include "hal.h"
  23. #define LCD_WIDTH 32
  24. #define LCD_HEIGHT 16
  25. #define ICON_NUM 8
  26. typedef enum {
  27. BTN_STATE_RELEASED = 0,
  28. BTN_STATE_PRESSED,
  29. } btn_state_t;
  30. typedef enum {
  31. BTN_LEFT = 0,
  32. BTN_MIDDLE,
  33. BTN_RIGHT,
  34. } button_t;
  35. bool_t hw_init(void);
  36. void hw_release(void);
  37. void hw_set_lcd_pin(u8_t seg, u8_t com, u8_t val);
  38. void hw_set_button(button_t btn, btn_state_t state);
  39. void hw_set_buzzer_freq(u4_t freq);
  40. void hw_enable_buzzer(bool_t en);
  41. #endif /* _HW_H_ */