mirror of
https://github.com/esphome/esphome.git
synced 2025-09-01 19:02:18 +01:00
[sx126x] Add sx126x component (#8516)
Co-authored-by: J. Nick Koston <nick@koston.org> Co-authored-by: J. Nick Koston <nick+github@koston.org>
This commit is contained in:
40
tests/components/sx126x/common.yaml
Normal file
40
tests/components/sx126x/common.yaml
Normal file
@@ -0,0 +1,40 @@
|
||||
spi:
|
||||
clk_pin: ${clk_pin}
|
||||
mosi_pin: ${mosi_pin}
|
||||
miso_pin: ${miso_pin}
|
||||
|
||||
sx126x:
|
||||
dio1_pin: ${dio1_pin}
|
||||
cs_pin: ${cs_pin}
|
||||
busy_pin: ${busy_pin}
|
||||
rst_pin: ${rst_pin}
|
||||
pa_power: 3
|
||||
bandwidth: 125_0kHz
|
||||
crc_enable: true
|
||||
frequency: 433920000
|
||||
modulation: LORA
|
||||
rx_start: true
|
||||
hw_version: sx1262
|
||||
rf_switch: true
|
||||
sync_value: [0x14, 0x24]
|
||||
preamble_size: 8
|
||||
spreading_factor: 7
|
||||
coding_rate: CR_4_6
|
||||
tcxo_voltage: 1_8V
|
||||
tcxo_delay: 5ms
|
||||
on_packet:
|
||||
then:
|
||||
- lambda: |-
|
||||
ESP_LOGD("lambda", "packet %.2f %.2f %s", rssi, snr, format_hex(x).c_str());
|
||||
|
||||
button:
|
||||
- platform: template
|
||||
name: "SX126x Button"
|
||||
on_press:
|
||||
then:
|
||||
- sx126x.set_mode_standby
|
||||
- sx126x.run_image_cal
|
||||
- sx126x.set_mode_sleep
|
||||
- sx126x.set_mode_rx
|
||||
- sx126x.send_packet:
|
||||
data: [0xC5, 0x51, 0x78, 0x82, 0xB7, 0xF9, 0x9C, 0x5C]
|
10
tests/components/sx126x/test.esp32-ard.yaml
Normal file
10
tests/components/sx126x/test.esp32-ard.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
substitutions:
|
||||
clk_pin: GPIO5
|
||||
mosi_pin: GPIO27
|
||||
miso_pin: GPIO19
|
||||
cs_pin: GPIO18
|
||||
rst_pin: GPIO23
|
||||
busy_pin: GPIO25
|
||||
dio1_pin: GPIO26
|
||||
|
||||
<<: !include common.yaml
|
10
tests/components/sx126x/test.esp32-c3-ard.yaml
Normal file
10
tests/components/sx126x/test.esp32-c3-ard.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
substitutions:
|
||||
clk_pin: GPIO5
|
||||
mosi_pin: GPIO18
|
||||
miso_pin: GPIO19
|
||||
cs_pin: GPIO1
|
||||
rst_pin: GPIO2
|
||||
busy_pin: GPIO4
|
||||
dio1_pin: GPIO3
|
||||
|
||||
<<: !include common.yaml
|
10
tests/components/sx126x/test.esp32-c3-idf.yaml
Normal file
10
tests/components/sx126x/test.esp32-c3-idf.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
substitutions:
|
||||
clk_pin: GPIO5
|
||||
mosi_pin: GPIO18
|
||||
miso_pin: GPIO19
|
||||
cs_pin: GPIO1
|
||||
rst_pin: GPIO2
|
||||
busy_pin: GPIO4
|
||||
dio1_pin: GPIO3
|
||||
|
||||
<<: !include common.yaml
|
10
tests/components/sx126x/test.esp32-idf.yaml
Normal file
10
tests/components/sx126x/test.esp32-idf.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
substitutions:
|
||||
clk_pin: GPIO5
|
||||
mosi_pin: GPIO27
|
||||
miso_pin: GPIO19
|
||||
cs_pin: GPIO18
|
||||
rst_pin: GPIO23
|
||||
busy_pin: GPIO25
|
||||
dio1_pin: GPIO26
|
||||
|
||||
<<: !include common.yaml
|
10
tests/components/sx126x/test.esp8266-ard.yaml
Normal file
10
tests/components/sx126x/test.esp8266-ard.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
substitutions:
|
||||
clk_pin: GPIO5
|
||||
mosi_pin: GPIO13
|
||||
miso_pin: GPIO12
|
||||
cs_pin: GPIO1
|
||||
rst_pin: GPIO2
|
||||
busy_pin: GPIO4
|
||||
dio1_pin: GPIO3
|
||||
|
||||
<<: !include common.yaml
|
10
tests/components/sx126x/test.rp2040-ard.yaml
Normal file
10
tests/components/sx126x/test.rp2040-ard.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
substitutions:
|
||||
clk_pin: GPIO2
|
||||
mosi_pin: GPIO3
|
||||
miso_pin: GPIO4
|
||||
cs_pin: GPIO5
|
||||
rst_pin: GPIO6
|
||||
busy_pin: GPIO8
|
||||
dio1_pin: GPIO7
|
||||
|
||||
<<: !include common.yaml
|
Reference in New Issue
Block a user