accessors.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. This example code is in the Public Domain (or CC0 licensed, at your option.)
  3. Unless required by applicable law or agreed to in writing, this
  4. software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
  5. CONDITIONS OF ANY KIND, either express or implied.
  6. */
  7. #pragma once
  8. #include "esp_system.h"
  9. #include "driver/i2c.h"
  10. #include "driver/spi_master.h"
  11. typedef struct {
  12. int width;
  13. int height;
  14. int RST_pin;
  15. int i2c_system_port;
  16. int address;
  17. int CS_pin;
  18. int speed;
  19. const char *drivername;
  20. const char *type;
  21. bool hflip;
  22. bool vflip;
  23. bool rotate;
  24. } display_config_t;
  25. const display_config_t * config_display_get();
  26. esp_err_t config_i2c_set(const i2c_config_t * config, int port);
  27. esp_err_t config_spi_set(const spi_bus_config_t * config, int host, int dc);
  28. const i2c_config_t * config_i2c_get(int * i2c_port);
  29. const spi_bus_config_t * config_spi_get(spi_host_device_t * spi_host);
  30. void parse_set_GPIO(void (*cb)(int gpio, char *value));
  31. typedef struct {
  32. bool fixed;
  33. char * name;
  34. char * group;
  35. int gpio;
  36. } gpio_entry_t;
  37. esp_err_t free_gpio_entry( gpio_entry_t ** gpio);
  38. gpio_entry_t * get_gpio_by_name(char * name,char * group, bool refresh);
  39. gpio_entry_t * get_gpio_by_no(int gpionum, bool refresh);
  40. cJSON * get_gpio_list();