#ifndef ELECTRODE_H
#define ELECTRODE_H
#include "main.h"
#include "Driver.h"
#include "Irrigation.h"
#include  "eeprom.h"
#define  PHOSPHORUS_RUN_TIME_ADDR  0x90    // 除磷运行时间存储地址
#define  PHOSPHORUS_STOP_TIME_ADDR 0x94    // 除磷停止时间存储地址
#define  PHOSPHORUS_FLAG_ADDR      0x98    // 除磷标志地址
#define  PHOSPHORUS_FLAG_VAL       0xB7    // 除磷标志值

extern uint8_t phosphorus_running;    // 除磷运行状态
extern uint8_t polarity_state;        // 极性状态：0-正常，1-反转
extern uint32_t phosphorus_timer;     // 运行时间计数器（分钟）
extern uint32_t PHOSPHORUS_RUN_TIME;     // 运行时间设置
extern uint32_t PHOSPHORUS_STOP_TIME;    // 停止时间设置
extern uint8_t Dephosphorization_state;

extern uint32_t PHOSPHORUS_RUN_TIME;
extern  uint32_t PHOSPHORUS_STOP_TIME;
void Control_Phosphorus_Polarity(void);

void Phosphorus_Control_Update(void);


void Phosphorus_Init(void);
void Save_Phosphorus_Time_To_EEPROM(uint32_t run_time, uint32_t stop_time);


#endif

