tps62740.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef _TPS62740_H__
  2. #define _TPS62740_H__
  3. #include <stdint.h>
  4. #include <stdbool.h>
  5. #include "define.h"
  6. #include "nrf_drv_gpiote.h"
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10. #define TPS62740_OFF nrf_gpio_pin_write(TPS72640_EN, 0);
  11. #define TPS62740_ON nrf_gpio_pin_write(TPS72640_EN, 1);
  12. #ifdef TPS62740_FAST
  13. #define TPS62740_FAST_DISABLE nrf_gpio_pin_write(TPS72640_FAST, 1);
  14. #define TPS62740_FAST_ENABLE nrf_gpio_pin_write(TPS72640_FAST, 0);
  15. #endif
  16. typedef enum{
  17. TPS62740_OFF_V=0,
  18. TPS62740_1_8_V=1,
  19. TPS62740_1_9_V=2,
  20. TPS62740_2_0_V=3,
  21. TPS62740_2_1_V=4,
  22. TPS62740_2_2_V=5,
  23. TPS62740_2_3_V=6,
  24. TPS62740_2_4_V=7,
  25. TPS62740_2_5_V=8,
  26. TPS62740_2_6_V=9,
  27. TPS62740_2_7_V=10,
  28. TPS62740_2_8_V=11,
  29. TPS62740_2_9_V=12,
  30. TPS62740_3_0_V=13,
  31. TPS62740_3_1_V=14,
  32. TPS62740_3_2_V=15,
  33. TPS62740_3_3_V=16,
  34. TPS62740_NORMAL_V=17,
  35. }TPS62740_V_SEL;
  36. void nrf_tps62740_gpio_init(void);
  37. bool nrf_tps62740_v_set(TPS62740_V_SEL sel);
  38. #ifdef TPS72640_PG
  39. void tps62740_dio_init(nrf_drv_gpiote_in_config_t *config,nrfx_gpiote_evt_handler_t evt_handler);
  40. #endif
  41. void tps62740_alarm_init(nrf_drv_gpiote_in_config_t *config,nrfx_gpiote_evt_handler_t evt_handler);
  42. void tps62740_pg_pro(void);
  43. void tps62740_alarm_pro(void);
  44. #ifdef __cplusplus
  45. }
  46. #endif
  47. #endif // _TPS62740_H__
  48. /** @} */