update pins and stuff to bump to rev 2.x

This commit is contained in:
2026-04-10 07:15:51 -05:00
parent bff0bb30dd
commit 2f1ff23678
14 changed files with 142 additions and 60 deletions
+2 -2
View File
@@ -32,8 +32,8 @@ static void init_i2c() {
i2c_config_t conf = {
.mode = I2C_MODE_MASTER,
.sda_io_num = GPIO_NUM_5,
.scl_io_num = GPIO_NUM_6,
.sda_io_num = PIN_I2C_SDA,
.scl_io_num = PIN_I2C_SCL,
.sda_pullup_en = GPIO_PULLUP_DISABLE,
.scl_pullup_en = GPIO_PULLUP_DISABLE,
// .sda_pullup_en = GPIO_PULLUP_ENABLE,
+3
View File
@@ -1,6 +1,9 @@
#ifndef ALL_H
#define ALL_H
#define PIN_I2C_SDA GPIO_NUM_7
#define PIN_I2C_SCL GPIO_NUM_15
#include "char_lcd.h"
#include "bottom_half.h"
#include "sd.h"
+3 -1
View File
@@ -190,10 +190,12 @@ static void poll_bottom_task(void *arg) {
// TODO: if using an interupt, switch this to use a queue
while (1) {
bool new_data = gpio_get_level(BOTTOM_PIN_INTERUPT) == 0;
// bool new_data = 1;
if (new_data) {
uint8_t delta = receive_delta();
// ESP_LOGI(_TAG, "delta: %d", delta);
if (delta == 0) ESP_LOGW(TAG, "delta pin was low, but delta register returned 0");
// if (delta == 0) ESP_LOGW(TAG, "delta pin was low, but delta register returned 0");
if (delta != 0) ESP_LOGI(TAG, "delta!");
if (delta & (1 << DELTA_BIT_KP)) receive_keypad();
if (delta & (1 << DELTA_BIT_BUTTON_SWITCH)) receive_button_switch();
+1 -1
View File
@@ -6,7 +6,7 @@
#define BOTTOM_I2C_NUM I2C_NUM_0
#define BOTTOM_I2C_ADDR 126
#define BOTTOM_PIN_INTERUPT GPIO_NUM_0
#define BOTTOM_PIN_INTERUPT GPIO_NUM_13
#define DELTA_BIT_KP 0
#define DELTA_BIT_BUTTON_SWITCH 1
@@ -128,7 +128,7 @@ static esp_err_t panel_ili9488_init(esp_lcd_panel_t *panel)
// ORIGINAL
lcd_init_cmd_t ili9488_init[] =
{
#if CONFIG_USE_NEW_DISPLAY
#if CONFIG_USE_NEW_DISPLAY || 1
{ ILI9488_POSITIVE_GAMMA_CTL, { 0x00, 0x08, 0x0c, 0x02, 0x0e, 0x04, 0x30, 0x45, 0x47, 0x04, 0x0C, 0x0a, 0x2e, 0x34, 0x0F }, 15 },
{ ILI9488_NEGATIVE_GAMMA_CTL, { 0x00, 0x11, 0x0d, 0x01, 0x0f, 0x05, 0x39, 0x36, 0x51, 0x06, 0x0f, 0x0d, 0x33, 0x37, 0x0F }, 15 },
#else
+14 -1
View File
@@ -1,10 +1,23 @@
#ifndef LEDS_H
#define LEDS_H
#include "main.h"
#include <stdint.h>
#define LED_COUNT 21
#define NEOPIXEL_PIN GPIO_NUM_7
#ifdef CONTROL_REV_2_0
#define NEOPIXEL_PIN GPIO_NUM_0
#endif
#ifdef CONTROL_REV_2_1
#define NEOPIXEL_PIN GPIO_NUM_21
#endif
#ifndef CONTROL_REV_2_0
#ifndef CONTROL_REV_2_1
#error "define rev2.0 or rev2.1"
#endif
#endif
// 10MHz resolution, 1 tick = 0.1us (led strip needs a high resolution)
#define LED_STRIP_RMT_RES_HZ (10 * 1000 * 1000)
+13 -6
View File
@@ -12,12 +12,19 @@
extern sdmmc_card_t *card;
#define SD_PIN_CLK GPIO_NUM_48
#define SD_PIN_CMD GPIO_NUM_45
#define SD_PIN_D0 GPIO_NUM_47
#define SD_PIN_D1 GPIO_NUM_21
#define SD_PIN_D2 GPIO_NUM_39
#define SD_PIN_D3 GPIO_NUM_38
#define SD_PIN_CLK GPIO_NUM_39
#define SD_PIN_CMD GPIO_NUM_40
#define SD_PIN_D0 GPIO_NUM_38
#define SD_PIN_D1 GPIO_NUM_45
#define SD_PIN_D2 GPIO_NUM_42
#define SD_PIN_D3 GPIO_NUM_41
#ifdef CONTROL_REV_2_0
#define SD_PIN_D1 GPIO_NUM_45
#endif
#ifdef CONTROL_REV_2_1
#define SD_PIN_D1 GPIO_NUM_47
#endif
/// @brief Initializes the SD card
///
+2 -2
View File
@@ -15,8 +15,8 @@
#include "sdkconfig.h"
#include "sd.h"
#define SPEAKER_PIN_BCLK GPIO_NUM_46
#define SPEAKER_PIN_WS GPIO_NUM_9
#define SPEAKER_PIN_BCLK GPIO_NUM_11
#define SPEAKER_PIN_WS GPIO_NUM_12
#define SPEAKER_PIN_DOUT GPIO_NUM_3
#define SAMPLE_RATE 44100
// The maximum number of clips that can be queued at one time.
+2 -2
View File
@@ -4,8 +4,8 @@
#include "TM1640/TM1640.h"
#include <esp_log.h>
#define SSEG_PIN_DATA GPIO_NUM_10
#define SSEG_PIN_CLK GPIO_NUM_11
#define SSEG_PIN_DATA GPIO_NUM_46
#define SSEG_PIN_CLK GPIO_NUM_48
extern TM1640* sseg;
+4 -4
View File
@@ -44,11 +44,11 @@
#define SPI_MAX_TRANSFER_SIZE 32768
#define TFT_PIN_MOSI GPIO_NUM_17
#define TFT_PIN_MISO GPIO_NUM_18
#define TFT_PIN_CLK GPIO_NUM_16
#define TFT_PIN_MISO GPIO_NUM_16
#define TFT_PIN_CLK GPIO_NUM_18
#define TFT_PIN_CS GPIO_NUM_NC
#define TFT_PIN_DC GPIO_NUM_15
#define TFT_PIN_RESET GPIO_NUM_8
#define TFT_PIN_DC GPIO_NUM_8
#define TFT_PIN_RESET GPIO_NUM_9
#define TFT_INVERT_COLOR false
+4 -4
View File
@@ -26,8 +26,8 @@ static void receive_button(void);
void init_wires(void) {
i2c_config_t wires_conf = {
.mode = I2C_MODE_MASTER,
.sda_io_num = GPIO_NUM_41,
.scl_io_num = GPIO_NUM_42,
.sda_io_num = PIN_WIRES_SDA,
.scl_io_num = PIN_WIRES_SCL,
.sda_pullup_en = GPIO_PULLUP_ENABLE,
.scl_pullup_en = GPIO_PULLUP_ENABLE,
.master = {
@@ -35,8 +35,8 @@ void init_wires(void) {
}
};
gpio_reset_pin(GPIO_NUM_41);
gpio_reset_pin(GPIO_NUM_42);
gpio_reset_pin(PIN_WIRES_SDA);
gpio_reset_pin(PIN_WIRES_SCL);
ESP_ERROR_CHECK(i2c_param_config(WIRES_I2C_NUM, &wires_conf));
ESP_ERROR_CHECK(i2c_driver_install(WIRES_I2C_NUM, wires_conf.mode, 0, 0, 0));
+10 -1
View File
@@ -9,7 +9,16 @@
#include "drivers/game_timer.h"
#include "main.h"
#define WIRES_PIN_DELTA GPIO_NUM_2
#define PIN_PERH0 GPIO_NUM_6
#define PIN_PERH1 GPIO_NUM_5
#define PIN_PERH2 GPIO_NUM_4
#define PIN_PERH3 GPIO_NUM_2
#define PIN_PERH4 GPIO_NUM_1
#define WIRES_PIN_DELTA PIN_PERH3
#define PIN_WIRES_SDA PIN_PERH1
#define PIN_WIRES_SCL PIN_PERH2
#define WIRES_I2C_NUM I2C_NUM_1
#define WIRES_I2C_ADDR 125