v0.2:重写项目。 #6
21
README.md
Normal file
21
README.md
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# UPS ESP32-C3 Rust
|
||||||
|
|
||||||
|
一个使用 Rust 语言开发的 UPS 程序,适用于 乐鑫×安信可的 ESP32-C3-32S 模块。
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- [x] 输入电压、输出电压、电池电压检测;
|
||||||
|
- [x] Wi-Fi 联网;
|
||||||
|
- [x] 以 NTP 方式校准时间;
|
||||||
|
- [x] 以 MQTT 方式上报状态;
|
||||||
|
- [x] 提供 UPS 电源输出的控制信号;
|
||||||
|
- [ ] 提供 UPS 内置电池充电电路电源输入的控制信号;
|
||||||
|
|
||||||
|
## GPIO 定义
|
||||||
|
|
||||||
|
- `GPIO 1`:UPS 输入电压检测,使用 `ADC 0`;
|
||||||
|
- `GPIO 2`:电池电芯电压检测,使用 `ADC 0`;
|
||||||
|
- `GPIO 3`:UPS 输出电压检测,使用 `ADC 0`;
|
||||||
|
- `GPIO 4`:蜂鸣器模拟信号输出,使用 `CHANNEL 0`, `TIMER 0`;
|
||||||
|
- `GPIO 5`:工作状态指示灯信号输出;
|
||||||
|
- `GPIO 6`:UPS 输出控制信号,适用于 P-MOS 开关;
|
@ -120,7 +120,6 @@ fn main() {
|
|||||||
if let Some(dc_state_event_loop) = unsafe { DC_OUT_STATE_EVENT_LOOP.as_mut() } {
|
if let Some(dc_state_event_loop) = unsafe { DC_OUT_STATE_EVENT_LOOP.as_mut() } {
|
||||||
_dc_out_state_subscription = dc_state_event_loop
|
_dc_out_state_subscription = dc_state_event_loop
|
||||||
.subscribe(move |message: &DcOutControllerState| {
|
.subscribe(move |message: &DcOutControllerState| {
|
||||||
info!("Event Loop Value");
|
|
||||||
match message.status {
|
match message.status {
|
||||||
dc_out_controller::DcOutStatus::WaitingOff => {
|
dc_out_controller::DcOutStatus::WaitingOff => {
|
||||||
beep.play(ringtone::ADAPTER_DOWN).expect("Can not beep.")
|
beep.play(ringtone::ADAPTER_DOWN).expect("Can not beep.")
|
||||||
|
Loading…
Reference in New Issue
Block a user