add sink source
This commit is contained in:
@@ -5,6 +5,10 @@
|
||||
#include <rtdevice.h>
|
||||
#include "drv_gpio.h"
|
||||
|
||||
#include "chrg_def.h"
|
||||
#include "chrg_source.h"
|
||||
#include "chrg_sink.h"
|
||||
|
||||
// 4路选通
|
||||
typedef enum {
|
||||
// U14 U23 U24 U25
|
||||
@@ -55,7 +59,11 @@ extern int chrg_switch_north (eIDX_CH ch);
|
||||
// 南向通道选择
|
||||
extern int chrg_switch_south (eIDX_SOUTH_CH ch);
|
||||
|
||||
|
||||
struct chrg_switch_t {
|
||||
eIDX_ID id;
|
||||
struct chrg_src_t source;
|
||||
struct chrg_sink_t sink;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -7,13 +7,26 @@
|
||||
#define DBG_LEVEL DBG_LOG
|
||||
#include <rtdbg.h>
|
||||
|
||||
struct chrg_north_t chrgnor = {
|
||||
struct chrg_north_t chrgnorth = {
|
||||
.name = THR_NAME_NORTH,
|
||||
.tid = RT_NULL,
|
||||
.tty = RT_NULL,
|
||||
.rx_len = 0,
|
||||
};
|
||||
|
||||
|
||||
int chrg_north_send (rt_uint8_t *data, rt_size_t length)
|
||||
{
|
||||
rt_ssize_t ret = -1;
|
||||
struct chrg_tty_t *pTTY = chrgnorth.tty;
|
||||
|
||||
if ((RT_NULL != pTTY)&&(RT_NULL != pTTY->dev)) {
|
||||
ret = rt_device_write(pTTY->dev, 0, data, length);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void chrg_north_thread_entry (void *data)
|
||||
{
|
||||
rt_err_t ret = RT_EOK;
|
||||
@@ -49,7 +62,7 @@ static void chrg_north_thread_entry (void *data)
|
||||
static int chrg_north_init (void)
|
||||
{
|
||||
rt_err_t ret;
|
||||
struct chrg_north_t *pNOR = &chrgnor;
|
||||
struct chrg_north_t *pNOR = &chrgnorth;
|
||||
|
||||
pNOR->tty = &chrgtty[IDX_TTY_NORTH];
|
||||
rt_memset(pNOR->rx_buf, 0, SIZE_BUF_UART);
|
||||
@@ -77,15 +90,7 @@ INIT_APP_EXPORT(chrg_north_init);
|
||||
|
||||
static int north_send(rt_uint8_t argc, char **argv)
|
||||
{
|
||||
rt_ssize_t ret = 0;
|
||||
struct chrg_north_t *pNOR = &chrgnor;
|
||||
struct chrg_tty_t *pTTY = pNOR->tty;
|
||||
|
||||
if (RT_NULL != pTTY->dev) {
|
||||
ret = rt_device_write(pTTY->dev, 0, "1234567890abcdef", 16);
|
||||
}
|
||||
|
||||
return ret;
|
||||
return chrg_north_send("1234567890abcdef", 16);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
#define __CHRG_NORTH_H__
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
#include "chrg_tty.h"
|
||||
#include "chrg_switch.h"
|
||||
|
||||
|
||||
#define THR_NAME_NORTH "thr_nor"
|
||||
|
||||
@@ -14,9 +17,13 @@ struct chrg_north_t {
|
||||
struct chrg_tty_t *tty;
|
||||
rt_uint16_t rx_len;
|
||||
rt_uint8_t rx_buf[SIZE_BUF_UART];
|
||||
|
||||
struct chrg_switch_t sw[TOTAL_CHS];
|
||||
};
|
||||
|
||||
extern struct chrg_north_t chrgnor;
|
||||
extern struct chrg_north_t chrgnorth;
|
||||
|
||||
extern int chrg_north_send (rt_uint8_t *data, rt_size_t length);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#define DBG_LEVEL DBG_LOG
|
||||
#include <rtdbg.h>
|
||||
|
||||
struct chrg_south_t chrgsou = {
|
||||
struct chrg_south_t chrgsouth = {
|
||||
.name = THR_NAME_SOUTH,
|
||||
.tid = RT_NULL,
|
||||
.tty = RT_NULL,
|
||||
@@ -49,7 +49,7 @@ static void chrg_south_thread_entry (void *data)
|
||||
static int chrg_south_init (void)
|
||||
{
|
||||
rt_err_t ret;
|
||||
struct chrg_south_t *pSOU = &chrgsou;
|
||||
struct chrg_south_t *pSOU = &chrgsouth;
|
||||
|
||||
pSOU->tty = &chrgtty[IDX_TTY_NORTH];
|
||||
rt_memset(pSOU->rx_buf, 0, SIZE_BUF_UART);
|
||||
@@ -77,7 +77,7 @@ INIT_APP_EXPORT(chrg_south_init);
|
||||
static int south_send(rt_uint8_t argc, char **argv)
|
||||
{
|
||||
rt_err_t ret;
|
||||
struct chrg_south_t *pSOU = &chrgsou;
|
||||
struct chrg_south_t *pSOU = &chrgsouth;
|
||||
struct chrg_tty_t *pTTY = pSOU->tty;
|
||||
|
||||
if (RT_NULL != pTTY->dev) {
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
#define __CHRG_SOUTH_H__
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
#include "chrg_tty.h"
|
||||
#include "chrg_switch.h"
|
||||
|
||||
#define THR_NAME_SOUTH "thr_sou"
|
||||
|
||||
@@ -14,9 +16,11 @@ struct chrg_south_t {
|
||||
struct chrg_tty_t *tty;
|
||||
rt_uint16_t rx_len;
|
||||
rt_uint8_t rx_buf[SIZE_BUF_UART];
|
||||
|
||||
struct chrg_switch_t sw[TOTAL_SOUTH_CHS];
|
||||
};
|
||||
|
||||
extern struct chrg_south_t chrgsou;
|
||||
extern struct chrg_south_t chrgsouth;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
#ifndef __CHRG_DEF_H__
|
||||
#define __CHRG_DEF_H__
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
|
||||
typedef enum {
|
||||
ID_SINK = 0x01, // SINK 的 ID 为 1, 波特率 200K
|
||||
ID_SOURCE = 0x02, // SOURCE 的 ID 为 2, 波特率 200K
|
||||
} eIDX_ID;
|
||||
|
||||
// 电压电流极值
|
||||
struct vc_mm_t {
|
||||
rt_uint16_t max_vol; // 最大电压 mV
|
||||
rt_uint16_t min_vol; // 最小电压 mV
|
||||
rt_uint16_t max_cur; // 最大电流 mA / 功率 W
|
||||
};
|
||||
|
||||
// 源类型
|
||||
enum {
|
||||
TYPE_SRC_PDO = 0x00,
|
||||
TYPE_SRC_APDO = 0x03,
|
||||
};
|
||||
|
||||
// PPS类型
|
||||
enum {
|
||||
TYPE_PPS_SPRPPS = 0x00,
|
||||
TYPE_PPS_EPR = 0x01,
|
||||
TYPE_PPS_SPRAVS = 0x02,
|
||||
|
||||
};
|
||||
|
||||
// PD协议数据
|
||||
struct vc_pd_t {
|
||||
rt_uint8_t src_type; // 源类型
|
||||
rt_uint8_t pps_type; // PPS类型
|
||||
struct vc_mm_t mm[2]; // 电压电流极值
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
#include "chrg_pkg.h"
|
||||
|
||||
int chrg_pkg_encode (eIDX_ID id, rt_uint8_t cmd, rt_uint8_t *data)
|
||||
{
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int chrg_pkg_decode (eIDX_ID id, rt_uint8_t *data)
|
||||
{
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
#ifndef __CHRG_PKG_H__
|
||||
#define __CHRG_PKG_H__
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
#include "chrg_def.h"
|
||||
|
||||
extern int chrg_pkg_encode (eIDX_ID id, rt_uint8_t cmd, rt_uint8_t *data);
|
||||
|
||||
extern int chrg_pkg_decode (eIDX_ID id, rt_uint8_t *data);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,31 +3,143 @@
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
#define SINK_ID 0x01
|
||||
#include "chrg_def.h"
|
||||
|
||||
#define SINK_REG_GET_VOLTAGE 0x20 // 读取变电压板电压
|
||||
#define SINK_REG_GET_PD 0x13 // 读取源端的PD协议数据
|
||||
#define SINK_REG_SET_CC 0x17 // 设置CC线
|
||||
#define SINK_REG_SET_LEVEL 0x16 // 设置CC线电平
|
||||
|
||||
// 设置快充协议
|
||||
#define SINK_REG_SET_QC2 0xF8 // QC2.0
|
||||
#define SINK_REG_SET_QC3 0xF6 // QC3.0
|
||||
#define SINK_REG_SET_FCP 0xF2 // FCP
|
||||
#define SINK_REG_SET_AFC 0xF9 // AFC
|
||||
#define SINK_REG_SET_SCP 0xF3 // SCP
|
||||
#define SINK_REG_SET_VIVO 0xFD // VIVO
|
||||
#define SINK_REG_SET_TFC 0xF7 // TFC 传音
|
||||
#define SINK_REG_SET_PD0 0xFB // PD0 手动/自动
|
||||
#define SINK_REG_SET_PPS 0xFC // PPS 手动/自动
|
||||
#define SINK_REG_SET_PD3P1 0xE1 // PD3.1
|
||||
#define SINK_REG_SET_UFCS 0xE0 // UFCS
|
||||
#define SINK_REG_SET_VOOC 0xE2 // VOOC
|
||||
#define SINK_REG_SET_AVS 0xE3 // AVS
|
||||
// 冠达快充板(SINK)通讯协议
|
||||
// SINK的ID为1,波特率200K,TTL
|
||||
|
||||
|
||||
|
||||
#define SINK_CMD_GET_VOLTAGE 0x20 // 读取变电压板电压
|
||||
// (需要实时比较设置的快充指令和读回来的快充指令,若有不一样,则重设)(注意vooc模式下数据返回会很慢)
|
||||
// 发送 0B 00 01 20 loadvh loadvl loadch loadcl nc nc CRC8
|
||||
// 长度+nc+id+指令+负载电压(2字节,0.01V)+负载电流(2字节,mA)+2个预留字节+CRC8校验
|
||||
// 接收 15 00 01 20 VH VL qc_data1 qc_data2 qc_data3 qc_data4 qc_data5 qc_data6 ver_h ver_l nc nc nc nc nc nc CRC8
|
||||
// 长度+nc+ID+指令+2字节电压(0.01V)+6字节快充指令+2字节版本号+6字节预留+CRC8校验
|
||||
|
||||
struct sink_vc_t {
|
||||
rt_uint8_t voltage; // 电压 0.01V
|
||||
rt_uint8_t qc[6]; // 快充指令
|
||||
rt_uint16_t version; // 版本号
|
||||
};
|
||||
|
||||
#define SINK_CMD_GET_PD 0x13 // 读取源端的PD协议数据(当前为PDO,PPS,PD3.1,AVS协议时有效)
|
||||
// 发送 05 00 01 13 2A
|
||||
// 接收 XX 00 01 13 // 长度(根据实际计算)+NC+ID+指令
|
||||
// 00 00 VMINH VMINL VMAXH VMAXL CURH/PORH CURL/PORL NC NC NC NC NC NC
|
||||
// 源类型(1字节,00为PDO,03为APDO) + PPS类型(1字节,源类型为3时有效,00为SPR PPS,01为EPR AVS,02为SPR AVS) +
|
||||
// 最小电压(2字节,mV) + 最大电压(2字节,mV) + 最大电流/功率(2字节,mA/W) + 预留(6字节,当PPS类型为02时有效,意义与前6字节一致)
|
||||
// 00 00 VMINH VMINL VMAXH VMAXL CURH/PORH CURL/PORL NC NC NC NC NC NC
|
||||
// ...... CRC8
|
||||
|
||||
#define SINK_CMD_SET_CC 0x17 // 设置CC线
|
||||
// 发送 06 00 01 17 00 2A // 长度+nc+id+指令+CC(0为都选通,1为选择CC1,2为CC2,3为全断开)+CRC8校验
|
||||
// 接收 05 00 01 17 2A // 长度+nc+id+指令+CRC8校验
|
||||
|
||||
// CC 线选通
|
||||
enum {
|
||||
CC_SEL_ALL = 0, // 全选通
|
||||
CC_SEL_CC1 = 1, // 选通CC1
|
||||
CC_SEL_CC2 = 2, // 选通CC2
|
||||
CC_SEL_NONE = 3, // 全断开
|
||||
};
|
||||
|
||||
#define SINK_CMD_SET_LEVEL 0x16 // 设置CC线电平
|
||||
// 发送 06 00 01 16 00 2A // 长度+nc+id+指令+电平等级(0-10,默认7)+CRC8校验
|
||||
// 接收 05 00 01 16 2A // 长度+nc+id+指令+CRC8校验
|
||||
|
||||
// 电平等级
|
||||
enum {
|
||||
CC_LVL_0 = 0,
|
||||
CC_LVL_1 = 1,
|
||||
CC_LVL_2 = 2,
|
||||
CC_LVL_3 = 3,
|
||||
CC_LVL_4 = 4,
|
||||
CC_LVL_5 = 5,
|
||||
CC_LVL_6 = 6,
|
||||
CC_LVL_7 = 7, // 默认为 7
|
||||
CC_LVL_8 = 8,
|
||||
CC_LVL_9 = 9,
|
||||
CC_LVL_10 = 10
|
||||
};
|
||||
|
||||
|
||||
// 设置快充协议(VOOC,UFCS模式下切换其他模式时,需要先把V+,V-,D+,D-,
|
||||
// CC等和变电压有关的继电器切至悬空,至少等待1s后,等能读到数据且快充指令正确,再把继电器切回)
|
||||
// 发送格式 长度+NC+ID+6字节快充数据+CRC8
|
||||
// 接收 长度+NC+ID+指令+CRC8
|
||||
|
||||
#define SINK_CMD_SET_QC20 0xF8 // QC2.0
|
||||
// QC2.0 电压5V/9V/12V/20V 命令:0A 00 01 F8 5A 00 00 00 00 2A
|
||||
// 第5个字节为电压(0.1V)
|
||||
|
||||
#define SINK_CMD_SET_QC30 0xF6 // QC3.0
|
||||
// QC3.0 电压3.3-20V 命令:0A 00 01 F6 5A 00 00 00 00 2A
|
||||
// 第5个字节为电压(0.1V)
|
||||
|
||||
#define SINK_CMD_SET_FCP 0xF2 // FCP
|
||||
// FCP 电压5V/9V/12V 命令:0A 00 01 F2 78 00 00 00 00 2A
|
||||
// 第5个字节为电压(0.1V)
|
||||
|
||||
#define SINK_CMD_SET_AFC 0xF9 // AFC
|
||||
// AFC 命令:0A 00 01 F9 46 00 00 00 00 2A
|
||||
// 第5个字节为变电压数据,详细参考AFC文档
|
||||
|
||||
#define SINK_CMD_SET_SCP 0xF3 // SCP
|
||||
// SCP 命令:0A 00 01 F3 27 10 0F A0 00 2A
|
||||
// 5,6字节为电压(mv),7,8字节为电流(mA)
|
||||
|
||||
#define SINK_CMD_SET_VIVO 0xFD // VIVO
|
||||
// VIVO 命令:0A 00 01 FD 27 10 00 00 00 2A
|
||||
// 5,6字节为电压(mv),7,8字节为电流(mA)
|
||||
|
||||
#define SINK_CMD_SET_TFC 0xF7 // TFC 传音
|
||||
// 传音/TFC 命令:0A 00 01 F7 2E E0 00 00 00/01 2A
|
||||
// 5,6字节为电压(mv), 7,8字节为电流(mA), 9字节为RFC/TFC选择
|
||||
|
||||
#define SINK_CMD_SET_PD0 0xFB // PD0 手动/自动
|
||||
// PDO手动,需要设定组号,电压和产品相关,命令:0A 00 01 FB 05 00 00 00 00 2A
|
||||
// 5字节为组号
|
||||
// PDO自动,组号设为0,自动变到指定电压,命令:0A 00 01 FB 00 2E E0 00 00 2A
|
||||
// 5字节为组号,6,7字节为电压(mv),8、9字节为电流(mA)
|
||||
|
||||
enum {
|
||||
SET_MANUAL = 0, // 手动
|
||||
SET_AUTO = 1, // 自动
|
||||
};
|
||||
|
||||
#define SINK_CMD_SET_PPS 0xFC // PPS 手动/自动
|
||||
// PPS手动,需要设定组号、电压、电流,电流0最大, 命令: 0A 00 01 FC 06 4E 20 00 00 2A
|
||||
// 5字节为组号,6,7字节为电压(mv),8、9字节为电流(mA)
|
||||
// PPS自动,组号设为0,设定电压、电流,电流0最大,命令:0A 00 01 FC 00 4E 20 00 00 2A
|
||||
// 5字节为组号,6,7字节为电压(mv),8、9字节为电流(mA)
|
||||
|
||||
#define SINK_CMD_SET_PD3P1 0xE1 // PD3.1
|
||||
// PD3.1, 命令:0A 00 01 E1 00 2328 07d0 2A (组号设置和电压设置都支持)
|
||||
// 5字节为组号,6,7字节为电压(mv),8、9字节为电流(mA)
|
||||
|
||||
#define SINK_CMD_SET_UFCS 0xE0 // UFCS
|
||||
// UFCS,命令:0A 00 01 E0 00 2328 07d0 2A (组号设置和电压设置都支持)
|
||||
// 5字节为组号,6,7字节为电压(mv),8、9字节为电流(mA)
|
||||
|
||||
#define SINK_CMD_SET_VOOC 0xE2 // VOOC
|
||||
// VOOC,电压10/11V, 命令:0A 00 01 E2 00 0000 0000 2A
|
||||
|
||||
#define SINK_CMD_SET_AVS 0xE3 // AVS
|
||||
// AVS,命令:0A 00 01 E3 00 4e 20 07 d0 2A (组号设置和电压设置都支持)
|
||||
// 5字节为组号,6,7字节为电压(mv),8、9字节为电流(mA)
|
||||
|
||||
|
||||
// sink 参数结构
|
||||
struct chrg_sink_t {
|
||||
rt_uint8_t type;
|
||||
rt_uint16_t loadv; // 负载电压 0.01V
|
||||
rt_uint16_t loadc; // 负载电流 mA
|
||||
|
||||
struct sink_vc_t vc;
|
||||
struct vc_pd_t pd_get[2];
|
||||
|
||||
rt_uint8_t cc_onoff; // 设置CC线开关
|
||||
rt_uint8_t cc_lvl; // 设置CC线电平等级(0-10,默认7)
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,32 @@
|
||||
|
||||
#include <rtthread.h>
|
||||
#include "chrg_source.h"
|
||||
|
||||
#include "chrg_north.h"
|
||||
|
||||
#include "chrg_utils.h"
|
||||
|
||||
void source_get_vc (rt_uint16_t vol, rt_uint16_t cur)
|
||||
{
|
||||
rt_size_t len = 0;
|
||||
rt_uint8_t data[12] = {0};
|
||||
|
||||
data[0] = 0x0B;
|
||||
data[1] = 0x00;
|
||||
data[2] = ID_SOURCE;
|
||||
data[3] = SRC_CMD_GET_VOLTAGE;
|
||||
|
||||
u16_to_u8v(vol, &data[4]);
|
||||
u16_to_u8v(cur, &data[6]);
|
||||
|
||||
data[8] = 0x00;
|
||||
data[9] = 0x00;
|
||||
data[10] = calc_crc8(data, 10);
|
||||
|
||||
len = 0x0B;
|
||||
|
||||
chrg_north_send(data, len);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,92 @@
|
||||
#ifndef __CHRG_SOURCE_H__
|
||||
#define __CHRG_SOURCE_H__
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
#include "chrg_def.h"
|
||||
|
||||
// 冠达快充板(SOURCE)通讯协议
|
||||
// SOURCE的ID为2, 波特率200K
|
||||
|
||||
|
||||
#define SRC_CMD_GET_VOLTAGE 0x20 // 读取数据
|
||||
// 发送 0B 00 02 20 volh voll curh curl nc nc CRC8
|
||||
// 长度+nc+id+指令+2字节当前电源电压(mV)+2字节当前电源电流(mA)+2个预留字节+CRC8校验
|
||||
// 接收 15 00 02 20 VH VL setvh setvl setch setcl NC NC verh verl NC NC NC NC NC NC CRC8
|
||||
// 长度+nc+ID+指令+2字节读取的电压(0.01V)+2字节source设置电压(mV)+2字节source设置电流(mA)+2字节预留+2字节版本号+6字节预留+CRC8校验
|
||||
|
||||
#define SRC_CMD_GET_PROTOCOL 0x13 // 读取source的PD协议数据(当前为PDO,PPS,PD3.1,AVS协议时有效)
|
||||
// 发送 05 00 02 13 2A
|
||||
// XX 00 02 13 //长度(根据实际计算)+NC+ID+指令
|
||||
// 00 00 VMAXH VMAXL VMINH VMINL CURH/PORH CURL/PORL NC NC NC NC NC NC
|
||||
//源类型(1字节,00为PDO,03为APDO) + PPS类型(1字节,源类型为3时有效,00为SPR PPS,01为EPR AVS,02为SPR AVS)
|
||||
// + 最大电压(2字节,mV) + 最小电压(2字节,mA) + 最大电流/功率(2字节,mA/W) + 预留(6字节,当协议类型为02时有效,意义与前6字节一致)
|
||||
// 00 00 VMAXH VMAXL VMINH VMINL CURH/PORH CURL/PORL NC NC NC NC NC NC
|
||||
// ...... CRC8
|
||||
|
||||
#define SRC_CMD_SET_CC_LEVEL 0x16
|
||||
// 发送 06 00 02 16 00 2A
|
||||
// 长度+nc+id+指令+电平等级(0xff为根据当前电流自动设置,否则为手动设定,设置方法待定)+CRC8校验
|
||||
// 接收 05 00 02 16 2A
|
||||
// 长度+nc+id+指令+CRC8校验
|
||||
|
||||
#define SRC_CMD_SET_PROTOCOL 0xD0
|
||||
// 发送 XX 00 02 D0 // 长度(根据实际计算)+NC+ID+指令
|
||||
// 00 00 00 VMAXH VMAXL VMINH VMINL CURH/PORH CURL/PORL NC NC NC NC NC NC
|
||||
// 协议(1字节) + 源类型(1字节,PD协议有效,00为PDO,03为APDO) +
|
||||
// PPS类型(1字节, PD协议有效,源类型为3时有效,00为SPR PPS,01为EPR AVS,02为SPR AVS) + 最大电压(2字节,mV) +
|
||||
// 最小电压(2字节,mA) + 最大电流/功率(2字节,mA/W) + 预留(6字节,当协议类型为02时有效,意义与前6字节一致)
|
||||
// 00 00 00 VMAXH VMAXL VMINH VMINL CURH/PORH CURL/PORL NC NC NC NC NC NC
|
||||
// ...... CRC8
|
||||
// 接收 05 00 02 D0 CRC8
|
||||
|
||||
|
||||
|
||||
typedef enum {
|
||||
PRO_NONE = 0x00, // 无快充
|
||||
PRO_VIFC = 0x01, // VIFC(暂不支持)
|
||||
PRO_FCP = 0x02, // FCP
|
||||
PRO_SCP = 0x03, // SCP
|
||||
PRO_SERV1 = 0x04, // 预留
|
||||
PRO_SERV2 = 0x05, // 预留
|
||||
PRO_RFC = 0x06, // RFC(暂不支持)
|
||||
PRO_QC30 = 0x07, // QC3.0
|
||||
PRO_QC20 = 0x08, // QC2.0
|
||||
PRO_AFC = 0x09, // AFC
|
||||
PRO_PD0PSS = 0x0A, // PD0/PPS
|
||||
PRO_SERV3 = 0x0B, // 预留
|
||||
PRO_UFCS = 0x0C, // UFCS
|
||||
PRO_PD31AVS = 0x0D, // PD3.1/AVS
|
||||
PRO_VOOC = 0x0E, // VOOC(暂不支持)
|
||||
|
||||
TOTAL_PROS
|
||||
} eSRC_PRO;
|
||||
|
||||
struct src_vc_t {
|
||||
rt_uint16_t voltage; // 读取 0.01V
|
||||
rt_uint16_t set_voltage; // 设置电压 mV
|
||||
rt_uint16_t set_current; // 设置电流 mA
|
||||
rt_uint16_t version; // 版本号
|
||||
};
|
||||
|
||||
|
||||
// source 参数结构
|
||||
struct chrg_src_t {
|
||||
rt_uint16_t voltage; // 当前电压 mV
|
||||
rt_uint16_t current; // 当前电流 mA
|
||||
|
||||
rt_uint8_t vol_lvl; // CC线电平
|
||||
eSRC_PRO protocol; // 协议类型
|
||||
|
||||
struct src_vc_t vc; // 读取数据
|
||||
struct vc_pd_t pd_get[2]; // 读取PD协议数据
|
||||
struct vc_pd_t pd_set[2]; // 设置PD协议数据
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -35,9 +35,25 @@ rt_uint8_t calc_crc8 (rt_uint8_t *data, rt_uint8_t length)
|
||||
return res;
|
||||
}
|
||||
|
||||
rt_uint8_t u16_to_u8v (rt_uint16_t value, rt_uint8_t *buf)
|
||||
{
|
||||
if (RT_NULL != buf) {
|
||||
buf[0] = (value>>8)&0xFF;
|
||||
buf[1] = value&0xFF;
|
||||
return 2;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
rt_uint16_t u8v_to_u16 (rt_uint8_t *buf)
|
||||
{
|
||||
if (RT_NULL != buf) {
|
||||
return (((rt_uint16_t)buf[0]<<8) + buf[1]);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
|
||||
extern rt_uint8_t calc_crc8 (rt_uint8_t *data, rt_uint8_t length);
|
||||
|
||||
extern rt_uint8_t u16_to_u8v (rt_uint16_t value, rt_uint8_t *buf);
|
||||
|
||||
extern rt_uint16_t u8v_to_u16 (rt_uint8_t *buf);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+241
-237
@@ -10,7 +10,6 @@
|
||||
<TargetName>chrg</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
@@ -337,9 +336,9 @@
|
||||
<v6Rtti>0</v6Rtti>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define>USE_HAL_DRIVER, RT_USING_ARMLIBC, __CLK_TCK=RT_TICK_PER_SECOND, __STDC_LIMIT_MACROS, RT_USING_LIBC, __RTTHREAD__, STM32F405xx</Define>
|
||||
<Define>__RTTHREAD__, RT_USING_ARMLIBC, USE_HAL_DRIVER, STM32F405xx, __CLK_TCK=RT_TICK_PER_SECOND, RT_USING_LIBC, __STDC_LIMIT_MACROS</Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath>..\..\rt-thread\components\drivers\include;..\..\rt-thread\bsp\stm32\libraries\HAL_Drivers\drivers;..\..\rt-thread\components\libc\posix\ipc;..\..\libs\stm32f4\STM32F4_CMSIS\Include;..\..\rt-thread\components\drivers\smp_call;.;..\..\rt-thread\libcpu\arm\common;..\..\rt-thread\components\libc\compilers\common\extension\fcntl\octal;..\..\libs\cmsis-core\Include;..\..\rt-thread\bsp\stm32\libraries\HAL_Drivers\drivers\drv_flash;..\..\rt-thread\components\libc\posix\io\eventfd;..\..\rt-thread\bsp\stm32\libraries\HAL_Drivers;..\..\rt-thread\components\drivers\include;..\..\rt-thread\components\libc\compilers\common\extension;..\..\rt-thread\components\drivers\include;..\..\libs\stm32f4\STM32F4_HAL\Inc;..\..\rt-thread\components\drivers\include;..\..\libs\freemodbus\modbus\include;..\..\libs\freemodbus\modbus\tcp;..\..\rt-thread\components\drivers\include;..\..\rt-thread\bsp\stm32\libraries\HAL_Drivers\drivers\config;..\..\libs\freemodbus\modbus\rtu;..\..\libs\freemodbus\modbus\ascii;..\..\rt-thread\include;board\ports;..\..\rt-thread\libcpu\arm\cortex-m4;..\..\rt-thread\components\drivers\include;applications\thread;..\..\rt-thread\components\drivers\include;..\..\libs\freemodbus\port;..\..\rt-thread\components\libc\compilers\common\include;board;..\..\rt-thread\components\fal\inc;board\CubeMX_Config\Inc;..\..\rt-thread\components\finsh;..\..\rt-thread\components\libc\posix\io\poll;..\..\libs\stm32f4\STM32F4_HAL\Inc\Legacy;applications\bsp;..\..\rt-thread\components\drivers\include;..\..\rt-thread\components\drivers\include;applications\utils;..\..\rt-thread\components\libc\posix\io\epoll;..\..\rt-thread\components\drivers\phy;applications;..\..\rt-thread\components\drivers\include</IncludePath>
|
||||
<IncludePath>..\..\libs\cmsis-core\Include;..\..\rt-thread\libcpu\arm\cortex-m4;board;.;..\..\rt-thread\components\drivers\include;..\..\libs\freemodbus\modbus\ascii;board\ports;..\..\rt-thread\bsp\stm32\libraries\HAL_Drivers\drivers\config;applications;..\..\rt-thread\components\fal\inc;..\..\libs\freemodbus\modbus\include;..\..\rt-thread\components\drivers\include;..\..\libs\freemodbus\port;..\..\rt-thread\include;..\..\rt-thread\components\drivers\include;..\..\rt-thread\components\libc\posix\ipc;..\..\rt-thread\components\drivers\include;..\..\rt-thread\components\drivers\smp_call;..\..\rt-thread\components\libc\compilers\common\extension;applications\thread;applications\utils;..\..\rt-thread\bsp\stm32\libraries\HAL_Drivers\drivers;..\..\rt-thread\components\libc\posix\io\poll;..\..\rt-thread\components\drivers\include;..\..\rt-thread\components\drivers\include;..\..\rt-thread\components\drivers\include;..\..\libs\stm32f4\STM32F4_HAL\Inc\Legacy;..\..\rt-thread\components\libc\posix\io\epoll;..\..\libs\stm32f4\STM32F4_HAL\Inc;board\CubeMX_Config\Inc;..\..\rt-thread\components\libc\compilers\common\include;..\..\rt-thread\components\libc\compilers\common\extension\fcntl\octal;..\..\libs\freemodbus\modbus\rtu;..\..\libs\stm32f4\STM32F4_CMSIS\Include;..\..\rt-thread\components\drivers\include;..\..\rt-thread\bsp\stm32\libraries\HAL_Drivers\drivers\drv_flash;..\..\rt-thread\components\drivers\phy;..\..\rt-thread\components\drivers\include;..\..\rt-thread\libcpu\arm\common;..\..\rt-thread\components\finsh;..\..\rt-thread\components\drivers\include;..\..\rt-thread\components\libc\posix\io\eventfd;..\..\rt-thread\bsp\stm32\libraries\HAL_Drivers;applications\bsp;..\..\libs\freemodbus\modbus\tcp</IncludePath>
|
||||
</VariousControls>
|
||||
</Cads>
|
||||
<Aads>
|
||||
@@ -394,39 +393,24 @@
|
||||
<GroupName>Applications/bsp</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>chrg_i2c.c</FileName>
|
||||
<FileName>chrg_tmr.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>applications\bsp\chrg_i2c.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>chrg_can.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>applications\bsp\chrg_can.c</FilePath>
|
||||
<FilePath>applications\bsp\chrg_tmr.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>chrg_pin.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>applications\bsp\chrg_pin.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>chrg_intr.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>applications\bsp\chrg_intr.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>chrg_fal.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>applications\bsp\chrg_fal.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>chrg_wdt.c</FileName>
|
||||
<FileName>chrg_can.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>applications\bsp\chrg_wdt.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>chrg_clk.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>applications\bsp\chrg_clk.c</FilePath>
|
||||
<FilePath>applications\bsp\chrg_can.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>chrg_switch.c</FileName>
|
||||
@@ -434,25 +418,35 @@
|
||||
<FilePath>applications\bsp\chrg_switch.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>chrg_tmr.c</FileName>
|
||||
<FileName>chrg_clk.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>applications\bsp\chrg_tmr.c</FilePath>
|
||||
<FilePath>applications\bsp\chrg_clk.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>chrg_intr.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>applications\bsp\chrg_intr.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>chrg_wdt.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>applications\bsp\chrg_wdt.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>chrg_tty.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>applications\bsp\chrg_tty.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>chrg_i2c.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>applications\bsp\chrg_i2c.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Applications/thread</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>chrg_lcd.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>applications\thread\chrg_lcd.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>chrg_north.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
@@ -468,31 +462,41 @@
|
||||
<FileType>1</FileType>
|
||||
<FilePath>applications\thread\chrg_south.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>chrg_lcd.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>applications\thread\chrg_lcd.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Applications/utils</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>chrg_utils.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>applications\utils\chrg_utils.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>chrg_sink.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>applications\utils\chrg_sink.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>chrg_pcf8574.c</FileName>
|
||||
<FileName>chrg_utils.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>applications\utils\chrg_pcf8574.c</FilePath>
|
||||
<FilePath>applications\utils\chrg_utils.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>chrg_source.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>applications\utils\chrg_source.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>chrg_pkg.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>applications\utils\chrg_pkg.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>chrg_pcf8574.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>applications\utils\chrg_pcf8574.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
@@ -1672,11 +1676,6 @@
|
||||
<Group>
|
||||
<GroupName>Fal</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>fal_flash.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\rt-thread\components\fal\src\fal_flash.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>fal_rtt.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
@@ -1687,6 +1686,11 @@
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\rt-thread\components\fal\src\fal.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>fal_flash.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\rt-thread\components\fal\src\fal_flash.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>fal_partition.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
@@ -1697,55 +1701,35 @@
|
||||
<Group>
|
||||
<GroupName>Finsh</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>msh.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\rt-thread\components\finsh\msh.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>shell.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\rt-thread\components\finsh\shell.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>msh_parse.c</FileName>
|
||||
<FileName>msh.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\rt-thread\components\finsh\msh_parse.c</FilePath>
|
||||
<FilePath>..\..\rt-thread\components\finsh\msh.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>cmd.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\rt-thread\components\finsh\cmd.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>msh_parse.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\rt-thread\components\finsh\msh_parse.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>FreeModbus</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>mbfuncdisc.c</FileName>
|
||||
<FileName>user_mb_app_m.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\freemodbus\modbus\functions\mbfuncdisc.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>mbfuncdisc_m.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\freemodbus\modbus\functions\mbfuncdisc_m.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>mbrtu.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\freemodbus\modbus\rtu\mbrtu.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>mbutils.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\freemodbus\modbus\functions\mbutils.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>porttcp.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\freemodbus\port\porttcp.c</FilePath>
|
||||
<FilePath>..\..\libs\freemodbus\port\user_mb_app_m.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>port.c</FileName>
|
||||
@@ -1753,59 +1737,29 @@
|
||||
<FilePath>..\..\libs\freemodbus\port\port.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>mbfuncdiag.c</FileName>
|
||||
<FileName>mbfunccoils.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\freemodbus\modbus\functions\mbfuncdiag.c</FilePath>
|
||||
<FilePath>..\..\libs\freemodbus\modbus\functions\mbfunccoils.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>porttimer.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\freemodbus\port\porttimer.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>mb_m.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\freemodbus\modbus\mb_m.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>user_mb_app_m.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\freemodbus\port\user_mb_app_m.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>mbcrc.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\freemodbus\modbus\rtu\mbcrc.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>mbfunccoils_m.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\freemodbus\modbus\functions\mbfunccoils_m.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>user_mb_app.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\freemodbus\port\user_mb_app.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>mbfuncholding.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\freemodbus\modbus\functions\mbfuncholding.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>mbfuncinput_m.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\freemodbus\modbus\functions\mbfuncinput_m.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>portserial.c</FileName>
|
||||
<FileName>mbfuncdisc.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\freemodbus\port\portserial.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>mbfuncinput.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\freemodbus\modbus\functions\mbfuncinput.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>mbfunccoils.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\freemodbus\modbus\functions\mbfunccoils.c</FilePath>
|
||||
<FilePath>..\..\libs\freemodbus\modbus\functions\mbfuncdisc.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>mb.c</FileName>
|
||||
@@ -1813,9 +1767,14 @@
|
||||
<FilePath>..\..\libs\freemodbus\modbus\mb.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>portevent.c</FileName>
|
||||
<FileName>sample_mb_slave.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\freemodbus\port\portevent.c</FilePath>
|
||||
<FilePath>..\..\libs\freemodbus\samples\sample_mb_slave.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>mbfuncdisc_m.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\freemodbus\modbus\functions\mbfuncdisc_m.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>sample_mb_master.c</FileName>
|
||||
@@ -1823,9 +1782,19 @@
|
||||
<FilePath>..\..\libs\freemodbus\samples\sample_mb_master.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>porttimer.c</FileName>
|
||||
<FileName>mbfuncinput.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\freemodbus\port\porttimer.c</FilePath>
|
||||
<FilePath>..\..\libs\freemodbus\modbus\functions\mbfuncinput.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>portserial.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\freemodbus\port\portserial.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>porttcp.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\freemodbus\port\porttcp.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>mbfuncholding_m.c</FileName>
|
||||
@@ -1837,6 +1806,16 @@
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\freemodbus\modbus\rtu\mbrtu_m.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>portserial_m.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\freemodbus\port\portserial_m.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>mbfuncholding.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\freemodbus\modbus\functions\mbfuncholding.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>porttimer_m.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
@@ -1848,9 +1827,9 @@
|
||||
<FilePath>..\..\libs\freemodbus\port\portevent_m.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>portserial_m.c</FileName>
|
||||
<FileName>mbutils.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\freemodbus\port\portserial_m.c</FilePath>
|
||||
<FilePath>..\..\libs\freemodbus\modbus\functions\mbutils.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>mbfuncother.c</FileName>
|
||||
@@ -1858,9 +1837,34 @@
|
||||
<FilePath>..\..\libs\freemodbus\modbus\functions\mbfuncother.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>sample_mb_slave.c</FileName>
|
||||
<FileName>portevent.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\freemodbus\samples\sample_mb_slave.c</FilePath>
|
||||
<FilePath>..\..\libs\freemodbus\port\portevent.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>mbfuncdiag.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\freemodbus\modbus\functions\mbfuncdiag.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>user_mb_app.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\freemodbus\port\user_mb_app.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>mbcrc.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\freemodbus\modbus\rtu\mbcrc.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>mbfunccoils_m.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\freemodbus\modbus\functions\mbfunccoils_m.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>mbrtu.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\freemodbus\modbus\rtu\mbrtu.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
@@ -2712,6 +2716,21 @@
|
||||
<Group>
|
||||
<GroupName>klibc</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>kstdio.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\rt-thread\src\klibc\kstdio.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>rt_vsnprintf_tiny.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\rt-thread\src\klibc\rt_vsnprintf_tiny.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>kerrno.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\rt-thread\src\klibc\kerrno.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>kstring.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
@@ -2722,21 +2741,6 @@
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\rt-thread\src\klibc\rt_vsscanf.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>kstdio.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\rt-thread\src\klibc\kstdio.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>kerrno.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\rt-thread\src\klibc\kerrno.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>rt_vsnprintf_tiny.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\rt-thread\src\klibc\rt_vsnprintf_tiny.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
@@ -2788,150 +2792,150 @@
|
||||
<GroupName>STM32F4-HAL</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_usart.c</FileName>
|
||||
<FileName>stm32f4xx_hal_can.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_usart.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_flash.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_flash.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_dma.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_dma.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_rcc.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_rcc.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_cec.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_cec.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_lptim.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_lptim.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_flash_ex.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_flash_ex.c</FilePath>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_can.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_uart.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_uart.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_rcc_ex.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_rcc_ex.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_rtc.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_rtc.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_wwdg.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_wwdg.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_cortex.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_cortex.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_rng.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_rng.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_tim.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_tim.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_i2c.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_i2c.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_crc.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_crc.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_iwdg.c</FileName>
|
||||
<FileName>stm32f4xx_hal_flash_ex.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_iwdg.c</FilePath>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_flash_ex.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_pwr.c</FileName>
|
||||
<FileName>stm32f4xx_hal_dma.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_pwr.c</FilePath>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_dma.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_rtc_ex.c</FileName>
|
||||
<FileName>stm32f4xx_hal_rtc.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_rtc_ex.c</FilePath>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_rtc.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_i2c_ex.c</FileName>
|
||||
<FileName>stm32f4xx_hal_usart.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_i2c_ex.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_gpio.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_gpio.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_dma_ex.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_dma_ex.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_flash_ramfunc.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_flash_ramfunc.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_can.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_can.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_cryp.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_cryp.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_cryp_ex.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_cryp_ex.c</FilePath>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_usart.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_pwr_ex.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_pwr_ex.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_pwr.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_pwr.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_cryp_ex.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_cryp_ex.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_wwdg.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_wwdg.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_rtc_ex.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_rtc_ex.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_cryp.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_cryp.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_flash.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_flash.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_cec.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_cec.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_gpio.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_gpio.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_i2c.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_i2c.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_flash_ramfunc.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_flash_ramfunc.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_tim.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_tim.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_tim_ex.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_tim_ex.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_i2c_ex.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_i2c_ex.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_rcc_ex.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_rcc_ex.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_iwdg.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_iwdg.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_lptim.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_lptim.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_rcc.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_rcc.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_dma_ex.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_dma_ex.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_rng.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_rng.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
</Groups>
|
||||
|
||||
Reference in New Issue
Block a user