├── src └── lib.rs ├── core ├── serial │ ├── README.md │ └── Cargo.toml ├── esp32s3-mpu6050 │ ├── .cargo-ok │ ├── src │ │ └── range.rs │ ├── README.md │ ├── .cargo │ │ └── config │ ├── .cargo_vcs_info.json │ ├── .gitignore │ ├── .github │ │ └── dependabot.yml │ ├── .circleci │ │ └── config.yml │ ├── examples │ │ ├── motion_detection.rs │ │ └── simple.rs │ ├── Cargo.toml │ └── LICENSE ├── oled │ ├── README.md │ ├── src │ │ └── lib.rs │ └── Cargo.toml ├── w25q64 │ ├── README.md │ ├── src │ │ └── lib.rs │ └── Cargo.toml ├── wifi │ ├── README.md │ ├── build.rs │ ├── cfg.toml.example │ ├── sdkconfig.defaults │ ├── Cargo.toml │ └── examples │ │ └── wifi.rs ├── esp32s3-nrf24l01 │ ├── .gitignore │ ├── src │ │ ├── error.rs │ │ ├── setup.rs │ │ └── payload.rs │ └── Cargo.toml ├── mpu6050 │ ├── README.md │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── conf.rs ├── pcnt_encoder │ ├── README.md │ └── Cargo.toml └── neopixel │ ├── README.md │ └── Cargo.toml ├── app ├── ffi │ ├── ffi_hello │ │ ├── hello │ │ │ ├── hello.h │ │ │ ├── bar.h │ │ │ ├── hello.c │ │ │ └── bar.c │ │ ├── README.md │ │ ├── build.rs │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ └── bindgen_hello │ │ ├── hello │ │ ├── bar.h │ │ ├── hello.h │ │ ├── hello.c │ │ ├── bar.c │ │ └── bindings.rs │ │ ├── src │ │ └── lib.rs │ │ ├── README.md │ │ ├── tests │ │ └── hello_demo.rs │ │ ├── Cargo.toml │ │ └── build.rs ├── adc │ ├── adc │ │ ├── cfg.toml │ │ ├── README.md │ │ ├── build.rs │ │ └── Cargo.toml │ ├── adc_oneshot │ │ ├── cfg.toml │ │ ├── README.md │ │ ├── build.rs │ │ └── Cargo.toml │ ├── ad_multichannel │ │ ├── cfg.toml │ │ ├── README.md │ │ ├── build.rs │ │ └── Cargo.toml │ ├── joystick_potentiometer_3d │ │ ├── cfg.toml │ │ ├── README.md │ │ └── build.rs │ └── potentiometer_reading_voltage │ │ ├── cfg.toml │ │ ├── README.md │ │ └── build.rs ├── http │ ├── http_server_vue │ │ ├── web │ │ │ ├── src │ │ │ │ ├── vite-env.d.ts │ │ │ │ ├── main.ts │ │ │ │ ├── components │ │ │ │ │ ├── About.vue │ │ │ │ │ ├── NotFound.vue │ │ │ │ │ └── HelloWorld.vue │ │ │ │ ├── assets │ │ │ │ │ └── vue.svg │ │ │ │ └── App.vue │ │ │ ├── .vscode │ │ │ │ └── extensions.json │ │ │ ├── vite.config.ts │ │ │ ├── tsconfig.node.json │ │ │ ├── .gitignore │ │ │ ├── index.html │ │ │ ├── package.json │ │ │ └── tsconfig.json │ │ ├── cfg.toml │ │ ├── README.md │ │ ├── build.rs │ │ └── src │ │ │ └── asset.rs │ ├── http_client │ │ ├── cfg.toml │ │ ├── README.md │ │ └── build.rs │ ├── http_server │ │ ├── cfg.toml │ │ ├── README.md │ │ └── build.rs │ ├── wifi_check │ │ ├── cfg.toml │ │ ├── README.md │ │ └── build.rs │ ├── https_client │ │ ├── cfg.toml │ │ ├── README.md │ │ └── build.rs │ ├── http_ureq_client │ │ ├── cfg.toml │ │ ├── README.md │ │ └── build.rs │ └── http_server_shtcx │ │ ├── cfg.toml │ │ ├── README.md │ │ └── build.rs ├── basic │ ├── blinky │ │ ├── cfg.toml │ │ ├── README.md │ │ ├── build.rs │ │ ├── src │ │ │ └── main.rs │ │ └── Cargo.toml │ ├── button │ │ ├── cfg.toml │ │ ├── README.md │ │ ├── build.rs │ │ ├── src │ │ │ └── main.rs │ │ └── Cargo.toml │ ├── buzzer │ │ ├── cfg.toml │ │ ├── README.md │ │ ├── build.rs │ │ ├── src │ │ │ └── main.rs │ │ └── Cargo.toml │ ├── log_level │ │ ├── cfg.toml │ │ ├── README.md │ │ ├── src │ │ │ └── main.rs │ │ ├── build.rs │ │ └── Cargo.toml │ ├── button_async │ │ ├── cfg.toml │ │ ├── README.md │ │ ├── src │ │ │ └── main.rs │ │ ├── build.rs │ │ └── Cargo.toml │ ├── hello_world │ │ ├── cfg.toml │ │ ├── README.md │ │ ├── src │ │ │ └── main.rs │ │ ├── build.rs │ │ └── Cargo.toml │ ├── button_toggle │ │ ├── cfg.toml │ │ ├── README.md │ │ ├── src │ │ │ └── main.rs │ │ ├── build.rs │ │ └── Cargo.toml │ ├── led_flow_light │ │ ├── cfg.toml │ │ ├── README.md │ │ ├── build.rs │ │ └── Cargo.toml │ ├── oled_show_str │ │ ├── cfg.toml │ │ ├── README.md │ │ ├── build.rs │ │ ├── src │ │ │ └── main.rs │ │ └── Cargo.toml │ ├── light_sensor_control_buzzer │ │ ├── cfg.toml │ │ ├── README.md │ │ ├── build.rs │ │ └── src │ │ │ └── main.rs │ └── opposing_infrared_sensor_buzzer │ │ ├── cfg.toml │ │ ├── README.md │ │ ├── build.rs │ │ └── src │ │ └── main.rs ├── uart │ ├── uart_fmt │ │ ├── cfg.toml │ │ ├── README.md │ │ ├── build.rs │ │ └── Cargo.toml │ ├── uart_isr │ │ ├── cfg.toml │ │ ├── README.md │ │ └── build.rs │ ├── uart_loopback │ │ ├── cfg.toml │ │ ├── README.md │ │ └── build.rs │ ├── uart_reconfigure │ │ ├── cfg.toml │ │ ├── README.md │ │ └── build.rs │ ├── uart_loopback_async │ │ ├── cfg.toml │ │ ├── README.md │ │ ├── build.rs │ │ └── src │ │ │ └── main.rs │ └── uart_continuous_tx_and_rx │ │ ├── cfg.toml │ │ ├── README.md │ │ └── build.rs ├── i2c │ ├── i2c_ssd1306 │ │ ├── cfg.toml │ │ ├── README.md │ │ └── build.rs │ ├── i2c_hard_mpu6050 │ │ ├── cfg.toml │ │ ├── README.md │ │ ├── build.rs │ │ └── src │ │ │ └── main.rs │ ├── i2c_master_slave │ │ ├── cfg.toml │ │ ├── README.md │ │ └── build.rs │ ├── i2c_soft_mpu6050 │ │ ├── cfg.toml │ │ ├── README.md │ │ ├── build.rs │ │ └── src │ │ │ └── main.rs │ └── i2c_mpu6050_crate │ │ ├── cfg.toml │ │ ├── README.md │ │ └── build.rs ├── interrupt │ ├── key_isr1 │ │ ├── cfg.toml │ │ ├── README.md │ │ ├── build.rs │ │ └── Cargo.toml │ ├── key_isr2 │ │ ├── cfg.toml │ │ ├── README.md │ │ ├── build.rs │ │ └── Cargo.toml │ ├── key_isr3 │ │ ├── cfg.toml │ │ ├── README.md │ │ ├── build.rs │ │ └── Cargo.toml │ ├── rtc_gpio │ │ ├── cfg.toml │ │ ├── README.md │ │ ├── build.rs │ │ └── Cargo.toml │ ├── rtc_isr │ │ ├── cfg.toml │ │ ├── README.md │ │ ├── build.rs │ │ └── Cargo.toml │ ├── button_isr │ │ ├── cfg.toml │ │ ├── README.md │ │ └── build.rs │ ├── timer_notify │ │ ├── cfg.toml │ │ ├── README.md │ │ ├── build.rs │ │ └── Cargo.toml │ ├── timer_alarm_isr │ │ ├── cfg.toml │ │ ├── README.md │ │ └── build.rs │ ├── rotary_encoder_count │ │ ├── cfg.toml │ │ ├── README.md │ │ └── build.rs │ ├── timer_external_clock │ │ ├── cfg.toml │ │ ├── README.md │ │ └── build.rs │ └── opposing_infrared_sensor_count │ │ ├── cfg.toml │ │ ├── README.md │ │ └── build.rs ├── spi │ ├── spi_nrf24l01 │ │ ├── build.rs │ │ └── README.md │ ├── spi_st7789 │ │ ├── cfg.toml │ │ ├── assets │ │ │ └── ferris.raw │ │ ├── README.md │ │ └── build.rs │ ├── spi_loopback │ │ ├── cfg.toml │ │ ├── README.md │ │ ├── build.rs │ │ └── Cargo.toml │ ├── spi_hard_w25q64 │ │ ├── cfg.toml │ │ ├── README.md │ │ └── build.rs │ ├── spi_soft_w25q64 │ │ ├── cfg.toml │ │ ├── README.md │ │ └── build.rs │ └── spi_loopback_async │ │ ├── cfg.toml │ │ ├── build.rs │ │ └── README.md ├── ledc │ ├── ledc_simple │ │ ├── cfg.toml │ │ ├── README.md │ │ └── build.rs │ ├── ledc_threads │ │ ├── cfg.toml │ │ ├── README.md │ │ └── build.rs │ ├── pwm_driven_motor │ │ ├── cfg.toml │ │ ├── README.md │ │ └── build.rs │ └── pwm_driven_servo │ │ ├── cfg.toml │ │ ├── build.rs │ │ └── README.md ├── delay │ ├── freertos_delay │ │ ├── cfg.toml │ │ ├── README.md │ │ ├── build.rs │ │ ├── src │ │ │ └── main.rs │ │ └── Cargo.toml │ └── async_timer_delay │ │ ├── cfg.toml │ │ ├── README.md │ │ ├── build.rs │ │ ├── src │ │ └── main.rs │ │ └── Cargo.toml ├── encoder │ ├── rotary_encoder │ │ ├── cfg.toml │ │ ├── README.md │ │ ├── build.rs │ │ └── src │ │ │ └── main.rs │ └── rotary_encoder_speed │ │ ├── cfg.toml │ │ ├── README.md │ │ ├── build.rs │ │ └── src │ │ └── main.rs ├── rmt │ ├── rmt_morse_code │ │ ├── cfg.toml │ │ ├── README.md │ │ └── build.rs │ ├── rmt_transceiver │ │ ├── cfg.toml │ │ ├── build.rs │ │ └── README.md │ └── rmt_musical_buzzer │ │ ├── cfg.toml │ │ ├── README.md │ │ └── build.rs ├── wdg │ ├── code_disable_wdg │ │ ├── cfg.toml │ │ ├── README.md │ │ ├── build.rs │ │ ├── src │ │ │ └── main.rs │ │ └── Cargo.toml │ └── sdkconfig_disable_wdg │ │ ├── cfg.toml │ │ ├── src │ │ └── main.rs │ │ ├── build.rs │ │ └── README.md ├── hardware │ ├── hardware_rgb_led │ │ ├── cfg.toml │ │ ├── README.md │ │ ├── build.rs │ │ └── Cargo.toml │ ├── hardware_memory_size │ │ ├── cfg.toml │ │ ├── README.md │ │ └── build.rs │ └── hardware_multiple_rgb_led │ │ ├── cfg.toml │ │ ├── README.md │ │ ├── build.rs │ │ └── src │ │ └── main.rs └── dma │ └── print_memory_address │ ├── cfg.toml │ ├── README.md │ ├── build.rs │ └── src │ └── main.rs ├── images ├── 3D摇杆电位器.png ├── 电位器引脚配置.jpg ├── NRF24L01引脚图.jpg ├── PWM驱动舵机引脚配置.jpg ├── cutecom配置.png ├── PWM驱动直流电机引脚配置.jpg └── ESP32-S3-DevKitC-1.png ├── rust-toolchain.toml ├── .vscode ├── extensions.json ├── c_cpp_properties.json └── launch.json ├── .gitignore ├── wokwi.toml ├── docs ├── sdkconfig │ ├── CMakeLists.txt │ └── README.md ├── partitions │ ├── partitions-16MB-no-uf2.csv │ └── partitions-16MB.csv ├── 问题答疑Q&A.md ├── stm32示例迁移.md └── esp-idf环境配置.md ├── .cargo └── config.toml ├── cfg.toml ├── diagram.json └── LICENSE /src/lib.rs: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /core/serial/README.md: -------------------------------------------------------------------------------- 1 | # 串口工具集 2 | -------------------------------------------------------------------------------- /core/esp32s3-mpu6050/.cargo-ok: -------------------------------------------------------------------------------- 1 | {"v":1} -------------------------------------------------------------------------------- /core/oled/README.md: -------------------------------------------------------------------------------- 1 | # OLED 显示屏 2 | -------------------------------------------------------------------------------- /app/ffi/ffi_hello/hello/hello.h: -------------------------------------------------------------------------------- 1 | int Hello(); 2 | -------------------------------------------------------------------------------- /core/w25q64/README.md: -------------------------------------------------------------------------------- 1 | # SPI 读写 W25Q64 非易失性存储器 2 | -------------------------------------------------------------------------------- /core/wifi/README.md: -------------------------------------------------------------------------------- 1 | # Wifi 助手 2 | 3 | 注: 示例来源于官方。 4 | -------------------------------------------------------------------------------- /app/ffi/bindgen_hello/hello/bar.h: -------------------------------------------------------------------------------- 1 | int max(int num1, int num2); -------------------------------------------------------------------------------- /core/esp32s3-mpu6050/src/range.rs: -------------------------------------------------------------------------------- 1 | use crate::device::*; 2 | -------------------------------------------------------------------------------- /app/ffi/bindgen_hello/hello/hello.h: -------------------------------------------------------------------------------- 1 | int Hello(); 2 | int Max(); 3 | -------------------------------------------------------------------------------- /core/esp32s3-nrf24l01/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | **/*.rs.bk 3 | Cargo.lock 4 | -------------------------------------------------------------------------------- /core/w25q64/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod conf; 2 | pub mod hal; 3 | pub mod reg; 4 | -------------------------------------------------------------------------------- /app/adc/adc/cfg.toml: -------------------------------------------------------------------------------- 1 | [adc] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /core/esp32s3-mpu6050/README.md: -------------------------------------------------------------------------------- 1 | # MPU6050 2 | 3 | 这是一个移植 STM32 的 MPU6050 库。 4 | -------------------------------------------------------------------------------- /core/wifi/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | embuild::espidf::sysenv::output(); 3 | } 4 | -------------------------------------------------------------------------------- /app/http/http_server_vue/web/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /app/basic/blinky/cfg.toml: -------------------------------------------------------------------------------- 1 | [blinky] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/basic/button/cfg.toml: -------------------------------------------------------------------------------- 1 | [button] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/basic/buzzer/cfg.toml: -------------------------------------------------------------------------------- 1 | [buzzer] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/uart/uart_fmt/cfg.toml: -------------------------------------------------------------------------------- 1 | [uart_fmt] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/uart/uart_isr/cfg.toml: -------------------------------------------------------------------------------- 1 | [uart_isr] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/adc/adc/README.md: -------------------------------------------------------------------------------- 1 | # ADC 2 | 3 | ## 执行指令 4 | 5 | ```shell 6 | cargo run -r -p adc 7 | ``` 8 | -------------------------------------------------------------------------------- /app/adc/adc_oneshot/cfg.toml: -------------------------------------------------------------------------------- 1 | [adc_oneshot] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/basic/log_level/cfg.toml: -------------------------------------------------------------------------------- 1 | [log_level] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/i2c/i2c_ssd1306/cfg.toml: -------------------------------------------------------------------------------- 1 | [i2c_ssd1306] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/interrupt/key_isr1/cfg.toml: -------------------------------------------------------------------------------- 1 | [key_isr1] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/interrupt/key_isr2/cfg.toml: -------------------------------------------------------------------------------- 1 | [key_isr2] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/interrupt/key_isr3/cfg.toml: -------------------------------------------------------------------------------- 1 | [key_isr3] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/interrupt/rtc_gpio/cfg.toml: -------------------------------------------------------------------------------- 1 | [rtc_gpio] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/interrupt/rtc_isr/cfg.toml: -------------------------------------------------------------------------------- 1 | [rtc_isr] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/spi/spi_nrf24l01/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | embuild::espidf::sysenv::output(); 3 | } 4 | -------------------------------------------------------------------------------- /app/spi/spi_st7789/cfg.toml: -------------------------------------------------------------------------------- 1 | [spi_st7789] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /core/wifi/cfg.toml.example: -------------------------------------------------------------------------------- 1 | [wifi] 2 | wifi_ssid = "FBI Surveillance Van" 3 | wifi_psk = "hunter2" -------------------------------------------------------------------------------- /app/basic/button_async/cfg.toml: -------------------------------------------------------------------------------- 1 | [button_async] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/basic/hello_world/cfg.toml: -------------------------------------------------------------------------------- 1 | [hello_world] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/ffi/ffi_hello/hello/bar.h: -------------------------------------------------------------------------------- 1 | int max(int num1, int num2); 2 | // 导出变量 3 | extern int AD_Value[4]; 4 | -------------------------------------------------------------------------------- /app/ffi/ffi_hello/hello/hello.c: -------------------------------------------------------------------------------- 1 | #include "bar.h" 2 | 3 | int Hello() { 4 | return 42; 5 | } 6 | -------------------------------------------------------------------------------- /app/interrupt/button_isr/cfg.toml: -------------------------------------------------------------------------------- 1 | [button_isr] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/ledc/ledc_simple/cfg.toml: -------------------------------------------------------------------------------- 1 | [ledc_simple] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/ledc/ledc_threads/cfg.toml: -------------------------------------------------------------------------------- 1 | [ledc_threads] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/spi/spi_loopback/cfg.toml: -------------------------------------------------------------------------------- 1 | [spi_loopback] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/uart/uart_loopback/cfg.toml: -------------------------------------------------------------------------------- 1 | [uart_loopback] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/adc/ad_multichannel/cfg.toml: -------------------------------------------------------------------------------- 1 | [ad_multichannel] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/basic/button_toggle/cfg.toml: -------------------------------------------------------------------------------- 1 | [button_toggle] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/basic/led_flow_light/cfg.toml: -------------------------------------------------------------------------------- 1 | [led_flow_light] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/basic/oled_show_str/cfg.toml: -------------------------------------------------------------------------------- 1 | [oled_show_str] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/delay/freertos_delay/cfg.toml: -------------------------------------------------------------------------------- 1 | [freertos_delay] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/encoder/rotary_encoder/cfg.toml: -------------------------------------------------------------------------------- 1 | [rotary_encoder] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/http/http_client/cfg.toml: -------------------------------------------------------------------------------- 1 | [http_client] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "asdfghjkl123" 4 | -------------------------------------------------------------------------------- /app/http/http_server/cfg.toml: -------------------------------------------------------------------------------- 1 | [http_server] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "asdfghjkl123" 4 | -------------------------------------------------------------------------------- /app/http/wifi_check/cfg.toml: -------------------------------------------------------------------------------- 1 | [wifi_check] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "asdfghjkl123" 4 | -------------------------------------------------------------------------------- /app/i2c/i2c_hard_mpu6050/cfg.toml: -------------------------------------------------------------------------------- 1 | [i2c_hard_mpu6050] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/i2c/i2c_master_slave/cfg.toml: -------------------------------------------------------------------------------- 1 | [i2c_master_slave] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/i2c/i2c_soft_mpu6050/cfg.toml: -------------------------------------------------------------------------------- 1 | [i2c_soft_mpu6050] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/interrupt/timer_notify/cfg.toml: -------------------------------------------------------------------------------- 1 | [timer_notify] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/rmt/rmt_morse_code/cfg.toml: -------------------------------------------------------------------------------- 1 | [rmt_morse_code] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/rmt/rmt_transceiver/cfg.toml: -------------------------------------------------------------------------------- 1 | [rmt_transceiver] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/spi/spi_hard_w25q64/cfg.toml: -------------------------------------------------------------------------------- 1 | [spi_hard_w25q64] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/spi/spi_soft_w25q64/cfg.toml: -------------------------------------------------------------------------------- 1 | [spi_soft_w25q64] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/wdg/code_disable_wdg/cfg.toml: -------------------------------------------------------------------------------- 1 | [code_disable_wdg] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /images/3D摇杆电位器.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silent-rain/esp32-s3-std-tutorial/HEAD/images/3D摇杆电位器.png -------------------------------------------------------------------------------- /images/电位器引脚配置.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silent-rain/esp32-s3-std-tutorial/HEAD/images/电位器引脚配置.jpg -------------------------------------------------------------------------------- /app/delay/async_timer_delay/cfg.toml: -------------------------------------------------------------------------------- 1 | [async_timer_delay] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/hardware/hardware_rgb_led/cfg.toml: -------------------------------------------------------------------------------- 1 | [hardware_rgb_led] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/http/https_client/cfg.toml: -------------------------------------------------------------------------------- 1 | [https_client] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "asdfghjkl123" 4 | -------------------------------------------------------------------------------- /app/i2c/i2c_mpu6050_crate/cfg.toml: -------------------------------------------------------------------------------- 1 | [i2c_mpu6050_crate] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/interrupt/timer_alarm_isr/cfg.toml: -------------------------------------------------------------------------------- 1 | [timer_alarm_isr] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/ledc/pwm_driven_motor/cfg.toml: -------------------------------------------------------------------------------- 1 | [pwm_driven_motor] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/ledc/pwm_driven_servo/cfg.toml: -------------------------------------------------------------------------------- 1 | [pwm_driven_servo] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/rmt/rmt_musical_buzzer/cfg.toml: -------------------------------------------------------------------------------- 1 | [rmt_musical_buzzer] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/spi/spi_loopback_async/cfg.toml: -------------------------------------------------------------------------------- 1 | [spi_loopback_async] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/uart/uart_reconfigure/cfg.toml: -------------------------------------------------------------------------------- 1 | [uart_reconfigure] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /images/NRF24L01引脚图.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silent-rain/esp32-s3-std-tutorial/HEAD/images/NRF24L01引脚图.jpg -------------------------------------------------------------------------------- /images/PWM驱动舵机引脚配置.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silent-rain/esp32-s3-std-tutorial/HEAD/images/PWM驱动舵机引脚配置.jpg -------------------------------------------------------------------------------- /images/cutecom配置.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silent-rain/esp32-s3-std-tutorial/HEAD/images/cutecom配置.png -------------------------------------------------------------------------------- /app/dma/print_memory_address/cfg.toml: -------------------------------------------------------------------------------- 1 | [print_memory_address] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/http/http_server_vue/cfg.toml: -------------------------------------------------------------------------------- 1 | [http_server_vue] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "asdfghjkl123" 4 | -------------------------------------------------------------------------------- /app/http/http_ureq_client/cfg.toml: -------------------------------------------------------------------------------- 1 | [http_ureq_client] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "asdfghjkl123" 4 | -------------------------------------------------------------------------------- /app/uart/uart_loopback_async/cfg.toml: -------------------------------------------------------------------------------- 1 | [uart_loopback_async] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/wdg/sdkconfig_disable_wdg/cfg.toml: -------------------------------------------------------------------------------- 1 | [sdkconfig_disable_wdg] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /core/esp32s3-mpu6050/.cargo/config: -------------------------------------------------------------------------------- 1 | [target.armv7-unknown-linux-gnueabihf] 2 | linker = "arm-linux-gnueabihf-gcc" 3 | -------------------------------------------------------------------------------- /core/wifi/sdkconfig.defaults: -------------------------------------------------------------------------------- 1 | CONFIG_ESP_MAIN_TASK_STACK_SIZE=20000 2 | CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=4096 -------------------------------------------------------------------------------- /images/PWM驱动直流电机引脚配置.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silent-rain/esp32-s3-std-tutorial/HEAD/images/PWM驱动直流电机引脚配置.jpg -------------------------------------------------------------------------------- /app/adc/adc_oneshot/README.md: -------------------------------------------------------------------------------- 1 | # adc oneshot 2 | 3 | ## 执行指令 4 | 5 | ```shell 6 | cargo run -r -p adc_oneshot 7 | ``` 8 | -------------------------------------------------------------------------------- /app/basic/hello_world/README.md: -------------------------------------------------------------------------------- 1 | # Hello World 2 | 3 | ## 执行指令 4 | 5 | ```shell 6 | cargo run -p hello_world 7 | ``` 8 | -------------------------------------------------------------------------------- /app/encoder/rotary_encoder_speed/cfg.toml: -------------------------------------------------------------------------------- 1 | [rotary_encoder_speed] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/hardware/hardware_memory_size/cfg.toml: -------------------------------------------------------------------------------- 1 | [hardware_memory_size] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/http/http_server_shtcx/cfg.toml: -------------------------------------------------------------------------------- 1 | [http_server_shtcx] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "asdfghjkl123" 4 | -------------------------------------------------------------------------------- /app/interrupt/rotary_encoder_count/cfg.toml: -------------------------------------------------------------------------------- 1 | [rotary_encoder_count] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/interrupt/timer_external_clock/cfg.toml: -------------------------------------------------------------------------------- 1 | [timer_external_clock] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/adc/ad_multichannel/README.md: -------------------------------------------------------------------------------- 1 | # 多通道读取数据 2 | 3 | ## 执行指令 4 | 5 | ```shell 6 | cargo run -r -p ad_multichannel 7 | ``` 8 | -------------------------------------------------------------------------------- /app/adc/joystick_potentiometer_3d/cfg.toml: -------------------------------------------------------------------------------- 1 | [joystick_potentiometer_3d] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/interrupt/timer_notify/README.md: -------------------------------------------------------------------------------- 1 | # 定时器通知 2 | 3 | ## 执行指令 4 | 5 | ```shell 6 | cargo run -r -p timer_notify 7 | ``` 8 | -------------------------------------------------------------------------------- /app/uart/uart_continuous_tx_and_rx/cfg.toml: -------------------------------------------------------------------------------- 1 | [uart_continuous_tx_and_rx] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /images/ESP32-S3-DevKitC-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silent-rain/esp32-s3-std-tutorial/HEAD/images/ESP32-S3-DevKitC-1.png -------------------------------------------------------------------------------- /rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | channel = "esp" 3 | # channel = "nightly-2023-11-15" 4 | # components = ["rust-src"] 5 | -------------------------------------------------------------------------------- /app/basic/light_sensor_control_buzzer/cfg.toml: -------------------------------------------------------------------------------- 1 | [light_sensor_control_buzzer] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/hardware/hardware_multiple_rgb_led/cfg.toml: -------------------------------------------------------------------------------- 1 | [hardware_multiple_rgb_led] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/interrupt/timer_alarm_isr/README.md: -------------------------------------------------------------------------------- 1 | # 定时器告警中断 2 | 3 | ## 执行指令 4 | 5 | ```shell 6 | cargo run -r -p timer_alarm_isr 7 | ``` 8 | -------------------------------------------------------------------------------- /app/adc/potentiometer_reading_voltage/cfg.toml: -------------------------------------------------------------------------------- 1 | [potentiometer_reading_voltage] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/basic/opposing_infrared_sensor_buzzer/cfg.toml: -------------------------------------------------------------------------------- 1 | [opposing_infrared_sensor_buzzer] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/http/http_server_vue/web/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"] 3 | } 4 | -------------------------------------------------------------------------------- /app/interrupt/opposing_infrared_sensor_count/cfg.toml: -------------------------------------------------------------------------------- 1 | [opposing_infrared_sensor_count] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | -------------------------------------------------------------------------------- /app/spi/spi_st7789/assets/ferris.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silent-rain/esp32-s3-std-tutorial/HEAD/app/spi/spi_st7789/assets/ferris.raw -------------------------------------------------------------------------------- /core/mpu6050/README.md: -------------------------------------------------------------------------------- 1 | # I2C 读写 MPU6050 2 | 3 | MPU6050 是一个 6 轴姿态传感器,可以测量芯片自身 X、Y、Z 轴的加速度、角速度参数,通过数据融合,可进一步得到姿态角,常应用于平衡车、飞行器等需要检测自身姿态的场景。 4 | -------------------------------------------------------------------------------- /core/pcnt_encoder/README.md: -------------------------------------------------------------------------------- 1 | # PCNT 解码旋转编码器 2 | 3 | 请注意,PCNT 只跟踪单个的 16 位值。我们使用中断来检测 LOW 和 HIGH 阈值并跟踪其占比,并提供 i64 值结果 4 | 5 | 注:示例来源于官方。 6 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "sugatoray.vscode-git-extension-pack", 4 | "rust-lang.rust-analyzer" 5 | ] 6 | } -------------------------------------------------------------------------------- /app/basic/log_level/README.md: -------------------------------------------------------------------------------- 1 | # 日志级别 2 | 3 | 设置日志级别,根据日志级别进行日式打印。 4 | 5 | ## 执行指令 6 | 7 | ```shell 8 | cargo run -r -p log_level 9 | ``` 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # .vscode 2 | 3 | # rust 4 | target 5 | # Cargo.lock 6 | examples/* 7 | 8 | # esp-idf 9 | build 10 | .embuild 11 | sdkconfig.old 12 | -------------------------------------------------------------------------------- /core/esp32s3-mpu6050/.cargo_vcs_info.json: -------------------------------------------------------------------------------- 1 | { 2 | "git": { 3 | "sha1": "d948e4e16cc1745da710e17ff33992ecb42eaab0" 4 | }, 5 | "path_in_vcs": "" 6 | } -------------------------------------------------------------------------------- /core/oled/src/lib.rs: -------------------------------------------------------------------------------- 1 | //! OLED 显示屏 2 | #![allow(unused)] 3 | 4 | pub mod font; 5 | pub mod oled; 6 | 7 | pub use font::OLED_FONT; 8 | pub use oled::OLED; 9 | -------------------------------------------------------------------------------- /app/dma/print_memory_address/README.md: -------------------------------------------------------------------------------- 1 | # 打印内存地址 2 | 3 | ## 引脚 4 | 5 | ## 执行指令 6 | 7 | ```shell 8 | cargo run -r -p print_memory_address 9 | ``` 10 | -------------------------------------------------------------------------------- /app/http/wifi_check/README.md: -------------------------------------------------------------------------------- 1 | # Wifi 检查 2 | 3 | 它与配置中给定的接入点建立 Wi-Fi 连接。 4 | 5 | ## 执行指令 6 | 7 | ```shell 8 | cargo run -r -p wifi_check 9 | ``` 10 | -------------------------------------------------------------------------------- /app/ffi/bindgen_hello/hello/hello.c: -------------------------------------------------------------------------------- 1 | #include "bar.h" 2 | 3 | int Hello() { 4 | return 42; 5 | } 6 | 7 | int Max() { 8 | return max(10,20); 9 | } 10 | -------------------------------------------------------------------------------- /app/delay/async_timer_delay/README.md: -------------------------------------------------------------------------------- 1 | # 定时器延迟 2 | 3 | 使用 `FreeRtos::delay_ms` 进行延迟打印日志。 4 | 5 | ## 执行指令 6 | 7 | ```shell 8 | cargo run -r -p timer_delay 9 | ``` 10 | -------------------------------------------------------------------------------- /app/http/http_client/README.md: -------------------------------------------------------------------------------- 1 | # HTTP 客户端 2 | 3 | 读取 HTTP 网页数据。 4 | 5 | 注: 示例来源于官方。 6 | 7 | ## 执行指令 8 | 9 | ```shell 10 | cargo run -r -p http_client 11 | ``` 12 | -------------------------------------------------------------------------------- /app/http/http_server_vue/web/src/main.ts: -------------------------------------------------------------------------------- 1 | import { createApp } from "vue"; 2 | import "./style.css"; 3 | import App from "./App.vue"; 4 | 5 | createApp(App).mount("#app"); 6 | -------------------------------------------------------------------------------- /core/esp32s3-mpu6050/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | */target 3 | example/**/*.rs.bk 4 | example/Cargo.lock 5 | .idea/ 6 | **/*.rs.bk 7 | Cargo.lock 8 | .DS_Store 9 | *.swp 10 | -------------------------------------------------------------------------------- /app/adc/joystick_potentiometer_3d/README.md: -------------------------------------------------------------------------------- 1 | # 3D 摇杆电位器 2 | 3 | 读取 3D 摇杆电位器数据。 4 | 5 | ## 执行指令 6 | 7 | ```shell 8 | cargo run -r -p joystick_potentiometer_3d 9 | ``` 10 | -------------------------------------------------------------------------------- /app/delay/freertos_delay/README.md: -------------------------------------------------------------------------------- 1 | # FreeRtos 延迟 2 | 3 | 使用 `FreeRtos::delay_ms` 进行延迟打印日志。 4 | 5 | ## 执行指令 6 | 7 | ```shell 8 | cargo run -r -p freertos_delay 9 | ``` 10 | -------------------------------------------------------------------------------- /app/http/https_client/README.md: -------------------------------------------------------------------------------- 1 | # HTTPS 客户端 2 | 3 | 读取 HTTPS 网页数据。 4 | 5 | 注: 示例来源于官方。 6 | 7 | ## 执行指令 8 | 9 | ```shell 10 | cargo run -r -p https_client 11 | ``` 12 | -------------------------------------------------------------------------------- /app/uart/uart_loopback_async/README.md: -------------------------------------------------------------------------------- 1 | # UART 异步回环测试 2 | 3 | 注: 示例来源于官方。 4 | 5 | ## 引脚 6 | 7 | ## 执行指令 8 | 9 | ```shell 10 | cargo run -r -p uart_loopback_async 11 | ``` 12 | -------------------------------------------------------------------------------- /app/basic/buzzer/README.md: -------------------------------------------------------------------------------- 1 | # 蜂鸣器 2 | 3 | ## 引脚 4 | 5 | ### 蜂鸣器 6 | 7 | - 正极: VCC 8 | - 负极: GND 9 | - I/O: IO4 10 | 11 | ## 执行指令 12 | 13 | ```shell 14 | cargo run -r -p buzzer 15 | ``` 16 | -------------------------------------------------------------------------------- /wokwi.toml: -------------------------------------------------------------------------------- 1 | [wokwi] 2 | version = 1 3 | gdbServerPort = 3333 4 | elf = "target/xtensa-esp32s3-espidf/debug/esp32-s3-std-tutorial" 5 | firmware = "target/xtensa-esp32s3-espidf/debug/esp32-s3-std-tutorial" 6 | -------------------------------------------------------------------------------- /app/http/http_server_vue/README.md: -------------------------------------------------------------------------------- 1 | # Vue HTTP 服务器 2 | 3 | 集合 VUE 搭建一个 HTTP 服务。 4 | 5 | ## 执行指令 6 | 7 | ```shell 8 | cd web && pnpm build && cd .. 9 | 10 | cargo run -r -p http_server_vue 11 | ``` 12 | -------------------------------------------------------------------------------- /app/ffi/bindgen_hello/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | #![no_main] 3 | #![allow(non_upper_case_globals)] 4 | #![allow(non_camel_case_types)] 5 | #![allow(non_snake_case)] 6 | 7 | include!(concat!("../hello/bindings.rs")); 8 | -------------------------------------------------------------------------------- /app/http/http_server_vue/web/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import vue from '@vitejs/plugin-vue' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [vue()], 7 | }) 8 | -------------------------------------------------------------------------------- /app/basic/blinky/README.md: -------------------------------------------------------------------------------- 1 | # LED 闪烁 2 | 3 | 将 LED 接入 PIN 4 引脚,让 LED 进行闪烁。 4 | 5 | ## 引脚 6 | 7 | ### LED 灯 8 | 9 | - 正极: IO4 10 | - 负极: GND 11 | 12 | ## 执行指令 13 | 14 | ```shell 15 | cargo run -r -p blinky 16 | ``` 17 | -------------------------------------------------------------------------------- /app/ledc/ledc_threads/README.md: -------------------------------------------------------------------------------- 1 | # LEDC 多线程 2 | 3 | 注: 示例来源于官方。 4 | 5 | ## 引脚 6 | 7 | ### LED 灯 8 | 9 | - 正极: IO4、IO5 10 | - 负极: GND 11 | 12 | ## 执行指令 13 | 14 | ```shell 15 | cargo run -r -p ledc_threads 16 | ``` 17 | -------------------------------------------------------------------------------- /app/uart/uart_reconfigure/README.md: -------------------------------------------------------------------------------- 1 | # UART 重新配置 2 | 3 | 这是一个串行接口重新配置的示例。在运行过程中重新配置波特率。 4 | 5 | ## 引脚 6 | 7 | - TX GPIO12 8 | - RX GPIO13 9 | 10 | ## 执行指令 11 | 12 | ```shell 13 | cargo run -r -p uart_reconfigure 14 | ``` 15 | -------------------------------------------------------------------------------- /app/encoder/rotary_encoder/README.md: -------------------------------------------------------------------------------- 1 | # 旋转编码器计数 2 | 3 | ## 引脚 4 | 5 | ### 旋转编码器 6 | 7 | - 正极: VCC 8 | - 负极: GND 9 | - S1: IO4 10 | - S2: IO5 11 | 12 | ## 执行指令 13 | 14 | ```shell 15 | cargo run -r -p rotary_encoder 16 | ``` 17 | -------------------------------------------------------------------------------- /app/http/http_server_vue/web/src/components/About.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /core/neopixel/README.md: -------------------------------------------------------------------------------- 1 | # RBG LED 2 | 3 | RGB LED 灯是通过 WS2812B 协议来控制的,这个协议的特点是,每个灯珠只有一个数据线,它可以接收来自上一个灯珠的数据,然后将自己不需要的数据传递给下一个灯珠。 4 | 5 | 这样,可以通过一个引脚来控制多个灯珠,只需要按照灯珠的顺序,依次发送每个灯珠的颜色数据即可。每个灯珠都会从数据线上读取第一个颜色数据,并显示出来,然后将剩余的数据传递给下一个灯珠,直到所有的灯珠都接收到了数据。 6 | -------------------------------------------------------------------------------- /app/hardware/hardware_rgb_led/README.md: -------------------------------------------------------------------------------- 1 | # RGB LED 闪烁 2 | 3 | 注意,把 RGB 焊盘短接才可以点亮。当需要熄灭时请设置为黑色。 4 | 5 | ## 引脚 6 | 7 | ### RGB LED 8 | 9 | - 默认引脚: IO48 10 | 11 | ## 执行指令 12 | 13 | ```shell 14 | cargo run -r -p hardware_rgb_led 15 | ``` 16 | -------------------------------------------------------------------------------- /app/http/http_server_vue/web/src/components/NotFound.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /app/i2c/i2c_hard_mpu6050/README.md: -------------------------------------------------------------------------------- 1 | # 硬件读写 MPU6050 2 | 3 | ## 引脚 4 | 5 | ### MPU6050 6 | 7 | - 正极: VCC 8 | - 负极: GND 9 | - SDA: IO5 10 | - SCL: IO6 11 | 12 | ## 执行指令 13 | 14 | ```shell 15 | cargo run -r -p i2c_hard_mpu6050 16 | ``` 17 | -------------------------------------------------------------------------------- /app/encoder/rotary_encoder_speed/README.md: -------------------------------------------------------------------------------- 1 | # 旋转编码器接口延时测速 2 | 3 | ## 引脚 4 | 5 | ### 旋转编码器 6 | 7 | - 正极: VCC 8 | - 负极: GND 9 | - S1: IO4 10 | - S2: IO5 11 | 12 | ## 执行指令 13 | 14 | ```shell 15 | cargo run -r -p rotary_encoder_speed 16 | ``` 17 | -------------------------------------------------------------------------------- /app/interrupt/rotary_encoder_count/README.md: -------------------------------------------------------------------------------- 1 | # 旋转编码器计次 2 | 3 | ## 引脚 4 | 5 | ### 旋转编码器 6 | 7 | - 正极: VCC 8 | - 负极: GND 9 | - S1: IO4 10 | - S2: IO5 11 | 12 | ## 执行指令 13 | 14 | ```shell 15 | cargo run -r -p rotary_encoder_count 16 | ``` 17 | -------------------------------------------------------------------------------- /app/i2c/i2c_mpu6050_crate/README.md: -------------------------------------------------------------------------------- 1 | # MPU6050 crate 读写 MPU6050 2 | 3 | ## 引脚 4 | 5 | ### MPU6050 6 | 7 | - 正极: VCC 8 | - 负极: GND 9 | - SDA: IO5 10 | - SCL: IO6 11 | 12 | ## 执行指令 13 | 14 | ```shell 15 | cargo run -r -p i2c_mpu6050_crate 16 | ``` 17 | -------------------------------------------------------------------------------- /app/interrupt/button_isr/README.md: -------------------------------------------------------------------------------- 1 | # 按键中断控制 LED 闪烁 2 | 3 | ## 引脚 4 | 5 | ### 按钮 6 | 7 | - 一端: GND 8 | - 一端: IO4 9 | 10 | ### LED 灯 11 | 12 | - 正极: IO5 13 | - 负极: GND 14 | 15 | ## 执行指令 16 | 17 | ```shell 18 | cargo run -r -p button_isr 19 | ``` 20 | -------------------------------------------------------------------------------- /app/interrupt/rtc_gpio/README.md: -------------------------------------------------------------------------------- 1 | # RTC 外部时钟 2 | 3 | 注意:这是一个失败的示例 4 | 5 | ## 引脚 6 | 7 | ### 外部时钟源 8 | 9 | - 信号: IO15 10 | 11 | ### 按钮 12 | 13 | - 一端: GND 14 | - 一端: IO5 15 | 16 | ## 执行指令 17 | 18 | ```shell 19 | cargo run -r -p rtc_gpio 20 | ``` 21 | -------------------------------------------------------------------------------- /app/interrupt/rtc_isr/README.md: -------------------------------------------------------------------------------- 1 | # RTC 中断 2 | 3 | RTC 中断是一种用于定时或唤醒的低功耗中断。ESP32 的 RTC 模块包括一个 64 位计数器,一个 8 位分频器,一个 64 位闹钟寄存器,一个 64 位时间戳寄存器,一个 32 位中断状态寄存器,一个 32 位中断使能寄存器,和一个 32 位中断清除寄存器。 4 | 5 | ## 执行指令 6 | 7 | ```shell 8 | cargo run -r -p rtc_isr 9 | ``` 10 | -------------------------------------------------------------------------------- /app/uart/uart_fmt/README.md: -------------------------------------------------------------------------------- 1 | # 串口写入格式化字符串 2 | 3 | ## 引脚 4 | 5 | ### UART 6 | 7 | - TX GPIO12 8 | - RX GPIO13 9 | 10 | ### USB UART 11 | 12 | - TX GPIO13 13 | - RX GPIO12 14 | 15 | ## 执行指令 16 | 17 | ```shell 18 | cargo run -r -p uart_fmt 19 | ``` 20 | -------------------------------------------------------------------------------- /app/basic/button/README.md: -------------------------------------------------------------------------------- 1 | # 按钮 2 | 3 | 根据按钮的状态打开/关闭 LED。 4 | 5 | ## 引脚 6 | 7 | ### 按钮 8 | 9 | - 一端: GND 10 | - 一端: IO4 11 | 12 | ### LED 灯 13 | 14 | - 正极: IO5 15 | - 负极: GND 16 | 17 | ## 执行指令 18 | 19 | ```shell 20 | cargo run -r -p button 21 | ``` 22 | -------------------------------------------------------------------------------- /app/basic/oled_show_str/README.md: -------------------------------------------------------------------------------- 1 | # OLED 显示屏 2 | 3 | 在 OLED 显示屏中显示字符串。 4 | 5 | ## 引脚 6 | 7 | ### OLED 8 | 9 | - 正极: VCC 3.3v 10 | - 负极: GND 11 | - SCL: IO4 12 | - SDA: IO5 13 | 14 | ## 执行指令 15 | 16 | ```shell 17 | cargo run -r -p oled_show_str 18 | ``` 19 | -------------------------------------------------------------------------------- /app/i2c/i2c_soft_mpu6050/README.md: -------------------------------------------------------------------------------- 1 | # 软件读写 MPU6050 2 | 3 | 注:这个示例获取数据时不灵敏。 4 | 5 | ## 引脚 6 | 7 | ### MPU6050 8 | 9 | - 正极: VCC 10 | - 负极: GND 11 | - SDA: IO5 12 | - SCL: IO6 13 | 14 | ## 执行指令 15 | 16 | ```shell 17 | cargo run -r -p i2c_soft_mpu6050 18 | ``` 19 | -------------------------------------------------------------------------------- /app/uart/uart_loopback/README.md: -------------------------------------------------------------------------------- 1 | # UART 回环测试 2 | 3 | 此示例通过 UART 传输数据。 4 | 连接 TX 和 RX 引脚,查看输出数据是否被读取为输入数据。 5 | 6 | 注: 示例来源于官方。 7 | 8 | ## 引脚 9 | 10 | - TX GPIO12 11 | - RX GPIO13 12 | 13 | ## 执行指令 14 | 15 | ```shell 16 | cargo run -r -p uart_loopback 17 | ``` 18 | -------------------------------------------------------------------------------- /app/ffi/bindgen_hello/hello/bar.c: -------------------------------------------------------------------------------- 1 | /* 函数返回两个数中较大的那个数 */ 2 | int max(int num1, int num2) 3 | { 4 | /* 局部变量声明 */ 5 | int result; 6 | 7 | if (num1 > num2) { 8 | result = num1; 9 | } else { 10 | result = num2; 11 | } 12 | return result; 13 | } -------------------------------------------------------------------------------- /app/hardware/hardware_multiple_rgb_led/README.md: -------------------------------------------------------------------------------- 1 | # RGB LED 灯珠闪烁 2 | 3 | 注意,把 RGB 焊盘短接才可以点亮。当需要熄灭时请设置为黑色。 4 | 5 | ## 引脚 6 | 7 | ### RGB LED 8 | 9 | - 默认引脚: IO48 10 | - 11 | 12 | ## 执行指令 13 | 14 | ```shell 15 | cargo run -r -p hardware_multiple_rgb_led 16 | ``` 17 | -------------------------------------------------------------------------------- /app/http/http_server/README.md: -------------------------------------------------------------------------------- 1 | # HTTP 服务器 2 | 3 | 搭建一个 HTTP 服务, 输出对射式红外传感器数据。 4 | 5 | 注: 示例来源于官方。 6 | 7 | ## 引脚 8 | 9 | ### 对射式红外传感器 10 | 11 | - 正极: VCC 12 | - 负极: GND 13 | - DO: IO5 14 | 15 | ## 执行指令 16 | 17 | ```shell 18 | cargo run -r -p http_server 19 | ``` 20 | -------------------------------------------------------------------------------- /app/uart/uart_continuous_tx_and_rx/README.md: -------------------------------------------------------------------------------- 1 | # 连续发送与接收 2 | 3 | ### UART 4 | 5 | - TX GPIO12 6 | - RX GPIO13 7 | 8 | ### USB UART 9 | 10 | - TX GPIO13 11 | - RX GPIO12 12 | 13 | ## 执行指令 14 | 15 | ```shell 16 | cargo run -r -p uart_continuous_tx_and_rx 17 | ``` 18 | -------------------------------------------------------------------------------- /app/basic/button_async/README.md: -------------------------------------------------------------------------------- 1 | # 按钮异步任务 2 | 3 | 这是一个按键控制 LED 灯的示例。 4 | 5 | ## 引脚 6 | 7 | ### 按钮 8 | 9 | - 一端: GND 10 | - 一端: IO4 11 | 12 | ### LED 灯 13 | 14 | - 正极: IO5 15 | - 负极: GND 16 | 17 | ## 执行指令 18 | 19 | ```shell 20 | cargo run -r -p button_async 21 | ``` 22 | -------------------------------------------------------------------------------- /app/spi/spi_loopback/README.md: -------------------------------------------------------------------------------- 1 | # SPI 回环测试 2 | 3 | 注: 示例来源于官方。 4 | 5 | ## 引脚 6 | 7 | - SCLK GPIO6 8 | - SDI GPIO2 9 | - SDO GPIO7 10 | - CS_1 GPIO10 11 | - CS_2 GPIO3 12 | - 连接 SDI 和 SDO 引脚 13 | 14 | ## 执行指令 15 | 16 | ```shell 17 | cargo run -r -p spi_loopback 18 | ``` 19 | -------------------------------------------------------------------------------- /app/uart/uart_isr/README.md: -------------------------------------------------------------------------------- 1 | # 串口中断 2 | 3 | 注: 这是一个失败的示例。 4 | 5 | ## 引脚 6 | 7 | ### UART 8 | 9 | - TX GPIO12 10 | - RX GPIO13 11 | 12 | ### USB UART 13 | 14 | - TX GPIO13 15 | - RX GPIO12 16 | 17 | ## 执行指令 18 | 19 | ```shell 20 | cargo run -r -p uart_isr 21 | ``` 22 | -------------------------------------------------------------------------------- /app/wdg/code_disable_wdg/README.md: -------------------------------------------------------------------------------- 1 | # 代码禁用开门狗 2 | 3 | ## 启用项目成员 4 | 5 | > vim Cargo.toml 6 | 7 | ```toml 8 | [workspace] 9 | members = [ 10 | "app/wdg/code_disable_wdg", 11 | ] 12 | ``` 13 | 14 | ## 执行指令 15 | 16 | ```shell 17 | cargo run -p code_disable_wdg 18 | ``` 19 | -------------------------------------------------------------------------------- /core/oled/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "oled" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | esp-idf-hal = "0.42.5" 10 | anyhow = "1.0.79" 11 | -------------------------------------------------------------------------------- /app/basic/button_toggle/README.md: -------------------------------------------------------------------------------- 1 | # 按钮 Toggle 2 | 3 | 根据按钮的状态打开/关闭 LED。 4 | 5 | ## 引脚 6 | 7 | ### 按钮 8 | 9 | - 一端: GND 10 | - 一端: IO4 11 | 12 | ### LED 灯 13 | 14 | - 正极: IO5 15 | - 负极: GND 16 | 17 | ## 执行指令 18 | 19 | ```shell 20 | cargo run -r -p button_toggle 21 | ``` 22 | -------------------------------------------------------------------------------- /core/mpu6050/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "mpu6050" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | esp-idf-hal = "0.42.5" 10 | anyhow = "1.0.79" 11 | -------------------------------------------------------------------------------- /core/neopixel/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "neopixel" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | esp-idf-hal = "0.42.5" 10 | anyhow = "1.0.79" 11 | -------------------------------------------------------------------------------- /core/serial/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "serial" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | esp-idf-hal = "0.42.5" 10 | anyhow = "1.0.79" 11 | -------------------------------------------------------------------------------- /app/spi/spi_soft_w25q64/README.md: -------------------------------------------------------------------------------- 1 | # 软件读写 W25Q64 2 | 3 | ## 引脚 4 | 5 | ### W25Q64 6 | 7 | - VCC: VCC 8 | - GND: GND 9 | - CS(SS): IO4 10 | - SCK(CSLK): IO5 11 | - DI(MOSI): IO6 12 | - DO(MISO): IO7 13 | 14 | ## 执行指令 15 | 16 | ```shell 17 | cargo run -r -p spi_soft_w25q64 18 | ``` 19 | -------------------------------------------------------------------------------- /app/interrupt/key_isr1/README.md: -------------------------------------------------------------------------------- 1 | # 按键中断计次 1 2 | 3 | subscribe 函数中断,在收到中断通知后,需要在非中断上下文中,再次调用 PinDriver::enable_interrupt 方法,来重新启用中断,否则会触发看门狗定时器。 4 | 5 | ## 引脚 6 | 7 | ### 按钮 8 | 9 | - 一端: GND 10 | - 一端: IO5 11 | 12 | ## 执行指令 13 | 14 | ```shell 15 | cargo run -r -p key_isr1 16 | ``` 17 | -------------------------------------------------------------------------------- /app/rmt/rmt_morse_code/README.md: -------------------------------------------------------------------------------- 1 | # 发送摩尔斯电码 2 | 3 | 使用 ESP32 的 RMT 模块来控制一个 LED 灯,使其以摩尔斯电码的形式发送一些信息。 4 | 5 | 注:这是官方示例。 6 | 7 | ## 引脚 8 | 9 | ### 蜂鸣器 10 | 11 | - 正极: VCC 12 | - 负极: GND 13 | - I/O: IO17 14 | 15 | ## 执行指令 16 | 17 | ```shell 18 | cargo run -r -p rmt_morse_code 19 | ``` 20 | -------------------------------------------------------------------------------- /core/pcnt_encoder/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pcnt_encoder" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | esp-idf-hal = "0.42.5" 10 | anyhow = "1.0.79" 11 | -------------------------------------------------------------------------------- /docs/sdkconfig/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The following lines of boilerplate have to be in your project's 2 | # CMakeLists in this exact order for cmake to work correctly 3 | cmake_minimum_required(VERSION 3.16) 4 | 5 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 6 | project(esp32-s3-std-tutorial) 7 | -------------------------------------------------------------------------------- /app/ffi/ffi_hello/hello/bar.c: -------------------------------------------------------------------------------- 1 | int AD_Value[4]; 2 | 3 | /* 函数返回两个数中较大的那个数 */ 4 | int max(int num1, int num2) 5 | { 6 | /* 局部变量声明 */ 7 | int result; 8 | 9 | if (num1 > num2) { 10 | result = num1; 11 | } else { 12 | result = num2; 13 | } 14 | return result; 15 | } -------------------------------------------------------------------------------- /app/hardware/hardware_memory_size/README.md: -------------------------------------------------------------------------------- 1 | # 查看内存大小 2 | 3 | ## 执行指令 4 | 5 | ```shell 6 | cargo run -p hardware_memory_size 7 | ``` 8 | 9 | ## 参考文档 10 | 11 | - [查看模组的 PSRAM](https://espressif-docs.readthedocs-hosted.com/projects/esp-faq/zh-cn/latest/software-framework/storage/psram.html) 12 | -------------------------------------------------------------------------------- /app/http/http_server_shtcx/README.md: -------------------------------------------------------------------------------- 1 | # HTTP 服务器 2 | 3 | 搭建一个 HTTP 服务, 输出温度传感器数据。 4 | 5 | 注: 示例来源于官方。 6 | 7 | ## 引脚 8 | 9 | ### 温度传感器 10 | 11 | - 正极: VCC 12 | - 负极: GND 13 | - SDA: IO10 14 | - SCL: IO8 15 | 16 | ## 执行指令 17 | 18 | ```shell 19 | cargo run -r -p http_server_shtcx 20 | ``` 21 | -------------------------------------------------------------------------------- /app/interrupt/key_isr2/README.md: -------------------------------------------------------------------------------- 1 | # 按键中断计次 2 2 | 3 | gpio_isr_register 注册 GPIO 中断处理程序,该处理程序是一个 ISR。处理程序将附加到运行此函数的同一 CPU 核心。 4 | 5 | 注意:这是一个失败的案例。 6 | 7 | ## 引脚 8 | 9 | ### 按钮 10 | 11 | - 一端: GND 12 | - 一端: IO5 13 | 14 | ## 执行指令 15 | 16 | ```shell 17 | cargo run -r -p key_isr2 18 | ``` 19 | -------------------------------------------------------------------------------- /core/w25q64/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "w25q64" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | esp-idf-hal = "0.42.5" 10 | anyhow = "1.0.79" 11 | nb = "1.1.0" 12 | -------------------------------------------------------------------------------- /app/http/http_server_vue/web/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "skipLibCheck": true, 5 | "module": "ESNext", 6 | "moduleResolution": "bundler", 7 | "allowSyntheticDefaultImports": true 8 | }, 9 | "include": ["vite.config.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /app/basic/light_sensor_control_buzzer/README.md: -------------------------------------------------------------------------------- 1 | # 光敏传感器控制蜂鸣器 2 | 3 | ## 引脚 4 | 5 | ### 蜂鸣器 6 | 7 | - 正极: VCC 8 | - 负极: GND 9 | - I/O: IO4 10 | 11 | ### 光敏传感器 12 | 13 | - 正极: VCC 14 | - 负极: GND 15 | - DO: IO5 16 | 17 | ## 执行指令 18 | 19 | ```shell 20 | cargo run -r -p light_sensor_control_buzzer 21 | ``` 22 | -------------------------------------------------------------------------------- /app/spi/spi_hard_w25q64/README.md: -------------------------------------------------------------------------------- 1 | # 硬件读写 W25Q64 2 | 3 | 注: 这是一个失败的示例。 4 | 5 | ## 引脚 6 | 7 | ### W25Q64 8 | 9 | - VCC: VCC 10 | - GND: GND 11 | - CS(SS): IO4 12 | - SCK(CSLK): IO5 13 | - DO(MOSI): IO6 14 | - DI(MISO): IO7 15 | 16 | ## 执行指令 17 | 18 | ```shell 19 | cargo run -r -p spi_hard_w25q64 20 | ``` 21 | -------------------------------------------------------------------------------- /core/mpu6050/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod conf; 2 | pub mod hal; 3 | pub mod reg; 4 | 5 | /// 加速度和角速度数据 6 | #[derive(Default)] 7 | pub struct AccelGyroData { 8 | pub acc_x: i16, 9 | pub acc_y: i16, 10 | pub acc_z: i16, 11 | pub gyro_x: i16, 12 | pub gyro_y: i16, 13 | pub gyro_z: i16, 14 | } 15 | -------------------------------------------------------------------------------- /app/basic/led_flow_light/README.md: -------------------------------------------------------------------------------- 1 | # LED 流水灯 2 | 3 | 用 LED 实现流水灯的效果。 4 | 这里会使用到循环进行批量操作 LED 灯的状态,因此需要抹平每个引脚的类型,这里将定一个 ErasePinDriver trait 进行动态分发。 5 | 6 | ## 引脚 7 | 8 | ### LED 灯数组 9 | 10 | - 正极: IO4,IO5,IO6... 11 | - 负极: GND 12 | 13 | ## 执行指令 14 | 15 | ```shell 16 | cargo run -r -p led_flow_light 17 | ``` 18 | -------------------------------------------------------------------------------- /app/i2c/i2c_ssd1306/README.md: -------------------------------------------------------------------------------- 1 | # SSD13063 OLED 显示器闪烁黑白颜色 2 | 3 | 通过 I2C 协议控制一个 SSD13063 OLED 显示器,让它闪烁黑白两种颜色。 4 | 5 | 注: 示例来源于官方。 6 | 7 | ## 引脚 8 | 9 | ### OLED 10 | 11 | - 正极: VCC 3.3v 12 | - 负极: GND 13 | - SDA: IO5 14 | - SCL: IO6 15 | 16 | ## 执行指令 17 | 18 | ```shell 19 | cargo run -r -p i2c_ssd1306 20 | ``` 21 | -------------------------------------------------------------------------------- /app/basic/opposing_infrared_sensor_buzzer/README.md: -------------------------------------------------------------------------------- 1 | # 对射式红外传感器控制蜂鸣器 2 | 3 | ## 引脚 4 | 5 | ### 蜂鸣器 6 | 7 | - 正极: VCC 8 | - 负极: GND 9 | - I/O: IO4 10 | 11 | ### 对射式红外传感器 12 | 13 | - 正极: VCC 14 | - 负极: GND 15 | - DO: IO5 16 | 17 | ## 执行指令 18 | 19 | ```shell 20 | cargo run -r -p opposing_infrared_sensor_buzzer 21 | ``` 22 | -------------------------------------------------------------------------------- /app/rmt/rmt_musical_buzzer/README.md: -------------------------------------------------------------------------------- 1 | # 蜂鸣器播放歌曲 2 | 3 | Play a song using a piezo buzzer. 4 | Should play "Ode to Joy" on pin 17. 5 | 6 | 注:这是官方示例。 7 | 8 | ## 引脚 9 | 10 | ### 蜂鸣器 11 | 12 | - 正极: VCC 13 | - 负极: GND 14 | - I/O: IO17 15 | 16 | ## 执行指令 17 | 18 | ```shell 19 | cargo run -r -p rmt_musical_buzzer 20 | ``` 21 | -------------------------------------------------------------------------------- /app/ffi/bindgen_hello/hello/bindings.rs: -------------------------------------------------------------------------------- 1 | /* automatically generated by rust-bindgen 0.66.1 */ 2 | 3 | extern "C" { 4 | pub fn Hello() -> ::core::ffi::c_int; 5 | } 6 | extern "C" { 7 | pub fn Max() -> ::core::ffi::c_int; 8 | } 9 | extern "C" { 10 | pub fn max(num1: ::core::ffi::c_int, num2: ::core::ffi::c_int) -> ::core::ffi::c_int; 11 | } 12 | -------------------------------------------------------------------------------- /app/spi/spi_st7789/README.md: -------------------------------------------------------------------------------- 1 | # ST7789 LCD 显示屏 2 | 3 | 使用 SPI 协议来驱动一个 ST7789 的 LCD 显示屏,并在上面显示一张螃蟹的图片。 4 | 5 | 注: 示例来源于官方。 6 | 注: 这是一个失败的示例, `display-interface-spi` 依赖库下载失败。 7 | 8 | ## 引脚 9 | 10 | - RST GPIO3 11 | - DC GPIO4 12 | - BACKLIGHT GPIO5 13 | - SCLK GPIO6 14 | - SDA GPIO7 15 | 16 | ## 执行指令 17 | 18 | ```shell 19 | cargo run -r -p spi_st7789 20 | ``` 21 | -------------------------------------------------------------------------------- /core/esp32s3-nrf24l01/src/error.rs: -------------------------------------------------------------------------------- 1 | use core::fmt::Debug; 2 | 3 | /// Wraps an SPI error 4 | /// 5 | /// TODO: eliminate this? 6 | #[derive(Debug)] 7 | pub enum Error { 8 | /// Wrap an SPI error 9 | SpiError(SPIE), 10 | } 11 | 12 | impl From for Error { 13 | fn from(e: SPIE) -> Self { 14 | Error::SpiError(e) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/ffi/ffi_hello/README.md: -------------------------------------------------------------------------------- 1 | # FFI Hello 2 | 3 | 这是一个使用 Rust FFI 绑定 C 语言的案例。 4 | 5 | ## 安装 ARM GCC 编译环境 6 | 7 | ```shell 8 | sudo pacman -S arm-none-eabi-gcc arm-none-eabi-newlib 9 | ``` 10 | 11 | ## 编译 12 | 13 | 绑定是动态生成。 14 | 15 | ```shell 16 | cargo build --package ffi_hello 17 | ``` 18 | 19 | ## 测试 20 | 21 | ```shell 22 | cargo test --target thumbv7m-none-eabi -p ffi_hello 23 | ``` 24 | -------------------------------------------------------------------------------- /app/http/http_server_vue/web/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /app/http/http_ureq_client/README.md: -------------------------------------------------------------------------------- 1 | # Ureq HTTP 客户端 2 | 3 | 这是一个使用 reqwest 库实现网络请求。 4 | 5 | 这是一个失败的示例。 6 | 7 | ```text 8 | Error: http://neverssl.com/: Network Error: Protocol not available (os error 109) 9 | 10 | Caused by: 11 | Protocol not available (os error 109) 12 | ``` 13 | 14 | 注意: 不支持 HTTPS 协议。 15 | 16 | ## 执行指令 17 | 18 | ```shell 19 | cargo run -r -p http_ureq_client 20 | ``` 21 | -------------------------------------------------------------------------------- /app/interrupt/key_isr3/README.md: -------------------------------------------------------------------------------- 1 | # 按键中断计次 3 2 | 3 | 安装 GPIO 驱动程序的 ETS_GPIO_INTR_SOURCE ISR 处理程序服务,该服务允许每个引脚 GPIO 中断处理程序。 4 | 5 | 该函数与 gpio_isr_register() 不兼容 - 如果使用该函数,将为所有 GPIO 中断注册一个全局 ISR 。如果使用此函数,ISR 服务将提供全局 GPIO ISR,并且通过 gpio_isr_handler_add() 函数注册各个引脚处理程序。 6 | 7 | ## 引脚 8 | 9 | ### 按钮 10 | 11 | - 一端: GND 12 | - 一端: IO5 13 | 14 | ## 执行指令 15 | 16 | ```shell 17 | cargo run -r -p key_isr3 18 | ``` 19 | -------------------------------------------------------------------------------- /core/wifi/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "wifi" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | esp-idf-svc = "0.47.3" 10 | anyhow = "1.0.79" 11 | log = "0.4.20" 12 | 13 | 14 | [dev-dependencies] 15 | toml-cfg = "0.1.3" 16 | 17 | 18 | [build-dependencies] 19 | embuild = "=0.31.4" 20 | -------------------------------------------------------------------------------- /app/spi/spi_nrf24l01/README.md: -------------------------------------------------------------------------------- 1 | # NRF24L01 2 | 3 | 这是一个使用 NRF24L01 SPI 2.4 GHz 无线通信的示例。 4 | 5 | 注意:这是一个失败的示例,NRF24L01 配对失败。 6 | 7 | ## 引脚 8 | 9 | ### NRF24L01 10 | 11 | - VCC: VCC 12 | - GND: GND 13 | - CSN: IO8 14 | - CE: IO7 15 | - MOSI: IO6 16 | - SCLK: IO4 17 | - MISO: IO5 18 | 19 | ## 执行指令 20 | 21 | ```shell 22 | cargo run -r -p spi_nrf24l01 23 | ``` 24 | 25 | ## 接线图 26 | 27 | ![](../../../images/NRF24L01引脚图.jpg) 28 | -------------------------------------------------------------------------------- /docs/partitions/partitions-16MB-no-uf2.csv: -------------------------------------------------------------------------------- 1 | # ESP-IDF Partition Table 2 | # Name, Type, SubType, Offset, Size, Flags 3 | # bootloader.bin,, 0x1000, 32K 4 | # partition table,, 0x8000, 4K 5 | nvs, data, nvs, 0x9000, 20K, 6 | otadata, data, ota, 0xe000, 8K, 7 | ota_0, 0, ota_0, 0x10000, 2048K, 8 | ota_1, 0, ota_1, 0x210000, 2048K, 9 | user_fs, data, fat, 0x410000, 12224K, 10 | -------------------------------------------------------------------------------- /.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | target = "xtensa-esp32s3-espidf" 3 | # 加快编译速度 +nightly 4 | rustflags = ["-Z", "threads=8"] 5 | 6 | [target.xtensa-esp32s3-espidf] 7 | linker = "ldproxy" 8 | runner = "sudo espflash flash --monitor" 9 | rustflags = [ 10 | "--cfg", 11 | "espidf_time64", 12 | ] # Extending time_t for ESP IDF 5: https://github.com/esp-rs/rust/issues/110 13 | 14 | [unstable] 15 | build-std = ["std", "panic_abort"] 16 | -------------------------------------------------------------------------------- /.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "linux-gcc-x64", 5 | "includePath": [ 6 | "${workspaceFolder}/**" 7 | ], 8 | "compilerPath": "/usr/bin/gcc", 9 | "cStandard": "${default}", 10 | "cppStandard": "${default}", 11 | "intelliSenseMode": "linux-gcc-x64", 12 | "compilerArgs": [ 13 | "" 14 | ] 15 | } 16 | ], 17 | "version": 4 18 | } -------------------------------------------------------------------------------- /app/interrupt/timer_external_clock/README.md: -------------------------------------------------------------------------------- 1 | # 定时器外部时钟 2 | 3 | 外部 32 kHz 晶振 - 可选 (XTAL32K) 4 | 5 | XTAL32K_CLK 的时钟源可以是连接到 XTAL_32K_P 和 XTAL_32K_N 管脚的 32 kHz 晶振,也可以是外部电路生成的 32 kHZ 时钟信号。如果使用外部电路生成的时钟信号,该信号必须连接到 XTAL_32K_P 管脚。 6 | 7 | 注意:这是一个失败的示例 8 | 9 | ## 引脚 10 | 11 | ### 外部时钟源 12 | 13 | - 信号: IO15 14 | 15 | ### 按钮 16 | 17 | - 一端: GND 18 | - 一端: IO5 19 | 20 | ## 执行指令 21 | 22 | ```shell 23 | cargo run -r -p timer_external_clock 24 | ``` 25 | -------------------------------------------------------------------------------- /core/esp32s3-nrf24l01/src/setup.rs: -------------------------------------------------------------------------------- 1 | //! Setup parameters for SPI 2 | use esp_idf_hal::spi::config::{Mode, Phase, Polarity}; 3 | 4 | /// SPI setup parameters 5 | pub fn spi_mode() -> Mode { 6 | Mode { 7 | polarity: Polarity::IdleLow, 8 | phase: Phase::CaptureOnFirstTransition, 9 | } 10 | } 11 | 12 | /// Recommended SPI clock speed 13 | /// 14 | /// Use as rough guidance. 15 | pub fn clock_mhz() -> u32 { 16 | 8 17 | } 18 | -------------------------------------------------------------------------------- /app/http/http_server_vue/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite + Vue + TS 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /core/esp32s3-mpu6050/.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: cargo 4 | directory: "/" 5 | schedule: 6 | interval: daily 7 | open-pull-requests-limit: 10 8 | ignore: 9 | - dependency-name: nalgebra 10 | versions: 11 | - 0.24.0 12 | - 0.24.1 13 | - 0.25.0 14 | - 0.25.1 15 | - 0.25.3 16 | - 0.25.4 17 | - 0.26.1 18 | - dependency-name: linux-embedded-hal 19 | versions: 20 | - 0.3.0 21 | -------------------------------------------------------------------------------- /docs/partitions/partitions-16MB.csv: -------------------------------------------------------------------------------- 1 | # ESP-IDF Partition Table 2 | # Name, Type, SubType, Offset, Size, Flags 3 | # bootloader.bin,, 0x1000, 32K 4 | # partition table,, 0x8000, 4K 5 | nvs, data, nvs, 0x9000, 20K, 6 | otadata, data, ota, 0xe000, 8K, 7 | ota_0, 0, ota_0, 0x10000, 2048K, 8 | ota_1, 0, ota_1, 0x210000, 2048K, 9 | uf2, app, factory,0x410000, 256K, 10 | user_fs, data, fat, 0x450000, 11968K, 11 | -------------------------------------------------------------------------------- /app/interrupt/opposing_infrared_sensor_count/README.md: -------------------------------------------------------------------------------- 1 | # 对射式红外传感器中断计次 2 | 3 | 安装 GPIO 驱动程序的 ETS_GPIO_INTR_SOURCE ISR 处理程序服务,该服务允许每个引脚 GPIO 中断处理程序。 4 | 5 | 该函数与 gpio_isr_register() 不兼容 - 如果使用该函数,将为所有 GPIO 中断注册一个全局 ISR 。如果使用此函数,ISR 服务将提供全局 GPIO ISR,并且通过 gpio_isr_handler_add() 函数注册各个引脚处理程序。 6 | 7 | ## 引脚 8 | 9 | ### 对射式红外传感器 10 | 11 | - 正极: VCC 12 | - 负极: GND 13 | - D0: IO5 14 | 15 | ## 执行指令 16 | 17 | ```shell 18 | cargo run -r -p opposing_infrared_sensor_count 19 | ``` 20 | -------------------------------------------------------------------------------- /app/http/http_server_vue/web/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vue-tsc && vite build", 9 | "preview": "vite preview" 10 | }, 11 | "dependencies": { 12 | "vue": "^3.3.11" 13 | }, 14 | "devDependencies": { 15 | "@vitejs/plugin-vue": "^4.5.2", 16 | "typescript": "^5.2.2", 17 | "vite": "^5.0.8", 18 | "vue-tsc": "^1.8.25" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/adc/potentiometer_reading_voltage/README.md: -------------------------------------------------------------------------------- 1 | # 电位器读取电压 2 | 3 | 电位器是一种可以调节电阻值的电子元件,它通常有三个引脚,分别是两个固定引脚和一个滑动引脚。固定引脚是电阻体的两端,滑动引脚是电刷,它可以在电阻体上移动,改变输出电压或电阻值。电位器既可以作为三端元件,也可以作为二端元件使用。 4 | 5 | ## 引脚 6 | 7 | ### 电位器 8 | 9 | 注:定位点为左下角。 10 | 11 | - 端子 1(A):电阻体的一端,通常接外加电压的正极或信号输入端。 12 | - 端子 2(B):电阻体的另一端,通常接外加电压的负极或信号输出端。 13 | - 滑动引脚(W):电刷,可以在电阻体上滑动,输出与滑动位置成一定关系的电压或电阻值。 14 | 15 | ## 图示 16 | 17 | ![](../../../images/电位器引脚配置.jpg) 18 | 19 | ## 执行指令 20 | 21 | ```shell 22 | cargo run -r -p potentiometer_reading_voltage 23 | ``` 24 | -------------------------------------------------------------------------------- /app/http/http_server_vue/web/src/assets/vue.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/i2c/i2c_master_slave/README.md: -------------------------------------------------------------------------------- 1 | # 主机和从机之间的 I2C 通信 2 | 3 | 这个程序是用来测试同一个设备上的主机和从机之间的 I2C 通信的。 4 | 这里提醒用户,ESP32-C2/C3 没有两个 I2C 外设,所以这个例子不适用。 5 | 6 | 程序由三个部分组成: 7 | 8 | - 第一部分是简单的主机写入,主机写入 8 个字节,并打印出从机接收到的内容。 9 | - 第二部分是简单的主机读取,主机读取 8 个字节,并打印出来。 10 | - 第三部分是读写寄存器,向一个寄存器地址写入一个值,并读取回来。 11 | 12 | 注: 示例来源于官方。 13 | 14 | ## 引脚 15 | 16 | ### ESP32-S3 17 | 18 | - GPIO20 to GPIO18: GPIO20 连接到 GPIO18 19 | - GPIO21 to GPIO19: GPIO21 连接到 GPIO19 20 | 21 | ## 执行指令 22 | 23 | ```shell 24 | cargo run -r -p i2c_master_slave 25 | ``` 26 | -------------------------------------------------------------------------------- /app/ledc/pwm_driven_motor/README.md: -------------------------------------------------------------------------------- 1 | # PWM 驱动直流电机 2 | 3 | ## 引脚 4 | 5 | ### 按钮 6 | 7 | - 一端: GND 8 | - 一端: IO4 9 | 10 | ### 电机驱动 TB6612FNG 11 | 12 | - PWMA: IO5 13 | - AN1: IO6 14 | - AN2: IO7 15 | - STBY: VCC 16 | - VM: VCC 5V 17 | - VCC: VCC 18 | - GND: GND 19 | - AO1: 电机正极 20 | - AO2: 电机负极 21 | 22 | ### 电机 23 | 24 | - 正极: TB6612FNG-AO1 25 | - 负极: TB6612FNG-AO2 26 | 27 | ## 图示 28 | 29 | ![](./../../../images/PWM驱动直流电机引脚配置.jpg) 30 | 31 | ## 执行指令 32 | 33 | ```shell 34 | cargo run -r -p pwm_driven_motor 35 | ``` 36 | -------------------------------------------------------------------------------- /app/basic/hello_world/src/main.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::empty_loop)] 2 | 3 | fn main() { 4 | // It is necessary to call this function once. Otherwise some patches to the runtime 5 | // implemented by esp-idf-sys might not link properly. See https://github.com/esp-rs/esp-idf-template/issues/71 6 | esp_idf_svc::sys::link_patches(); 7 | 8 | // Bind the log crate to the ESP Logging facilities 9 | esp_idf_svc::log::EspLogger::initialize_default(); 10 | 11 | log::info!("Hello, world!"); 12 | loop {} 13 | } 14 | -------------------------------------------------------------------------------- /app/wdg/sdkconfig_disable_wdg/src/main.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::empty_loop)] 2 | 3 | fn main() { 4 | // It is necessary to call this function once. Otherwise some patches to the runtime 5 | // implemented by esp-idf-sys might not link properly. See https://github.com/esp-rs/esp-idf-template/issues/71 6 | esp_idf_svc::sys::link_patches(); 7 | 8 | // Bind the log crate to the ESP Logging facilities 9 | esp_idf_svc::log::EspLogger::initialize_default(); 10 | 11 | log::info!("Hello, world!"); 12 | loop {} 13 | } 14 | -------------------------------------------------------------------------------- /app/ffi/bindgen_hello/README.md: -------------------------------------------------------------------------------- 1 | # Bindgen Hello 2 | 3 | 这是一个使用 Rust 工具自动绑定 C 语言的案例。 4 | 5 | 注:暂不支持 6 | 7 | ## 安装 ARM GCC 编译环境 8 | 9 | ```shell 10 | sudo pacman -S arm-none-eabi-gcc arm-none-eabi-newlib 11 | ``` 12 | 13 | ## 编译 14 | 15 | 绑定是动态生成。 16 | 17 | ```shell 18 | cargo build --target thumbv7m-none-eabi --package bindgen_hello 19 | ``` 20 | 21 | ## lib 测试 22 | 23 | ```shell 24 | cargo test --target thumbv7m-none-eabi -p bindgen_hello 25 | ``` 26 | 27 | ## 指定测试 28 | 29 | ```shell 30 | cargo test --target thumbv7m-none-eabi --package bindgen_hello --test hello_demo 31 | ``` 32 | -------------------------------------------------------------------------------- /app/ledc/ledc_simple/README.md: -------------------------------------------------------------------------------- 1 | # LEDC 简单示例 2 | 3 | LEDC 是 LED 控制器的缩写,它是 ESP32-S3 的一个外设,主要用于控制 LED 的亮度,也可以用于生成 PWM 信号用于其他用途。它有 8 个通道,可以生成独立的波形,例如用于驱动 RGB LED 设备。PWM 控制器可以自动增加或减少占空比,实现无需处理器干预的渐变效果。 4 | 5 | 它没有单独的 PWM 模块,因为 LEDC 模块已经提供了 PWM 的功能。 6 | 7 | 要使用 LEDC,您需要进行以下几个步骤: 8 | 9 | - 定时器配置,指定 PWM 信号的频率和占空比分辨率。 10 | - 通道配置,将其与定时器和 GPIO 管脚关联,输出 PWM 信号。 11 | - 改变 PWM 信号,改变输出的占空比,从而改变 LED 的亮度。这可以完全由软件控制,也可以使用硬件渐变功能。 12 | 13 | 注: 示例来源于官方。 14 | 15 | ## 引脚 16 | 17 | ### LED 灯 18 | 19 | - 正极: IO5 20 | - 负极: GND 21 | 22 | ## 执行指令 23 | 24 | ```shell 25 | cargo run -r -p ledc_simple 26 | ``` 27 | -------------------------------------------------------------------------------- /app/ffi/ffi_hello/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | cc::Build::new() 3 | // 编译单个文件 4 | // .file("hello/hello.c") 5 | // 正则匹配多个编译文件 6 | .files(glob::glob("hello/*.c").unwrap().filter_map(Result::ok)) 7 | // 将多个目录添加到包含路径。-I 8 | .includes(&["hello"]) 9 | // 配置所有对象文件和静态文件的输出目录 10 | // .out_dir("out_dir") 11 | // 设置编译目标, 默认会自动从环境中抓取 TARGET 变量 12 | // .target("thumbv7m-none-eabi") 13 | // 定义是否应为货物发出元数据,使其能够 自动链接二进制文件。 14 | .cargo_metadata(true) 15 | // 运行编译器,生成output文件 16 | .compile("hello"); 17 | } 18 | -------------------------------------------------------------------------------- /app/ffi/bindgen_hello/tests/hello_demo.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | #![no_main] 3 | 4 | use bindgen_hello::max; 5 | use bindgen_hello::Hello; 6 | 7 | use defmt_rtt as _; 8 | use panic_probe as _; 9 | 10 | use stm32f1xx_hal as _; 11 | 12 | #[cfg(test)] 13 | #[defmt_test::tests] 14 | mod unit_tests { 15 | use super::*; 16 | 17 | use defmt::assert; 18 | use defmt::assert_eq; 19 | 20 | #[test] 21 | fn it_works() { 22 | assert!(true) 23 | } 24 | 25 | #[test] 26 | fn it_hello() { 27 | assert_eq!(unsafe { Hello() }, 42) 28 | } 29 | 30 | #[test] 31 | fn it_max() { 32 | assert_eq!(unsafe { max(10, 20) }, 20) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /cfg.toml: -------------------------------------------------------------------------------- 1 | [esp32-s3-std-tutorial] 2 | wifi_ssid = "Silent Rain" 3 | wifi_psk = "pass" 4 | 5 | [wifi_check] 6 | wifi_ssid = "Silent Rain" 7 | wifi_psk = "asdfghjkl123" 8 | 9 | [http_client] 10 | wifi_ssid = "Silent Rain" 11 | wifi_psk = "asdfghjkl123" 12 | 13 | [https_client] 14 | wifi_ssid = "Silent Rain" 15 | wifi_psk = "asdfghjkl123" 16 | 17 | [http_ureq_client] 18 | wifi_ssid = "Silent Rain" 19 | wifi_psk = "asdfghjkl123" 20 | 21 | 22 | [http_server] 23 | wifi_ssid = "Silent Rain" 24 | wifi_psk = "asdfghjkl123" 25 | 26 | [http_server_shtcx] 27 | wifi_ssid = "Silent Rain" 28 | wifi_psk = "asdfghjkl123" 29 | 30 | [http_server_vue] 31 | wifi_ssid = "Silent Rain" 32 | wifi_psk = "asdfghjkl123" 33 | 34 | -------------------------------------------------------------------------------- /app/ffi/ffi_hello/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ffi_hello" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [lib] 7 | harness = false 8 | 9 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 10 | [dependencies] 11 | cortex-m = {version = "0.7.7", features = ["critical-section-single-core"]} 12 | cortex-m-rt = "0.7.3" 13 | stm32f1xx-hal = {version = "0.10.0", features = ["rt", "stm32f103", "medium"]} 14 | defmt = "0.3" 15 | defmt-rtt = "0.4.0" 16 | panic-probe = {version = "0.3.1", features = ["print-defmt"]} 17 | 18 | [dev-dependencies] 19 | defmt-test = "0.3.0" 20 | 21 | [build-dependencies] 22 | bindgen = "0.66.1" 23 | cc = "1.0.83" 24 | glob = "0.3.1" 25 | -------------------------------------------------------------------------------- /app/basic/button_async/src/main.rs: -------------------------------------------------------------------------------- 1 | use esp_idf_svc::{ 2 | hal::{gpio::*, peripherals::Peripherals, task::block_on}, 3 | sys::link_patches, 4 | }; 5 | 6 | fn main() -> anyhow::Result<()> { 7 | link_patches(); 8 | 9 | let peripherals = Peripherals::take()?; 10 | 11 | let mut button = PinDriver::input(peripherals.pins.gpio4)?; 12 | 13 | let mut led = PinDriver::output(peripherals.pins.gpio5)?; 14 | 15 | button.set_pull(Pull::Up)?; 16 | 17 | block_on(async { 18 | loop { 19 | button.wait_for_high().await?; 20 | 21 | led.set_high()?; 22 | 23 | button.wait_for_low().await?; 24 | 25 | led.set_low()?; 26 | } 27 | }) 28 | } 29 | -------------------------------------------------------------------------------- /app/ffi/ffi_hello/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | #![no_main] 3 | 4 | use defmt_rtt as _; 5 | use panic_probe as _; 6 | 7 | use stm32f1xx_hal as _; 8 | 9 | #[allow(unused)] 10 | extern "C" { 11 | #[link_name = "Hello"] 12 | pub fn hello() -> i32; 13 | pub fn max(num1: i32, num2: i32) -> i32; 14 | } 15 | 16 | #[cfg(test)] 17 | #[defmt_test::tests] 18 | mod unit_tests { 19 | use super::*; 20 | 21 | use defmt::assert; 22 | 23 | #[test] 24 | fn it_works() { 25 | assert!(true) 26 | } 27 | 28 | #[test] 29 | fn it_hello() { 30 | assert_eq!(unsafe { hello() }, 42) 31 | } 32 | 33 | #[test] 34 | fn it_max() { 35 | assert_eq!(unsafe { max(10, 20) }, 20) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/basic/log_level/src/main.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::empty_loop)] 2 | 3 | fn main() { 4 | // It is necessary to call this function once. Otherwise some patches to the runtime 5 | // implemented by esp-idf-sys might not link properly. See https://github.com/esp-rs/esp-idf-template/issues/71 6 | esp_idf_svc::sys::link_patches(); 7 | 8 | // Bind the log crate to the ESP Logging facilities 9 | esp_idf_svc::log::EspLogger::initialize_default(); 10 | 11 | // 设置日志级别 12 | log::set_max_level(log::LevelFilter::Warn); 13 | 14 | log::trace!("this is trace!"); 15 | log::debug!("this is debug!"); 16 | log::info!("this is info!"); 17 | log::warn!("this is warn!"); 18 | log::error!("this is error!"); 19 | loop {} 20 | } 21 | -------------------------------------------------------------------------------- /app/basic/button_toggle/src/main.rs: -------------------------------------------------------------------------------- 1 | use esp_idf_svc::{ 2 | hal::{delay::FreeRtos, gpio::*, peripherals::Peripherals}, 3 | sys::link_patches, 4 | }; 5 | 6 | fn main() -> anyhow::Result<()> { 7 | link_patches(); 8 | 9 | let peripherals = Peripherals::take()?; 10 | 11 | let mut button = PinDriver::input(peripherals.pins.gpio4)?; 12 | 13 | let mut led = PinDriver::output(peripherals.pins.gpio5)?; 14 | 15 | button.set_pull(Pull::Up)?; 16 | 17 | log::info!("loop"); 18 | loop { 19 | // we are using thread::sleep here to make sure the watchdog isn't triggered 20 | FreeRtos::delay_ms(10); 21 | 22 | if button.is_high() { 23 | log::info!("is_high"); 24 | led.toggle()?; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /core/esp32s3-mpu6050/.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | jobs: 3 | 1dot64: 4 | docker: 5 | - image: cimg/rust:1.64.0 6 | steps: 7 | - checkout 8 | - run: 9 | name: build and test 10 | command: cargo build 11 | 1dot63: 12 | docker: 13 | - image: cimg/rust:1.63.0 14 | steps: 15 | - checkout 16 | - run: 17 | name: build and test 18 | command: cargo build 19 | 1dot62: 20 | docker: 21 | - image: cimg/rust:1.62.0 22 | steps: 23 | - checkout 24 | - run: 25 | name: build and test 26 | command: cargo build 27 | 28 | workflows: 29 | version: 2 30 | build_and_test: 31 | jobs: 32 | - 1dot64 33 | - 1dot63 34 | - 1dot62 35 | 36 | -------------------------------------------------------------------------------- /app/http/http_server_vue/web/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2020", 4 | "useDefineForClassFields": true, 5 | "module": "ESNext", 6 | "lib": ["ES2020", "DOM", "DOM.Iterable"], 7 | "skipLibCheck": true, 8 | 9 | /* Bundler mode */ 10 | "moduleResolution": "bundler", 11 | "allowImportingTsExtensions": true, 12 | "resolveJsonModule": true, 13 | "isolatedModules": true, 14 | "noEmit": true, 15 | "jsx": "preserve", 16 | 17 | /* Linting */ 18 | "strict": true, 19 | "noUnusedLocals": true, 20 | "noUnusedParameters": true, 21 | "noFallthroughCasesInSwitch": true 22 | }, 23 | "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"], 24 | "references": [{ "path": "./tsconfig.node.json" }] 25 | } 26 | -------------------------------------------------------------------------------- /app/adc/adc/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/ffi/bindgen_hello/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "bindgen_hello" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [lib] 7 | harness = false 8 | 9 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 10 | [dependencies] 11 | cortex-m = {version = "0.7.7", features = ["critical-section-single-core"]} 12 | cortex-m-rt = "0.7.3" 13 | stm32f1xx-hal = {version = "0.10.0", features = ["rt", "stm32f103", "medium"]} 14 | defmt = "0.3" 15 | defmt-rtt = "0.4.0" 16 | panic-probe = {version = "0.3.1", features = ["print-defmt"]} 17 | 18 | [dev-dependencies] 19 | defmt-test = "0.3.0" 20 | 21 | [build-dependencies] 22 | bindgen = "0.66.1" 23 | cc = "1.0.83" 24 | glob = "0.3.1" 25 | 26 | [[test]] 27 | name = "hello_demo" 28 | path = "tests/hello_demo.rs" 29 | harness = false 30 | -------------------------------------------------------------------------------- /diagram.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "editor": "wokwi", 4 | "author": "silent-rain <2367221387@qq.com>", 5 | "parts": [ 6 | { 7 | "type": "board-esp32-s3-devkitc-1", 8 | "id": "esp", 9 | "top": 0.59, 10 | "left": 0.67, 11 | "attrs": { 12 | "flashSize": "16" 13 | } 14 | } 15 | ], 16 | "connections": [ 17 | [ 18 | "esp:TX", 19 | "$serialMonitor:RX", 20 | "", 21 | [] 22 | ], 23 | [ 24 | "esp:RX", 25 | "$serialMonitor:TX", 26 | "", 27 | [] 28 | ] 29 | ], 30 | "serialMonitor": { 31 | "display": "terminal", 32 | "convertEol": true 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/basic/blinky/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/basic/button/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/basic/button/src/main.rs: -------------------------------------------------------------------------------- 1 | use esp_idf_svc::{ 2 | hal::{delay::FreeRtos, gpio::*, peripherals::Peripherals}, 3 | sys::link_patches, 4 | }; 5 | 6 | fn main() -> anyhow::Result<()> { 7 | link_patches(); 8 | 9 | let peripherals = Peripherals::take()?; 10 | 11 | let mut button = PinDriver::input(peripherals.pins.gpio4)?; 12 | 13 | let mut led = PinDriver::output(peripherals.pins.gpio5)?; 14 | 15 | button.set_pull(Pull::Up)?; 16 | 17 | log::info!("loop"); 18 | loop { 19 | // we are using thread::sleep here to make sure the watchdog isn't triggered 20 | FreeRtos::delay_ms(10); 21 | if button.is_high() { 22 | log::info!("is_high"); 23 | led.set_low()?; 24 | } else { 25 | led.set_high()?; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/basic/buzzer/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/uart/uart_fmt/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/uart/uart_isr/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/adc/adc_oneshot/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/basic/button_async/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/basic/hello_world/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/basic/log_level/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/i2c/i2c_ssd1306/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/interrupt/key_isr1/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/interrupt/key_isr2/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/interrupt/key_isr3/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/interrupt/rtc_gpio/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/interrupt/rtc_isr/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/ledc/ledc_simple/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/ledc/ledc_threads/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/rmt/rmt_morse_code/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/spi/spi_loopback/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/spi/spi_st7789/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/uart/uart_loopback/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/adc/ad_multichannel/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/basic/button_toggle/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/basic/led_flow_light/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/basic/oled_show_str/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/delay/async_timer_delay/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/delay/freertos_delay/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/encoder/rotary_encoder/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/i2c/i2c_hard_mpu6050/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/i2c/i2c_master_slave/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/i2c/i2c_mpu6050_crate/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/i2c/i2c_soft_mpu6050/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/interrupt/button_isr/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/interrupt/timer_notify/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/ledc/pwm_driven_motor/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/ledc/pwm_driven_servo/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/rmt/rmt_musical_buzzer/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/rmt/rmt_transceiver/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/spi/spi_hard_w25q64/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/spi/spi_loopback_async/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/spi/spi_soft_w25q64/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/uart/uart_reconfigure/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/wdg/code_disable_wdg/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/dma/print_memory_address/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/encoder/rotary_encoder_speed/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/hardware/hardware_rgb_led/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/http/http_client/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | // let app_config = CONFIG; 17 | // if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | // panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | // } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/http/http_server/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | // let app_config = CONFIG; 17 | // if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | // panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | // } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/http/wifi_check/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | // let app_config = CONFIG; 17 | // if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | // panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | // } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/interrupt/timer_alarm_isr/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/uart/uart_loopback_async/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/wdg/sdkconfig_disable_wdg/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/adc/joystick_potentiometer_3d/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/adc/potentiometer_reading_voltage/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/basic/light_sensor_control_buzzer/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/hardware/hardware_memory_size/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/http/http_server_vue/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | // let app_config = CONFIG; 17 | // if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | // panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | // } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/http/http_ureq_client/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | // let app_config = CONFIG; 17 | // if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | // panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | // } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/http/https_client/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | // let app_config = CONFIG; 17 | // if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | // panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | // } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/interrupt/rotary_encoder_count/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/interrupt/timer_external_clock/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/uart/uart_continuous_tx_and_rx/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/basic/opposing_infrared_sensor_buzzer/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/hardware/hardware_multiple_rgb_led/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/http/http_server_shtcx/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | // let app_config = CONFIG; 17 | // if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | // panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | // } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/interrupt/opposing_infrared_sensor_count/build.rs: -------------------------------------------------------------------------------- 1 | #[toml_cfg::toml_config] 2 | pub struct Config { 3 | #[default("")] 4 | wifi_ssid: &'static str, 5 | #[default("")] 6 | wifi_psk: &'static str, 7 | } 8 | 9 | fn main() { 10 | // Check if the `cfg.toml` file exists and has been filled out. 11 | if !std::path::Path::new("cfg.toml").exists() { 12 | panic!("You need to create a `cfg.toml` file with your Wi-Fi credentials! Use `cfg.toml.example` as a template."); 13 | } 14 | 15 | // The constant `CONFIG` is auto-generated by `toml_config`. 16 | let app_config = CONFIG; 17 | if app_config.wifi_ssid == "FBI Surveillance Van" || app_config.wifi_psk == "hunter2" { 18 | panic!("You need to set the Wi-Fi credentials in `cfg.toml`!"); 19 | } 20 | 21 | embuild::espidf::sysenv::output(); 22 | } 23 | -------------------------------------------------------------------------------- /app/spi/spi_loopback_async/README.md: -------------------------------------------------------------------------------- 1 | # SPI 异步回环测试 2 | 3 | 注: 示例来源于官方。 4 | 注: 这是一个失败的示例,SDK 配置没有生效。 5 | 6 | ## 配置 SDK 7 | 8 | ```text 9 | # SPI Configuration 10 | # 11 | # CONFIG_SPI_MASTER_IN_IRAM is not set 12 | CONFIG_SPI_MASTER_ISR_IN_IRAM=y 13 | # CONFIG_SPI_SLAVE_IN_IRAM is not set 14 | CONFIG_SPI_SLAVE_ISR_IN_IRAM=y 15 | # end of SPI Configuration 16 | 17 | # ============= 调整为以下配置 ============= 18 | 19 | # SPI Configuration 20 | # 21 | # CONFIG_SPI_MASTER_IN_IRAM is not set 22 | # CONFIG_SPI_MASTER_ISR_IN_IRAM is not set 23 | # CONFIG_SPI_SLAVE_IN_IRAM is not set 24 | # CONFIG_SPI_SLAVE_ISR_IN_IRAM is not set 25 | # end of SPI Configuration 26 | ``` 27 | 28 | ## 引脚 29 | 30 | - SCLK GPIO6 31 | - SDI GPIO2 32 | - SDO GPIO7 33 | - CS_1 GPIO10 34 | - CS_2 GPIO3 35 | - 连接 SDI 和 SDO 引脚 36 | 37 | ## 执行指令 38 | 39 | ```shell 40 | cargo run -r -p spi_loopback_async 41 | ``` 42 | -------------------------------------------------------------------------------- /app/delay/freertos_delay/src/main.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::empty_loop)] 2 | 3 | use esp_idf_svc::{ 4 | hal::{delay::FreeRtos, peripherals::Peripherals}, 5 | log::EspLogger, 6 | sys::link_patches, 7 | }; 8 | 9 | fn main() -> anyhow::Result<()> { 10 | // It is necessary to call this function once. Otherwise some patches to the runtime 11 | // implemented by esp-idf-sys might not link properly. See https://github.com/esp-rs/esp-idf-template/issues/71 12 | link_patches(); 13 | 14 | // Bind the log crate to the ESP Logging facilities 15 | EspLogger::initialize_default(); 16 | 17 | // 设置日志级别 18 | log::set_max_level(log::LevelFilter::Info); 19 | 20 | // Get the peripherals 21 | let _peripherals = Peripherals::take()?; 22 | 23 | log::warn!("loop"); 24 | loop { 25 | FreeRtos::delay_ms(1000); 26 | log::warn!("delay_ms"); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/wdg/sdkconfig_disable_wdg/README.md: -------------------------------------------------------------------------------- 1 | # SDK 配置禁用开门狗 2 | 3 | - 注意: SDK 中禁用开门狗后将不会生成对应的代码 4 | 5 | ## 执行指令 6 | 7 | ```shell 8 | cargo run -p sdkconfig_disable_wdg 9 | ``` 10 | 11 | ## 启用开门狗配置或 TUI 中进行配置 12 | 13 | ```text 14 | CONFIG_ESP_INT_WDT=y 15 | CONFIG_ESP_INT_WDT_TIMEOUT_MS=300 16 | CONFIG_ESP_INT_WDT_CHECK_CPU1=y 17 | CONFIG_ESP_TASK_WDT_EN=y 18 | CONFIG_ESP_TASK_WDT_INIT=y 19 | # CONFIG_ESP_TASK_WDT_PANIC is not set 20 | CONFIG_ESP_TASK_WDT_TIMEOUT_S=5 21 | CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y 22 | CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y 23 | # CONFIG_ESP_INT_WDT is not set 24 | # CONFIG_ESP_TASK_WDT_EN is not set 25 | 26 | CONFIG_INT_WDT=n 27 | CONFIG_INT_WDT_TIMEOUT_MS=300 28 | CONFIG_INT_WDT_CHECK_CPU1=y 29 | CONFIG_TASK_WDT=y 30 | CONFIG_ESP_TASK_WDT=n 31 | # CONFIG_TASK_WDT_PANIC is not set 32 | CONFIG_TASK_WDT_TIMEOUT_S=5 33 | CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y 34 | CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y 35 | # CONFIG_INT_WDT is not set 36 | ``` 37 | -------------------------------------------------------------------------------- /core/esp32s3-mpu6050/examples/motion_detection.rs: -------------------------------------------------------------------------------- 1 | use mpu6050::{*, device::MOT_DETECT_STATUS}; 2 | use linux_embedded_hal::{I2cdev, Delay}; 3 | use i2cdev::linux::LinuxI2CError; 4 | use embedded_hal::blocking::delay::DelayMs; 5 | 6 | fn main() -> Result<(), Mpu6050Error> { 7 | let i2c = I2cdev::new("/dev/i2c-1") 8 | .map_err(Mpu6050Error::I2c)?; 9 | 10 | let mut delay = Delay; 11 | let mut mpu = Mpu6050::new(i2c); 12 | 13 | mpu.init(&mut delay)?; 14 | mpu.setup_motion_detection()?; 15 | 16 | let mut count: u8 = 0; 17 | 18 | loop { 19 | if mpu.get_motion_detected()? { 20 | println!("YEAH BUDDY. Motion by axes: {:b}", mpu.read_byte(MOT_DETECT_STATUS::ADDR)?); 21 | count += 1; 22 | } 23 | 24 | delay.delay_ms(10u8); 25 | 26 | if count > 5 { 27 | mpu.reset_device(&mut delay)?; 28 | break; 29 | } 30 | } 31 | 32 | Ok(()) 33 | } 34 | -------------------------------------------------------------------------------- /app/ledc/pwm_driven_servo/README.md: -------------------------------------------------------------------------------- 1 | # PWM 驱动舵机 2 | 3 | 这是一个使用 PWM 驱动舵机的示例。主要展示控制舵机旋转角度,以及旋转角度计算。 4 | 5 | 舵机的控制一般需要一个 20Ms 左右的时基脉冲,该脉冲的高电平部分一般为 0.5Ms~2.5Ms 范围内的角度控制脉冲部分,总间隔为 2Ms。 6 | 7 | 注: 这是一个失败的示例。 8 | 9 | ## 公式介绍 10 | 11 | - PWM 信号的总周期和频率之间的关系,T 是总周期,f 是频率 12 | 13 | ```text 14 | T=1/f 15 | ``` 16 | 17 | - 如果您想要设置总周期为 20ms,那么您需要设置频率为 50Hz: 18 | 19 | ```text 20 | f=1/T=1s/0.02s=50Hz 21 | ``` 22 | 23 | - 以 180° 舵机为例,对应的控制关系如下: 24 | 25 | ```text 26 | 1.5ms 0° (1.5ms / 20ms) * 1024 ≈ 51.2 27 | 2ms 45° (2ms / 20ms) * 1024 ≈ 102.4 28 | 2.5ms 90° (2.5ms / 20ms) * 1024 ≈ 128 29 | 30 | let duty = ((angle as f32 * (102.0 - 51.0) / 180.0) + 51.0) as u32; 31 | ``` 32 | 33 | ## 引脚 34 | 35 | ### 舵机 SG90 36 | 37 | - GND(棕): GND 38 | - VCC(红): VCC 5V 39 | - PWM(橙): IO5 40 | 41 | ### 按钮 42 | 43 | - 一端: GND 44 | - 一端: IO4 45 | 46 | ## 图示 47 | 48 | ![](../../../images/PWM驱动舵机引脚配置.jpg) 49 | 50 | ## 执行指令 51 | 52 | ```shell 53 | cargo run -r -p pwm_driven_servo 54 | ``` 55 | -------------------------------------------------------------------------------- /core/esp32s3-mpu6050/examples/simple.rs: -------------------------------------------------------------------------------- 1 | use mpu6050::*; 2 | use linux_embedded_hal::{I2cdev, Delay}; 3 | use i2cdev::linux::LinuxI2CError; 4 | 5 | fn main() -> Result<(), Mpu6050Error> { 6 | let i2c = I2cdev::new("/dev/i2c-1") 7 | .map_err(Mpu6050Error::I2c)?; 8 | 9 | let mut delay = Delay; 10 | let mut mpu = Mpu6050::new(i2c); 11 | 12 | mpu.init(&mut delay)?; 13 | 14 | loop { 15 | // get roll and pitch estimate 16 | let acc = mpu.get_acc_angles()?; 17 | println!("r/p: {:?}", acc); 18 | 19 | // get sensor temp 20 | let temp = mpu.get_temp()?; 21 | println!("temp: {:?}c", temp); 22 | 23 | // get gyro data, scaled with sensitivity 24 | let gyro = mpu.get_gyro()?; 25 | println!("gyro: {:?}", gyro); 26 | 27 | // get accelerometer data, scaled with sensitivity 28 | let acc = mpu.get_acc()?; 29 | println!("acc: {:?}", acc); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/http/http_server_vue/web/src/components/HelloWorld.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 33 | 34 | 39 | -------------------------------------------------------------------------------- /app/encoder/rotary_encoder/src/main.rs: -------------------------------------------------------------------------------- 1 | use anyhow::Context; 2 | use esp_idf_svc::{ 3 | hal::{delay::FreeRtos, peripherals::Peripherals}, 4 | log::EspLogger, 5 | sys::link_patches, 6 | }; 7 | use pcnt_encoder::Encoder; 8 | 9 | fn main() -> anyhow::Result<()> { 10 | link_patches(); 11 | EspLogger::initialize_default(); 12 | log::set_max_level(log::LevelFilter::Info); 13 | 14 | println!("setup pins"); 15 | let peripherals = Peripherals::take().context("failed to take Peripherals")?; 16 | let mut pin_a = peripherals.pins.gpio4; 17 | let mut pin_b = peripherals.pins.gpio5; 18 | println!("setup encoder"); 19 | let encoder = Encoder::new(peripherals.pcnt0, &mut pin_a, &mut pin_b)?; 20 | 21 | let mut last_value = 0_i32; 22 | loop { 23 | let value = encoder.get_value()?; 24 | if value != last_value { 25 | println!("value: {value}"); 26 | last_value = value; 27 | } 28 | FreeRtos::delay_ms(100u32); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /core/esp32s3-nrf24l01/Cargo.toml: -------------------------------------------------------------------------------- 1 | # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO 2 | # 3 | # When uploading crates to the registry Cargo will automatically 4 | # "normalize" Cargo.toml files for maximal compatibility 5 | # with all versions of Cargo and also rewrite `path` dependencies 6 | # to registry (e.g., crates.io) dependencies 7 | # 8 | # If you believe there's an error in this file please file an 9 | # issue against the rust-lang/cargo repository. If you're 10 | # editing this file be aware that the upstream Cargo.toml 11 | # will likely look very different (and much more reasonable) 12 | [package] 13 | name = "esp32s3-nrf24l01" 14 | version = "0.1.0" 15 | edition = "2021" 16 | authors = ["silent-rain <2367221387@qq.com>"] 17 | description = "A driver for NRF24L01(+) transceivers on embedded-hal platforms." 18 | keywords = ["driver", "wireless", "nrf", "nrf24l01"] 19 | categories = [] 20 | repository = "" 21 | 22 | [dependencies] 23 | esp-idf-hal = "0.42.5" 24 | anyhow = "1.0.79" 25 | bitfield = "0.14.0" 26 | nb = "1.1.0" 27 | -------------------------------------------------------------------------------- /app/basic/buzzer/src/main.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::empty_loop)] 2 | 3 | use esp_idf_svc::{ 4 | hal::{delay::FreeRtos, gpio::PinDriver, peripherals::Peripherals}, 5 | log::EspLogger, 6 | sys::link_patches, 7 | }; 8 | 9 | fn main() -> anyhow::Result<()> { 10 | // It is necessary to call this function once. Otherwise some patches to the runtime 11 | // implemented by esp-idf-sys might not link properly. See https://github.com/esp-rs/esp-idf-template/issues/71 12 | link_patches(); 13 | 14 | // Bind the log crate to the ESP Logging facilities 15 | EspLogger::initialize_default(); 16 | 17 | // 设置日志级别 18 | log::set_max_level(log::LevelFilter::Info); 19 | 20 | // Get the peripherals 21 | let peripherals = Peripherals::take()?; 22 | 23 | let mut buzzer = PinDriver::output(peripherals.pins.gpio4)?; 24 | 25 | log::warn!("loop"); 26 | loop { 27 | buzzer.set_high()?; 28 | FreeRtos::delay_ms(1000); 29 | buzzer.set_low()?; 30 | FreeRtos::delay_ms(1000); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /core/esp32s3-nrf24l01/src/payload.rs: -------------------------------------------------------------------------------- 1 | use core::ops::Deref; 2 | 3 | /// Represents a received packet. Stores 32 bytes and the actual length. 4 | /// 5 | /// Use [`as_ref()`](#method.as_ref) or [`Deref`](#impl-Deref) to 6 | /// obtain a slice of the content. 7 | pub struct Payload { 8 | data: [u8; 32], 9 | len: usize, 10 | } 11 | 12 | impl Payload { 13 | /// Copy a slice 14 | pub fn new(source: &[u8]) -> Self { 15 | let mut data = [0; 32]; 16 | let len = source.len().min(data.len()); 17 | data[0..len].copy_from_slice(&source[0..len]); 18 | Payload { data, len } 19 | } 20 | 21 | /// Read length 22 | #[allow(clippy::len_without_is_empty)] 23 | pub fn len(&self) -> usize { 24 | self.len 25 | } 26 | } 27 | 28 | impl AsRef<[u8]> for Payload { 29 | fn as_ref(&self) -> &[u8] { 30 | &self.data[0..self.len] 31 | } 32 | } 33 | 34 | impl Deref for Payload { 35 | type Target = [u8]; 36 | fn deref(&self) -> &[u8] { 37 | self.as_ref() 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/http/http_server_vue/src/asset.rs: -------------------------------------------------------------------------------- 1 | //! 静态资源文件 2 | #![allow(unused)] 3 | use rust_embed::RustEmbed; 4 | 5 | /// WEB 静态资源 6 | #[derive(Debug, Default, RustEmbed)] 7 | #[folder = "./web/dist/"] 8 | pub struct AssetWebDist; 9 | 10 | impl AssetWebDist { 11 | pub fn to_bytes(path: String) -> Option> { 12 | let asset = Self::get(&path)?; 13 | Some(asset.data.to_vec()) 14 | } 15 | 16 | /// 获取文件类型 17 | pub fn mimetype(path: String) -> Option { 18 | let asset = Self::get(&path)?; 19 | Some(asset.metadata.mimetype().to_string()) 20 | } 21 | } 22 | 23 | #[cfg(test)] 24 | mod tests { 25 | use std::io::Read; 26 | 27 | use super::*; 28 | 29 | #[test] 30 | fn it_file() { 31 | let body = match AssetWebDist::to_bytes("/assets/index-dcH5h-_h.js".to_string()) { 32 | Some(v) => v, 33 | None => "not found".as_bytes().to_vec(), 34 | }; 35 | log::error!("===== {:#?}", body.bytes()); 36 | assert_ne!(body.len(), 0); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/basic/opposing_infrared_sensor_buzzer/src/main.rs: -------------------------------------------------------------------------------- 1 | use esp_idf_svc::{ 2 | hal::{ 3 | delay::FreeRtos, 4 | gpio::{PinDriver, Pull}, 5 | peripherals::Peripherals, 6 | }, 7 | log::EspLogger, 8 | sys::link_patches, 9 | }; 10 | 11 | fn main() -> anyhow::Result<()> { 12 | link_patches(); 13 | 14 | EspLogger::initialize_default(); 15 | log::set_max_level(log::LevelFilter::Info); 16 | 17 | // Get the peripherals 18 | let peripherals = Peripherals::take()?; 19 | 20 | let mut buzzer = PinDriver::output(peripherals.pins.gpio4)?; 21 | 22 | let mut sensor = PinDriver::input(peripherals.pins.gpio5)?; 23 | 24 | // 停止蜂鸣 25 | buzzer.set_high()?; 26 | sensor.set_pull(Pull::Up)?; 27 | 28 | log::info!("loop"); 29 | loop { 30 | FreeRtos::delay_ms(10); 31 | 32 | if sensor.is_high() { 33 | log::info!("is_high"); 34 | buzzer.set_low()?; 35 | } else { 36 | // 停止蜂鸣 37 | buzzer.set_high()?; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/basic/light_sensor_control_buzzer/src/main.rs: -------------------------------------------------------------------------------- 1 | use esp_idf_svc::{ 2 | hal::{ 3 | delay::FreeRtos, 4 | gpio::{PinDriver, Pull}, 5 | peripherals::Peripherals, 6 | }, 7 | log::EspLogger, 8 | sys::link_patches, 9 | }; 10 | 11 | fn main() -> anyhow::Result<()> { 12 | link_patches(); 13 | 14 | EspLogger::initialize_default(); 15 | log::set_max_level(log::LevelFilter::Info); 16 | 17 | // Get the peripherals 18 | let peripherals = Peripherals::take()?; 19 | 20 | let mut buzzer = PinDriver::output(peripherals.pins.gpio4)?; 21 | 22 | let mut light_sensor = PinDriver::input(peripherals.pins.gpio5)?; 23 | 24 | // 停止蜂鸣 25 | buzzer.set_high()?; 26 | light_sensor.set_pull(Pull::Up)?; 27 | 28 | log::info!("loop"); 29 | loop { 30 | FreeRtos::delay_ms(10); 31 | 32 | if light_sensor.is_high() { 33 | log::info!("is_high"); 34 | buzzer.set_low()?; 35 | } else { 36 | // 停止蜂鸣 37 | buzzer.set_high()?; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/basic/oled_show_str/src/main.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::empty_loop)] 2 | use oled::OLED; 3 | 4 | use esp_idf_svc::{ 5 | hal::{delay::FreeRtos, peripherals::Peripherals}, 6 | log::EspLogger, 7 | sys::link_patches, 8 | }; 9 | 10 | fn main() -> anyhow::Result<()> { 11 | // It is necessary to call this function once. Otherwise some patches to the runtime 12 | // implemented by esp-idf-sys might not link properly. See https://github.com/esp-rs/esp-idf-template/issues/71 13 | link_patches(); 14 | 15 | // Bind the log crate to the ESP Logging facilities 16 | EspLogger::initialize_default(); 17 | 18 | // 设置日志级别 19 | log::set_max_level(log::LevelFilter::Info); 20 | 21 | // Get the peripherals 22 | let peripherals = Peripherals::take()?; 23 | 24 | let pins = peripherals.pins; 25 | let mut oled = OLED::new(pins.gpio4, pins.gpio5)?; 26 | 27 | oled.show_string(1, 1, "tiele"); 28 | oled.show_string(2, 1, "this is test."); 29 | 30 | log::warn!("loop"); 31 | loop { 32 | FreeRtos::delay_ms(1000); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/i2c/i2c_soft_mpu6050/src/main.rs: -------------------------------------------------------------------------------- 1 | use mpu6050::reg::Mpu6050; 2 | 3 | use esp_idf_svc::{ 4 | hal::{delay::FreeRtos, peripherals::Peripherals}, 5 | log::EspLogger, 6 | sys::link_patches, 7 | }; 8 | 9 | fn main() -> anyhow::Result<()> { 10 | link_patches(); 11 | // Bind the log crate to the ESP Logging facilities 12 | EspLogger::initialize_default(); 13 | // 设置日志级别 14 | log::set_max_level(log::LevelFilter::Info); 15 | 16 | // Get the peripherals 17 | let peripherals = Peripherals::take()?; 18 | 19 | let sda = peripherals.pins.gpio5; 20 | let scl = peripherals.pins.gpio6; 21 | let mut mpu = Mpu6050::new(scl, sda)?; 22 | 23 | let id = mpu.get_id()?; 24 | log::info!("MPU6050 ID {id}"); 25 | 26 | log::info!("loop"); 27 | loop { 28 | let data = mpu.get_data()?; 29 | 30 | // 打印读取到的数据 31 | println!("Accel: ({}, {}, {})", data.acc_x, data.acc_y, data.acc_z); 32 | println!("Gyro: ({}, {}, {})", data.gyro_x, data.gyro_y, data.gyro_z); 33 | FreeRtos::delay_ms(500); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /docs/问题答疑Q&A.md: -------------------------------------------------------------------------------- 1 | # 问题答疑 Q&A 2 | 3 | ## 常用 sdkconfig 4 | 5 | ``` 6 | # main检测到任务中的堆栈溢出 7 | # 与C相比,Rust通常需要一点额外的主任务堆栈大小(默认值为3K) 8 | CONFIG_ESP_MAIN_TASK_STACK_SIZE=8000 9 | 10 | # 使用此选项可将FreeRTOS内核滴答频率设置为1000 Hz(默认为100 Hz)。 11 | # 这允许线程睡眠使用1ms的粒度(默认情况下为10ms)。 12 | #CONFIG_FREERTOS_HZ=1000 13 | 14 | # Workaround for https://github.com/espressif/esp-idf/issues/7631 15 | #CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=n 16 | #CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=n 17 | 18 | 19 | # 禁用看门狗定时器 20 | # CONFIG_INT_WDT=n 21 | # CONFIG_ESP_TASK_WDT=n 22 | 23 | # ESP-IDF 会尝试在本地网络中注册主机名 espressif 24 | # http://espressif/ 25 | CONFIG_LWIP_LOCAL_HOSTNAME="espressif" 26 | 27 | # FLASH 28 | # CONFIG_ESPTOOLPY_FLASHMODE_DIO is not set 29 | CONFIG_ESPTOOLPY_FLASHMODE_QIO=y 30 | CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y 31 | CONFIG_ESPTOOLPY_FLASHSIZE="16MB" 32 | CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE=y 33 | # CONFIG_FLASHMODE_DIO is not set 34 | CONFIG_FLASHMODE_QIO=y 35 | 36 | # SPIRAM 37 | CONFIG_SPIRAM=y 38 | CONFIG_SPIRAM_MODE_QUAD=y 39 | CONFIG_SPIRAM_TYPE_AUTO=y 40 | CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY=y 41 | 42 | ``` 43 | -------------------------------------------------------------------------------- /core/esp32s3-mpu6050/Cargo.toml: -------------------------------------------------------------------------------- 1 | # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO 2 | # 3 | # When uploading crates to the registry Cargo will automatically 4 | # "normalize" Cargo.toml files for maximal compatibility 5 | # with all versions of Cargo and also rewrite `path` dependencies 6 | # to registry (e.g., crates.io) dependencies. 7 | # 8 | # If you are reading this file be aware that the original Cargo.toml 9 | # will likely look very different (and much more reasonable). 10 | # See Cargo.toml.orig for the original contents. 11 | 12 | [package] 13 | edition = "2018" 14 | name = "esp32s3-mpu6050" 15 | version = "0.1.6" 16 | authors = ["silent-rain <2367221387@qq.com>"] 17 | description = "Platform agnostic driver for MPU6050 6-axis IMU" 18 | readme = "README.md" 19 | keywords = ["mpu6050", "imu", "embedded"] 20 | license = "MIT" 21 | repository = "https://github.com/juliangaal/mpu6050" 22 | 23 | [dependencies] 24 | esp-idf-hal = "0.42.5" 25 | # embedded-hal = "0.2.4" 26 | libm = "0.2.1" 27 | nalgebra = { version = "0.31.2", default-features = false } 28 | # i2cdev = "0.5.1" 29 | # linux-embedded-hal = "0.3.0" 30 | -------------------------------------------------------------------------------- /app/rmt/rmt_transceiver/README.md: -------------------------------------------------------------------------------- 1 | # RMT 收发器 2 | 3 | 一个设置 RMT 发送器和 RMT 接收器的简单示例 4 | 5 | GPIO 引脚 2 为输入,GPIO 引脚 4 为输出 6 | 7 | TYPICAL OUTPUT: 8 | Tx Loop 9 | Rx Loop 10 | level0 = High dur0 = PulseTicks(620) level1 = Low dur1 = PulseTicks(620) 11 | level0 = High dur0 = PulseTicks(620) level1 = Low dur1 = PulseTicks(620) 12 | level0 = High dur0 = PulseTicks(210) level1 = Low dur1 = PulseTicks(410) 13 | level0 = High dur0 = PulseTicks(410) level1 = Low dur1 = PulseTicks(210) 14 | level0 = High dur0 = PulseTicks(210) level1 = Low dur1 = PulseTicks(0) 15 | Rx Loop 16 | level0 = High dur0 = PulseTicks(620) level1 = Low dur1 = PulseTicks(620) 17 | level0 = High dur0 = PulseTicks(620) level1 = Low dur1 = PulseTicks(620) 18 | level0 = High dur0 = PulseTicks(210) level1 = Low dur1 = PulseTicks(410) 19 | level0 = High dur0 = PulseTicks(410) level1 = Low dur1 = PulseTicks(210) 20 | level0 = High dur0 = PulseTicks(210) level1 = Low dur1 = PulseTicks(0) 21 | Tx Loop 22 | 23 | 注:这是官方示例。 24 | 25 | ## 引脚 26 | 27 | ### RMT 收发器 28 | 29 | - 输入: IO2 30 | - 输出: IO4 31 | 32 | ## 执行指令 33 | 34 | ```shell 35 | cargo run -r -p rmt_transceiver 36 | ``` 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 silent rain 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /app/i2c/i2c_hard_mpu6050/src/main.rs: -------------------------------------------------------------------------------- 1 | use mpu6050::hal::Mpu6050; 2 | 3 | use esp_idf_svc::{ 4 | hal::{delay::FreeRtos, peripherals::Peripherals}, 5 | log::EspLogger, 6 | sys::link_patches, 7 | }; 8 | 9 | fn main() -> anyhow::Result<()> { 10 | link_patches(); 11 | // Bind the log crate to the ESP Logging facilities 12 | EspLogger::initialize_default(); 13 | // 设置日志级别 14 | log::set_max_level(log::LevelFilter::Info); 15 | 16 | // Get the peripherals 17 | let peripherals = Peripherals::take()?; 18 | 19 | let i2c = peripherals.i2c0; 20 | let sda = peripherals.pins.gpio5; 21 | let scl = peripherals.pins.gpio6; 22 | 23 | let mut mpu = Mpu6050::new(i2c, sda, scl)?; 24 | mpu.wake_up()?; 25 | let id = mpu.get_id()?; 26 | log::info!("MPU6050 ID {id}"); 27 | 28 | log::info!("loop"); 29 | loop { 30 | let data = mpu.get_data()?; 31 | 32 | // 打印读取到的数据 33 | println!("Accel: ({}, {}, {})", data.acc_x, data.acc_y, data.acc_z); 34 | println!("Gyro: ({}, {}, {})", data.gyro_x, data.gyro_y, data.gyro_z); 35 | FreeRtos::delay_ms(1000); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /core/esp32s3-mpu6050/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Julian Gaal 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs/stm32示例迁移.md: -------------------------------------------------------------------------------- 1 | # Stm32 示例迁移 2 | 3 | ### DMA 数据转运 4 | 5 | - [DMA 数据转运](./app/dma/dma_data_transfer) 6 | - [DMA 数据连续转运](./app/dma/dma_data_continuous_transfer) 7 | - [DMA+AD 多通道](./app/dma/scan_dma_and_ad_multichannel) 8 | - [DMA+AD 多通道循环读取](./app/dma/scan_dma_and_ad_multichannel_loop) 9 | - [DMA+AD 多通道分批读取](./app/dma/scan_dma_and_ad_multichannel_peek) 10 | 11 | ### RTC 12 | 13 | - [RTC 实时时钟计数器](./app/rtc/rtc_counter) 14 | - [BKP 断电恢复](./app/rtc/rtc_bkp) 15 | - [读写备份寄存器](./app/rtc/rtc_bkp_dyn_data) 16 | - [RTC 告警闪烁 LED](./app/rtc/rtc_alarm_blinky) 17 | - [RTC 实时时间](./app/rtc/rtc_time) 18 | 19 | ### PWR 电源控制 20 | 21 | - [修改系统时钟主频](./app/pwr/syst_freq) 22 | - [睡眠模式-串口发送接收](./app/pwr/sleep_mode_serial_tx_and_rx) 23 | - [停止模式-对射式红外传感器计次](./app/pwr/stop_mode_infrared_sensor_count) 24 | - [待机模式-实时时钟计数](./app/pwr/standby_mode_rtc_counter) 25 | 26 | ### WDG 看门狗 27 | 28 | - [独立看门狗](./app/wdg/iwdg) 29 | - [窗口看门狗](./app/wdg/wwdg) 30 | 31 | ### FLASH 32 | 33 | - [读写内部 FLASH](./app/flash/internal_flash) 34 | - [读取芯片 ID](./app/flash/read_chip_id) 35 | 36 | ### 常用外设工具库封装 37 | 38 | - [硬件工具库](./core/hardware) 39 | pub mod flash_store; 40 | pub mod key; 41 | pub mod serial; 42 | -------------------------------------------------------------------------------- /app/basic/blinky/src/main.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::empty_loop)] 2 | 3 | use esp_idf_svc::{ 4 | hal::{delay::FreeRtos, gpio::PinDriver, peripherals::Peripherals}, 5 | log::EspLogger, 6 | sys::link_patches, 7 | }; 8 | 9 | fn main() -> anyhow::Result<()> { 10 | // It is necessary to call this function once. Otherwise some patches to the runtime 11 | // implemented by esp-idf-sys might not link properly. See https://github.com/esp-rs/esp-idf-template/issues/71 12 | link_patches(); 13 | 14 | // Bind the log crate to the ESP Logging facilities 15 | EspLogger::initialize_default(); 16 | 17 | // 设置日志级别 18 | log::set_max_level(log::LevelFilter::Info); 19 | 20 | // Get the peripherals 21 | let peripherals = Peripherals::take()?; 22 | 23 | let mut led = PinDriver::output(peripherals.pins.gpio4)?; 24 | 25 | log::warn!("loop"); 26 | loop { 27 | led.set_high()?; 28 | log::warn!("on"); 29 | // we are sleeping here to make sure the watchdog isn't triggered 30 | FreeRtos::delay_ms(1000); 31 | 32 | led.set_low()?; 33 | log::warn!("off"); 34 | FreeRtos::delay_ms(1000); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/basic/oled_show_str/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "oled_show_str" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | 7 | [features] 8 | default = ["std", "embassy", "esp-idf-svc/native"] 9 | 10 | std = ["alloc", "esp-idf-svc/binstart", "esp-idf-svc/std"] 11 | alloc = ["esp-idf-svc/alloc"] 12 | nightly = ["esp-idf-svc/nightly"] 13 | experimental = ["esp-idf-svc/experimental"] 14 | embassy = [ 15 | "esp-idf-svc/embassy-sync", 16 | "esp-idf-svc/critical-section", 17 | "esp-idf-svc/embassy-time-driver", 18 | ] 19 | 20 | [dependencies] 21 | esp-idf-svc = { version = "0.47.3", default-features = false } 22 | enumset = "1.1.3" 23 | toml-cfg = "0.1.3" 24 | log = { version = "0.4", default-features = false } 25 | anyhow = "1.0.79" 26 | 27 | [dependencies.oled] 28 | path = "../../../core/oled" 29 | 30 | [build-dependencies] 31 | embuild = "0.31.4" 32 | toml-cfg = "0.1.3" 33 | 34 | [package.metadata.esp-idf-sys] 35 | mcu = "esp32s3" 36 | esp_idf_version = "v5.1.1" 37 | esp_idf_tools_install_dir = "global" 38 | esp_idf_sdkconfig = "sdkconfig" 39 | # 使用 ESP-IDF 的本地模式来禁用远程下载 40 | # git clone --branch v5.1.1 https://github.com/espressif/esp-idf.git 41 | idf_path = "/home/one/.espup/esp-idf" 42 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Wokwi GDB", 6 | "type": "cppdbg", 7 | "request": "launch", 8 | "program": "${workspaceFolder}/target/xtensa-esp32s3-espidf/debug/esp32-s3-std-tutorial", 9 | "cwd": "${workspaceFolder}", 10 | "MIMode": "gdb", 11 | "miDebuggerPath": "${userHome}/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-gdb", 12 | "miDebuggerServerAddress": "localhost:3333" 13 | }, 14 | { 15 | "name": "C/C++ Runner: Debug Session", 16 | "type": "cppdbg", 17 | "request": "launch", 18 | "args": [], 19 | "stopAtEntry": false, 20 | "externalConsole": false, 21 | "cwd": "/home/one/.espup/esp-idf/components/spi_flash", 22 | "program": "/home/one/.espup/esp-idf/components/spi_flash/build/Debug/outDebug", 23 | "MIMode": "gdb", 24 | "miDebuggerPath": "gdb", 25 | "setupCommands": [ 26 | { 27 | "description": "Enable pretty-printing for gdb", 28 | "text": "-enable-pretty-printing", 29 | "ignoreFailures": true 30 | } 31 | ] 32 | } 33 | ] 34 | } -------------------------------------------------------------------------------- /core/wifi/examples/wifi.rs: -------------------------------------------------------------------------------- 1 | use anyhow::{bail, Result}; 2 | use esp_idf_svc::{eventloop::EspSystemEventLoop, hal::prelude::Peripherals}; 3 | use wifi::wifi; 4 | 5 | /// This configuration is picked up at compile time by `build.rs` from the 6 | /// file `cfg.toml`. 7 | #[toml_cfg::toml_config] 8 | pub struct Config { 9 | #[default("")] 10 | wifi_ssid: &'static str, 11 | #[default("")] 12 | wifi_psk: &'static str, 13 | } 14 | 15 | fn main() -> Result<()> { 16 | esp_idf_svc::sys::link_patches(); 17 | esp_idf_svc::log::EspLogger::initialize_default(); 18 | 19 | let peripherals = Peripherals::take().unwrap(); 20 | let sysloop = EspSystemEventLoop::take()?; 21 | 22 | let app_config = CONFIG; 23 | // Connect to the Wi-Fi network 24 | let _wifi = match wifi( 25 | app_config.wifi_ssid, 26 | app_config.wifi_psk, 27 | peripherals.modem, 28 | sysloop, 29 | ) { 30 | Ok(inner) => { 31 | println!("Connected to Wi-Fi network!"); 32 | inner 33 | } 34 | Err(err) => { 35 | // Red! 36 | bail!("Could not connect to Wi-Fi network: {:?}", err) 37 | } 38 | }; 39 | Ok(()) 40 | } 41 | -------------------------------------------------------------------------------- /app/delay/async_timer_delay/src/main.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::empty_loop)] 2 | 3 | use esp_idf_svc::{ 4 | hal::{ 5 | peripherals::Peripherals, 6 | task::block_on, 7 | timer::{TimerConfig, TimerDriver}, 8 | }, 9 | log::EspLogger, 10 | sys::link_patches, 11 | }; 12 | 13 | fn main() -> anyhow::Result<()> { 14 | // It is necessary to call this function once. Otherwise some patches to the runtime 15 | // implemented by esp-idf-sys might not link properly. See https://github.com/esp-rs/esp-idf-template/issues/71 16 | link_patches(); 17 | 18 | // Bind the log crate to the ESP Logging facilities 19 | EspLogger::initialize_default(); 20 | 21 | // 设置日志级别 22 | log::set_max_level(log::LevelFilter::Info); 23 | 24 | // Get the peripherals 25 | let peripherals = Peripherals::take()?; 26 | 27 | let mut timer = TimerDriver::new(peripherals.timer00, &TimerConfig::new())?; 28 | 29 | block_on(async { 30 | loop { 31 | // Every second 32 | timer.delay(timer.tick_hz()).await?; 33 | 34 | // 延迟10ms 35 | // timer.delay(timer.tick_hz() / 100).await?; 36 | log::info!("Tick"); 37 | } 38 | }) 39 | } 40 | -------------------------------------------------------------------------------- /app/hardware/hardware_multiple_rgb_led/src/main.rs: -------------------------------------------------------------------------------- 1 | use neopixel::{NeoPixel, Rgb}; 2 | 3 | use esp_idf_svc::{ 4 | hal::{delay::FreeRtos, peripherals::Peripherals}, 5 | log::EspLogger, 6 | sys::link_patches, 7 | }; 8 | 9 | fn main() -> anyhow::Result<()> { 10 | link_patches(); 11 | 12 | // Bind the log crate to the ESP Logging facilities 13 | EspLogger::initialize_default(); 14 | 15 | // 设置日志级别 16 | log::set_max_level(log::LevelFilter::Info); 17 | 18 | // Get the peripherals 19 | let peripherals = Peripherals::take()?; 20 | 21 | let channel = peripherals.rmt.channel0; 22 | let mut neopixel = NeoPixel::new(peripherals.pins.gpio48, channel, 1)?; 23 | 24 | loop { 25 | // 红色 26 | neopixel.set_color(0, Rgb::new(255, 0, 0))?; 27 | neopixel.show()?; 28 | // 延迟 29 | FreeRtos::delay_ms(1000); 30 | // 绿色 31 | neopixel.set_color(0, Rgb::new(0, 255, 0))?; 32 | neopixel.show()?; 33 | // 延迟 34 | FreeRtos::delay_ms(1000); 35 | // 蓝色 36 | neopixel.set_color_and_show(0, Rgb::new(0, 0, 255))?; 37 | // 延迟 38 | FreeRtos::delay_ms(1000); 39 | 40 | log::warn!("this is warn!"); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/wdg/code_disable_wdg/src/main.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::empty_loop)] 2 | use std::time::Duration; 3 | 4 | use esp_idf_svc::{ 5 | hal::{ 6 | peripherals::Peripherals, 7 | task::{self, watchdog::TWDTConfig}, 8 | }, 9 | log::EspLogger, 10 | sys::link_patches, 11 | }; 12 | 13 | fn main() { 14 | // It is necessary to call this function once. 15 | // Otherwise some patches to the runtime implemented by esp-idf-sys might not link properly. 16 | // See https://github.com/esp-rs/esp-idf-template/issues/71 17 | link_patches(); 18 | 19 | // Bind the log crate to the ESP Logging facilities 20 | EspLogger::initialize_default(); 21 | 22 | // 设置日志级别为 INFO 23 | log::set_max_level(log::LevelFilter::Info); 24 | 25 | // Get the peripherals 26 | let peripherals = Peripherals::take().unwrap(); 27 | 28 | // 禁用开门狗 29 | let config = TWDTConfig { 30 | duration: Duration::from_secs(2), 31 | panic_on_trigger: true, 32 | subscribed_idle_tasks: enumset::EnumSet::empty(), 33 | }; 34 | let driver = task::watchdog::TWDTDriver::new(peripherals.twdt, &config).unwrap(); 35 | // 停止 TWDT 并释放资源 36 | drop(driver); 37 | 38 | log::info!("Hello, world!"); 39 | loop {} 40 | } 41 | -------------------------------------------------------------------------------- /app/dma/print_memory_address/src/main.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::empty_loop)] 2 | 3 | use esp_idf_svc::{ 4 | hal::{delay::FreeRtos, peripherals::Peripherals}, 5 | log::EspLogger, 6 | sys::link_patches, 7 | }; 8 | 9 | const CONST: i32 = 0x66; 10 | static STATIC: i32 = 0x66; 11 | 12 | fn main() -> anyhow::Result<()> { 13 | // It is necessary to call this function once. Otherwise some patches to the runtime 14 | // implemented by esp-idf-sys might not link properly. See https://github.com/esp-rs/esp-idf-template/issues/71 15 | link_patches(); 16 | 17 | // Bind the log crate to the ESP Logging facilities 18 | EspLogger::initialize_default(); 19 | 20 | // 设置日志级别 21 | log::set_max_level(log::LevelFilter::Info); 22 | 23 | // Get the peripherals 24 | let _peripherals = Peripherals::take()?; 25 | 26 | let var = 0x66; 27 | let var_p = &var as *const i32 as usize as u32; 28 | let const_p = &CONST as *const i32 as usize as u32; 29 | let static_p = &STATIC as *const i32 as usize as u32; 30 | log::info!( 31 | "var_p={:?} const_p={:?} static_p={:?}", 32 | var_p, 33 | const_p, 34 | static_p, 35 | ); 36 | 37 | log::info!("loop"); 38 | loop { 39 | FreeRtos::delay_ms(1000); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /docs/sdkconfig/README.md: -------------------------------------------------------------------------------- 1 | # 配置 SDK 2 | 3 | ## Flash 配置 4 | 5 | ``` 6 | Serial flasher config ---> 7 | ``` 8 | 9 | - 配置模式 10 | 11 | ``` 12 | Flash SPI mode (DIO) ---> QIO 13 | ``` 14 | 15 | - 配置频率 16 | 17 | ``` 18 | Flash SPI speed (80 MHz) ---> 80 MHz 19 | ``` 20 | 21 | - 设置内存大小 22 | 23 | ``` 24 | Flash size (2 MB) ---> 16 MB 25 | ``` 26 | 27 | - 自动检测, 闪烁引导加载程序时检测闪存大小 28 | 29 | ``` 30 | [*] Detect flash size when flashing bootloader 31 | ``` 32 | 33 | ## ESP PSRAM 配置 34 | 35 | ``` 36 | Component config ---> ESP PSRAM ---> 37 | ``` 38 | 39 | - 启用 PSRAM 40 | 41 | ``` 42 | [*] Support for external, SPI-connected RAM 43 | ``` 44 | 45 | ### RAM 配置 46 | 47 | ``` 48 | SPI RAM config ---> 49 | ``` 50 | 51 | - (QUAD/OCT) of SPI RAM chip in use (Octal Mode PSRAM) 设置为 Octal Mode PSRAM,因为 ESP32 S3 N16R8 模块内置的 PSRAM 是八线模式的 PSRAM 52 | 53 | ``` 54 | Mode (QUAD/OCT) of SPI RAM chip in use (Quad Mode PSRAM) ---> Octal Mode PSRAM 55 | ``` 56 | 57 | - 设置 PSRAM 的频率(可选) 58 | 59 | ``` 60 | Set RAM clock speed (80MHz clock speed) ---> 80MHz clock speed 61 | ``` 62 | 63 | ## 开门狗配置 64 | 65 | - 禁用开门狗 66 | 67 | ``` 68 | (Top) → Component config → ESP System Settings 69 | 70 | # 关闭中断看门狗定时器 (IWDT) 71 | [ ] Interrupt watchdog 72 | # 任务看门狗定时器 (TWDT) 73 | [ ] Enable Task Watchdog Timer 74 | ``` 75 | 76 | -------------------------------------------------------------------------------- /app/uart/uart_loopback_async/src/main.rs: -------------------------------------------------------------------------------- 1 | use esp_idf_svc::{ 2 | hal::{ 3 | gpio, 4 | peripherals::Peripherals, 5 | task::block_on, 6 | uart::{AsyncUartDriver, UartConfig}, 7 | units::Hertz, 8 | }, 9 | log::EspLogger, 10 | sys::link_patches, 11 | }; 12 | 13 | fn main() -> anyhow::Result<()> { 14 | link_patches(); 15 | // Bind the log crate to the ESP Logging facilities 16 | EspLogger::initialize_default(); 17 | // 设置日志级别 18 | log::set_max_level(log::LevelFilter::Info); 19 | 20 | // Get the peripherals 21 | let peripherals = Peripherals::take()?; 22 | let tx = peripherals.pins.gpio12; 23 | let rx = peripherals.pins.gpio13; 24 | 25 | println!("Starting UART loopback test"); 26 | let config = UartConfig::new().baudrate(Hertz(115_200)); 27 | let uart = AsyncUartDriver::new( 28 | peripherals.uart1, 29 | tx, 30 | rx, 31 | Option::::None, 32 | Option::::None, 33 | &config, 34 | )?; 35 | 36 | block_on(async { 37 | loop { 38 | uart.write(&[0xaa]).await?; 39 | 40 | let mut buf = [0_u8; 1]; 41 | uart.read(&mut buf).await?; 42 | 43 | println!("Written 0xaa, read 0x{:02x}", buf[0]); 44 | } 45 | }) 46 | } 47 | -------------------------------------------------------------------------------- /core/mpu6050/src/conf.rs: -------------------------------------------------------------------------------- 1 | //! 配置 2 | pub const DEFAULT_SLAVE_ADDR: u8 = 0x68; 3 | 4 | // 采样率分频,典型值:0x07(125Hz) 5 | pub const MPU6050_SMPLRT_DIV: u8 = 0x19; 6 | // 低通滤波频率,典型值:0x06(5Hz) 7 | pub const MPU6050_CONFIG: u8 = 0x1A; 8 | // 陀螺仪自检及测量范围,典型值:0x18(不自检,2000deg/s) 9 | pub const MPU6050_GYRO_CONFIG: u8 = 0x1B; 10 | // 加速计自检、测量范围及高通滤波频率,典型值:0x01(不自检,2G,5Hz) 11 | pub const MPU6050_ACCEL_CONFIG: u8 = 0x1C; 12 | 13 | // 存储最近的X轴、Y轴、Z轴加速度感应器的测量值 14 | pub const MPU6050_ACCEL_XOUT_H: u8 = 0x3B; 15 | pub const MPU6050_ACCEL_XOUT_L: u8 = 0x3C; 16 | pub const MPU6050_ACCEL_YOUT_H: u8 = 0x3D; 17 | pub const MPU6050_ACCEL_YOUT_L: u8 = 0x3E; 18 | pub const MPU6050_ACCEL_ZOUT_H: u8 = 0x3F; 19 | pub const MPU6050_ACCEL_ZOUT_L: u8 = 0x40; 20 | 21 | // 存储的最近温度传感器的测量值 22 | pub const MPU6050_TEMP_OUT_H: u8 = 0x41; 23 | pub const MPU6050_TEMP_OUT_L: u8 = 0x42; 24 | 25 | // 存储最近的X轴、Y轴、Z轴陀螺仪感应器的测量值 26 | pub const MPU6050_GYRO_XOUT_H: u8 = 0x43; 27 | pub const MPU6050_GYRO_XOUT_L: u8 = 0x44; 28 | pub const MPU6050_GYRO_YOUT_H: u8 = 0x45; 29 | pub const MPU6050_GYRO_YOUT_L: u8 = 0x46; 30 | pub const MPU6050_GYRO_ZOUT_H: u8 = 0x47; 31 | pub const MPU6050_GYRO_ZOUT_L: u8 = 0x48; 32 | 33 | // 电源管理,典型值:0x00(正常启用) 34 | pub const MPU6050_PWR_MGMT_1: u8 = 0x6B; 35 | pub const MPU6050_PWR_MGMT_2: u8 = 0x6C; 36 | // IIC地址寄存器(默认数值0x68,只读) 37 | pub const MPU6050_WHO_AM_I: u8 = 0x75; 38 | -------------------------------------------------------------------------------- /app/encoder/rotary_encoder_speed/src/main.rs: -------------------------------------------------------------------------------- 1 | use anyhow::Context; 2 | use esp_idf_svc::{ 3 | hal::{delay::FreeRtos, peripherals::Peripherals}, 4 | log::EspLogger, 5 | sys::{link_patches, EspError}, 6 | }; 7 | use pcnt_encoder::Encoder; 8 | 9 | fn main() -> anyhow::Result<()> { 10 | link_patches(); 11 | EspLogger::initialize_default(); 12 | log::set_max_level(log::LevelFilter::Info); 13 | 14 | println!("setup pins"); 15 | let peripherals = Peripherals::take().context("failed to take Peripherals")?; 16 | let mut pin_a = peripherals.pins.gpio4; 17 | let mut pin_b = peripherals.pins.gpio5; 18 | println!("setup encoder"); 19 | let encoder = Encoder::new(peripherals.pcnt0, &mut pin_a, &mut pin_b)?; 20 | 21 | let mut last_value = 0_i32; 22 | loop { 23 | let value = encoder.get_value()?; 24 | let speed = get_speed(&encoder)?; 25 | if value != last_value { 26 | println!("value: {value}, speed: {speed}"); 27 | last_value = value; 28 | } 29 | FreeRtos::delay_ms(100u32); 30 | } 31 | } 32 | 33 | /// 获取速度 34 | pub fn get_speed(encoder: &Encoder<'_>) -> Result { 35 | let before = encoder.get_value()?; 36 | // 模拟耗时时间 37 | // 不建议在主循环中加入过长的延时,会阻塞主函数的执行 38 | FreeRtos::delay_ms(100u32); 39 | let after = encoder.get_value()?; 40 | 41 | Ok(after.wrapping_sub(before)) 42 | } 43 | -------------------------------------------------------------------------------- /app/ffi/bindgen_hello/build.rs: -------------------------------------------------------------------------------- 1 | use std::path::PathBuf; 2 | 3 | use bindgen::CargoCallbacks; 4 | 5 | fn main() { 6 | cc::Build::new() 7 | // 编译单个文件 8 | // .file("hello/hello.c") 9 | // 正则匹配多个编译文件 10 | .files(glob::glob("hello/*.c").unwrap().filter_map(Result::ok)) 11 | // 将多个目录添加到包含路径。-I 12 | .includes(&["hello"]) 13 | // 配置所有对象文件和静态文件的输出目录 14 | // .out_dir("out_dir") 15 | // 设置编译目标, 默认会自动从环境中抓取 TARGET 变量 16 | // .target("thumbv7m-none-eabi") 17 | // 定义是否应为货物发出元数据,使其能够 自动链接二进制文件。 18 | .cargo_metadata(true) 19 | // 运行编译器,生成output文件 20 | .compile("hello"); 21 | 22 | // bindgen::Builder是bindgen的主要入口点,允许您为生成的绑定构建选项。 23 | let bindings = bindgen::Builder::default() 24 | // 我们要为其生成绑定的输入标头。 25 | .header("hello/hello.h") 26 | .header("hello/bar.h") 27 | .use_core() 28 | .bitfield_enum("USE_STDPERIPH_DRIVER") 29 | .bitfield_enum("STM32F10X_MD") 30 | // 当包含的任何头文件发生变化时,告诉货物使已构建的板条箱失效。 31 | .parse_callbacks(Box::new(CargoCallbacks)) 32 | // 完成构建器并生成绑定。 33 | .generate() 34 | .expect("Unable to generate bindings"); 35 | 36 | // 将绑定写入 bindings.rs 文件。 37 | let out_path = PathBuf::from("./hello"); 38 | bindings 39 | .write_to_file(out_path.join("bindings.rs")) 40 | .expect("Couldn't write bindings!"); 41 | } 42 | -------------------------------------------------------------------------------- /docs/esp-idf环境配置.md: -------------------------------------------------------------------------------- 1 | # esp-idf 环境配置 2 | 3 | 注意: 这里搭建 esp-idf 环境配置仅用于可视化配置单片机的 SDK 配置。 4 | 5 | ## 开发环境 6 | 7 | - IDE: vscode 8 | - 语言: C+Python 9 | - 框架: esp-idf v5.1 10 | 11 | ## 开发环境搭建 12 | 13 | ### 安装 python 环境 14 | 15 | 系统默认已安装 python3; 16 | 仅安装虚拟环境, 防止本地环境混乱; 17 | 18 | - 安装虚拟环境 19 | 20 | ```shell 21 | sudo pacman -S extra/python-virtualenvwrapper 22 | ``` 23 | 24 | - 配置环境变量 25 | > vim ~/.zshrc 26 | 27 | ```shell 28 | # >>> virtualenvwrapper initialize >>> 29 | export WORKON_HOME=$HOME/.virtualenvs 30 | VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3 31 | source $HOME/.local/bin/virtualenvwrapper.sh 32 | PATH=$HOME/.local/bin:$PATH 33 | # <<< virtualenvwrapper initialize <<< 34 | ``` 35 | 36 | - 激活环境变量 37 | 38 | ```shell 39 | source ~/.zshrc 40 | ``` 41 | 42 | - 创建虚拟环境 43 | 44 | ```shell 45 | mkvirtualenv esp32s3 46 | ``` 47 | 48 | ### 搭建 esp-idf 开发环境 49 | 50 | - [Linux 和 macOS 平台工具链的标准设置](https://docs.espressif.com/projects/esp-idf/zh_CN/latest/esp32s3/get-started/linux-macos-setup.html) 51 | 52 | - 提示代码示例位置 53 | 54 | ```shell 55 | esp-idf/examples/get-started/hello_world 56 | ``` 57 | 58 | ## 编译与运行 59 | 60 | ### 编译 61 | 62 | ```shell 63 | # 进入python虚拟环境 64 | workon esp32s3 65 | 66 | # 进入esp-idf环境 67 | source ~/.espup/esp-idf/export.sh 68 | 69 | # 设置“目标”芯片 70 | idf.py set-target esp32s3 71 | 72 | ## 芯片SDK配置 73 | idf.py menuconfig 74 | 75 | # 编译 76 | idf.py build 77 | 78 | # 烧录 79 | idf.py -p PORT monitor 80 | ``` 81 | -------------------------------------------------------------------------------- /app/adc/adc/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "adc" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | 7 | [features] 8 | default = ["std", "embassy", "esp-idf-svc/native"] 9 | 10 | # pio = ["esp-idf-svc/pio"] 11 | std = ["alloc", "esp-idf-svc/binstart", "esp-idf-svc/std"] 12 | alloc = ["esp-idf-svc/alloc"] 13 | nightly = ["esp-idf-svc/nightly"] 14 | experimental = ["esp-idf-svc/experimental"] 15 | embassy = [ 16 | "esp-idf-svc/embassy-sync", 17 | "esp-idf-svc/critical-section", 18 | "esp-idf-svc/embassy-time-driver", 19 | ] 20 | 21 | [dependencies] 22 | esp-idf-svc = { version = "0.47.3", default-features = false } 23 | # esp-idf-sys = "0.33.7" 24 | enumset = "1.1.3" 25 | toml-cfg = "0.1.3" 26 | log = { version = "0.4", default-features = false } 27 | anyhow = "1.0.79" 28 | 29 | [build-dependencies] 30 | embuild = "0.31.4" 31 | toml-cfg = "0.1.3" 32 | 33 | [package.metadata.esp-idf-sys] 34 | # MCU 名称 35 | mcu = "esp32s3" 36 | # esp-idf 版本 37 | # native builder only 38 | esp_idf_version = "v5.1.1" 39 | # 工具链路径设置为全局(global) 40 | esp_idf_tools_install_dir = "global" 41 | # SDK 配置文件路径 42 | esp_idf_sdkconfig = "sdkconfig" 43 | # esp_idf_sdkconfig_defaults = ["sdkconfig.defaults"] 44 | # 使用 ESP-IDF 的本地模式来禁用远程下载 45 | # git clone --branch v5.1.1 https://github.com/espressif/esp-idf.git 46 | idf_path = "/home/one/.espup/esp-idf" 47 | # esp-idf 组件管理器, 运行期间自动从组件注册表或 Git 存储库中获取组件 48 | # esp_idf_component_manager = "y" 49 | # esp_idf_components = ["spi_flash"] 50 | -------------------------------------------------------------------------------- /app/http/http_server_vue/web/src/App.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 35 | 36 | 50 | -------------------------------------------------------------------------------- /app/interrupt/rtc_isr/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rtc_isr" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | 7 | [features] 8 | default = ["std", "embassy", "esp-idf-svc/native"] 9 | 10 | # pio = ["esp-idf-svc/pio"] 11 | std = ["alloc", "esp-idf-svc/binstart", "esp-idf-svc/std"] 12 | alloc = ["esp-idf-svc/alloc"] 13 | nightly = ["esp-idf-svc/nightly"] 14 | experimental = ["esp-idf-svc/experimental"] 15 | embassy = [ 16 | "esp-idf-svc/embassy-sync", 17 | "esp-idf-svc/critical-section", 18 | "esp-idf-svc/embassy-time-driver", 19 | ] 20 | 21 | [dependencies] 22 | esp-idf-svc = { version = "0.47.3", default-features = false } 23 | # esp-idf-sys = "0.33.7" 24 | toml-cfg = "0.1.3" 25 | log = { version = "0.4", default-features = false } 26 | anyhow = "1.0.79" 27 | 28 | 29 | [build-dependencies] 30 | embuild = "0.31.4" 31 | toml-cfg = "0.1.3" 32 | 33 | [package.metadata.esp-idf-sys] 34 | # MCU 名称 35 | mcu = "esp32s3" 36 | # esp-idf 版本 37 | # native builder only 38 | esp_idf_version = "v5.1.1" 39 | # 工具链路径设置为全局(global) 40 | esp_idf_tools_install_dir = "global" 41 | # SDK 配置文件路径 42 | esp_idf_sdkconfig = "sdkconfig" 43 | # esp_idf_sdkconfig_defaults = ["sdkconfig.defaults"] 44 | # 使用 ESP-IDF 的本地模式来禁用远程下载 45 | # git clone --branch v5.1.1 https://github.com/espressif/esp-idf.git 46 | idf_path = "/home/one/.espup/esp-idf" 47 | # esp-idf 组件管理器, 运行期间自动从组件注册表或 Git 存储库中获取组件 48 | # esp_idf_component_manager = "y" 49 | esp_idf_components = ["driver", "spi_flash"] 50 | -------------------------------------------------------------------------------- /app/basic/blinky/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "blinky" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | 7 | [features] 8 | default = ["std", "embassy", "esp-idf-svc/native"] 9 | 10 | # pio = ["esp-idf-svc/pio"] 11 | std = ["alloc", "esp-idf-svc/binstart", "esp-idf-svc/std"] 12 | alloc = ["esp-idf-svc/alloc"] 13 | nightly = ["esp-idf-svc/nightly"] 14 | experimental = ["esp-idf-svc/experimental"] 15 | embassy = [ 16 | "esp-idf-svc/embassy-sync", 17 | "esp-idf-svc/critical-section", 18 | "esp-idf-svc/embassy-time-driver", 19 | ] 20 | 21 | [dependencies] 22 | esp-idf-svc = { version = "0.47.3", default-features = false } 23 | # esp-idf-sys = "0.33.7" 24 | enumset = "1.1.3" 25 | toml-cfg = "0.1.3" 26 | log = { version = "0.4", default-features = false } 27 | anyhow = "1.0.79" 28 | 29 | [build-dependencies] 30 | embuild = "0.31.4" 31 | toml-cfg = "0.1.3" 32 | 33 | [package.metadata.esp-idf-sys] 34 | # MCU 名称 35 | mcu = "esp32s3" 36 | # esp-idf 版本 37 | # native builder only 38 | esp_idf_version = "v5.1.1" 39 | # 工具链路径设置为全局(global) 40 | esp_idf_tools_install_dir = "global" 41 | # SDK 配置文件路径 42 | esp_idf_sdkconfig = "sdkconfig" 43 | # esp_idf_sdkconfig_defaults = ["sdkconfig.defaults"] 44 | # 使用 ESP-IDF 的本地模式来禁用远程下载 45 | # git clone --branch v5.1.1 https://github.com/espressif/esp-idf.git 46 | idf_path = "/home/one/.espup/esp-idf" 47 | # esp-idf 组件管理器, 运行期间自动从组件注册表或 Git 存储库中获取组件 48 | # esp_idf_component_manager = "y" 49 | # esp_idf_components = ["spi_flash"] 50 | -------------------------------------------------------------------------------- /app/basic/button/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "button" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | 7 | [features] 8 | default = ["std", "embassy", "esp-idf-svc/native"] 9 | 10 | # pio = ["esp-idf-svc/pio"] 11 | std = ["alloc", "esp-idf-svc/binstart", "esp-idf-svc/std"] 12 | alloc = ["esp-idf-svc/alloc"] 13 | nightly = ["esp-idf-svc/nightly"] 14 | experimental = ["esp-idf-svc/experimental"] 15 | embassy = [ 16 | "esp-idf-svc/embassy-sync", 17 | "esp-idf-svc/critical-section", 18 | "esp-idf-svc/embassy-time-driver", 19 | ] 20 | 21 | [dependencies] 22 | esp-idf-svc = { version = "0.47.3", default-features = false } 23 | # esp-idf-sys = "0.33.7" 24 | enumset = "1.1.3" 25 | toml-cfg = "0.1.3" 26 | log = { version = "0.4", default-features = false } 27 | anyhow = "1.0.79" 28 | 29 | [build-dependencies] 30 | embuild = "0.31.4" 31 | toml-cfg = "0.1.3" 32 | 33 | [package.metadata.esp-idf-sys] 34 | # MCU 名称 35 | mcu = "esp32s3" 36 | # esp-idf 版本 37 | # native builder only 38 | esp_idf_version = "v5.1.1" 39 | # 工具链路径设置为全局(global) 40 | esp_idf_tools_install_dir = "global" 41 | # SDK 配置文件路径 42 | esp_idf_sdkconfig = "sdkconfig" 43 | # esp_idf_sdkconfig_defaults = ["sdkconfig.defaults"] 44 | # 使用 ESP-IDF 的本地模式来禁用远程下载 45 | # git clone --branch v5.1.1 https://github.com/espressif/esp-idf.git 46 | idf_path = "/home/one/.espup/esp-idf" 47 | # esp-idf 组件管理器, 运行期间自动从组件注册表或 Git 存储库中获取组件 48 | # esp_idf_component_manager = "y" 49 | # esp_idf_components = ["spi_flash"] 50 | -------------------------------------------------------------------------------- /app/basic/buzzer/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "buzzer" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | 7 | [features] 8 | default = ["std", "embassy", "esp-idf-svc/native"] 9 | 10 | # pio = ["esp-idf-svc/pio"] 11 | std = ["alloc", "esp-idf-svc/binstart", "esp-idf-svc/std"] 12 | alloc = ["esp-idf-svc/alloc"] 13 | nightly = ["esp-idf-svc/nightly"] 14 | experimental = ["esp-idf-svc/experimental"] 15 | embassy = [ 16 | "esp-idf-svc/embassy-sync", 17 | "esp-idf-svc/critical-section", 18 | "esp-idf-svc/embassy-time-driver", 19 | ] 20 | 21 | [dependencies] 22 | esp-idf-svc = { version = "0.47.3", default-features = false } 23 | # esp-idf-sys = "0.33.7" 24 | enumset = "1.1.3" 25 | toml-cfg = "0.1.3" 26 | log = { version = "0.4", default-features = false } 27 | anyhow = "1.0.79" 28 | 29 | [build-dependencies] 30 | embuild = "0.31.4" 31 | toml-cfg = "0.1.3" 32 | 33 | [package.metadata.esp-idf-sys] 34 | # MCU 名称 35 | mcu = "esp32s3" 36 | # esp-idf 版本 37 | # native builder only 38 | esp_idf_version = "v5.1.1" 39 | # 工具链路径设置为全局(global) 40 | esp_idf_tools_install_dir = "global" 41 | # SDK 配置文件路径 42 | esp_idf_sdkconfig = "sdkconfig" 43 | # esp_idf_sdkconfig_defaults = ["sdkconfig.defaults"] 44 | # 使用 ESP-IDF 的本地模式来禁用远程下载 45 | # git clone --branch v5.1.1 https://github.com/espressif/esp-idf.git 46 | idf_path = "/home/one/.espup/esp-idf" 47 | # esp-idf 组件管理器, 运行期间自动从组件注册表或 Git 存储库中获取组件 48 | # esp_idf_component_manager = "y" 49 | # esp_idf_components = ["spi_flash"] 50 | -------------------------------------------------------------------------------- /app/adc/adc_oneshot/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "adc_oneshot" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | 7 | [features] 8 | default = ["std", "embassy", "esp-idf-svc/native"] 9 | 10 | # pio = ["esp-idf-svc/pio"] 11 | std = ["alloc", "esp-idf-svc/binstart", "esp-idf-svc/std"] 12 | alloc = ["esp-idf-svc/alloc"] 13 | nightly = ["esp-idf-svc/nightly"] 14 | experimental = ["esp-idf-svc/experimental"] 15 | embassy = [ 16 | "esp-idf-svc/embassy-sync", 17 | "esp-idf-svc/critical-section", 18 | "esp-idf-svc/embassy-time-driver", 19 | ] 20 | 21 | [dependencies] 22 | esp-idf-svc = { version = "0.47.3", default-features = false } 23 | # esp-idf-sys = "0.33.7" 24 | enumset = "1.1.3" 25 | toml-cfg = "0.1.3" 26 | log = { version = "0.4", default-features = false } 27 | anyhow = "1.0.79" 28 | 29 | [build-dependencies] 30 | embuild = "0.31.4" 31 | toml-cfg = "0.1.3" 32 | 33 | [package.metadata.esp-idf-sys] 34 | # MCU 名称 35 | mcu = "esp32s3" 36 | # esp-idf 版本 37 | # native builder only 38 | esp_idf_version = "v5.1.1" 39 | # 工具链路径设置为全局(global) 40 | esp_idf_tools_install_dir = "global" 41 | # SDK 配置文件路径 42 | esp_idf_sdkconfig = "sdkconfig" 43 | # esp_idf_sdkconfig_defaults = ["sdkconfig.defaults"] 44 | # 使用 ESP-IDF 的本地模式来禁用远程下载 45 | # git clone --branch v5.1.1 https://github.com/espressif/esp-idf.git 46 | idf_path = "/home/one/.espup/esp-idf" 47 | # esp-idf 组件管理器, 运行期间自动从组件注册表或 Git 存储库中获取组件 48 | # esp_idf_component_manager = "y" 49 | # esp_idf_components = ["spi_flash"] 50 | -------------------------------------------------------------------------------- /app/basic/log_level/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "log_level" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | 7 | [features] 8 | default = ["std", "embassy", "esp-idf-svc/native"] 9 | 10 | # pio = ["esp-idf-svc/pio"] 11 | std = ["alloc", "esp-idf-svc/binstart", "esp-idf-svc/std"] 12 | alloc = ["esp-idf-svc/alloc"] 13 | nightly = ["esp-idf-svc/nightly"] 14 | experimental = ["esp-idf-svc/experimental"] 15 | embassy = [ 16 | "esp-idf-svc/embassy-sync", 17 | "esp-idf-svc/critical-section", 18 | "esp-idf-svc/embassy-time-driver", 19 | ] 20 | 21 | [dependencies] 22 | esp-idf-svc = { version = "0.47.3", default-features = false } 23 | # esp-idf-sys = "0.33.7" 24 | enumset = "1.1.3" 25 | toml-cfg = "0.1.3" 26 | log = { version = "0.4", default-features = false } 27 | anyhow = "1.0.79" 28 | 29 | [build-dependencies] 30 | embuild = "0.31.4" 31 | toml-cfg = "0.1.3" 32 | 33 | [package.metadata.esp-idf-sys] 34 | # MCU 名称 35 | mcu = "esp32s3" 36 | # esp-idf 版本 37 | # native builder only 38 | esp_idf_version = "v5.1.1" 39 | # 工具链路径设置为全局(global) 40 | esp_idf_tools_install_dir = "global" 41 | # SDK 配置文件路径 42 | esp_idf_sdkconfig = "sdkconfig" 43 | # esp_idf_sdkconfig_defaults = ["sdkconfig.defaults"] 44 | # 使用 ESP-IDF 的本地模式来禁用远程下载 45 | # git clone --branch v5.1.1 https://github.com/espressif/esp-idf.git 46 | idf_path = "/home/one/.espup/esp-idf" 47 | # esp-idf 组件管理器, 运行期间自动从组件注册表或 Git 存储库中获取组件 48 | # esp_idf_component_manager = "y" 49 | # esp_idf_components = ["spi_flash"] 50 | -------------------------------------------------------------------------------- /app/basic/button_async/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "button_async" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | 7 | [features] 8 | default = ["std", "embassy", "esp-idf-svc/native"] 9 | 10 | # pio = ["esp-idf-svc/pio"] 11 | std = ["alloc", "esp-idf-svc/binstart", "esp-idf-svc/std"] 12 | alloc = ["esp-idf-svc/alloc"] 13 | nightly = ["esp-idf-svc/nightly"] 14 | experimental = ["esp-idf-svc/experimental"] 15 | embassy = [ 16 | "esp-idf-svc/embassy-sync", 17 | "esp-idf-svc/critical-section", 18 | "esp-idf-svc/embassy-time-driver", 19 | ] 20 | 21 | [dependencies] 22 | esp-idf-svc = { version = "0.47.3", default-features = false } 23 | # esp-idf-sys = "0.33.7" 24 | enumset = "1.1.3" 25 | toml-cfg = "0.1.3" 26 | log = { version = "0.4", default-features = false } 27 | anyhow = "1.0.79" 28 | 29 | [build-dependencies] 30 | embuild = "0.31.4" 31 | toml-cfg = "0.1.3" 32 | 33 | [package.metadata.esp-idf-sys] 34 | # MCU 名称 35 | mcu = "esp32s3" 36 | # esp-idf 版本 37 | # native builder only 38 | esp_idf_version = "v5.1.1" 39 | # 工具链路径设置为全局(global) 40 | esp_idf_tools_install_dir = "global" 41 | # SDK 配置文件路径 42 | esp_idf_sdkconfig = "sdkconfig" 43 | # esp_idf_sdkconfig_defaults = ["sdkconfig.defaults"] 44 | # 使用 ESP-IDF 的本地模式来禁用远程下载 45 | # git clone --branch v5.1.1 https://github.com/espressif/esp-idf.git 46 | idf_path = "/home/one/.espup/esp-idf" 47 | # esp-idf 组件管理器, 运行期间自动从组件注册表或 Git 存储库中获取组件 48 | # esp_idf_component_manager = "y" 49 | # esp_idf_components = ["spi_flash"] 50 | -------------------------------------------------------------------------------- /app/basic/hello_world/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "hello_world" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | 7 | [features] 8 | default = ["std", "embassy", "esp-idf-svc/native"] 9 | 10 | # pio = ["esp-idf-svc/pio"] 11 | std = ["alloc", "esp-idf-svc/binstart", "esp-idf-svc/std"] 12 | alloc = ["esp-idf-svc/alloc"] 13 | nightly = ["esp-idf-svc/nightly"] 14 | experimental = ["esp-idf-svc/experimental"] 15 | embassy = [ 16 | "esp-idf-svc/embassy-sync", 17 | "esp-idf-svc/critical-section", 18 | "esp-idf-svc/embassy-time-driver", 19 | ] 20 | 21 | [dependencies] 22 | esp-idf-svc = { version = "0.47.3", default-features = false } 23 | # esp-idf-sys = "0.33.7" 24 | enumset = "1.1.3" 25 | toml-cfg = "0.1.3" 26 | log = { version = "0.4", default-features = false } 27 | anyhow = "1.0.79" 28 | 29 | [build-dependencies] 30 | embuild = "0.31.4" 31 | toml-cfg = "0.1.3" 32 | 33 | [package.metadata.esp-idf-sys] 34 | # MCU 名称 35 | mcu = "esp32s3" 36 | # esp-idf 版本 37 | # native builder only 38 | esp_idf_version = "v5.1.1" 39 | # 工具链路径设置为全局(global) 40 | esp_idf_tools_install_dir = "global" 41 | # SDK 配置文件路径 42 | esp_idf_sdkconfig = "sdkconfig" 43 | # esp_idf_sdkconfig_defaults = ["sdkconfig.defaults"] 44 | # 使用 ESP-IDF 的本地模式来禁用远程下载 45 | # git clone --branch v5.1.1 https://github.com/espressif/esp-idf.git 46 | idf_path = "/home/one/.espup/esp-idf" 47 | # esp-idf 组件管理器, 运行期间自动从组件注册表或 Git 存储库中获取组件 48 | # esp_idf_component_manager = "y" 49 | # esp_idf_components = ["spi_flash"] 50 | -------------------------------------------------------------------------------- /app/uart/uart_fmt/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "uart_fmt" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | 7 | [features] 8 | default = ["std", "embassy", "esp-idf-svc/native"] 9 | 10 | # pio = ["esp-idf-svc/pio"] 11 | std = ["alloc", "esp-idf-svc/binstart", "esp-idf-svc/std"] 12 | alloc = ["esp-idf-svc/alloc"] 13 | nightly = ["esp-idf-svc/nightly"] 14 | experimental = ["esp-idf-svc/experimental"] 15 | embassy = [ 16 | "esp-idf-svc/embassy-sync", 17 | "esp-idf-svc/critical-section", 18 | "esp-idf-svc/embassy-time-driver", 19 | ] 20 | 21 | [dependencies] 22 | esp-idf-svc = { version = "0.47.3", default-features = false } 23 | # esp-idf-sys = "0.33.7" 24 | enumset = "1.1.3" 25 | toml-cfg = "0.1.3" 26 | log = { version = "0.4", default-features = false } 27 | anyhow = "1.0.79" 28 | 29 | 30 | [build-dependencies] 31 | embuild = "0.31.4" 32 | toml-cfg = "0.1.3" 33 | 34 | [package.metadata.esp-idf-sys] 35 | # MCU 名称 36 | mcu = "esp32s3" 37 | # esp-idf 版本 38 | # native builder only 39 | esp_idf_version = "v5.1.1" 40 | # 工具链路径设置为全局(global) 41 | esp_idf_tools_install_dir = "global" 42 | # SDK 配置文件路径 43 | esp_idf_sdkconfig = "sdkconfig" 44 | # esp_idf_sdkconfig_defaults = ["sdkconfig.defaults"] 45 | # 使用 ESP-IDF 的本地模式来禁用远程下载 46 | # git clone --branch v5.1.1 https://github.com/espressif/esp-idf.git 47 | idf_path = "/home/one/.espup/esp-idf" 48 | # esp-idf 组件管理器, 运行期间自动从组件注册表或 Git 存储库中获取组件 49 | # esp_idf_component_manager = "y" 50 | # esp_idf_components = ["spi_flash"] 51 | -------------------------------------------------------------------------------- /app/adc/ad_multichannel/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ad_multichannel" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | 7 | [features] 8 | default = ["std", "embassy", "esp-idf-svc/native"] 9 | 10 | # pio = ["esp-idf-svc/pio"] 11 | std = ["alloc", "esp-idf-svc/binstart", "esp-idf-svc/std"] 12 | alloc = ["esp-idf-svc/alloc"] 13 | nightly = ["esp-idf-svc/nightly"] 14 | experimental = ["esp-idf-svc/experimental"] 15 | embassy = [ 16 | "esp-idf-svc/embassy-sync", 17 | "esp-idf-svc/critical-section", 18 | "esp-idf-svc/embassy-time-driver", 19 | ] 20 | 21 | [dependencies] 22 | esp-idf-svc = { version = "0.47.3", default-features = false } 23 | # esp-idf-sys = "0.33.7" 24 | enumset = "1.1.3" 25 | toml-cfg = "0.1.3" 26 | log = { version = "0.4", default-features = false } 27 | anyhow = "1.0.79" 28 | 29 | [build-dependencies] 30 | embuild = "0.31.4" 31 | toml-cfg = "0.1.3" 32 | 33 | [package.metadata.esp-idf-sys] 34 | # MCU 名称 35 | mcu = "esp32s3" 36 | # esp-idf 版本 37 | # native builder only 38 | esp_idf_version = "v5.1.1" 39 | # 工具链路径设置为全局(global) 40 | esp_idf_tools_install_dir = "global" 41 | # SDK 配置文件路径 42 | esp_idf_sdkconfig = "sdkconfig" 43 | # esp_idf_sdkconfig_defaults = ["sdkconfig.defaults"] 44 | # 使用 ESP-IDF 的本地模式来禁用远程下载 45 | # git clone --branch v5.1.1 https://github.com/espressif/esp-idf.git 46 | idf_path = "/home/one/.espup/esp-idf" 47 | # esp-idf 组件管理器, 运行期间自动从组件注册表或 Git 存储库中获取组件 48 | # esp_idf_component_manager = "y" 49 | # esp_idf_components = ["spi_flash"] 50 | -------------------------------------------------------------------------------- /app/basic/button_toggle/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "button_toggle" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | 7 | [features] 8 | default = ["std", "embassy", "esp-idf-svc/native"] 9 | 10 | # pio = ["esp-idf-svc/pio"] 11 | std = ["alloc", "esp-idf-svc/binstart", "esp-idf-svc/std"] 12 | alloc = ["esp-idf-svc/alloc"] 13 | nightly = ["esp-idf-svc/nightly"] 14 | experimental = ["esp-idf-svc/experimental"] 15 | embassy = [ 16 | "esp-idf-svc/embassy-sync", 17 | "esp-idf-svc/critical-section", 18 | "esp-idf-svc/embassy-time-driver", 19 | ] 20 | 21 | [dependencies] 22 | esp-idf-svc = { version = "0.47.3", default-features = false } 23 | # esp-idf-sys = "0.33.7" 24 | enumset = "1.1.3" 25 | toml-cfg = "0.1.3" 26 | log = { version = "0.4", default-features = false } 27 | anyhow = "1.0.79" 28 | 29 | [build-dependencies] 30 | embuild = "0.31.4" 31 | toml-cfg = "0.1.3" 32 | 33 | [package.metadata.esp-idf-sys] 34 | # MCU 名称 35 | mcu = "esp32s3" 36 | # esp-idf 版本 37 | # native builder only 38 | esp_idf_version = "v5.1.1" 39 | # 工具链路径设置为全局(global) 40 | esp_idf_tools_install_dir = "global" 41 | # SDK 配置文件路径 42 | esp_idf_sdkconfig = "sdkconfig" 43 | # esp_idf_sdkconfig_defaults = ["sdkconfig.defaults"] 44 | # 使用 ESP-IDF 的本地模式来禁用远程下载 45 | # git clone --branch v5.1.1 https://github.com/espressif/esp-idf.git 46 | idf_path = "/home/one/.espup/esp-idf" 47 | # esp-idf 组件管理器, 运行期间自动从组件注册表或 Git 存储库中获取组件 48 | # esp_idf_component_manager = "y" 49 | # esp_idf_components = ["spi_flash"] 50 | -------------------------------------------------------------------------------- /app/basic/led_flow_light/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "led_flow_light" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | 7 | [features] 8 | default = ["std", "embassy", "esp-idf-svc/native"] 9 | 10 | # pio = ["esp-idf-svc/pio"] 11 | std = ["alloc", "esp-idf-svc/binstart", "esp-idf-svc/std"] 12 | alloc = ["esp-idf-svc/alloc"] 13 | nightly = ["esp-idf-svc/nightly"] 14 | experimental = ["esp-idf-svc/experimental"] 15 | embassy = [ 16 | "esp-idf-svc/embassy-sync", 17 | "esp-idf-svc/critical-section", 18 | "esp-idf-svc/embassy-time-driver", 19 | ] 20 | 21 | [dependencies] 22 | esp-idf-svc = { version = "0.47.3", default-features = false } 23 | # esp-idf-sys = "0.33.7" 24 | enumset = "1.1.3" 25 | toml-cfg = "0.1.3" 26 | log = { version = "0.4", default-features = false } 27 | anyhow = "1.0.79" 28 | 29 | [build-dependencies] 30 | embuild = "0.31.4" 31 | toml-cfg = "0.1.3" 32 | 33 | [package.metadata.esp-idf-sys] 34 | # MCU 名称 35 | mcu = "esp32s3" 36 | # esp-idf 版本 37 | # native builder only 38 | esp_idf_version = "v5.1.1" 39 | # 工具链路径设置为全局(global) 40 | esp_idf_tools_install_dir = "global" 41 | # SDK 配置文件路径 42 | esp_idf_sdkconfig = "sdkconfig" 43 | # esp_idf_sdkconfig_defaults = ["sdkconfig.defaults"] 44 | # 使用 ESP-IDF 的本地模式来禁用远程下载 45 | # git clone --branch v5.1.1 https://github.com/espressif/esp-idf.git 46 | idf_path = "/home/one/.espup/esp-idf" 47 | # esp-idf 组件管理器, 运行期间自动从组件注册表或 Git 存储库中获取组件 48 | # esp_idf_component_manager = "y" 49 | # esp_idf_components = ["spi_flash"] 50 | -------------------------------------------------------------------------------- /app/delay/freertos_delay/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "freertos_delay" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | 7 | [features] 8 | default = ["std", "embassy", "esp-idf-svc/native"] 9 | 10 | # pio = ["esp-idf-svc/pio"] 11 | std = ["alloc", "esp-idf-svc/binstart", "esp-idf-svc/std"] 12 | alloc = ["esp-idf-svc/alloc"] 13 | nightly = ["esp-idf-svc/nightly"] 14 | experimental = ["esp-idf-svc/experimental"] 15 | embassy = [ 16 | "esp-idf-svc/embassy-sync", 17 | "esp-idf-svc/critical-section", 18 | "esp-idf-svc/embassy-time-driver", 19 | ] 20 | 21 | [dependencies] 22 | esp-idf-svc = { version = "0.47.3", default-features = false } 23 | # esp-idf-sys = "0.33.7" 24 | enumset = "1.1.3" 25 | toml-cfg = "0.1.3" 26 | log = { version = "0.4", default-features = false } 27 | anyhow = "1.0.79" 28 | 29 | [build-dependencies] 30 | embuild = "0.31.4" 31 | toml-cfg = "0.1.3" 32 | 33 | [package.metadata.esp-idf-sys] 34 | # MCU 名称 35 | mcu = "esp32s3" 36 | # esp-idf 版本 37 | # native builder only 38 | esp_idf_version = "v5.1.1" 39 | # 工具链路径设置为全局(global) 40 | esp_idf_tools_install_dir = "global" 41 | # SDK 配置文件路径 42 | esp_idf_sdkconfig = "sdkconfig" 43 | # esp_idf_sdkconfig_defaults = ["sdkconfig.defaults"] 44 | # 使用 ESP-IDF 的本地模式来禁用远程下载 45 | # git clone --branch v5.1.1 https://github.com/espressif/esp-idf.git 46 | idf_path = "/home/one/.espup/esp-idf" 47 | # esp-idf 组件管理器, 运行期间自动从组件注册表或 Git 存储库中获取组件 48 | # esp_idf_component_manager = "y" 49 | # esp_idf_components = ["spi_flash"] 50 | -------------------------------------------------------------------------------- /app/interrupt/key_isr1/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "key_isr1" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | 7 | [features] 8 | default = ["std", "embassy", "esp-idf-svc/native"] 9 | 10 | # pio = ["esp-idf-svc/pio"] 11 | std = ["alloc", "esp-idf-svc/binstart", "esp-idf-svc/std"] 12 | alloc = ["esp-idf-svc/alloc"] 13 | nightly = ["esp-idf-svc/nightly"] 14 | experimental = ["esp-idf-svc/experimental"] 15 | embassy = [ 16 | "esp-idf-svc/embassy-sync", 17 | "esp-idf-svc/critical-section", 18 | "esp-idf-svc/embassy-time-driver", 19 | ] 20 | 21 | [dependencies] 22 | esp-idf-svc = { version = "0.47.3", default-features = false } 23 | # esp-idf-sys = "0.33.7" 24 | enumset = "1.1.3" 25 | toml-cfg = "0.1.3" 26 | log = { version = "0.4", default-features = false } 27 | anyhow = "1.0.79" 28 | 29 | 30 | [build-dependencies] 31 | embuild = "0.31.4" 32 | toml-cfg = "0.1.3" 33 | 34 | [package.metadata.esp-idf-sys] 35 | # MCU 名称 36 | mcu = "esp32s3" 37 | # esp-idf 版本 38 | # native builder only 39 | esp_idf_version = "v5.1.1" 40 | # 工具链路径设置为全局(global) 41 | esp_idf_tools_install_dir = "global" 42 | # SDK 配置文件路径 43 | esp_idf_sdkconfig = "sdkconfig" 44 | # esp_idf_sdkconfig_defaults = ["sdkconfig.defaults"] 45 | # 使用 ESP-IDF 的本地模式来禁用远程下载 46 | # git clone --branch v5.1.1 https://github.com/espressif/esp-idf.git 47 | idf_path = "/home/one/.espup/esp-idf" 48 | # esp-idf 组件管理器, 运行期间自动从组件注册表或 Git 存储库中获取组件 49 | # esp_idf_component_manager = "y" 50 | # esp_idf_components = ["spi_flash"] 51 | -------------------------------------------------------------------------------- /app/interrupt/key_isr2/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "key_isr2" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | 7 | [features] 8 | default = ["std", "embassy", "esp-idf-svc/native"] 9 | 10 | # pio = ["esp-idf-svc/pio"] 11 | std = ["alloc", "esp-idf-svc/binstart", "esp-idf-svc/std"] 12 | alloc = ["esp-idf-svc/alloc"] 13 | nightly = ["esp-idf-svc/nightly"] 14 | experimental = ["esp-idf-svc/experimental"] 15 | embassy = [ 16 | "esp-idf-svc/embassy-sync", 17 | "esp-idf-svc/critical-section", 18 | "esp-idf-svc/embassy-time-driver", 19 | ] 20 | 21 | [dependencies] 22 | esp-idf-svc = { version = "0.47.3", default-features = false } 23 | # esp-idf-sys = "0.33.7" 24 | enumset = "1.1.3" 25 | toml-cfg = "0.1.3" 26 | log = { version = "0.4", default-features = false } 27 | anyhow = "1.0.79" 28 | 29 | 30 | [build-dependencies] 31 | embuild = "0.31.4" 32 | toml-cfg = "0.1.3" 33 | 34 | [package.metadata.esp-idf-sys] 35 | # MCU 名称 36 | mcu = "esp32s3" 37 | # esp-idf 版本 38 | # native builder only 39 | esp_idf_version = "v5.1.1" 40 | # 工具链路径设置为全局(global) 41 | esp_idf_tools_install_dir = "global" 42 | # SDK 配置文件路径 43 | esp_idf_sdkconfig = "sdkconfig" 44 | # esp_idf_sdkconfig_defaults = ["sdkconfig.defaults"] 45 | # 使用 ESP-IDF 的本地模式来禁用远程下载 46 | # git clone --branch v5.1.1 https://github.com/espressif/esp-idf.git 47 | idf_path = "/home/one/.espup/esp-idf" 48 | # esp-idf 组件管理器, 运行期间自动从组件注册表或 Git 存储库中获取组件 49 | # esp_idf_component_manager = "y" 50 | # esp_idf_components = ["spi_flash"] 51 | -------------------------------------------------------------------------------- /app/interrupt/key_isr3/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "key_isr3" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | 7 | [features] 8 | default = ["std", "embassy", "esp-idf-svc/native"] 9 | 10 | # pio = ["esp-idf-svc/pio"] 11 | std = ["alloc", "esp-idf-svc/binstart", "esp-idf-svc/std"] 12 | alloc = ["esp-idf-svc/alloc"] 13 | nightly = ["esp-idf-svc/nightly"] 14 | experimental = ["esp-idf-svc/experimental"] 15 | embassy = [ 16 | "esp-idf-svc/embassy-sync", 17 | "esp-idf-svc/critical-section", 18 | "esp-idf-svc/embassy-time-driver", 19 | ] 20 | 21 | [dependencies] 22 | esp-idf-svc = { version = "0.47.3", default-features = false } 23 | # esp-idf-sys = "0.33.7" 24 | enumset = "1.1.3" 25 | toml-cfg = "0.1.3" 26 | log = { version = "0.4", default-features = false } 27 | anyhow = "1.0.79" 28 | 29 | 30 | [build-dependencies] 31 | embuild = "0.31.4" 32 | toml-cfg = "0.1.3" 33 | 34 | [package.metadata.esp-idf-sys] 35 | # MCU 名称 36 | mcu = "esp32s3" 37 | # esp-idf 版本 38 | # native builder only 39 | esp_idf_version = "v5.1.1" 40 | # 工具链路径设置为全局(global) 41 | esp_idf_tools_install_dir = "global" 42 | # SDK 配置文件路径 43 | esp_idf_sdkconfig = "sdkconfig" 44 | # esp_idf_sdkconfig_defaults = ["sdkconfig.defaults"] 45 | # 使用 ESP-IDF 的本地模式来禁用远程下载 46 | # git clone --branch v5.1.1 https://github.com/espressif/esp-idf.git 47 | idf_path = "/home/one/.espup/esp-idf" 48 | # esp-idf 组件管理器, 运行期间自动从组件注册表或 Git 存储库中获取组件 49 | # esp_idf_component_manager = "y" 50 | # esp_idf_components = ["spi_flash"] 51 | -------------------------------------------------------------------------------- /app/interrupt/rtc_gpio/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rtc_gpio" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | 7 | [features] 8 | default = ["std", "embassy", "esp-idf-svc/native"] 9 | 10 | # pio = ["esp-idf-svc/pio"] 11 | std = ["alloc", "esp-idf-svc/binstart", "esp-idf-svc/std"] 12 | alloc = ["esp-idf-svc/alloc"] 13 | nightly = ["esp-idf-svc/nightly"] 14 | experimental = ["esp-idf-svc/experimental"] 15 | embassy = [ 16 | "esp-idf-svc/embassy-sync", 17 | "esp-idf-svc/critical-section", 18 | "esp-idf-svc/embassy-time-driver", 19 | ] 20 | 21 | [dependencies] 22 | esp-idf-svc = { version = "0.47.3", default-features = false } 23 | # esp-idf-sys = "0.33.7" 24 | enumset = "1.1.3" 25 | toml-cfg = "0.1.3" 26 | log = { version = "0.4", default-features = false } 27 | anyhow = "1.0.79" 28 | 29 | 30 | [build-dependencies] 31 | embuild = "0.31.4" 32 | toml-cfg = "0.1.3" 33 | 34 | [package.metadata.esp-idf-sys] 35 | # MCU 名称 36 | mcu = "esp32s3" 37 | # esp-idf 版本 38 | # native builder only 39 | esp_idf_version = "v5.1.1" 40 | # 工具链路径设置为全局(global) 41 | esp_idf_tools_install_dir = "global" 42 | # SDK 配置文件路径 43 | esp_idf_sdkconfig = "sdkconfig" 44 | # esp_idf_sdkconfig_defaults = ["sdkconfig.defaults"] 45 | # 使用 ESP-IDF 的本地模式来禁用远程下载 46 | # git clone --branch v5.1.1 https://github.com/espressif/esp-idf.git 47 | idf_path = "/home/one/.espup/esp-idf" 48 | # esp-idf 组件管理器, 运行期间自动从组件注册表或 Git 存储库中获取组件 49 | # esp_idf_component_manager = "y" 50 | # esp_idf_components = ["spi_flash"] 51 | -------------------------------------------------------------------------------- /app/spi/spi_loopback/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "spi_loopback" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | 7 | [features] 8 | default = ["std", "embassy", "esp-idf-svc/native"] 9 | 10 | # pio = ["esp-idf-svc/pio"] 11 | std = ["alloc", "esp-idf-svc/binstart", "esp-idf-svc/std"] 12 | alloc = ["esp-idf-svc/alloc"] 13 | nightly = ["esp-idf-svc/nightly"] 14 | experimental = ["esp-idf-svc/experimental"] 15 | embassy = [ 16 | "esp-idf-svc/embassy-sync", 17 | "esp-idf-svc/critical-section", 18 | "esp-idf-svc/embassy-time-driver", 19 | ] 20 | 21 | [dependencies] 22 | esp-idf-svc = { version = "0.47.3", default-features = false } 23 | # esp-idf-sys = "0.33.7" 24 | enumset = "1.1.3" 25 | toml-cfg = "0.1.3" 26 | log = { version = "0.4", default-features = false } 27 | anyhow = "1.0.79" 28 | 29 | 30 | [build-dependencies] 31 | embuild = "0.31.4" 32 | toml-cfg = "0.1.3" 33 | 34 | [package.metadata.esp-idf-sys] 35 | # MCU 名称 36 | mcu = "esp32s3" 37 | # esp-idf 版本 38 | # native builder only 39 | esp_idf_version = "v5.1.1" 40 | # 工具链路径设置为全局(global) 41 | esp_idf_tools_install_dir = "global" 42 | # SDK 配置文件路径 43 | esp_idf_sdkconfig = "sdkconfig" 44 | # esp_idf_sdkconfig_defaults = ["sdkconfig.defaults"] 45 | # 使用 ESP-IDF 的本地模式来禁用远程下载 46 | # git clone --branch v5.1.1 https://github.com/espressif/esp-idf.git 47 | idf_path = "/home/one/.espup/esp-idf" 48 | # esp-idf 组件管理器, 运行期间自动从组件注册表或 Git 存储库中获取组件 49 | # esp_idf_component_manager = "y" 50 | # esp_idf_components = ["spi_flash"] 51 | -------------------------------------------------------------------------------- /app/wdg/code_disable_wdg/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "code_disable_wdg" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | 7 | [features] 8 | default = ["std", "embassy", "esp-idf-svc/native"] 9 | 10 | # pio = ["esp-idf-svc/pio"] 11 | std = ["alloc", "esp-idf-svc/binstart", "esp-idf-svc/std"] 12 | alloc = ["esp-idf-svc/alloc"] 13 | nightly = ["esp-idf-svc/nightly"] 14 | experimental = ["esp-idf-svc/experimental"] 15 | embassy = [ 16 | "esp-idf-svc/embassy-sync", 17 | "esp-idf-svc/critical-section", 18 | "esp-idf-svc/embassy-time-driver", 19 | ] 20 | 21 | [dependencies] 22 | esp-idf-svc = { version = "0.47.3", default-features = false } 23 | # esp-idf-sys = "0.33.7" 24 | enumset = "1.1.3" 25 | toml-cfg = "0.1.3" 26 | log = { version = "0.4", default-features = false } 27 | anyhow = "1.0.79" 28 | 29 | [build-dependencies] 30 | embuild = "0.31.4" 31 | toml-cfg = "0.1.3" 32 | 33 | [package.metadata.esp-idf-sys] 34 | # MCU 名称 35 | mcu = "esp32s3" 36 | # esp-idf 版本 37 | # native builder only 38 | esp_idf_version = "v5.1.1" 39 | # 工具链路径设置为全局(global) 40 | esp_idf_tools_install_dir = "global" 41 | # SDK 配置文件路径 42 | esp_idf_sdkconfig = "sdkconfig" 43 | # esp_idf_sdkconfig_defaults = ["sdkconfig.defaults"] 44 | # 使用 ESP-IDF 的本地模式来禁用远程下载 45 | # git clone --branch v5.1.1 https://github.com/espressif/esp-idf.git 46 | idf_path = "/home/one/.espup/esp-idf" 47 | # esp-idf 组件管理器, 运行期间自动从组件注册表或 Git 存储库中获取组件 48 | # esp_idf_component_manager = "y" 49 | # esp_idf_components = ["spi_flash"] 50 | -------------------------------------------------------------------------------- /app/delay/async_timer_delay/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "async_timer_delay" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | 7 | [features] 8 | default = ["std", "embassy", "esp-idf-svc/native"] 9 | 10 | # pio = ["esp-idf-svc/pio"] 11 | std = ["alloc", "esp-idf-svc/binstart", "esp-idf-svc/std"] 12 | alloc = ["esp-idf-svc/alloc"] 13 | nightly = ["esp-idf-svc/nightly"] 14 | experimental = ["esp-idf-svc/experimental"] 15 | embassy = [ 16 | "esp-idf-svc/embassy-sync", 17 | "esp-idf-svc/critical-section", 18 | "esp-idf-svc/embassy-time-driver", 19 | ] 20 | 21 | [dependencies] 22 | esp-idf-svc = { version = "0.47.3", default-features = false } 23 | # esp-idf-sys = "0.33.7" 24 | enumset = "1.1.3" 25 | toml-cfg = "0.1.3" 26 | log = { version = "0.4", default-features = false } 27 | anyhow = "1.0.79" 28 | 29 | [build-dependencies] 30 | embuild = "0.31.4" 31 | toml-cfg = "0.1.3" 32 | 33 | [package.metadata.esp-idf-sys] 34 | # MCU 名称 35 | mcu = "esp32s3" 36 | # esp-idf 版本 37 | # native builder only 38 | esp_idf_version = "v5.1.1" 39 | # 工具链路径设置为全局(global) 40 | esp_idf_tools_install_dir = "global" 41 | # SDK 配置文件路径 42 | esp_idf_sdkconfig = "sdkconfig" 43 | # esp_idf_sdkconfig_defaults = ["sdkconfig.defaults"] 44 | # 使用 ESP-IDF 的本地模式来禁用远程下载 45 | # git clone --branch v5.1.1 https://github.com/espressif/esp-idf.git 46 | idf_path = "/home/one/.espup/esp-idf" 47 | # esp-idf 组件管理器, 运行期间自动从组件注册表或 Git 存储库中获取组件 48 | # esp_idf_component_manager = "y" 49 | # esp_idf_components = ["spi_flash"] 50 | -------------------------------------------------------------------------------- /app/hardware/hardware_rgb_led/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "hardware_rgb_led" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | 7 | [features] 8 | default = ["std", "embassy", "esp-idf-svc/native"] 9 | 10 | # pio = ["esp-idf-svc/pio"] 11 | std = ["alloc", "esp-idf-svc/binstart", "esp-idf-svc/std"] 12 | alloc = ["esp-idf-svc/alloc"] 13 | nightly = ["esp-idf-svc/nightly"] 14 | experimental = ["esp-idf-svc/experimental"] 15 | embassy = [ 16 | "esp-idf-svc/embassy-sync", 17 | "esp-idf-svc/critical-section", 18 | "esp-idf-svc/embassy-time-driver", 19 | ] 20 | 21 | [dependencies] 22 | esp-idf-svc = { version = "0.47.3", default-features = false } 23 | # esp-idf-sys = "0.33.7" 24 | enumset = "1.1.3" 25 | toml-cfg = "0.1.3" 26 | log = { version = "0.4", default-features = false } 27 | anyhow = "1.0.79" 28 | 29 | [build-dependencies] 30 | embuild = "0.31.4" 31 | toml-cfg = "0.1.3" 32 | 33 | [package.metadata.esp-idf-sys] 34 | # MCU 名称 35 | mcu = "esp32s3" 36 | # esp-idf 版本 37 | # native builder only 38 | esp_idf_version = "v5.1.1" 39 | # 工具链路径设置为全局(global) 40 | esp_idf_tools_install_dir = "global" 41 | # SDK 配置文件路径 42 | esp_idf_sdkconfig = "sdkconfig" 43 | # esp_idf_sdkconfig_defaults = ["sdkconfig.defaults"] 44 | # 使用 ESP-IDF 的本地模式来禁用远程下载 45 | # git clone --branch v5.1.1 https://github.com/espressif/esp-idf.git 46 | idf_path = "/home/one/.espup/esp-idf" 47 | # esp-idf 组件管理器, 运行期间自动从组件注册表或 Git 存储库中获取组件 48 | # esp_idf_component_manager = "y" 49 | # esp_idf_components = ["spi_flash"] 50 | -------------------------------------------------------------------------------- /app/interrupt/timer_notify/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "timer_notify" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | 7 | [features] 8 | default = ["std", "embassy", "esp-idf-svc/native"] 9 | 10 | # pio = ["esp-idf-svc/pio"] 11 | std = ["alloc", "esp-idf-svc/binstart", "esp-idf-svc/std"] 12 | alloc = ["esp-idf-svc/alloc"] 13 | nightly = ["esp-idf-svc/nightly"] 14 | experimental = ["esp-idf-svc/experimental"] 15 | embassy = [ 16 | "esp-idf-svc/embassy-sync", 17 | "esp-idf-svc/critical-section", 18 | "esp-idf-svc/embassy-time-driver", 19 | ] 20 | 21 | [dependencies] 22 | esp-idf-svc = { version = "0.47.3", default-features = false } 23 | # esp-idf-sys = "0.33.7" 24 | enumset = "1.1.3" 25 | toml-cfg = "0.1.3" 26 | log = { version = "0.4", default-features = false } 27 | anyhow = "1.0.79" 28 | 29 | 30 | [build-dependencies] 31 | embuild = "0.31.4" 32 | toml-cfg = "0.1.3" 33 | 34 | [package.metadata.esp-idf-sys] 35 | # MCU 名称 36 | mcu = "esp32s3" 37 | # esp-idf 版本 38 | # native builder only 39 | esp_idf_version = "v5.1.1" 40 | # 工具链路径设置为全局(global) 41 | esp_idf_tools_install_dir = "global" 42 | # SDK 配置文件路径 43 | esp_idf_sdkconfig = "sdkconfig" 44 | # esp_idf_sdkconfig_defaults = ["sdkconfig.defaults"] 45 | # 使用 ESP-IDF 的本地模式来禁用远程下载 46 | # git clone --branch v5.1.1 https://github.com/espressif/esp-idf.git 47 | idf_path = "/home/one/.espup/esp-idf" 48 | # esp-idf 组件管理器, 运行期间自动从组件注册表或 Git 存储库中获取组件 49 | # esp_idf_component_manager = "y" 50 | # esp_idf_components = ["spi_flash"] 51 | --------------------------------------------------------------------------------