添加中断发送
This commit is contained in:
parent
8cd729d904
commit
eca3fd058a
|
@ -30,6 +30,7 @@
|
|||
"cfg_protocol.h": "c",
|
||||
"chargcontrolenum.h": "c",
|
||||
"chargcontroltypes.h": "c",
|
||||
"fm_rtc.h": "c"
|
||||
"fm_rtc.h": "c",
|
||||
"interruptsend.h": "c"
|
||||
}
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
|
||||
#ifndef APP_COMM_H_
|
||||
#define APP_COMM_H_
|
||||
|
||||
#include "comm_types.h"
|
||||
#include "bl_comm.h"
|
||||
|
||||
|
||||
void uart_comm(void);
|
||||
|
||||
|
||||
#endif
|
|
@ -1,8 +0,0 @@
|
|||
|
||||
#include "comm.h"
|
||||
|
||||
void uart_comm(void)
|
||||
{
|
||||
GW485_comm();
|
||||
BAT485_comm();
|
||||
}
|
|
@ -9,10 +9,11 @@
|
|||
#define buffLen 100
|
||||
extern uint8_t rs485_buff[buffLen];
|
||||
|
||||
void GW485_comm(void);
|
||||
void BAT485_comm(void);
|
||||
|
||||
void gw485_RxIt(void);
|
||||
void bat485_RxIt(void);
|
||||
|
||||
void gw485_TxIt(void);
|
||||
void bat485_TxIt(void);
|
||||
|
||||
#endif
|
|
@ -0,0 +1,22 @@
|
|||
|
||||
#ifndef BL_INTERRUPT_SEND_H_
|
||||
#define BL_INTERRUPT_SEND_H_
|
||||
|
||||
#include "uart_dev.h"
|
||||
#include "comm_types.h"
|
||||
#include "chargControlTypes.h"
|
||||
|
||||
|
||||
void setIdleStateGw(void);
|
||||
void setIdleStateBat(void);
|
||||
void setGwState(void);
|
||||
void setBatState(void);
|
||||
|
||||
void setSendOverStateGw(void);
|
||||
void setSendOverStateBat(void);
|
||||
|
||||
void send_init(void);
|
||||
void check_sendState(void);
|
||||
void uart_interruptSend(device_handle device, uint8_t buff[], uint8_t len);
|
||||
|
||||
#endif
|
|
@ -17,4 +17,7 @@ void startShortCircuitProtection(void);
|
|||
void stopShortCircuitProtection(void);
|
||||
void startExcessiveLoadProtection(void);
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -7,9 +7,8 @@
|
|||
#include "uart_dev.h"
|
||||
#include "parameter.h"
|
||||
#include "abnormalManage.h"
|
||||
|
||||
extern int getMPPT_Mode(void);
|
||||
//extern config_parameter g_cfgParameter;
|
||||
#include "pDebug.h"
|
||||
#include "interruptSend.h"
|
||||
|
||||
/**
|
||||
* @brief 初始化外设,同时通过配置文件初始化系统参数
|
||||
|
@ -19,9 +18,11 @@ extern int getMPPT_Mode(void);
|
|||
*/
|
||||
void Init(void)
|
||||
{
|
||||
HAL_Delay(10000);
|
||||
|
||||
config_info_start();
|
||||
ADC_Capture_Init();
|
||||
proportionalInt(getMPPT_Mode());
|
||||
proportionalInt(g_cfgParameter.onlyPower);
|
||||
|
||||
FM_GPIO_Init();
|
||||
tim_Init();
|
||||
|
@ -34,7 +35,10 @@ void Init(void)
|
|||
start_gw485Rx_It();
|
||||
start_bat485Rx_It();
|
||||
|
||||
send_init();
|
||||
// POW_FF_PCON_Open();
|
||||
// POW_OUT_PCON_Open();
|
||||
|
||||
HAL_Delay(100);
|
||||
setPowerOutput(TRUE);
|
||||
}
|
||||
|
|
|
@ -174,8 +174,10 @@ BOOL getExcessiveLoadFlag(void)
|
|||
void setPowerOutput(BOOL state)
|
||||
{
|
||||
if (state == TRUE) {
|
||||
POW_FF_PCON_Open();
|
||||
POW_OUT_PCON_Open();
|
||||
if (get_OUT_VOLT_IN() < (get_PV_VOLT_OUT() - 0.1f)) {
|
||||
POW_FF_PCON_Open();
|
||||
POW_OUT_PCON_Open();
|
||||
}
|
||||
} else {
|
||||
POW_FF_PCON_Close();
|
||||
POW_OUT_PCON_Close();
|
||||
|
|
|
@ -303,10 +303,22 @@ void mppt_readJust(void)
|
|||
|
||||
/* 调节电压,两个电压步调节 */
|
||||
static float Power = 0;
|
||||
Power = getOutputVoltage() * getChargCurrent();
|
||||
static float totalPower = 0;
|
||||
static float powerData[50] = {0};
|
||||
static uint8_t powerIndex = 0;
|
||||
|
||||
/* 获取50次的平均值 */
|
||||
totalPower -= powerData[powerIndex];
|
||||
powerData[powerIndex] = getOutputVoltage() * getChargCurrent();
|
||||
totalPower += powerData[powerIndex];
|
||||
powerIndex++;
|
||||
if (powerIndex >= 50) {
|
||||
powerIndex = 0;
|
||||
}
|
||||
|
||||
static float lPower = 0;
|
||||
static float lLPower = 0;
|
||||
static float lLLPower = 0;
|
||||
// static float lLLPower = 0;
|
||||
|
||||
static float SolarInCircuitV = 17; //控制太阳能板的输出电压稳定在该值,初始为17V
|
||||
// static float kp = 0.005;
|
||||
|
@ -320,7 +332,7 @@ void mppt_readJust(void)
|
|||
/* 延时一段时间才判断 */
|
||||
static uint16_t flag = 0;
|
||||
flag++;
|
||||
if (flag < 50) {
|
||||
if (flag < 200) {
|
||||
// float pv1Volt = getSolarInCircuitVoltage();
|
||||
// float error = pv1Volt - SolarInCircuitV;
|
||||
// float stepPwm = kp * error + ki * pv1Volt;
|
||||
|
@ -333,6 +345,7 @@ void mppt_readJust(void)
|
|||
return;
|
||||
}
|
||||
flag = 0;
|
||||
Power = totalPower / 50.0f;
|
||||
|
||||
static float powerT = 0;
|
||||
powerT = Power - lPower;
|
||||
|
@ -340,9 +353,9 @@ void mppt_readJust(void)
|
|||
powerT = -powerT;
|
||||
}
|
||||
|
||||
if ((lPower + 0.8f < Power) && (lLPower + 0.8f < Power) && (lLLPower + 0.8f < Power)) {
|
||||
// if ((lPower + 0.7f < Power) && (lLPower + 0.7f < Power)) {
|
||||
// if ((lPower + 1.0f < Power)) {
|
||||
// if ((lPower + 0.8f < Power) && (lLPower + 0.8f < Power) && (lLLPower + 0.8f < Power)) {
|
||||
if ((lPower + 0.1f < Power) && (lLPower + 0.1f < Power)) {
|
||||
// if ((lPower + 0.3f < Power)) {
|
||||
if (powerT > 5) {
|
||||
if (flag1) {
|
||||
SolarInCircuitV += stepV1;
|
||||
|
@ -360,9 +373,9 @@ void mppt_readJust(void)
|
|||
flag1 = 0;
|
||||
}
|
||||
}
|
||||
} else if ((lPower - 0.8f > Power) && (lLPower - 0.8f > Power) && (lLLPower - 0.8f > Power)) {
|
||||
// } else if ((lPower - 0.7f > Power) && (lLPower - 0.7f > Power)) {
|
||||
// else if ((lPower - 1.0f > Power)) {
|
||||
// } else if ((lPower - 0.8f > Power) && (lLPower - 0.8f > Power) && (lLLPower - 0.8f > Power)) {
|
||||
} else if ((lPower - 0.1f > Power) && (lLPower - 0.1f > Power)) {
|
||||
// } else if ((lPower - 0.3f > Power)) {
|
||||
if (powerT > 5) {
|
||||
if (flag1) {
|
||||
SolarInCircuitV -= stepV1;
|
||||
|
@ -389,7 +402,7 @@ void mppt_readJust(void)
|
|||
SolarInCircuitV = 16.0f;
|
||||
}
|
||||
|
||||
lLLPower = lLPower;
|
||||
// lLLPower = lLPower;
|
||||
lLPower = lPower;
|
||||
lPower = Power;
|
||||
}
|
||||
|
@ -524,16 +537,16 @@ void chargControlMode(void)
|
|||
endChargWork();
|
||||
}
|
||||
|
||||
if (floatChargConditions()) {
|
||||
else if (floatChargConditions()) {
|
||||
setMPPT_Mode(floatCharg);
|
||||
}
|
||||
|
||||
if (mpptChargConditions()) {
|
||||
setMPPT_Mode(MPPT);
|
||||
else if (constantVChargConditions()) {
|
||||
setMPPT_Mode(constantVoltage);
|
||||
}
|
||||
|
||||
if (constantVChargConditions()) {
|
||||
setMPPT_Mode(constantVoltage);
|
||||
else if (mpptChargConditions()) {
|
||||
setMPPT_Mode(MPPT);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,24 +1,12 @@
|
|||
|
||||
#include "bl_comm.h"
|
||||
#include "uart_dev.h"
|
||||
|
||||
#include "interruptSend.h"
|
||||
|
||||
uint8_t rs485_buff[buffLen]={0x00};
|
||||
|
||||
|
||||
|
||||
void GW485_comm(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void BAT485_comm(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief gw485串口接收中断回调函数
|
||||
|
@ -31,6 +19,7 @@ void gw485_RxIt(void)
|
|||
// uart_device_info *dev = (uart_device_info *)g_gw485_uart2_handle;
|
||||
// if(!RingQueueFull(&dev->uart_ring_queue))
|
||||
// InRingQueue(&dev->uart_ring_queue, rx_gw485_buf[0]);
|
||||
setIdleStateGw();
|
||||
|
||||
uint8_t c = 0;
|
||||
c = rx_gw485_buf[0];
|
||||
|
@ -50,9 +39,39 @@ void gw485_RxIt(void)
|
|||
*/
|
||||
void bat485_RxIt(void)
|
||||
{
|
||||
setIdleStateBat();
|
||||
|
||||
uint8_t c = 0;
|
||||
c = rx_bat485_buf[0];
|
||||
|
||||
uart_device_info *dev = (uart_device_info *)g_bat485_uart3_handle;
|
||||
if(!RingQueueFull(&dev->uart_ring_queue))
|
||||
InRingQueue(&dev->uart_ring_queue, rx_bat485_buf[0]);
|
||||
InRingQueue(&dev->uart_ring_queue, c);
|
||||
|
||||
start_bat485Rx_It();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief gw485串口中断发送回调函数
|
||||
* @param
|
||||
* @retval
|
||||
*
|
||||
*/
|
||||
void gw485_TxIt(void)
|
||||
{
|
||||
setSendOverStateGw();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief bat485串口中断发送回调函数
|
||||
* @param
|
||||
* @retval
|
||||
*
|
||||
*/
|
||||
void bat485_TxIt(void)
|
||||
{
|
||||
setSendOverStateBat();
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,316 @@
|
|||
|
||||
#include "interruptSend.h"
|
||||
|
||||
|
||||
#define RS485_MAX_PACK_DATA_LEN 60
|
||||
|
||||
static uint8_t dataLocation1[RS485_MAX_PACK_DATA_LEN];
|
||||
static uint8_t dataLocation2[RS485_MAX_PACK_DATA_LEN];
|
||||
static uint8_t dataLocation3[RS485_MAX_PACK_DATA_LEN];
|
||||
|
||||
extern UART_HandleTypeDef huart2;
|
||||
extern UART_HandleTypeDef huart3;
|
||||
|
||||
#define GW485_huart huart2
|
||||
#define BAT485_huart huart3
|
||||
|
||||
/* 指定对齐方式为1字节 */
|
||||
#pragma pack(push,1)
|
||||
|
||||
typedef struct _send_data_info{
|
||||
device_handle device;
|
||||
BOOL dataState; //储存数据的状态,TRUE:有数据,FALSE:无数据
|
||||
uint8_t dataLen; //数据长度
|
||||
uint8_t Counter; //已经发送的长度
|
||||
uint8_t *data; //储存数据的内容
|
||||
}send_data_info;
|
||||
|
||||
typedef struct _uart_send_info {
|
||||
uint8_t insertState; //能否插入指示,大于0代表能插入
|
||||
// uint8_t sendStateGw:1; //能否发送指示,1:需要发送,0:不需要发送
|
||||
// uint8_t sendStateBat:1; //能否发送指示
|
||||
// uint8_t sendOverStateGw:1; //发送完成指示,1:发送完成,0:发送中
|
||||
// uint8_t sendOverStateBat:1; //发送完成指示
|
||||
// uint8_t GwState:1; //向上通信485总线空闲状态,1:空闲,0:繁忙
|
||||
// uint8_t idleStateGw:1; //向上通信空闲状态,1:没数据到来,0:有数据到来
|
||||
// uint8_t BatState:1; //向下通信485总线空闲状态
|
||||
// uint8_t idleStateBat:1; //向下通信空闲状态
|
||||
|
||||
BOOL sendStateGw; //能否发送指示,TRUE:需要发送,FALSE:不需要发送
|
||||
BOOL sendStateBat; //能否发送指示
|
||||
BOOL sendOverStateGw; //发送完成指示,TRUE:发送完成,FALSE:发送中
|
||||
BOOL sendOverStateBat; //发送完成指示
|
||||
BOOL GwState; //向上通信485总线空闲状态,TRUE:空闲,FALSE:繁忙
|
||||
BOOL idleStateGw; //向上通信空闲状态,TRUE:没数据到来,FALSE:有数据到来
|
||||
BOOL BatState; //向下通信485总线空闲状态
|
||||
BOOL idleStateBat; //向下通信空闲状态
|
||||
|
||||
send_data_info *insertData; //通过该指针写入数据
|
||||
send_data_info *sendDataGw; //通过该指针发送数据
|
||||
send_data_info *sendDataBat; //通过该指针发送数据
|
||||
send_data_info data1; //储存数据的第1个位置
|
||||
send_data_info data2; //储存数据的第2个位置
|
||||
send_data_info data3; //储存数据的第3个位置
|
||||
}uart_send_info;
|
||||
/* 恢复默认的对齐设置 */
|
||||
#pragma pack(pop)
|
||||
|
||||
static uart_send_info uart_send = {0};
|
||||
|
||||
/**
|
||||
* @brief 串口中断发送的初始化,通过空闲中断来判断总线空闲状态
|
||||
* @param
|
||||
* @retval
|
||||
*
|
||||
*/
|
||||
void send_init(void)
|
||||
{
|
||||
/* 指定数据储存位置 */
|
||||
uart_send.data1.data = dataLocation1;
|
||||
uart_send.data2.data = dataLocation2;
|
||||
uart_send.data3.data = dataLocation3;
|
||||
|
||||
/* 初始化插入位置为data1 */
|
||||
uart_send.insertData = &uart_send.data1;
|
||||
uart_send.sendDataGw = NULL;
|
||||
uart_send.sendDataBat = NULL;
|
||||
|
||||
//有3个位置可以写入数据
|
||||
uart_send.insertState = 3;
|
||||
|
||||
//没有数据能够发送
|
||||
uart_send.sendStateGw = FALSE;
|
||||
uart_send.sendStateBat = FALSE;
|
||||
|
||||
//发送完成
|
||||
uart_send.sendOverStateBat = TRUE;
|
||||
uart_send.sendOverStateGw = TRUE;
|
||||
|
||||
//485总线空闲
|
||||
uart_send.GwState = TRUE;
|
||||
uart_send.idleStateGw = TRUE;
|
||||
uart_send.BatState = TRUE;
|
||||
uart_send.idleStateBat = TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief GW485串口接收到数据后调用该函数,设置485总线空闲状态
|
||||
* @param
|
||||
* @retval
|
||||
*
|
||||
*/
|
||||
void setIdleStateGw(void)
|
||||
{
|
||||
if (uart_send.idleStateGw == FALSE) {
|
||||
uart_send.idleStateGw = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief BAT485串口接收到数据后调用该函数,设置485总线空闲状态
|
||||
* @param
|
||||
* @retval
|
||||
*
|
||||
*/
|
||||
void setIdleStateBat(void)
|
||||
{
|
||||
if (uart_send.idleStateBat == FALSE) {
|
||||
uart_send.idleStateBat = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief GW485串口设置485总线空闲状态,间隔10ms使用
|
||||
* @param
|
||||
* @retval
|
||||
*
|
||||
*/
|
||||
void setGwState(void)
|
||||
{
|
||||
if (uart_send.idleStateGw == FALSE) {
|
||||
uart_send.GwState = TRUE;
|
||||
} else {
|
||||
uart_send.GwState = FALSE;
|
||||
}
|
||||
|
||||
uart_send.idleStateGw = FALSE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief BAT485串口设置485总线空闲状态,间隔10ms使用
|
||||
* @param
|
||||
* @retval
|
||||
*
|
||||
*/
|
||||
void setBatState(void)
|
||||
{
|
||||
if (uart_send.idleStateBat == FALSE) {
|
||||
uart_send.BatState = TRUE;
|
||||
} else {
|
||||
uart_send.BatState = FALSE;
|
||||
}
|
||||
|
||||
uart_send.idleStateBat = FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief GW485串口发送完成后,调用该函数
|
||||
* @param
|
||||
* @retval
|
||||
*
|
||||
*/
|
||||
void setSendOverStateGw(void)
|
||||
{
|
||||
uart_send.sendOverStateGw = TRUE;
|
||||
uart_send.sendStateGw = FALSE;
|
||||
uart_send.sendDataGw->dataState = FALSE;
|
||||
uart_send.sendDataGw = NULL;
|
||||
uart_send.insertState++;
|
||||
|
||||
/* 插入指针指向为空时 */
|
||||
if (uart_send.data1.dataState == FALSE) {
|
||||
uart_send.insertData = &uart_send.data1;
|
||||
}
|
||||
else if (uart_send.data2.dataState == FALSE) {
|
||||
uart_send.insertData = &uart_send.data2;
|
||||
}
|
||||
else if (uart_send.data3.dataState == FALSE) {
|
||||
uart_send.insertData = &uart_send.data3;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief BAT485串口发送完成后,调用该函数
|
||||
* @param
|
||||
* @retval
|
||||
*
|
||||
*/
|
||||
void setSendOverStateBat(void)
|
||||
{
|
||||
uart_send.sendOverStateBat = TRUE;
|
||||
uart_send.sendStateBat = FALSE;
|
||||
uart_send.sendDataBat->dataState = FALSE;
|
||||
uart_send.sendDataBat = NULL;
|
||||
uart_send.insertState++;
|
||||
|
||||
/* 插入指针指向为空时 */
|
||||
if (uart_send.data1.dataState == FALSE) {
|
||||
uart_send.insertData = &uart_send.data1;
|
||||
}
|
||||
else if (uart_send.data2.dataState == FALSE) {
|
||||
uart_send.insertData = &uart_send.data2;
|
||||
}
|
||||
else if (uart_send.data3.dataState == FALSE) {
|
||||
uart_send.insertData = &uart_send.data3;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 检测是否有数据需要发送
|
||||
* @param
|
||||
* @retval
|
||||
*
|
||||
*/
|
||||
void check_sendState(void)
|
||||
{
|
||||
/* 向上通信总线空闲时,检测到有数据需要发送,同时上一次数据发送完成 */
|
||||
if (uart_send.GwState && uart_send.sendStateGw && uart_send.sendOverStateGw) {
|
||||
/* 将数据塞入中断发送 */
|
||||
HAL_UART_Transmit_IT(&GW485_huart, uart_send.sendDataGw->data, uart_send.sendDataGw->dataLen);
|
||||
uart_send.sendOverStateGw = FALSE;
|
||||
}
|
||||
|
||||
/* 向下通信总线空闲时,检测到有数据需要发送,同时上一次数据发送完成 */
|
||||
if (uart_send.BatState && uart_send.sendStateBat && uart_send.sendOverStateBat) {
|
||||
HAL_UART_Transmit_IT(&BAT485_huart, uart_send.sendDataBat->data, uart_send.sendDataBat->dataLen);
|
||||
uart_send.sendOverStateBat = FALSE;
|
||||
}
|
||||
|
||||
if (uart_send.sendDataGw == NULL) {
|
||||
if (uart_send.data1.dataState) {
|
||||
if (uart_send.data1.device == g_gw485_uart2_handle) {
|
||||
uart_send.sendStateGw = TRUE;
|
||||
uart_send.sendDataGw = &uart_send.data1;
|
||||
}
|
||||
}
|
||||
if (uart_send.data2.dataState) {
|
||||
if (uart_send.data2.device == g_gw485_uart2_handle) {
|
||||
uart_send.sendStateGw= TRUE;
|
||||
uart_send.sendDataGw = &uart_send.data2;
|
||||
}
|
||||
}
|
||||
if (uart_send.data3.dataState) {
|
||||
if (uart_send.data3.device == g_gw485_uart2_handle) {
|
||||
uart_send.sendStateGw = TRUE;
|
||||
uart_send.sendDataGw = &uart_send.data3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (uart_send.sendDataBat == NULL) {
|
||||
if (uart_send.data1.dataState) {
|
||||
if (uart_send.data1.device == g_bat485_uart3_handle) {
|
||||
uart_send.sendStateBat = TRUE;
|
||||
uart_send.sendDataBat = &uart_send.data1;
|
||||
}
|
||||
}
|
||||
if (uart_send.data2.dataState) {
|
||||
if (uart_send.data2.device == g_bat485_uart3_handle) {
|
||||
uart_send.sendStateBat= TRUE;
|
||||
uart_send.sendDataBat = &uart_send.data2;
|
||||
}
|
||||
}
|
||||
if (uart_send.data3.dataState) {
|
||||
if (uart_send.data3.device == g_bat485_uart3_handle) {
|
||||
uart_send.sendStateBat = TRUE;
|
||||
uart_send.sendDataBat = &uart_send.data3;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 串口中断发送函数
|
||||
* @param
|
||||
* @retval
|
||||
*
|
||||
*/
|
||||
void uart_interruptSend(device_handle device, uint8_t buff[], uint8_t len)
|
||||
{
|
||||
/* 拷贝数据到发送 */
|
||||
do {
|
||||
if (uart_send.insertState > 0 && uart_send.insertData != NULL) {
|
||||
// memcpy(uart_send.insertData->data, buff, len);
|
||||
for (int var = 0; var < len; ++var) {
|
||||
uart_send.insertData->data[var] = buff[var];
|
||||
// printf(" %x ", uart_send.insertData->data[var]);
|
||||
}
|
||||
uart_send.insertData->Counter = 0;
|
||||
uart_send.insertData->dataLen = len;
|
||||
uart_send.insertData->device = device;
|
||||
// uart_send.insertData->dataState = 1;
|
||||
// uart_send.insertState--;
|
||||
break;
|
||||
}
|
||||
} while (1);
|
||||
|
||||
uart_send.insertData->dataState = TRUE;
|
||||
uart_send.insertState--;
|
||||
|
||||
/* 可插入数据大于0时,将插入指针指向空的储存位置,否则指向NULL */
|
||||
if (uart_send.insertState > 0) {
|
||||
if (uart_send.data1.dataState == FALSE) {
|
||||
uart_send.insertData = &uart_send.data1;
|
||||
}
|
||||
else if (uart_send.data2.dataState == FALSE) {
|
||||
uart_send.insertData = &uart_send.data2;
|
||||
}
|
||||
else if (uart_send.data3.dataState == FALSE) {
|
||||
uart_send.insertData = &uart_send.data3;
|
||||
}
|
||||
} else {
|
||||
uart_send.insertData = NULL;
|
||||
}
|
||||
}
|
||||
|
|
@ -9,6 +9,7 @@
|
|||
#include "cfg_protocol.h"
|
||||
#include "uart_dev.h"
|
||||
#include "abnormalManage.h"
|
||||
#include "interruptSend.h"
|
||||
|
||||
|
||||
/* 控制运行指示灯和喂狗 */
|
||||
|
@ -92,6 +93,18 @@ static void Task_shortCircuitProtection(void);
|
|||
STR_TimeSliceOffset m_excessiveLoad;
|
||||
void Task_excessiveLoad(void);
|
||||
|
||||
/* 总线状态检测 */
|
||||
#define busFree_reloadVal 5 /* 任务执行间隔 */
|
||||
#define busFree_offset 0 /* 任务执行偏移量 */
|
||||
STR_TimeSliceOffset m_busFree;
|
||||
void Task_busFree(void);
|
||||
|
||||
// /* 中断发送 */
|
||||
// #define interruptSend_reloadVal 1 /* 任务执行间隔 */
|
||||
// #define interruptSend_offset 0 /* 任务执行偏移量 */
|
||||
// STR_TimeSliceOffset m_interruptSend;
|
||||
// void Task_interruptSend(void);
|
||||
|
||||
/**
|
||||
* @brief 启动时初始化各任务
|
||||
* @param None
|
||||
|
@ -111,6 +124,7 @@ void task_Init(void)
|
|||
uartTaskInit();
|
||||
TimeSliceOffset_Register(&m_usartJudge, Task_usartJudge, usartJudge_reloadVal, usartJudge_offset);
|
||||
TimeSliceOffset_Register(&m_usartCfg, Task_usartCfg, usartCfg_reloadVal, usartCfg_offset);
|
||||
TimeSliceOffset_Register(&m_busFree, Task_busFree, busFree_reloadVal, busFree_offset);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -145,6 +159,8 @@ void Task_wdi(void)
|
|||
debug_printf("loopImpedance:%f \n", g_cfgParameter.loopImpedance);
|
||||
debug_printf("DutyRatio:%f \n", getDutyRatio());
|
||||
|
||||
uart_interruptSend(g_gw485_uart2_handle, "hello world\n", sizeof("hello world\n"));
|
||||
|
||||
/* 每天复位一次,复位前将电量信息写入flash中 */
|
||||
static uint32_t temp = 60 * 60 * 24;
|
||||
if (!(--temp)) {
|
||||
|
@ -597,3 +613,39 @@ void startExcessiveLoadProtection(void)
|
|||
TimeSliceOffset_Register(&m_excessiveLoad, Task_excessiveLoad
|
||||
, excessiveLoad_reloadVal, excessiveLoad_offset);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 检测总线是否空闲,并且判断有无数据需要发送
|
||||
* @param
|
||||
* @retval
|
||||
*/
|
||||
void Task_busFree(void)
|
||||
{
|
||||
setGwState();
|
||||
setBatState();
|
||||
check_sendState();
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @brief 中断发送任务
|
||||
// * @param
|
||||
// * @retval
|
||||
// */
|
||||
// void Task_interruptSend(void)
|
||||
// {
|
||||
// // if(check_sendState() == TRUE) {
|
||||
// // TimeSliceOffset_Unregister(&m_interruptSend);
|
||||
// // m_interruptSend.runFlag = 0;
|
||||
// // }
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * @brief 启动中断发送任务
|
||||
// * @param
|
||||
// * @retval
|
||||
// */
|
||||
// void startInterruptSendTask(void)
|
||||
// {
|
||||
// TimeSliceOffset_Register(&m_interruptSend, Task_interruptSend
|
||||
// , interruptSend_reloadVal, interruptSend_offset);
|
||||
// }
|
|
@ -8,5 +8,6 @@
|
|||
void FM_RTC_Init(void);
|
||||
void setRTC_Time(timeInfo *time);
|
||||
void getRTC_Time(timeInfo *time);
|
||||
uint32_t differTime(timeInfo *time1, timeInfo *time2);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -30,6 +30,7 @@ float get_DSG_CURR(void);
|
|||
float get_PV1_VOLT_IN(void);
|
||||
float get_PV_VOLT_IN1(void);
|
||||
float get_MOSFET_Temper(void);
|
||||
float get_OUT_VOLT_IN(void);
|
||||
|
||||
void adcCaptureFir();
|
||||
|
||||
|
|
|
@ -52,4 +52,8 @@ void start_bat485Rx_It(void);
|
|||
extern void gw485_RxIt(void);
|
||||
extern void bat485_RxIt(void);
|
||||
|
||||
extern void gw485_TxIt(void);
|
||||
extern void bat485_TxIt(void);
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -60,3 +60,32 @@ void getRTC_Time(timeInfo *time)
|
|||
time->minute = getTime.Minutes;
|
||||
time->second = getTime.Seconds;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief time1 - time2的差值
|
||||
* @param
|
||||
* @retval 返回的时间单位为秒
|
||||
*/
|
||||
uint32_t differTime(timeInfo *time1, timeInfo *time2)
|
||||
{
|
||||
uint32_t differ_s;
|
||||
|
||||
differ_s = time1->second - time2->second
|
||||
+ time1->minute * 60 - time2->minute * 60
|
||||
+ time1->hour * 3600 - time2->hour * 3600
|
||||
+ time1->day * 86400 - time2->day * 86400
|
||||
+ (time1->month - time2->month) * 2592000
|
||||
+ (time1->year - time2->year) * 31536000;
|
||||
|
||||
return differ_s;
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @brief time3根据time1和time2差值得到time3,time3 += time1 - time2
|
||||
// * @param
|
||||
// * @retval
|
||||
// */
|
||||
// void chargeTime(timeInfo *time1, timeInfo *time2, timeInfo *time3)
|
||||
// {
|
||||
|
||||
// }
|
||||
|
|
|
@ -113,6 +113,7 @@ static float P_PV_VOLT_OUT = 0;
|
|||
static float P_DSG_CURR = 0;
|
||||
static float P_PV1_VOLT_IN = 0;
|
||||
static float P_PV_VOLT_IN1 = 0;
|
||||
static float P_OUT_VOLT_IN = 0;
|
||||
|
||||
/* 2.5为adc的电压,4095是2^adc的位数 - 1 */
|
||||
// const float32_t Proportion = 2.5 / 4095;
|
||||
|
@ -186,13 +187,15 @@ void proportionalInt(int mode)
|
|||
/* 光伏充电输出电流比例,放大倍数*电阻 */
|
||||
P_CHG_CURR = (1.0 / (50 * (1 / (1 / 0.01 + 1 / 0.002)))) * Proportion;
|
||||
/* 充电控制盒输出电压比例,分压系数 */
|
||||
P_PV_VOLT_OUT = ((47.0 + 10.0) / 10.0) * Proportion;
|
||||
P_PV_VOLT_OUT = ((47.0 + 4.7) / 4.7) * Proportion;
|
||||
/* 放电电流采集电流倍数 */
|
||||
P_DSG_CURR = (1.0 / (50 * (1 / (1 / 0.002 * 2)))) * Proportion;
|
||||
/* 光伏板输出电压比例 */
|
||||
P_PV1_VOLT_IN = ((47.0 + 4.7) / 4.7) * Proportion;
|
||||
/* 系统电源电压比例 */
|
||||
P_PV_VOLT_IN1 = ((47 + 4.7) / 4.7) * Proportion;
|
||||
P_PV_VOLT_IN1 = ((47.0 + 4.7) / 4.7) * Proportion;
|
||||
/* 输出外部电压比例 */
|
||||
P_OUT_VOLT_IN = ((100 + 4.7) / 4.7) * Proportion;
|
||||
}
|
||||
|
||||
/* 电源盒外还有网关功能 */
|
||||
|
@ -207,18 +210,20 @@ void proportionalInt(int mode)
|
|||
P_PV1_VOLT_IN = ((47.0 + 4.7) / 4.7) * Proportion;
|
||||
/* 系统电源电压比例 */
|
||||
P_PV_VOLT_IN1 = ((47 + 4.7) / 4.7) * Proportion;
|
||||
/* 输出外部电压比例 */
|
||||
P_OUT_VOLT_IN = ((100 + 4.7) / 4.7) * Proportion;
|
||||
}
|
||||
|
||||
/* 光伏充电输出电流比例,放大倍数*电阻 */
|
||||
P_CHG_CURR = (1.0 / (50 * (1 / (1 / 0.01 + 1 / 0.002)))) * Proportion;
|
||||
/* 充电控制盒输出电压比例,分压系数 */
|
||||
P_PV_VOLT_OUT = ((47.0 + 10.0) / 10.0) * Proportion;
|
||||
/* 放电电流采集电流倍数 */
|
||||
P_DSG_CURR = (1.0 / (50 * (1 / (1 / 0.002 * 2)))) * Proportion;
|
||||
/* 光伏板输出电压比例 */
|
||||
P_PV1_VOLT_IN = ((47.0 + 4.7) / 4.7) * Proportion;
|
||||
/* 系统电源电压比例 */
|
||||
P_PV_VOLT_IN1 = ((47 + 4.7) / 4.7) * Proportion;
|
||||
// /* 光伏充电输出电流比例,放大倍数*电阻 */
|
||||
// P_CHG_CURR = (1.0 / (50 * (1 / (1 / 0.01 + 1 / 0.002)))) * Proportion;
|
||||
// /* 充电控制盒输出电压比例,分压系数 */
|
||||
// P_PV_VOLT_OUT = ((47.0 + 10.0) / 10.0) * Proportion;
|
||||
// /* 放电电流采集电流倍数 */
|
||||
// P_DSG_CURR = (1.0 / (50 * (1 / (1 / 0.002 * 2)))) * Proportion;
|
||||
// /* 光伏板输出电压比例 */
|
||||
// P_PV1_VOLT_IN = ((47.0 + 4.7) / 4.7) * Proportion;
|
||||
// /* 系统电源电压比例 */
|
||||
// P_PV_VOLT_IN1 = ((47 + 4.7) / 4.7) * Proportion;
|
||||
}
|
||||
|
||||
#define N 4
|
||||
|
@ -356,7 +361,7 @@ float get_PV1_VOLT_IN(void)
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 得到系统电压电压
|
||||
* @brief 得到系统电压
|
||||
* @param
|
||||
* @retval V 电压值
|
||||
*/
|
||||
|
@ -410,6 +415,29 @@ float get_MOSFET_Temper(void)
|
|||
return T;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 输出外部电压
|
||||
* @param
|
||||
* @retval V 电压值
|
||||
*/
|
||||
float get_OUT_VOLT_IN(void)
|
||||
{
|
||||
float V;
|
||||
uint16_t V_ADC;
|
||||
|
||||
V_ADC = ADC2_Capture(OUT_VOLT_IN_CHANNEL);
|
||||
|
||||
V = (float)(V_ADC) * P_OUT_VOLT_IN;
|
||||
|
||||
#ifdef enable_Printf_VI
|
||||
debug("\n OUT_VOLT_IN ADC : %d \n", V_ADC);
|
||||
debug(" OUT_VOLT_IN V : %f \n", V);
|
||||
#endif
|
||||
|
||||
return V;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief adc转换并传输完成后进入该回调函数
|
||||
* @param hdma dma
|
||||
|
|
|
@ -248,6 +248,20 @@ void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
|
||||
{
|
||||
if (huart->Instance == USART2) {
|
||||
gw485_TxIt();
|
||||
}
|
||||
else if (huart->Instance == USART3) {
|
||||
bat485_TxIt();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief 开启向上对网关通信485串口的中断接收.
|
||||
* @retval None
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include "stm32g431xx.h"
|
||||
|
||||
#define SYS_VOLT_IN_CHANNEL ADC_CHANNEL_1
|
||||
#define OUT_VOLT_IN_CHANNEL ADC_CHANNEL_9
|
||||
#define MOSFET_Temper_CHANNEL ADC_CHANNEL_15
|
||||
|
||||
void HD_adc_Init(void);
|
||||
|
|
|
@ -64,6 +64,8 @@ void Error_Handler(void);
|
|||
#define WORK_VOLT_GPIO_Port GPIOC
|
||||
#define DSG_CURR_Pin GPIO_PIN_2
|
||||
#define DSG_CURR_GPIO_Port GPIOC
|
||||
#define OUT_VOLT_IN_Pin GPIO_PIN_3
|
||||
#define OUT_VOLT_IN_GPIO_Port GPIOC
|
||||
#define SYS_VOLT_IN_Pin GPIO_PIN_0
|
||||
#define SYS_VOLT_IN_GPIO_Port GPIOA
|
||||
#define GW485_RDE_Pin GPIO_PIN_1
|
||||
|
@ -111,7 +113,7 @@ void Error_Handler(void);
|
|||
#define RUN_LED_GPIO_Port GPIOB
|
||||
#define POW_FF_CON_Pin GPIO_PIN_7
|
||||
#define POW_FF_CON_GPIO_Port GPIOB
|
||||
#define POW_OUT_CON_Pin GPIO_PIN_8
|
||||
#define POW_OUT_CON_Pin GPIO_PIN_9
|
||||
#define POW_OUT_CON_GPIO_Port GPIOB
|
||||
|
||||
/* USER CODE BEGIN Private defines */
|
||||
|
|
|
@ -263,12 +263,19 @@ void HAL_ADC_MspInit(ADC_HandleTypeDef* adcHandle)
|
|||
__HAL_RCC_ADC12_CLK_ENABLE();
|
||||
}
|
||||
|
||||
__HAL_RCC_GPIOC_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOB_CLK_ENABLE();
|
||||
/**ADC2 GPIO Configuration
|
||||
PC3 ------> ADC2_IN9
|
||||
PA0 ------> ADC2_IN1
|
||||
PB15 ------> ADC2_IN15
|
||||
*/
|
||||
GPIO_InitStruct.Pin = OUT_VOLT_IN_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(OUT_VOLT_IN_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
GPIO_InitStruct.Pin = SYS_VOLT_IN_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
|
@ -327,9 +334,12 @@ void HAL_ADC_MspDeInit(ADC_HandleTypeDef* adcHandle)
|
|||
}
|
||||
|
||||
/**ADC2 GPIO Configuration
|
||||
PC3 ------> ADC2_IN9
|
||||
PA0 ------> ADC2_IN1
|
||||
PB15 ------> ADC2_IN15
|
||||
*/
|
||||
HAL_GPIO_DeInit(OUT_VOLT_IN_GPIO_Port, OUT_VOLT_IN_Pin);
|
||||
|
||||
HAL_GPIO_DeInit(SYS_VOLT_IN_GPIO_Port, SYS_VOLT_IN_Pin);
|
||||
|
||||
HAL_GPIO_DeInit(MOSFET_Temper_GPIO_Port, MOSFET_Temper_Pin);
|
||||
|
|
|
@ -95,20 +95,20 @@ int main(void)
|
|||
/* USER CODE END SysInit */
|
||||
|
||||
/* Initialize all configured peripherals */
|
||||
// MX_GPIO_Init();
|
||||
// MX_DMA_Init();
|
||||
// MX_ADC1_Init();
|
||||
// MX_ADC2_Init();
|
||||
// MX_SPI1_Init();
|
||||
// MX_TIM3_Init();
|
||||
// MX_TIM6_Init();
|
||||
// MX_UART4_Init();
|
||||
// MX_USART2_UART_Init();
|
||||
// MX_USART3_UART_Init();
|
||||
// MX_TIM7_Init();
|
||||
// MX_TIM16_Init();
|
||||
// MX_TIM15_Init();
|
||||
// MX_RTC_Init();
|
||||
// MX_GPIO_Init();
|
||||
// MX_DMA_Init();
|
||||
// MX_ADC1_Init();
|
||||
// MX_ADC2_Init();
|
||||
// MX_SPI1_Init();
|
||||
// MX_TIM3_Init();
|
||||
// MX_TIM6_Init();
|
||||
// MX_UART4_Init();
|
||||
// MX_USART2_UART_Init();
|
||||
// MX_USART3_UART_Init();
|
||||
// MX_TIM7_Init();
|
||||
// MX_TIM16_Init();
|
||||
// MX_TIM15_Init();
|
||||
// MX_RTC_Init();
|
||||
/* USER CODE BEGIN 2 */
|
||||
|
||||
start();
|
||||
|
@ -142,12 +142,17 @@ void SystemClock_Config(void)
|
|||
*/
|
||||
HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1);
|
||||
|
||||
/** Configure LSE Drive Capability
|
||||
*/
|
||||
HAL_PWR_EnableBkUpAccess();
|
||||
__HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
|
||||
|
||||
/** Initializes the RCC Oscillators according to the specified parameters
|
||||
* in the RCC_OscInitTypeDef structure.
|
||||
*/
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI|RCC_OSCILLATORTYPE_HSE;
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE|RCC_OSCILLATORTYPE_LSE;
|
||||
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
|
||||
RCC_OscInitStruct.LSIState = RCC_LSI_ON;
|
||||
RCC_OscInitStruct.LSEState = RCC_LSE_ON;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
|
||||
RCC_OscInitStruct.PLL.PLLM = RCC_PLLM_DIV1;
|
||||
|
|
|
@ -101,7 +101,7 @@ void HAL_RTC_MspInit(RTC_HandleTypeDef* rtcHandle)
|
|||
/** Initializes the peripherals clocks
|
||||
*/
|
||||
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_RTC;
|
||||
PeriphClkInit.RTCClockSelection = RCC_RTCCLKSOURCE_LSI;
|
||||
PeriphClkInit.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
|
||||
|
||||
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
|
||||
{
|
||||
|
|
|
@ -1111,9 +1111,6 @@
|
|||
<file>
|
||||
<name>$PROJ_DIR$\..\APP\application\Src\chargControl.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\APP\application\Src\comm.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\APP\application\Src\start.c</name>
|
||||
</file>
|
||||
|
@ -1141,6 +1138,9 @@
|
|||
<file>
|
||||
<name>$PROJ_DIR$\..\APP\businessLogic\Src\Init.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\APP\businessLogic\Src\interruptSend.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\APP\businessLogic\Src\parameter.c</name>
|
||||
</file>
|
||||
|
|
|
@ -1433,9 +1433,6 @@
|
|||
<file>
|
||||
<name>$PROJ_DIR$\..\APP\application\Src\chargControl.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\APP\application\Src\comm.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\APP\application\Src\start.c</name>
|
||||
</file>
|
||||
|
@ -1463,6 +1460,9 @@
|
|||
<file>
|
||||
<name>$PROJ_DIR$\..\APP\businessLogic\Src\Init.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\APP\businessLogic\Src\interruptSend.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\APP\businessLogic\Src\parameter.c</name>
|
||||
</file>
|
||||
|
|
|
@ -86,47 +86,48 @@ Mcu.Name=STM32G431R(6-8-B)Tx
|
|||
Mcu.Package=LQFP64
|
||||
Mcu.Pin0=PC13
|
||||
Mcu.Pin1=PC14-OSC32_IN
|
||||
Mcu.Pin10=PA3
|
||||
Mcu.Pin11=PA4
|
||||
Mcu.Pin12=PA5
|
||||
Mcu.Pin13=PA6
|
||||
Mcu.Pin14=PA7
|
||||
Mcu.Pin15=PB0
|
||||
Mcu.Pin16=PB1
|
||||
Mcu.Pin17=PB10
|
||||
Mcu.Pin18=PB11
|
||||
Mcu.Pin19=PB12
|
||||
Mcu.Pin10=PA2
|
||||
Mcu.Pin11=PA3
|
||||
Mcu.Pin12=PA4
|
||||
Mcu.Pin13=PA5
|
||||
Mcu.Pin14=PA6
|
||||
Mcu.Pin15=PA7
|
||||
Mcu.Pin16=PB0
|
||||
Mcu.Pin17=PB1
|
||||
Mcu.Pin18=PB10
|
||||
Mcu.Pin19=PB11
|
||||
Mcu.Pin2=PC15-OSC32_OUT
|
||||
Mcu.Pin20=PB14
|
||||
Mcu.Pin21=PB15
|
||||
Mcu.Pin22=PC9
|
||||
Mcu.Pin23=PA10
|
||||
Mcu.Pin24=PA11
|
||||
Mcu.Pin25=PA12
|
||||
Mcu.Pin26=PA13
|
||||
Mcu.Pin27=PA14
|
||||
Mcu.Pin28=PC10
|
||||
Mcu.Pin29=PC11
|
||||
Mcu.Pin20=PB12
|
||||
Mcu.Pin21=PB14
|
||||
Mcu.Pin22=PB15
|
||||
Mcu.Pin23=PC9
|
||||
Mcu.Pin24=PA10
|
||||
Mcu.Pin25=PA11
|
||||
Mcu.Pin26=PA12
|
||||
Mcu.Pin27=PA13
|
||||
Mcu.Pin28=PA14
|
||||
Mcu.Pin29=PC10
|
||||
Mcu.Pin3=PF0-OSC_IN
|
||||
Mcu.Pin30=PB6
|
||||
Mcu.Pin31=PB7
|
||||
Mcu.Pin32=PB8-BOOT0
|
||||
Mcu.Pin33=VP_RTC_VS_RTC_Activate
|
||||
Mcu.Pin34=VP_RTC_VS_RTC_Calendar
|
||||
Mcu.Pin35=VP_SYS_VS_Systick
|
||||
Mcu.Pin36=VP_SYS_VS_DBSignals
|
||||
Mcu.Pin37=VP_TIM6_VS_ClockSourceINT
|
||||
Mcu.Pin38=VP_TIM7_VS_ClockSourceINT
|
||||
Mcu.Pin39=VP_TIM15_VS_ClockSourceINT
|
||||
Mcu.Pin30=PC11
|
||||
Mcu.Pin31=PB6
|
||||
Mcu.Pin32=PB7
|
||||
Mcu.Pin33=PB9
|
||||
Mcu.Pin34=VP_RTC_VS_RTC_Activate
|
||||
Mcu.Pin35=VP_RTC_VS_RTC_Calendar
|
||||
Mcu.Pin36=VP_SYS_VS_Systick
|
||||
Mcu.Pin37=VP_SYS_VS_DBSignals
|
||||
Mcu.Pin38=VP_TIM6_VS_ClockSourceINT
|
||||
Mcu.Pin39=VP_TIM7_VS_ClockSourceINT
|
||||
Mcu.Pin4=PF1-OSC_OUT
|
||||
Mcu.Pin40=VP_TIM16_VS_ClockSourceINT
|
||||
Mcu.Pin41=VP_STMicroelectronics.X-CUBE-ALGOBUILD_VS_DSPOoLibraryJjLibrary_1.4.0_1.4.0
|
||||
Mcu.Pin40=VP_TIM15_VS_ClockSourceINT
|
||||
Mcu.Pin41=VP_TIM16_VS_ClockSourceINT
|
||||
Mcu.Pin42=VP_STMicroelectronics.X-CUBE-ALGOBUILD_VS_DSPOoLibraryJjLibrary_1.4.0_1.4.0
|
||||
Mcu.Pin5=PC1
|
||||
Mcu.Pin6=PC2
|
||||
Mcu.Pin7=PA0
|
||||
Mcu.Pin8=PA1
|
||||
Mcu.Pin9=PA2
|
||||
Mcu.PinsNb=42
|
||||
Mcu.Pin7=PC3
|
||||
Mcu.Pin8=PA0
|
||||
Mcu.Pin9=PA1
|
||||
Mcu.PinsNb=43
|
||||
Mcu.ThirdParty0=STMicroelectronics.X-CUBE-ALGOBUILD.1.4.0
|
||||
Mcu.ThirdPartyNb=1
|
||||
Mcu.UserConstants=
|
||||
|
@ -249,10 +250,10 @@ PB7.GPIOParameters=GPIO_Label
|
|||
PB7.GPIO_Label=POW_FF_CON
|
||||
PB7.Locked=true
|
||||
PB7.Signal=GPIO_Output
|
||||
PB8-BOOT0.GPIOParameters=GPIO_Label
|
||||
PB8-BOOT0.GPIO_Label=POW_OUT_CON
|
||||
PB8-BOOT0.Locked=true
|
||||
PB8-BOOT0.Signal=GPIO_Output
|
||||
PB9.GPIOParameters=GPIO_Label
|
||||
PB9.GPIO_Label=POW_OUT_CON
|
||||
PB9.Locked=true
|
||||
PB9.Signal=GPIO_Output
|
||||
PC1.GPIOParameters=GPIO_Label
|
||||
PC1.GPIO_Label=WORK_VOLT
|
||||
PC1.Locked=true
|
||||
|
@ -280,6 +281,11 @@ PC2.GPIOParameters=GPIO_Label
|
|||
PC2.GPIO_Label=DSG_CURR
|
||||
PC2.Mode=IN8-Single-Ended
|
||||
PC2.Signal=ADC1_IN8
|
||||
PC3.GPIOParameters=GPIO_Label
|
||||
PC3.GPIO_Label=OUT_VOLT_IN
|
||||
PC3.Locked=true
|
||||
PC3.Mode=IN9-Single-Ended
|
||||
PC3.Signal=ADC2_IN9
|
||||
PC9.GPIOParameters=GPIO_Speed,GPIO_Label
|
||||
PC9.GPIO_Label=CHG_CONH
|
||||
PC9.GPIO_Speed=GPIO_SPEED_FREQ_VERY_HIGH
|
||||
|
@ -341,7 +347,7 @@ RCC.I2C1Freq_Value=72000000
|
|||
RCC.I2C2Freq_Value=72000000
|
||||
RCC.I2C3Freq_Value=72000000
|
||||
RCC.I2SFreq_Value=72000000
|
||||
RCC.IPParameters=ADC12Freq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,CRSFreq_Value,CortexFreq_Value,EXTERNAL_CLOCK_VALUE,FCLKCortexFreq_Value,FDCANFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C2Freq_Value,I2C3Freq_Value,I2SFreq_Value,LPTIM1Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSI_VALUE,MCO1PinFreq_Value,PLLN,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSourceVirtual,PWRFreq_Value,RNGFreq_Value,SAI1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,UART4Freq_Value,USART1Freq_Value,USART2Freq_Value,USART3Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value
|
||||
RCC.IPParameters=ADC12Freq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,CRSFreq_Value,CortexFreq_Value,EXTERNAL_CLOCK_VALUE,FCLKCortexFreq_Value,FDCANFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C2Freq_Value,I2C3Freq_Value,I2SFreq_Value,LPTIM1Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSI_VALUE,MCO1PinFreq_Value,PLLN,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSourceVirtual,PWRFreq_Value,RNGFreq_Value,RTCClockSelection,RTCFreq_Value,SAI1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,UART4Freq_Value,USART1Freq_Value,USART2Freq_Value,USART3Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value
|
||||
RCC.LPTIM1Freq_Value=72000000
|
||||
RCC.LPUART1Freq_Value=72000000
|
||||
RCC.LSCOPinFreq_Value=32000
|
||||
|
@ -354,6 +360,8 @@ RCC.PLLRCLKFreq_Value=72000000
|
|||
RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSE
|
||||
RCC.PWRFreq_Value=72000000
|
||||
RCC.RNGFreq_Value=72000000
|
||||
RCC.RTCClockSelection=RCC_RTCCLKSOURCE_LSE
|
||||
RCC.RTCFreq_Value=32768
|
||||
RCC.SAI1Freq_Value=72000000
|
||||
RCC.SYSCLKFreq_VALUE=72000000
|
||||
RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK
|
||||
|
|
Loading…
Reference in New Issue