Skip to content

Commit

Permalink
Add ESP32_KA platform
Browse files Browse the repository at this point in the history
Add ability to customize pixel SPI device.
  • Loading branch information
MartinMueller2003 committed Jun 27, 2024
1 parent 755e2c6 commit 0b8da27
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 4 deletions.
2 changes: 2 additions & 0 deletions ESPixelStick/src/GPIO_Defs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ typedef enum
# include "platformDefinitions/GPIO_Defs_ESP32_D1_MINI_ETH.hpp"
#elif defined (BOARD_ESP32_D1_MINI)
# include "platformDefinitions/GPIO_Defs_ESP32_D1_MINI.hpp"
#elif defined (BOARD_ESP32_KA)
# include "platformDefinitions/GPIO_Defs_ESP32_KA.hpp"
#elif defined (BOARD_ESP32_LOLIN_D32_PRO_ETH)
# include "platformDefinitions/GPIO_Defs_ESP32_LoLin_D32_PRO_ETH.hpp"
#elif defined (BOARD_ESP32_LOLIN_D32_PRO)
Expand Down
2 changes: 1 addition & 1 deletion ESPixelStick/src/output/OutputSpi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class c_OutputSpi
#define SPI_NUM_TRANSACTIONS 2
#define SPI_NUM_INTENSITY_PER_TRANSACTION 128
#define SPI_BITS_PER_INTENSITY 8
#define SPI_SPI_HOST VSPI_HOST
#define SPI_SPI_HOST DEFAULT_SPI_DEVICE
#define SPI_SPI_DMA_CHANNEL 2

uint8_t NumIntensityValuesPerInterrupt = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* GPIO_Defs_ESP32_D1_MINI.hpp - Output Management class
*
* Project: ESPixelStick - An ESP8266 / ESP32 and E1.31 based pixel driver
* Copyright (c) 2021 Shelby Merrick
* Copyright (c) 2024 Shelby Merrick
* http://www.forkineye.com
*
* This program is provided free for you to use in any way that you wish,
Expand All @@ -30,6 +30,7 @@
#define SUPPORT_SPI_OUTPUT
#define DEFAULT_SPI_DATA_GPIO gpio_num_t::GPIO_NUM_15
#define DEFAULT_SPI_CLOCK_GPIO gpio_num_t::GPIO_NUM_25
#define DEFAULT_SPI_DEVICE HSPI_HOST

#define DEFAULT_I2C_SDA gpio_num_t::GPIO_NUM_21
#define DEFAULT_I2C_SCL gpio_num_t::GPIO_NUM_22
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* GPIO_Defs_ESP32_DevkitC.hpp - Output Management class
*
* Project: ESPixelStick - An ESP8266 / ESP32 and E1.31 based pixel driver
* Copyright (c) 2022 Shelby Merrick
* Copyright (c) 2024 Shelby Merrick
* http://www.forkineye.com
*
* This program is provided free for you to use in any way that you wish,
Expand Down Expand Up @@ -31,6 +31,7 @@
#define SUPPORT_SPI_OUTPUT
#define DEFAULT_SPI_DATA_GPIO gpio_num_t::GPIO_NUM_16
#define DEFAULT_SPI_CLOCK_GPIO gpio_num_t::GPIO_NUM_17
#define DEFAULT_SPI_DEVICE HSPI_HOST

#define DEFAULT_I2C_SDA gpio_num_t::GPIO_NUM_3
#define DEFAULT_I2C_SCL gpio_num_t::GPIO_NUM_5
Expand Down
57 changes: 57 additions & 0 deletions ESPixelStick/src/platformDefinitions/GPIO_Defs_ESP32_KA.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#pragma once
/*
* GPIO_Defs_ESP32_KA.hpp - Output Management class
*
* Project: ESPixelStick - An ESP8266 / ESP32 and E1.31 based pixel driver
* Copyright (c) 2024 Shelby Merrick
* http://www.forkineye.com
*
* This program is provided free for you to use in any way that you wish,
* subject to the laws and regulations where you are using it. Due diligence
* is strongly suggested before using this code. Please give credit where due.
*
* The Author makes no warranty of any kind, express or implied, with regard
* to this program or the documentation contained in this document. The
* Author shall not be liable in any event for incidental or consequential
* damages in connection with, or arising out of, the furnishing, performance
* or use of these programs.
*
*/

//Output Manager
#define DEFAULT_RMT_0_GPIO gpio_num_t::GPIO_NUM_2
#define DEFAULT_RMT_1_GPIO gpio_num_t::GPIO_NUM_4
#define DEFAULT_RMT_2_GPIO gpio_num_t::GPIO_NUM_0
#define DEFAULT_RMT_3_GPIO gpio_num_t::GPIO_NUM_16

// SPI Output
#define SUPPORT_SPI_OUTPUT
#define DEFAULT_SPI_DATA_GPIO gpio_num_t::GPIO_NUM_15
#define DEFAULT_SPI_CLOCK_GPIO gpio_num_t::GPIO_NUM_25
#define DEFAULT_SPI_DEVICE HSPI_HOST

#define DEFAULT_I2C_SDA gpio_num_t::GPIO_NUM_21
#define DEFAULT_I2C_SCL gpio_num_t::GPIO_NUM_22

// File Manager
#define SUPPORT_SD
#define SD_CARD_MISO_PIN gpio_num_t::GPIO_NUM_19
#define SD_CARD_MOSI_PIN gpio_num_t::GPIO_NUM_23
#define SD_CARD_CLK_PIN gpio_num_t::GPIO_NUM_18
#define SD_CARD_CS_PIN gpio_num_t::GPIO_NUM_5

// Output Types
// Not Finished - #define SUPPORT_OutputType_TLS3001
#define SUPPORT_OutputType_APA102 // SPI
#define SUPPORT_OutputType_DMX // UART
#define SUPPORT_OutputType_GECE // UART
#define SUPPORT_OutputType_GS8208 // UART / RMT
#define SUPPORT_OutputType_Renard // UART
#define SUPPORT_OutputType_Serial // UART
#define SUPPORT_OutputType_TM1814 // UART / RMT
#define SUPPORT_OutputType_UCS1903 // UART / RMT
#define SUPPORT_OutputType_UCS8903 // UART / RMT
#define SUPPORT_OutputType_WS2801 // SPI
#define SUPPORT_OutputType_WS2811 // UART / RMT
#define SUPPORT_OutputType_Relay // GPIO
#define SUPPORT_OutputType_Servo_PCA9685 // I2C (default pins)
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#define SUPPORT_SPI_OUTPUT
#define DEFAULT_SPI_DATA_GPIO gpio_num_t::GPIO_NUM_27
#define DEFAULT_SPI_CLOCK_GPIO gpio_num_t::GPIO_NUM_32
#define DEFAULT_SPI_DEVICE HSPI_HOST

#define DEFAULT_I2C_SDA gpio_num_t::GPIO_NUM_3
#define DEFAULT_I2C_SCL gpio_num_t::GPIO_NUM_5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#define SUPPORT_SPI_OUTPUT
#define DEFAULT_SPI_DATA_GPIO gpio_num_t::GPIO_NUM_16
#define DEFAULT_SPI_CLOCK_GPIO gpio_num_t::GPIO_NUM_17
#define DEFAULT_SPI_DEVICE HSPI_HOST

#define DEFAULT_I2C_SDA gpio_num_t::GPIO_NUM_21
#define DEFAULT_I2C_SCL gpio_num_t::GPIO_NUM_22
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#define SUPPORT_SPI_OUTPUT
#define DEFAULT_SPI_DATA_GPIO gpio_num_t::GPIO_NUM_15
#define DEFAULT_SPI_CLOCK_GPIO gpio_num_t::GPIO_NUM_25
#define DEFAULT_SPI_DEVICE HSPI_HOST

#define DEFAULT_I2C_SDA gpio_num_t::GPIO_NUM_21
#define DEFAULT_I2C_SCL gpio_num_t::GPIO_NUM_22
Expand Down
13 changes: 12 additions & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
; Local configuration should be done in platformio_user.ini

[platformio]
default_envs = espsv3, d1_mini, d1_mini_pro, d32_pro, d32_pro_eth, esp32_cam, esp32_ttgo_t8, d1_mini32, d1_mini32_eth, esp32_bong69, esp32_wt32eth01, esp32_quinled_quad, esp32_quinled_quad_ae_plus, esp32_quinled_quad_ae_plus_8, esp32_quinled_quad_eth, esp32_quinled_uno, esp32_quinled_uno_ae_plus, esp32_quinled_uno_eth, esp32_quinled_dig_octa, esp01s, d1_mini_mhetesp32minikit, olimex_esp32_gw, d1_mini_twilightlord, d1_mini_twilightlord_eth, esp32_devkitc, esp32_quinled_uno_eth_espsv3, esp32_quinled_uno_espsv3, m5stack_atom, esp3deuxquatro_dmx, esp32_wasatch, esp32_tetra2go, esp32_kr_lights_msm, d1_mini_lolinsd
default_envs = espsv3, d1_mini, d1_mini_pro, d32_pro, d32_pro_eth, esp32_cam, esp32_ttgo_t8, d1_mini32, d1_mini32_eth, esp32_bong69, esp32_wt32eth01, esp32_quinled_quad, esp32_quinled_quad_ae_plus, esp32_quinled_quad_ae_plus_8, esp32_quinled_quad_eth, esp32_quinled_uno, esp32_quinled_uno_ae_plus, esp32_quinled_uno_eth, esp32_quinled_dig_octa, esp01s, d1_mini_mhetesp32minikit, olimex_esp32_gw, d1_mini_twilightlord, d1_mini_twilightlord_eth, esp32_devkitc, esp32_quinled_uno_eth_espsv3, esp32_quinled_uno_espsv3, m5stack_atom, esp3deuxquatro_dmx, esp32_wasatch, esp32_tetra2go, esp32_kr_lights_msm, d1_mini_lolinsd, esp32_ka
src_dir = ./ESPixelStick
data_dir = ./ESPixelStick/data
build_cache_dir = ./.pio/.buildcache
Expand Down Expand Up @@ -464,3 +464,14 @@ build_unflags =
-D BOARD_HAS_PSRAM
-mfix-esp32-psram-cache-issue
-mfix-esp32-psram-cache-strategy=memw

; KA Relay board
[env:esp32_ka]
extends = esp32git
board = wemos_d1_mini32
build_flags =
${esp32git.build_flags}
-D BOARD_NAME='"esp32_ka"'
-D BOARD_ESP32_KA
build_unflags =
-U BOARD_HAS_PSRAM

0 comments on commit 0b8da27

Please sign in to comment.