Files

39 lines
675 B
C
Raw Permalink Normal View History

2025-08-12 18:43:52 +08:00
#ifndef __GATE_H__
#define __GATE_H__
#ifdef __cplusplus
extern "C" {
#endif
#include "main.h"
2025-09-14 18:47:02 +08:00
#include "adc.h"
2025-08-12 18:43:52 +08:00
// EN1
#define EN1_PORT GPIOB
#define EN1_PIN GPIO_PIN_3
// EN2
#define EN2_PORT GPIOA
#define EN2_PIN GPIO_PIN_15
// Flow route selection
2025-09-14 18:47:02 +08:00
#define HIGH_CUR 3
#define MID_CUR 2
#define LOW_CUR 1
2025-08-12 18:43:52 +08:00
// Resistance values in ohms
2025-09-14 18:47:02 +08:00
#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
2025-08-12 18:43:52 +08:00
void Gate_Port_Init(void);
void flow_route_selection(uint8_t selection);
uint8_t Gate_get_status(void);
2025-09-14 18:47:02 +08:00
void Gate_Swich_and_UART_Send(ADC_Packet adc_packet);
2025-08-12 18:43:52 +08:00
#ifdef __cplusplus
}
#endif
#endif