worked on SPI, fixed some bugs

adjusted LCD code
added code for INA3221
worked on UI
This commit is contained in:
2020-06-24 21:28:44 +02:00
parent 6dfce7803a
commit ccd7f119d3
11 changed files with 258 additions and 88 deletions

View File

@@ -98,6 +98,11 @@
#include "driver/gpio.h"
// NOTE from the manual
// GPIO 6-11 are usually used for SPI flash.
// GPIO 34-39 can only be set as input mode and do not have software pullup or pulldown functions.
struct MyGPIO {
static inline bool get(const uint8_t num) {
@@ -134,7 +139,7 @@
io_conf.pin_bit_mask = (1<<num);
io_conf.pull_down_en = GPIO_PULLDOWN_DISABLE;
io_conf.pull_up_en = GPIO_PULLUP_DISABLE;
gpio_config(&io_conf);
ESP_ERROR_CHECK(gpio_config(&io_conf));
}
static inline void setInput(const uint8_t num) {
@@ -148,7 +153,20 @@
io_conf.pin_bit_mask = (1<<num);
io_conf.pull_down_en = GPIO_PULLDOWN_DISABLE;
io_conf.pull_up_en = GPIO_PULLUP_DISABLE;
gpio_config(&io_conf);
ESP_ERROR_CHECK(gpio_config(&io_conf));
}
static inline void setInputPullUp(const uint8_t num) {
setInputPullUp((gpio_num_t)num);
}
static inline void setInputPullUp(const gpio_num_t num) {
gpio_config_t io_conf;
io_conf.intr_type = GPIO_INTR_DISABLE;
io_conf.mode = GPIO_MODE_INPUT;
io_conf.pin_bit_mask = (1<<num);
io_conf.pull_down_en = GPIO_PULLDOWN_DISABLE;
io_conf.pull_up_en = GPIO_PULLUP_ENABLE; // here
ESP_ERROR_CHECK(gpio_config(&io_conf));
}
static void toggleBuiltInLED() {