Skip to content

Commit

Permalink
Merge pull request #111 from bmorcelli/main
Browse files Browse the repository at this point in the history
BLE Scan, Mic Spectrum and Prep for ports
  • Loading branch information
pr3y authored Aug 2, 2024
2 parents bb4b0f3 + 5948c65 commit b01fd76
Show file tree
Hide file tree
Showing 22 changed files with 349 additions and 370 deletions.
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
"stdexcept": "cpp",
"streambuf": "cpp",
"cinttypes": "cpp",
"typeinfo": "cpp"
"typeinfo": "cpp",
"bitset": "cpp",
"complex": "cpp",
"ctime": "cpp",
"regex": "cpp"
}
}
4 changes: 4 additions & 0 deletions custom_4Mb_full.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x6000,
app0, app, ota_0, 0x10000, 0x2F0000,
spiffs, data, spiffs, 0x300000,0x400000,
249 changes: 208 additions & 41 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ lib_deps =
FFat
ESP8266SAM
TinyGPSPlus
tinyu-zhao/FFT@^0.0.1

[env:m5stack-cplus2]
platform = espressif32
Expand All @@ -56,30 +57,48 @@ build_flags =

-DSTICK_C_PLUS2=1

-DROTATION=3

;Features Enabled
;-DLITE_VERSION=1 ; limits some features to save space for M5Launcher Compatibility
-DMIC_SPM1423=1 ;Applicable for SPM1423 device
-DPIN_CLK=0
-DI2S_SCLK_PIN=0
-DI2S_DATA_PIN=34
-DPIN_DATA=34

;Have RTC Chip
-DHAS_RTC=1

;Buttons configuration
-DHAS_BTN=1
-DSEL_BTN=37
-DUP_BTN=35
-DDW_BTN=39
-DBTN_ACT=LOW
-DBTN_ALIAS='"M5"'

-DHAS_SCREEN=1
-DWIDTH=240
-DHEIGHT=135
-DBACKLIGHT=27
-DMINBRIGHT=160

;Infrared Led default pin and state
-DLED=19
-DLED_ON=HIGH
-DLED_OFF=LOW

;Battery ADC read pin
-DBAT_PIN=38


;Font sizes, depending on device
-DFP=1
-DFM=2
-DFG=3
-DMAX_MENU_SIZE=5


; Screen Setup
-DHAS_SCREEN=1
-DROTATION=3
-DWIDTH=240
-DHEIGHT=135
-DBACKLIGHT=27
-DMINBRIGHT=160

; TFT_eSPI Setup
-DUSER_SETUP_LOADED=1
-DST7789_2_DRIVER=1
-DTFT_RGB_ORDER=1
Expand All @@ -98,18 +117,17 @@ build_flags =
-DSPI_READ_FREQUENCY=20000000
-DSPI_TOUCH_FREQUENCY=2500000

-DSDCARD_SPI_BUS=HSPI
;SD Card Setup pins
-DSDCARD_CS=14
-DSDCARD_SCK=0
-DSDCARD_MISO=36
-DSDCARD_MOSI=26

;Default I2C port
-DGROVE_SDA=32
-DGROVE_SCL=33
lib_deps =
${common.lib_deps}
tinyu-zhao/FFT@^0.0.1
platform_packages = platformio/toolchain-xtensa32@^2.50200.97

[env:m5stack-cplus1_1]
platform = espressif32
Expand All @@ -119,27 +137,47 @@ board_build.partitions = custom_4Mb.csv
build_flags =
${common.build_flags}
-DCORE_DEBUG_LEVEL=5

-DSTICK_C_PLUS=1
-DROTATION=3

;Features Enabled
-DLITE_VERSION=1 ; limits some features to save space for M5Launcher Compatibility
;Microphone
-DMIC_SPM1423=1 ;Applicable for SPM1423 device
-DPIN_CLK=0
-DI2S_SCLK_PIN=0
-DI2S_DATA_PIN=34
-DPIN_DATA=34

;Buttons Setup
-DHAS_BTN=1
-DSEL_BTN=37
-DUP_BTN=0
-DDW_BTN=39
-DBTN_ACT=LOW
-DBTN_ALIAS='"M5"'

-DWIDTH=240
-DHEIGHT=135
-DMAX_MENU_SIZE=5
-DHAS_SCREEN=1

;Infrared Led default pin and state
-DLED=9
-DLED_ON=LOW
-DLED_OFF=HIGH


;Battery ADC read pin
-DBAT_PIN=10

;Font sizes, depending on device
-DFP=1
-DFM=2
-DFG=3


; Screen Setup
-DHAS_SCREEN=1
-DROTATION=3
-DWIDTH=240
-DHEIGHT=135
-DMAX_MENU_SIZE=5

; TFT_eSPI Setup
-DUSER_SETUP_LOADED=1
-DST7789_2_DRIVER=1
-DTFT_RGB_ORDER=1
Expand All @@ -158,19 +196,18 @@ build_flags =
-DSPI_READ_FREQUENCY=20000000
-DSPI_TOUCH_FREQUENCY=2500000

-DSDCARD_SPI_BUS=HSPI
;SD Card Setup pins
-DSDCARD_CS=14
-DSDCARD_SCK=0
-DSDCARD_MISO=36
-DSDCARD_MOSI=26


;Default I2C port
-DGROVE_SDA=32
-DGROVE_SCL=33
lib_deps =
https://github.com/tanakamasayuki/I2C_AXP192
${common.lib_deps}
tinyu-zhao/FFT@^0.0.1
platform_packages = platformio/toolchain-xtensa32@^2.50200.97


[env:m5stack-cardputer]
platform = espressif32
Expand All @@ -180,31 +217,163 @@ board_build.partitions = custom_8Mb.csv
build_flags =
${common.build_flags}
-DCORE_DEBUG_LEVEL=5
-DARDUINO_USB_CDC_ON_BOOT=1

-DCARDPUTER=1

-DROTATION=1

-DHAS_BTN=1

;Features Enabled
;-DLITE_VERSION=1 ; limits some features to save space for M5Launcher Compatibility
;Microphone
-DMIC_SPM1423=1 ; uncomment to enable Applicable for SPM1423 device
-DPIN_CLK=43
-DI2S_SCLK_PIN=43
-DI2S_DATA_PIN=46
-DPIN_DATA=46

;RGB LED runned by xylopyrographer/LiteLED@^1.2.0 library
-DHAS_RGB_LED=1
-DRGB_LED=21

;Speaker to run music, compatible with NS4168
-DHAS_NS4168_SPKR=1 ; uncomment to enable
-DBCLK=41
-DWCLK=43
-DDOUT=42

;Can run USB as HID
-DUSB_as_HID=1

;Buttons configuration
-DHAS_BTN=0
-DBTN_ALIAS='"Ok"'
-DBTN_PIN=0

-DBTN_ACT=LOw

;Font sizes, depending on device
-DFP=1
-DFM=2
-DFG=3

;Infrared Led default pin and state
-DLED=44
-DLED_ON=HIGH
-DLED_OFF=LOW

; Screen Setup
-DHAS_SCREEN=1
-DROTATION=1
-DWIDTH=240
-DHEIGHT=135
-DBACKLIGHT=38
-DMINBRIGHT=160
-DMAX_MENU_SIZE=5

; TFT_eSPI Setup
-DUSER_SETUP_LOADED=1
-DUSE_HSPI_PORT=1
-DST7789_2_DRIVER=1
-DTFT_RGB_ORDER=1
-DTFT_WIDTH=135
-DTFT_HEIGHT=240
-DTFT_BACKLIGHT_ON=1
-DTFT_BL=38
-DTFT_RST=33
-DTFT_DC=34
-DTFT_MOSI=35
-DTFT_SCLK=36
-DTFT_CS=37
-DTOUCH_CS=-1
-DSMOOTH_FONT=1
-DSPI_FREQUENCY=20000000
-DSPI_READ_FREQUENCY=20000000
-DSPI_TOUCH_FREQUENCY=2500000

-DFP=1
-DFM=2
-DFG=3
;SD Card Setup pins
-DSDCARD_CS=12
-DSDCARD_SCK=40
-DSDCARD_MISO=39
-DSDCARD_MOSI=14

;Default I2C port
-DGROVE_SDA=2
-DGROVE_SCL=1

-DBAT_PIN=10
lib_deps =
${common.lib_deps}
xylopyrographer/LiteLED@^1.2.0


#New device model
[env:NewDeviceModel]
platform = espressif32
board = m5stack-stamps3
framework = arduino
board_build.partitions = custom_8Mb.csv
build_flags =
${common.build_flags}
-DCORE_DEBUG_LEVEL=5
-DARDUINO_USB_CDC_ON_BOOT=1

-DNEW_DEVICE=1 ; key for new device,
; mykeyboard.cpp: need map buttons an/or touchscreen and battery status value,
; settings.cpp: need map brighness control
; main.cpp: need set startup
; serialcmds.cpp: need set power off command

;Features Enabled
;-DLITE_VERSION=1 ; limits some features to save space for M5Launcher Compatibility
;Microphone
;-DMIC_SPM1423=1 ; uncomment to enable Applicable for SPM1423 device
-DPIN_CLK=43
-DI2S_SCLK_PIN=43
-DI2S_DATA_PIN=46
-DPIN_DATA=46

;RGB LED runned by xylopyrographer/LiteLED@^1.2.0 library
;-DHAS_RGB_LED=1 ; uncomment to enable
-DRGB_LED=21

;Have RTC Chip
;-DHAS_RTC=1

;Speaker to run music, compatible with NS4168
;-DHAS_NS4168_SPKR=1 ; uncomment to enable
-DBCLK=41
-DWCLK=43
-DDOUT=42

;Can run USB as HID
;-DUSB_as_HID=1 ; uncomment to enable

;Battery ADC read pin
;-DBAT_PIN=10

;Buttons configuration
-DHAS_BTN=0
-DBTN_ALIAS='"Ok"'
-DBTN_PIN=0
-DBTN_ACT=LOw

;Infrared Led default pin and state
-DLED=44
-DLED_ON=HIGH
-DLED_OFF=LOW

;Font sizes, depending on device
-DFP=1
-DFM=2
-DFG=3

; Screen Setup
-DHAS_SCREEN=1
-DROTATION=1
-DWIDTH=240
-DHEIGHT=135
-DBACKLIGHT=38
-DMINBRIGHT=160
-DMAX_MENU_SIZE=5 ;HEIGHT/25

; TFT_eSPI Setup
-DUSER_SETUP_LOADED=1
-DUSE_HSPI_PORT=1
-DST7789_2_DRIVER=1
Expand All @@ -224,18 +393,16 @@ build_flags =
-DSPI_READ_FREQUENCY=20000000
-DSPI_TOUCH_FREQUENCY=2500000

-DSDCARD_SPI_BUS=FSPI
;SD Card Setup pins
-DSDCARD_CS=12
-DSDCARD_SCK=40
-DSDCARD_MISO=39
-DSDCARD_MOSI=14


;Default I2C port
-DGROVE_SDA=2
-DGROVE_SCL=1

-DARDUINO_USB_CDC_ON_BOOT=1
lib_deps =
${common.lib_deps}
xylopyrographer/LiteLED@^1.2.0
tinyu-zhao/FFT@^0.0.1
platform_packages = platformio/toolchain-xtensa32@^2.50200.97
xylopyrographer/LiteLED@^1.2.0
Loading

0 comments on commit b01fd76

Please sign in to comment.