user_plug.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef __USER_ESPSWITCH_H__
  2. #define __USER_ESPSWITCH_H__
  3. #include "driver/key.h"
  4. /* NOTICE---this is for 512KB spi flash.
  5. * you can change to other sector if you use other size spi flash. */
  6. #define PRIV_PARAM_START_SEC 0x3C
  7. #define PRIV_PARAM_SAVE 0
  8. #define PLUG_KEY_NUM 1
  9. #define PLUG_KEY_0_IO_MUX PERIPHS_IO_MUX_MTCK_U
  10. #define PLUG_KEY_0_IO_NUM 13
  11. #define PLUG_KEY_0_IO_FUNC FUNC_GPIO13
  12. #define PLUG_WIFI_LED_IO_MUX PERIPHS_IO_MUX_GPIO0_U
  13. #define PLUG_WIFI_LED_IO_NUM 0
  14. #define PLUG_WIFI_LED_IO_FUNC FUNC_GPIO0
  15. #define PLUG_LINK_LED_IO_MUX PERIPHS_IO_MUX_MTDI_U
  16. #define PLUG_LINK_LED_IO_NUM 12
  17. #define PLUG_LINK_LED_IO_FUNC FUNC_GPIO12
  18. #define PLUG_RELAY_LED_IO_MUX PERIPHS_IO_MUX_MTDO_U
  19. #define PLUG_RELAY_LED_IO_NUM 15
  20. #define PLUG_RELAY_LED_IO_FUNC FUNC_GPIO15
  21. #define PLUG_STATUS_OUTPUT(pin, on) GPIO_OUTPUT_SET(pin, on)
  22. struct plug_saved_param {
  23. uint8_t status;
  24. uint8_t pad[3];
  25. };
  26. void user_plug_init(void);
  27. uint8 user_plug_get_status(void);
  28. void user_plug_set_status(bool status);
  29. #endif