Skip to content

Commit

Permalink
change target to esp32
Browse files Browse the repository at this point in the history
  • Loading branch information
sfxfs committed Nov 12, 2024
1 parent 03ee767 commit 5970eb6
Show file tree
Hide file tree
Showing 15 changed files with 77 additions and 50 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# _esp-sub-master_

请先使用 esp-idf 插件创建 `.vscode` 文件夹,后设置目标为 `esp32s3 (via builtin USB-JTAG)`
请先使用 esp-idf 插件创建 `.vscode` 文件夹
File renamed without changes.
44 changes: 44 additions & 0 deletions components/sub_bus_init/Kconfig.projbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
menu "SUB:Bus Interface"

menu "Interface I2C"
menu "I2C0 Config"
config SUB_ENABLE_I2C0
bool "Enable interface"
default n
depends on SOC_I2C_SUPPORTED

if SUB_ENABLE_I2C0
config SUB_I2C0_SCL_PIN
int "Set SCL pin num"
default 6

config SUB_I2C0_SDA_PIN
int "Set SDA pin num"
default 7
endif
endmenu

menu "I2C1 Config"
config SUB_ENABLE_I2C1
bool "Enable interface"
default n
depends on SOC_I2C_SUPPORTED

if SUB_ENABLE_I2C1
config SUB_I2C1_SCL_PIN
int "Set SCL pin num"
default 8
depends on SUB_ENABLE_I2C1

config SUB_I2C1_SDA_PIN
int "Set SDA pin num"
default 9
depends on SUB_ENABLE_I2C1
endif
endmenu
endmenu

menu "Interface SPI"
endmenu

endmenu
File renamed without changes.
9 changes: 9 additions & 0 deletions components/sub_bus_init/include/sub_spi.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#ifndef SUB_INTF_INIT_SPI_H
#define SUB_INTF_INIT_SPI_H

#include "esp_err.h"

esp_err_t sub_spi_intf_init(void);
esp_err_t sub_spi_intf_deinit(void);

#endif
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
#include "sub_intf_init.h"
#include "sub_i2c.h"
#include "sub_spi.h"

esp_err_t sub_all_intf_init(void)
{
esp_err_t ret = ESP_OK;
ret += sub_i2c_intf_init();
ret += sub_spi_intf_init();
return ret;
}

esp_err_t sub_all_intf_deinit(void)
{
esp_err_t ret = ESP_OK;
ret += sub_i2c_intf_deinit();
ret += sub_spi_intf_deinit();
return ret;
}
16 changes: 16 additions & 0 deletions components/sub_bus_init/sub_spi.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include "driver/spi_master.h" // esp_driver_i2c
#include "sdkconfig.h"

#include "sub_spi.h"

esp_err_t sub_spi_intf_init(void)
{
esp_err_t ret = ESP_OK;
return ret;
}

esp_err_t sub_spi_intf_deinit(void)
{
esp_err_t ret = ESP_OK;
return ret;
}
42 changes: 0 additions & 42 deletions components/sub_interface_init/Kconfig.projbuild

This file was deleted.

Empty file.
Empty file.
2 changes: 1 addition & 1 deletion main/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
idf_component_register(SRCS "main.c"
INCLUDE_DIRS "."
PRIV_REQUIRES sub_interface_init pca9685 aht30)
PRIV_REQUIRES sub_bus_init pca9685 aht30)
File renamed without changes.
9 changes: 3 additions & 6 deletions sdkconfig.defaults
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
# This file was generated using idf.py save-defconfig. It can be edited manually.
# Espressif IoT Development Framework (ESP-IDF) 5.3.1 Project Minimal Configuration
#
CONFIG_IDF_TARGET="esp32s3"
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_n4.csv"
CONFIG_SPIRAM=y
CONFIG_SPIRAM_SPEED_80M=y
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_sub.csv"

0 comments on commit 5970eb6

Please sign in to comment.