driver_axp209.h 874 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef _DRIVER_AXP209_H_
  2. #define _DRIVER_AXP209_H_
  3. /****************************************************************
  4. * Includes
  5. ****************************************************************/
  6. #include <stdbool.h>
  7. /****************************************************************
  8. * Defines
  9. ****************************************************************/
  10. // Chip physical address
  11. #define AXP209_I2C_ADDR 0x34
  12. // Chip registers adresses
  13. #define AXP209_INTERRUPT_BANK_3_STATUS 0x4A
  14. // Masks
  15. #define AXP209_INTERRUPT_PEK_SHORT_PRESS 0x02
  16. #define AXP209_INTERRUPT_PEK_LONG_PRESS 0x01
  17. /****************************************************************
  18. * Public functions
  19. ****************************************************************/
  20. bool axp209_init(void);
  21. bool axp209_deinit(void);
  22. int axp209_read_interrupt_bank_3(void);
  23. #endif //_DRIVER_AXP209_H_