slidekey.h 517 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef DEVICE_SLIDEKEY_H
  2. #define DEVICE_SLIDEKEY_H
  3. #include "typedef.h"
  4. #include "device/device.h"
  5. #include "asm/adc_api.h"
  6. struct slidekey_port {
  7. u8 io;
  8. u8 io_up_en; //是否用外部上拉,1:用外部上拉, 0:用内部上拉10K
  9. u32 level;
  10. u32 ad_channel;
  11. int msg;
  12. };
  13. struct slidekey_platform_data {
  14. u8 enable;
  15. u8 num;
  16. const struct slidekey_port *port;
  17. };
  18. //API:
  19. extern int slidekey_init(const struct slidekey_platform_data *slidekey_data);
  20. #endif