update valtage and current get

This commit is contained in:
不吃油炸鸡
2025-09-14 18:47:02 +08:00
parent b7e746a7c2
commit a3b9fbbbe7
7 changed files with 122 additions and 29 deletions

View File

@@ -6,6 +6,7 @@ extern "C" {
#endif
#include "main.h"
#include "adc.h"
// EN1
#define EN1_PORT GPIOB
@@ -16,18 +17,19 @@ extern "C" {
#define EN2_PIN GPIO_PIN_15
// Flow route selection
#define HIGH_CUR 2
#define MID_CUR 1
#define LOW_CUR 0
#define HIGH_CUR 3
#define MID_CUR 2
#define LOW_CUR 1
// Resistance values in ohms
#define HIGH_CUR_RES 0.005 // 5 m ohm
#define MID_CUR_RES 0.5 // 500 m ohm
#define LOW_CUR_RES 50.0 // 50 ohm
#define HIGH_CUR_RES 0.005f // 5 m ohm
#define MID_CUR_RES 0.5f // 500 m ohm
#define LOW_CUR_RES 50.0f // 50 ohm
void Gate_Port_Init(void);
void flow_route_selection(uint8_t selection);
uint8_t Gate_get_status(void);
void Gate_Swich_and_UART_Send(ADC_Packet adc_packet);
#ifdef __cplusplus
}