Skip to content

Commit

Permalink
Update radio to use ESP32 rather than STM32
Browse files Browse the repository at this point in the history
  • Loading branch information
mawildoer committed Mar 7, 2024
1 parent b75b698 commit eb94147
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 34 deletions.
6 changes: 1 addition & 5 deletions ato.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ dependencies:
- rp2040
- saleae-header ^v0.0.2
- sk6805-ec20
- stm32l432kbu6
- sx1280imltrt
- tps63020dsjr
- usb-connectors ^v2.0.1


# services:
# components: https://atopile-component-server-atsuhzfd5a-uc.a.run.app/jlc
- esp32-s3 ^v0.0.1
10 changes: 5 additions & 5 deletions elec/src/debug.ato
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ module Debug:
swoop.power_supply.power5v ~ saleae4.ch1
swoop.power_supply.battery.power ~ saleae4.ch2

swoop.radio.radio.spi ~ saleae5.spi
swoop.radio.radio.data1 ~ saleae6.ch0
swoop.radio.radio.data2 ~ saleae6.ch1
swoop.radio.radio.data3 ~ saleae6.ch2
swoop.radio.radio.busy ~ saleae6.ch3
swoop.radio._radio.spi ~ saleae5.spi
swoop.radio._radio.data1 ~ saleae6.ch0
swoop.radio._radio.data2 ~ saleae6.ch1
swoop.radio._radio.data3 ~ saleae6.ch2
swoop.radio._radio.busy ~ saleae6.ch3

swoop.power3v3 ~ pot.power
swoop.micro.micro.gpio23 ~ pot.output.io
Expand Down
2 changes: 1 addition & 1 deletion elec/src/imu.ato
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module IMU:

# I2C
i2c ~ bno055.i2c # address = 0x28
i2c ~ bmi088.i2c # address = 0x19
i2c ~ bmi088.i2c # address = 0x18, 0x69
i2c ~ lis3mdltr.i2c # address = 0x1E

# Interrupt
Expand Down
73 changes: 50 additions & 23 deletions elec/src/radio.ato
Original file line number Diff line number Diff line change
@@ -1,35 +1,62 @@
import STM32L432KBU6 from "stm32l432kbu6/elec/src/stm32l432kbu6.ato"
import SX1280 from "sx1280imltrt/elec/src/sx1280imltrt.ato"
import JTAG_10PIN from "programming-headers/elec/src/programming-headers.ato"
from "generics/interfaces.ato" import Power, UART, Pair
from "generics/buttons.ato" import ButtonPullup, ButtonSKRPACE010

import Power from "generics/interfaces.ato"
import UART from "generics/interfaces.ato"
from "sx1280imltrt/elec/src/sx1280imltrt.ato" import SX1280
from "programming-headers/elec/src/programming-headers.ato" import JTAG_10PIN
from "esp32-s3/esp32-s3.ato" import ESP32S3
from "sk6805-ec20/elec/src/sk6805-ec20.ato" import SK6805EC20


module Radio:
"""
ExpressLRS Radio Module based on the SX1280 and ESP32-S3

Required setup:
- 3.3V power ~> power
- A button in place of 'boot_button.btn'
- UART for comms with handset

Optional setup:
- An RGB LED ~> led_do_if

TODO: validate configuration in firmware
https://github.com/mawildoer/ExpressLRS-targets/blob/mawildoer/swoop/TX/DIY%20S3_WROOM_1_N16R2%202400.json
"""
power = new Power
uart = new UART
micro = new STM32L432KBU6
radio = new SX1280
_micro = new ESP32S3
_radio = new SX1280

# optional JTAG header
jtag_header = new JTAG_10PIN
# Optional: Interface to connect an RGB LED to the radio
led_do_if = new Pair
led_do_if.gnd ~ power.gnd

# external connections
power ~ micro.power
power ~ radio.power
# Uart connections need to be crossed (need a better way to do this )
uart.tx ~ micro.uart.rx
uart.rx ~ micro.uart.tx
power ~ _micro.power
power ~ _radio.power

# ESP32
# UART connections need to be crossed (need a better way to do this)
# This means people can connect straight to the UART as needed
uart.tx ~ _micro.ic.RXD0 # GPIO43
uart.rx ~ _micro.ic.TXD0 # GPIO44
power.gnd ~ uart.gnd

# internal connections
radio.spi ~ micro.spi
radio.data1 ~ micro.PA10
radio.data2 ~ micro.PA9
radio.data3 ~ micro.PA8
radio.busy ~ micro.PA11
radio.reset ~ micro.PB4
boot_button = new ButtonPullup
boot_button.btn -> ButtonSKRPACE010
_micro.power ~ boot_button.power
boot_button.output.vcc ~ _micro.ic.IO0

_radio.spi.miso ~ _micro.ic.IO15
_radio.spi.mosi ~ _micro.ic.IO16
_radio.spi.sck ~ _micro.ic.IO7
_radio.busy.io ~ _micro.ic.IO4
_radio.data1.io ~ _micro.ic.IO5
_radio.reset.io ~ _micro.ic.IO6
_radio.spi.cs ~ _micro.ic.IO17

# optional JTAG header
jtag_header.jtag ~ micro.jtag
_micro.ic.IO48 ~ led_do_if.io

# JTAG header
jtag_header = new JTAG_10PIN
jtag_header.jtag ~ _micro.jtag

0 comments on commit eb94147

Please sign in to comment.