串口通信更新
This commit is contained in:
parent
3633b6d226
commit
a5f4294421
|
@ -0,0 +1,66 @@
|
||||||
|
//微秒延时
|
||||||
|
extern void DelayUs(unsigned int delay);
|
||||||
|
|
||||||
|
//毫秒延时
|
||||||
|
extern void DelayMs(unsigned int delay);
|
||||||
|
|
||||||
|
|
||||||
|
//接收数据判断(放置串口接收数据内)
|
||||||
|
extern void Do_Receive_Uart_For_Module(unsigned char ch);
|
||||||
|
|
||||||
|
//单独发送
|
||||||
|
extern void UART1_SendData(uint8_t dat);
|
||||||
|
|
||||||
|
//发送数据
|
||||||
|
extern void UART1_Send_Char(uint8_t dat);
|
||||||
|
|
||||||
|
//发送一个字符串
|
||||||
|
//extern void send_string(uchar *p);
|
||||||
|
|
||||||
|
//初始化
|
||||||
|
extern void InitUart_Data(void);
|
||||||
|
|
||||||
|
//接收串口1
|
||||||
|
extern void start_ttl_receive_timer(uint32_t ms);
|
||||||
|
|
||||||
|
extern void over_ttl_receive_timer(void);
|
||||||
|
|
||||||
|
extern void clear_ttl_receive_timer(void);
|
||||||
|
|
||||||
|
|
||||||
|
//返回串口屏应答是否接收完成的结果
|
||||||
|
//0:没超时 1:超时
|
||||||
|
extern uint8_t judge_ttl_receive_timer(void);
|
||||||
|
|
||||||
|
//放在大循环中的计时器里
|
||||||
|
extern void process_ttl_receive_timer(void);
|
||||||
|
|
||||||
|
//放串口中断内,接收数据
|
||||||
|
extern void receive_ttl_data(uint8_t rx_data);
|
||||||
|
|
||||||
|
//CRC校验
|
||||||
|
extern unsigned int ModbusCRC16(unsigned char *data_value, unsigned char length);
|
||||||
|
|
||||||
|
//异或校验
|
||||||
|
extern unsigned char VerfiyRC(unsigned char data_value[], unsigned char length);
|
||||||
|
|
||||||
|
//发送延时
|
||||||
|
extern void Uart_Send_Delay(unsigned int delay);
|
||||||
|
|
||||||
|
//发送数据
|
||||||
|
extern void send_set_resp(unsigned int OrderNum, unsigned int addr, unsigned char Num, unsigned char sData[]);
|
||||||
|
|
||||||
|
//分析地址是否为本地址
|
||||||
|
extern uint8_t Check_Resive_Addr(uint16_t addr);
|
||||||
|
|
||||||
|
//接收数据判断(放置串口接收数据内)
|
||||||
|
extern void Do_Receive_Uart_For_Module(unsigned char ch);
|
||||||
|
|
||||||
|
//数据长度
|
||||||
|
extern uint8_t Get_Data_Len(void);
|
||||||
|
|
||||||
|
//检查校验
|
||||||
|
extern unsigned char Check_VerfiyData(void);
|
||||||
|
|
||||||
|
//数据接收分析(放置大循环内)
|
||||||
|
extern void Deal_Uart_Data_For_Module(void);
|
|
@ -1,6 +1,7 @@
|
||||||
#ifndef _KEY_H
|
#ifndef _KEY_H
|
||||||
#define _KEY_H
|
#define _KEY_H
|
||||||
|
|
||||||
|
#include "main.h"
|
||||||
//void Key_Init(void);
|
//void Key_Init(void);
|
||||||
void Key_Scan(void);
|
void Key_Scan(void);
|
||||||
|
|
||||||
|
@ -13,4 +14,12 @@ void Key_Scan(void);
|
||||||
void key_act(void);
|
void key_act(void);
|
||||||
void msg_clr(void);
|
void msg_clr(void);
|
||||||
|
|
||||||
|
extern uint32_t rampmode ;
|
||||||
|
extern uint32_t speed_1;
|
||||||
|
extern uint32_t speed_max;
|
||||||
|
extern uint32_t acc_1;
|
||||||
|
extern uint32_t acc_max;
|
||||||
|
extern uint32_t dcr_1;
|
||||||
|
extern uint32_t dcr_max;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -11,5 +11,12 @@
|
||||||
|
|
||||||
void uart_test(void);
|
void uart_test(void);
|
||||||
|
|
||||||
|
extern char text_r[20];
|
||||||
|
extern char text_t[20];
|
||||||
|
extern char uart_rx_flag;
|
||||||
|
#define DATA_MAX 60
|
||||||
|
extern unsigned char uart_rx_temp[DATA_MAX];
|
||||||
|
extern unsigned char text_r8;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -8,12 +8,20 @@ void TMC5160_SPIReadInt(uint8_t addr, uint8_t record[5]);
|
||||||
void tmc5160_init(void);
|
void tmc5160_init(void);
|
||||||
void tmc5160_act(void);
|
void tmc5160_act(void);
|
||||||
void TMC5160A_Init_Gpio(void);
|
void TMC5160A_Init_Gpio(void);
|
||||||
uint32_t Raw_32(uint8_t raw[5]);
|
signed int Raw_32(uint8_t raw[5]);
|
||||||
|
|
||||||
extern char tmc5160_sw;
|
extern char tmc5160_sw;
|
||||||
//void TMC5160A_SPI_Transmit(unsigned char val);
|
|
||||||
|
|
||||||
//void TMC5160A_SPI_Receive(unsigned char *val);
|
#define RAMPMODE_ADDR 0x20
|
||||||
|
#define XTARGET_ADDR 0x2D
|
||||||
|
#define A1_ADDR 0x24
|
||||||
|
#define AMAX_ADDR 0x26
|
||||||
|
#define V1_ADDR 0x25
|
||||||
|
#define VMAX_ADDR 0x27
|
||||||
|
#define D1_ADDR 0x2A
|
||||||
|
#define DMAX_ADDR 0x28
|
||||||
|
#define XACTUAL_ADDR 0x21
|
||||||
|
#define VACTUAL_ADDR 0x22
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,735 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include "main.h"
|
||||||
|
|
||||||
|
//#include "SC_Init.h" //MCU Init header,Include all IC resource headers
|
||||||
|
//#include "SC_it.h"
|
||||||
|
//#include "..\Drivers\SCDriver_list.h"
|
||||||
|
//#include "HeadFiles\SysFunVarDefine.h"
|
||||||
|
|
||||||
|
#include "Uart1.h"
|
||||||
|
#include "usart.h"
|
||||||
|
//#include "Motor.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#define HD_VER 0001 //硬件版本
|
||||||
|
#define SW_VER 0001 //软件版本
|
||||||
|
|
||||||
|
#define TTL_SEND_BUFF_LEN 60 //发送数据长度
|
||||||
|
#define TTL_RECEIVE_BUFF_LEN 60 //接收数据长度
|
||||||
|
|
||||||
|
//----------------------------------------------------------------
|
||||||
|
//uart1用于接收usb转ttl的串口
|
||||||
|
//----------------------------------------------------------------
|
||||||
|
|
||||||
|
//存放发送的数据内容
|
||||||
|
uint8_t motor_data[10];
|
||||||
|
|
||||||
|
//发送buff
|
||||||
|
uint8_t ttl_send_len = 0;
|
||||||
|
uint8_t ttl_send_buff[TTL_SEND_BUFF_LEN] = {0};
|
||||||
|
|
||||||
|
//接收buff
|
||||||
|
uint8_t ttl_receive_len = 0;
|
||||||
|
uint8_t ttl_receive_buff[TTL_RECEIVE_BUFF_LEN] = {0};
|
||||||
|
|
||||||
|
//接收超时
|
||||||
|
uint8_t ttl_receive_flag = 0;
|
||||||
|
uint8_t ttl_receive_cnt = 0;
|
||||||
|
uint8_t ttl_receive_interval = 0;
|
||||||
|
|
||||||
|
#define DATA_LEN TTL_RECEIVE_BUFF_LEN //一般数据长度
|
||||||
|
#define UART_ORDER_SOF 0x05 //起始字
|
||||||
|
#define UART_ORDER_END 0x1B //结束字
|
||||||
|
#define FIXED_LEN 0x0B //固定长度 //取消RW
|
||||||
|
|
||||||
|
uint16_t SUR_DEVICE_ADDR = 0x00A1; //PC //0x00A1; //设备
|
||||||
|
uint16_t OBJ_DEVICE_ADDR = 0x00B1; //主板 //0x00B1; //PC群发 FFFF 0000
|
||||||
|
|
||||||
|
uint8_t order_flag = 0;
|
||||||
|
unsigned int checksum = 0, re_status = 0, rec_len = 0, data_len = 0, shouldaccept = 0;
|
||||||
|
|
||||||
|
//单独发送
|
||||||
|
void UART1_SendData(uint8_t dat)
|
||||||
|
{
|
||||||
|
//SSI_UART1_SendData8(dat);
|
||||||
|
HAL_UART_Transmit_IT(&huart1,&dat,1);
|
||||||
|
}
|
||||||
|
|
||||||
|
//发送数据
|
||||||
|
void UART1_Send_Char(uint8_t dat)
|
||||||
|
{
|
||||||
|
// SSI_UART1_SendData8(dat);
|
||||||
|
HAL_UART_Transmit_IT(&huart1,&dat,1);
|
||||||
|
}
|
||||||
|
|
||||||
|
//初始化
|
||||||
|
void InitUart_Data(void)
|
||||||
|
{
|
||||||
|
order_flag = 0;
|
||||||
|
rec_len = 0;
|
||||||
|
re_status = 0;
|
||||||
|
shouldaccept = 0;
|
||||||
|
|
||||||
|
ttl_receive_flag = 0;
|
||||||
|
ttl_receive_cnt = 0;
|
||||||
|
|
||||||
|
checksum = 0;
|
||||||
|
|
||||||
|
for(data_len = 0; data_len < DATA_LEN; data_len++)
|
||||||
|
{
|
||||||
|
ttl_receive_buff[data_len] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
data_len = 0;
|
||||||
|
|
||||||
|
// UART_Send_Char(0xdd);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Private function prototypes -----------------------------------------------*/
|
||||||
|
/* Private functions ---------------------------------------------------------*/
|
||||||
|
//----------------------------------------------------------------
|
||||||
|
//接收串口1
|
||||||
|
//----------------------------------------------------------------
|
||||||
|
/****************************************************************************************************
|
||||||
|
* @brief Download a file via serial port
|
||||||
|
* @param None
|
||||||
|
* @retval None
|
||||||
|
**************************************************************************************************/
|
||||||
|
void start_ttl_receive_timer(uint32_t ms)
|
||||||
|
{
|
||||||
|
if(ms == 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ttl_receive_flag = 1;
|
||||||
|
ttl_receive_cnt = 0;
|
||||||
|
ttl_receive_interval = ms;
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************************
|
||||||
|
* @brief Upload a file via serial port.
|
||||||
|
* @param None
|
||||||
|
* @retval None
|
||||||
|
**************************************************************************************************/
|
||||||
|
void over_ttl_receive_timer(void)
|
||||||
|
{
|
||||||
|
ttl_receive_flag = 0;
|
||||||
|
ttl_receive_cnt = 0;
|
||||||
|
ttl_receive_interval = 0;
|
||||||
|
|
||||||
|
InitUart_Data();
|
||||||
|
|
||||||
|
// UART2_Send_Char(0xed);
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************************
|
||||||
|
* @brief Display the Main Menu on HyperTerminal
|
||||||
|
* @param None
|
||||||
|
* @retval None
|
||||||
|
**************************************************************************************************/
|
||||||
|
void clear_ttl_receive_timer(void)
|
||||||
|
{
|
||||||
|
uint16_t i = 0;
|
||||||
|
ttl_receive_len = 0;
|
||||||
|
ttl_receive_flag = 0;
|
||||||
|
ttl_receive_cnt = 0;
|
||||||
|
ttl_receive_interval = 0;
|
||||||
|
|
||||||
|
for(i = 0; i < TTL_RECEIVE_BUFF_LEN; i++)
|
||||||
|
{
|
||||||
|
ttl_receive_buff[i] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//返回串口屏应答是否接收完成的结果
|
||||||
|
//0:没超时 1:超时
|
||||||
|
uint8_t judge_ttl_receive_timer(void)
|
||||||
|
{
|
||||||
|
if(ttl_receive_flag == 2)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************************
|
||||||
|
* @brief Display the Main Menu on HyperTerminal
|
||||||
|
* @param None
|
||||||
|
* @retval None
|
||||||
|
**************************************************************************************************/
|
||||||
|
//放在大循环中的计时器里
|
||||||
|
void process_ttl_receive_timer(void)
|
||||||
|
{
|
||||||
|
if(ttl_receive_flag == 1)
|
||||||
|
{
|
||||||
|
ttl_receive_cnt++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if((ttl_receive_interval > 0) && (ttl_receive_cnt >= ttl_receive_interval))
|
||||||
|
{
|
||||||
|
over_ttl_receive_timer();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#define TTL_OVER_TIME 10
|
||||||
|
/****************************************************************************************************
|
||||||
|
* @brief Display the Main Menu on HyperTerminal
|
||||||
|
* @param None
|
||||||
|
* @retval None
|
||||||
|
**************************************************************************************************/
|
||||||
|
//放串口中断内,接收数据
|
||||||
|
void receive_ttl_data(uint8_t rx_data)
|
||||||
|
{
|
||||||
|
//不能超过数组的最大长度
|
||||||
|
if(ttl_receive_len < TTL_RECEIVE_BUFF_LEN)
|
||||||
|
{
|
||||||
|
//开始计时
|
||||||
|
start_ttl_receive_timer(TTL_OVER_TIME);
|
||||||
|
//串口接收数据分析
|
||||||
|
Do_Receive_Uart_For_Module(rx_data);
|
||||||
|
}
|
||||||
|
else //超过上限则抛弃后面的数据
|
||||||
|
{
|
||||||
|
//超时处理
|
||||||
|
over_ttl_receive_timer();
|
||||||
|
InitUart_Data();
|
||||||
|
//UART_Send_Char(0xcc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#define CRC_PRESET 0xFFFF
|
||||||
|
#define CRC_POLYNOM 0x4204
|
||||||
|
/*---------------------------------------------------------------------------
|
||||||
|
调用方式:unsigned int ModbusCRC16(unsigned char *data_value, unsigned char length)
|
||||||
|
函数说明:CRC校验
|
||||||
|
---------------------------------------------------------------------------*/
|
||||||
|
unsigned int ModbusCRC16(unsigned char *data_value, unsigned char length)
|
||||||
|
{
|
||||||
|
unsigned int crc_value = CRC_PRESET;
|
||||||
|
unsigned char i;
|
||||||
|
data_value++;
|
||||||
|
while(length-- != 0)
|
||||||
|
{//ModbusCRC16(PData, Num + FIXED_LEN - 3);
|
||||||
|
for(i = 0x01; i != 0; i <<= 1)
|
||||||
|
{
|
||||||
|
if((crc_value & 0x0001) != 0)
|
||||||
|
{
|
||||||
|
crc_value >>= 1;
|
||||||
|
crc_value ^= CRC_POLYNOM;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
crc_value >>= 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if((*data_value & i) != 0)
|
||||||
|
{
|
||||||
|
crc_value ^= CRC_POLYNOM;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
data_value++;
|
||||||
|
}
|
||||||
|
return(crc_value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------
|
||||||
|
调用方式:unsigned int VerfiyRC(unsigned char *data_value, unsigned char length)
|
||||||
|
函数说明:异或校验
|
||||||
|
除了头尾固定,不校验外,其他的校验
|
||||||
|
-----------------------------------------------------------------------------*/
|
||||||
|
unsigned char VerfiyRC(unsigned char data_value[], unsigned char length) //不用异或校验,用crc校验
|
||||||
|
{
|
||||||
|
unsigned char i;
|
||||||
|
unsigned char V_b = data_value[1];
|
||||||
|
|
||||||
|
for(i = 0x00; i < length; i++)
|
||||||
|
{
|
||||||
|
//异或校验
|
||||||
|
V_b ^= data_value[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
return(V_b);
|
||||||
|
}
|
||||||
|
|
||||||
|
//发送延时
|
||||||
|
void Uart_Send_Delay(unsigned int delay)
|
||||||
|
{
|
||||||
|
unsigned int i = 0, j = 0;
|
||||||
|
|
||||||
|
for(i = 0; i < delay; i++)
|
||||||
|
{
|
||||||
|
for(j = 0; j < 125; j++);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//校验 + 0X1B
|
||||||
|
#define VERFIY_TYPE 1
|
||||||
|
|
||||||
|
/*
|
||||||
|
SOF: 1个字节 0x05 起始字节
|
||||||
|
Len: 2个字节 长度
|
||||||
|
Fou_adr: 2个字节 源地址
|
||||||
|
Com_adr: 2个字节 目标地址,0ff为广播地址
|
||||||
|
Cmd16: 2个字节 命令字
|
||||||
|
Request-data: N字节 数据
|
||||||
|
XOR: 2个字节 校验
|
||||||
|
END: 0x1B 结束字节
|
||||||
|
*/
|
||||||
|
|
||||||
|
//发送数据
|
||||||
|
void send_set_resp(unsigned int OrderNum, unsigned int addr, unsigned char Num, unsigned char sData[])
|
||||||
|
{
|
||||||
|
unsigned int xor_data = 0;
|
||||||
|
unsigned char PData[TTL_SEND_BUFF_LEN];
|
||||||
|
unsigned char i = 0;
|
||||||
|
|
||||||
|
PData[0] = UART_ORDER_SOF; //第一个字节
|
||||||
|
PData[1] = (Num + FIXED_LEN) / 0x100; //长度 高8位
|
||||||
|
PData[2] = (Num + FIXED_LEN) % 0x100; //长度 低8位
|
||||||
|
PData[3] = (addr >> 8) & 0xff; //源地址
|
||||||
|
PData[4] = addr & 0xff; //源地址
|
||||||
|
PData[5] = (SUR_DEVICE_ADDR >> 8) & 0xff; //目标地址
|
||||||
|
PData[6] = SUR_DEVICE_ADDR & 0xff; //目标地址
|
||||||
|
PData[7] = (OrderNum >> 8) & 0xff; //命令字 -1
|
||||||
|
PData[8] = OrderNum & 0xff; //命令字 -2
|
||||||
|
|
||||||
|
// PData[6] = RW_Flag; //读写标志
|
||||||
|
|
||||||
|
for(i = 0; i < Num; i++) //发送数据
|
||||||
|
{
|
||||||
|
PData[FIXED_LEN - 2 + i] = sData[i]; //数据
|
||||||
|
}
|
||||||
|
|
||||||
|
//校验
|
||||||
|
if(VERFIY_TYPE) //异或校验 + 末尾字节 2字节
|
||||||
|
{
|
||||||
|
xor_data = VerfiyRC(PData, Num + FIXED_LEN - 2);
|
||||||
|
PData[FIXED_LEN + Num - 2] = xor_data;
|
||||||
|
PData[FIXED_LEN + Num - 1] = 00;
|
||||||
|
}
|
||||||
|
else //CRC校验 2字节
|
||||||
|
{
|
||||||
|
xor_data = ModbusCRC16(PData, Num + FIXED_LEN - 3);
|
||||||
|
PData[FIXED_LEN + Num - 2] = (xor_data) & 0xff;
|
||||||
|
PData[FIXED_LEN + Num - 1] = (xor_data >> 8) & 0xff;
|
||||||
|
}
|
||||||
|
|
||||||
|
PData[FIXED_LEN + Num] = UART_ORDER_END; // 末尾字节
|
||||||
|
|
||||||
|
//全部发送
|
||||||
|
for(i = 0; i < (Num + FIXED_LEN + 1); i++) //一次性发送所有数据
|
||||||
|
{
|
||||||
|
UART1_Send_Char(PData[i]);
|
||||||
|
//增加延时
|
||||||
|
Uart_Send_Delay(50);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//分析地址是否为本地址
|
||||||
|
uint8_t Check_Resive_Addr(uint16_t addr)
|
||||||
|
{
|
||||||
|
//确定是否为接收地址
|
||||||
|
if((OBJ_DEVICE_ADDR == addr) || (0xFFFF == addr) || (0x0000 == addr) || (0x00B1 == addr))
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
InitUart_Data(); //2清数据
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//接收数据判断(放置串口接收数据内)
|
||||||
|
void Do_Receive_Uart_For_Module(unsigned char ch)
|
||||||
|
{
|
||||||
|
switch(re_status)
|
||||||
|
{
|
||||||
|
case 0 : //0x05 1字节 起始字
|
||||||
|
{
|
||||||
|
if(ch == UART_ORDER_SOF)
|
||||||
|
{
|
||||||
|
rec_len = 0;
|
||||||
|
ttl_receive_buff[rec_len] = ch;
|
||||||
|
re_status = 1;
|
||||||
|
shouldaccept = 0;
|
||||||
|
// UART2_Send_Char(0xaa);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 1: //长度 2字节
|
||||||
|
{
|
||||||
|
rec_len++;
|
||||||
|
ttl_receive_buff[rec_len] = ch;
|
||||||
|
|
||||||
|
if(rec_len >= 2)
|
||||||
|
{
|
||||||
|
re_status = 2;
|
||||||
|
shouldaccept = ttl_receive_buff[1] * 0x100 + ttl_receive_buff[2];
|
||||||
|
|
||||||
|
if(shouldaccept >= TTL_RECEIVE_BUFF_LEN - 1)
|
||||||
|
{
|
||||||
|
InitUart_Data();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 2: //命令字 2个字节 05 00 0B 00 C1 00 A1 F0 01 87 1B
|
||||||
|
{
|
||||||
|
rec_len++;
|
||||||
|
|
||||||
|
if(rec_len >= TTL_RECEIVE_BUFF_LEN - 1)
|
||||||
|
{
|
||||||
|
InitUart_Data();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ttl_receive_buff[rec_len] = ch; //接收
|
||||||
|
|
||||||
|
if(rec_len >= shouldaccept) //判断是否接收完成
|
||||||
|
{
|
||||||
|
// uint8_t i = 0;
|
||||||
|
// UART2_Send_Char(0x30);
|
||||||
|
// UART2_Send_Char(rec_len);
|
||||||
|
// UART2_Send_Char(shouldaccept);
|
||||||
|
// UART2_Send_Char(FIXED_LEN - 1);
|
||||||
|
|
||||||
|
// UART2_Send_Char(rec_len);
|
||||||
|
// for( i = 0;i < shouldaccept;i++) UART2_Send_Char(ttl_receive_buff[i]);
|
||||||
|
|
||||||
|
//等待处理分析,至少要大于固定长度
|
||||||
|
// if(rec_len >= FIXED_LEN - 1)
|
||||||
|
// {
|
||||||
|
//判断接收目标地址是否是自己
|
||||||
|
// int adr = ttl_receive_buff[3];
|
||||||
|
// adr = adr << 8;
|
||||||
|
// adr |= ttl_receive_buff[4];
|
||||||
|
int adr = ttl_receive_buff[5];
|
||||||
|
adr = adr << 8;
|
||||||
|
adr |= ttl_receive_buff[6];
|
||||||
|
|
||||||
|
//UART2_TxByte(0xAA);
|
||||||
|
//UART2_TxByte(ttl_receive_buff[3]);
|
||||||
|
//UART2_TxByte(ttl_receive_buff[4]);
|
||||||
|
//
|
||||||
|
if(Check_Resive_Addr(adr))
|
||||||
|
{
|
||||||
|
//命令字
|
||||||
|
unsigned int order = 0;
|
||||||
|
order = ttl_receive_buff[7];
|
||||||
|
order = order << 8;
|
||||||
|
order += ttl_receive_buff[8];
|
||||||
|
|
||||||
|
// //目标地址
|
||||||
|
// OBJ_DEVICE_ADDR = ttl_receive_buff[3];
|
||||||
|
// OBJ_DEVICE_ADDR <<= 8;
|
||||||
|
// OBJ_DEVICE_ADDR += ttl_receive_buff[4];
|
||||||
|
|
||||||
|
//UART2_Send_Char(order / 0x100);
|
||||||
|
//UART2_Send_Char(order % 0x100);
|
||||||
|
//UART2_TxByte(0xBB);
|
||||||
|
//UART2_TxByte(ttl_receive_buff[7]);
|
||||||
|
//UART2_TxByte(ttl_receive_buff[8]);
|
||||||
|
|
||||||
|
switch(order)
|
||||||
|
{
|
||||||
|
//=================== ===================================================
|
||||||
|
//设备接收数据
|
||||||
|
//======================================================================
|
||||||
|
case 0xF001 : //解析数据
|
||||||
|
{
|
||||||
|
order_flag = 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0xF0C1 : //设置设备加密信息
|
||||||
|
{
|
||||||
|
order_flag = 2;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
//======================================================================
|
||||||
|
//设备信息
|
||||||
|
//======================================================================
|
||||||
|
case 0xF111 : //控制参数
|
||||||
|
{
|
||||||
|
order_flag = 3;
|
||||||
|
// UART2_Send_Char(0x33);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
//======================================================================
|
||||||
|
//设备信息
|
||||||
|
//======================================================================
|
||||||
|
case 0xF112 : //读 状态与温度
|
||||||
|
{
|
||||||
|
order_flag = 4;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 0xF102 : //读 状态与温度
|
||||||
|
{
|
||||||
|
order_flag = 4;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
//======================================================================
|
||||||
|
//
|
||||||
|
//======================================================================
|
||||||
|
default :
|
||||||
|
{
|
||||||
|
InitUart_Data();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
InitUart_Data();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default :
|
||||||
|
InitUart_Data();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//数据长度
|
||||||
|
uint8_t Get_Data_Len(void)
|
||||||
|
{
|
||||||
|
uint16_t Re_Len = 0;
|
||||||
|
Re_Len = (ttl_receive_buff[1] * 0x100 + ttl_receive_buff[2]) - FIXED_LEN;
|
||||||
|
return Re_Len;
|
||||||
|
}
|
||||||
|
|
||||||
|
//检查校验
|
||||||
|
unsigned char Check_VerfiyData(void)
|
||||||
|
{
|
||||||
|
return 1; //调试期间,不用验证
|
||||||
|
|
||||||
|
if(VERFIY_TYPE) //异或校验 + 末尾字节
|
||||||
|
{
|
||||||
|
unsigned char v_A = 0;
|
||||||
|
unsigned char v_B = 0;
|
||||||
|
v_A = ttl_receive_buff[shouldaccept];
|
||||||
|
v_B = VerfiyRC(ttl_receive_buff, shouldaccept - 2);
|
||||||
|
|
||||||
|
if(v_A == v_B) //数据的完整性
|
||||||
|
{
|
||||||
|
//结尾数据相同
|
||||||
|
if(ttl_receive_buff[shouldaccept + 1] == UART_ORDER_END)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else //判断CRC校验
|
||||||
|
{
|
||||||
|
unsigned int CRC16 = 0;
|
||||||
|
unsigned int Get_CRC16 = 0;
|
||||||
|
CRC16 = ttl_receive_buff[shouldaccept];
|
||||||
|
CRC16 = CRC16 << 8;
|
||||||
|
CRC16 += ttl_receive_buff[shouldaccept - 1];
|
||||||
|
|
||||||
|
Get_CRC16 = ModbusCRC16(ttl_receive_buff, shouldaccept - 2);
|
||||||
|
|
||||||
|
if(CRC16 == Get_CRC16) //数据的完整性
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
InitUart_Data();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//数据接收分析(放置大循环内)
|
||||||
|
void Deal_Uart_Data_For_Module(void)
|
||||||
|
{
|
||||||
|
if(order_flag) //有接收的指令
|
||||||
|
{
|
||||||
|
//校验
|
||||||
|
if(Check_VerfiyData() == 1) //测试
|
||||||
|
{
|
||||||
|
switch(order_flag)
|
||||||
|
{
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
case 1 : //数据解析
|
||||||
|
{
|
||||||
|
// uint8_t i = 0; //临时变量
|
||||||
|
// uint8_t len = 0; //长度
|
||||||
|
// uint8_t temp[DATA_LEN];
|
||||||
|
|
||||||
|
// //发送标志
|
||||||
|
// send_flag = 0;
|
||||||
|
|
||||||
|
// //数据长度
|
||||||
|
// len = Get_Data_Len();
|
||||||
|
|
||||||
|
// //解析数据
|
||||||
|
// for(i = 0; i < len; i++)
|
||||||
|
// {
|
||||||
|
// temp[i] = ttl_receive_buff[i + FIXED_LEN - 2];
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// //角行程 、直行程
|
||||||
|
// Travle_Flag = temp[0]; //0 直 1 角
|
||||||
|
// Motor_Run = temp[1]; //0 停止 1 运行 2 运行到起始点 3 运行到结束点
|
||||||
|
// Run_Mode = temp[2]; //0 点动 1 方案一 2 方案二
|
||||||
|
//
|
||||||
|
// Run_Step = temp[3]; //电机运行多少圈为一个步长
|
||||||
|
// Run_Step <<= 8;
|
||||||
|
// Run_Step += temp[4];
|
||||||
|
//
|
||||||
|
// Run_Inter = temp[5]; //电机运行间隔时长
|
||||||
|
// Run_Inter <<= 8;
|
||||||
|
// Run_Inter += temp[6];
|
||||||
|
//
|
||||||
|
// Run_Stop = temp[7]; //到“结束点”后,停止时间
|
||||||
|
// Run_Stop <<= 8;
|
||||||
|
// Run_Stop += temp[8];
|
||||||
|
//
|
||||||
|
// ClrRunmotorStep();//清除电机标记
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2 : //
|
||||||
|
{
|
||||||
|
// uint8_t i = 0;
|
||||||
|
// uint8_t len = 0;
|
||||||
|
// uint8_t temp[DATA_LEN];
|
||||||
|
|
||||||
|
// send_set_resp(0xF0C1, OBJ_DEVICE_ADDR, len, temp);
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
//LED 控制
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
case 3 : //F111 05 00 0C 00 A1 00 C1 F1 01 05 03 50 87 1B
|
||||||
|
{
|
||||||
|
uint8_t addr = 0;
|
||||||
|
addr = ttl_receive_buff[FIXED_LEN - 2];
|
||||||
|
if(addr == ((SUR_DEVICE_ADDR & 0xf0) == 0xC0))
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
//======================================================================
|
||||||
|
//
|
||||||
|
//======================================================================
|
||||||
|
case 4 : //
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
//实时信息
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
case 5 : //
|
||||||
|
{
|
||||||
|
uint8_t len = 0;
|
||||||
|
uint8_t temp[DATA_LEN];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
temp[0] = (SUR_DEVICE_ADDR >> 8) & 0xff;
|
||||||
|
temp[1] = (SUR_DEVICE_ADDR >> 0) & 0xff;
|
||||||
|
|
||||||
|
// //版本号 4
|
||||||
|
temp[2] = HD_VER >> 8; //HD_VER 0101 //硬件版本号
|
||||||
|
temp[3] = HD_VER & 0xff;
|
||||||
|
|
||||||
|
temp[4] = SW_VER >> 8; //SW_VER 0101 //软件版本号
|
||||||
|
temp[5] = SW_VER & 0xff;
|
||||||
|
|
||||||
|
len = 6;
|
||||||
|
send_set_resp(0xF113, OBJ_DEVICE_ADDR, len, temp);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 6 : // 设置 地址 + 版本号 F1D3 05 00 0D 00 A1 00 00 F1 D3 00 C1 07 A9 1B
|
||||||
|
{
|
||||||
|
|
||||||
|
uint8_t i = 0;
|
||||||
|
uint8_t len = 0;
|
||||||
|
uint8_t temp[DATA_LEN];
|
||||||
|
|
||||||
|
//数据长度
|
||||||
|
len = Get_Data_Len();
|
||||||
|
|
||||||
|
for(i = 0; i < len; i++)
|
||||||
|
{
|
||||||
|
temp[i] = ttl_receive_buff[i + FIXED_LEN - 2];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
send_set_resp(0xF1C3, OBJ_DEVICE_ADDR, len, temp);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 7 : //更新程序
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
//设备信息
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
case 10 : //F115 05 00 0A 00 C1 00 A1 F1 05 50 87 1B
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
default :
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//清空数据
|
||||||
|
InitUart_Data();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,12 +11,15 @@
|
||||||
#include "oled.h"
|
#include "oled.h"
|
||||||
#include "ads1220.h"
|
#include "ads1220.h"
|
||||||
#include "tmc5160.h"
|
#include "tmc5160.h"
|
||||||
|
#include "uart1.h"
|
||||||
|
|
||||||
//绿灯 NOR ;蓝灯 ERR
|
//绿灯 NOR ;蓝灯 ERR
|
||||||
float X_ads1220 = 0;
|
float X_ads1220 = 0; //读到的电压值
|
||||||
|
float X_ads1220_L = 36.875; //电压值上限
|
||||||
|
float X_ads1220_H = 1311.150; //电压值下限
|
||||||
|
float X_ads1220_prc = 0; //电压百分比(即位移百分比)
|
||||||
float TEMP = 0;
|
float TEMP = 0;
|
||||||
|
|
||||||
|
|
||||||
void app_act (void)
|
void app_act (void)
|
||||||
{
|
{
|
||||||
//1按键操作
|
//1按键操作
|
||||||
|
@ -30,19 +33,26 @@ void app_act (void)
|
||||||
|
|
||||||
TEMP = M1820_Get_Temp(); //温度采集
|
TEMP = M1820_Get_Temp(); //温度采集
|
||||||
|
|
||||||
X_ads1220 = GetAD(4); //电阻尺采集
|
tmc5160_act(); //电机执行功能
|
||||||
|
|
||||||
|
|
||||||
tmc5160_act(); //电机执行功能
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//3 串口通信
|
//3 串口通信
|
||||||
//uart_test();
|
// uart_test();
|
||||||
|
|
||||||
//4 OLED
|
//4 OLED
|
||||||
if(it_100ms_flag)
|
if(it_100ms_flag)
|
||||||
{
|
{
|
||||||
it_100ms_flag = 0;
|
it_100ms_flag = 0;
|
||||||
OLED_Act();
|
|
||||||
|
OLED_Act(); //OLED刷新
|
||||||
|
|
||||||
|
X_ads1220 = GetAD(4); //电阻尺采集
|
||||||
|
X_ads1220_prc =( X_ads1220 - X_ads1220_L )/(X_ads1220_H - X_ads1220_L);
|
||||||
|
|
||||||
|
//串口计时
|
||||||
|
process_ttl_receive_timer();
|
||||||
}
|
}
|
||||||
|
|
||||||
//5 电阻尺 位移传感器
|
//5 电阻尺 位移传感器
|
||||||
|
@ -54,6 +64,11 @@ void app_act (void)
|
||||||
// it_1000ms_flag = 0;
|
// it_1000ms_flag = 0;
|
||||||
// tmc5160_act();
|
// tmc5160_act();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
//7 串口数据处理
|
||||||
|
Deal_Uart_Data_For_Module();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -56,32 +56,38 @@ void msg_clr()
|
||||||
|
|
||||||
void key_act(void)
|
void key_act(void)
|
||||||
{
|
{
|
||||||
if(key_msg[0] == 1) //K1完成按下后,切换OLED与绿灯状态,两者同亮同灭
|
if(key_msg[0] == 1) //K1完成按下后
|
||||||
{
|
{
|
||||||
if(oled_flag == 0)
|
if( speed_max < 0x007EA5E0 ) //电机加速
|
||||||
{
|
{
|
||||||
HAL_GPIO_WritePin(LED_NOR_GPIO_Port,LED_NOR_Pin,GPIO_PIN_RESET);
|
speed_max += 10000;
|
||||||
OLED_DisPlay_On();
|
TMC5160_SPIWriteInt(VMAX_ADDR, speed_max,1);
|
||||||
oled_flag = 1;
|
|
||||||
|
|
||||||
key_msg[0] = 2; //完成OLED和绿灯操作后,触发事件2
|
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
HAL_GPIO_WritePin(LED_ERR_GPIO_Port,LED_NOR_Pin,GPIO_PIN_SET);
|
speed_max = 0x007EA5E0;
|
||||||
OLED_DisPlay_Off();
|
TMC5160_SPIWriteInt(VMAX_ADDR, speed_max,1);
|
||||||
oled_flag = 0;
|
|
||||||
|
|
||||||
key_msg[0] = 2; //完成OLED和绿灯操作后,触发事件2
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
key_msg[0] = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(key_msg[1] == 1)//K2完成按下后,进行翻页,page one->last page->page one
|
if(key_msg[1] == 1) //K2完成按下后
|
||||||
{
|
{
|
||||||
if(oled_page >= PAGEMAX)
|
// if(oled_page >= PAGEMAX) //OLED翻页
|
||||||
|
// {
|
||||||
|
// oled_page = 1;
|
||||||
|
// }else oled_page++;
|
||||||
|
// OLED_NewFrame();
|
||||||
|
|
||||||
|
if( speed_max > 0 ) //电机减速
|
||||||
{
|
{
|
||||||
oled_page = 1;
|
speed_max -= 10000;
|
||||||
}else oled_page++;
|
TMC5160_SPIWriteInt(VMAX_ADDR, speed_max,1);
|
||||||
OLED_NewFrame();
|
}else
|
||||||
|
{
|
||||||
|
speed_max = 0;
|
||||||
|
TMC5160_SPIWriteInt(VMAX_ADDR, speed_max,1);
|
||||||
|
}
|
||||||
|
|
||||||
key_msg[1] = 2;
|
key_msg[1] = 2;
|
||||||
}
|
}
|
||||||
|
@ -89,6 +95,15 @@ void key_act(void)
|
||||||
if(key_msg[2] == 1)//K3完成按下后
|
if(key_msg[2] == 1)//K3完成按下后
|
||||||
{
|
{
|
||||||
tmc5160_sw =(tmc5160_sw == 0);
|
tmc5160_sw =(tmc5160_sw == 0);
|
||||||
|
|
||||||
|
if(tmc5160_sw == 1) //0->1时初始化
|
||||||
|
{
|
||||||
|
speed_max = 0x000061A8;
|
||||||
|
tmc5160_init();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(tmc5160_sw == 0) TMC5160_SPIWriteInt(RAMPMODE_ADDR, 0x00000000,1); //1->0时切换至位置模式,通过减速停止电机
|
||||||
|
|
||||||
key_msg[2] = 2;
|
key_msg[2] = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,53 +31,53 @@ void OLED_SendCmd(uint8_t cmd)//
|
||||||
//OLED³õʼ»¯
|
//OLED³õʼ»¯
|
||||||
void OLED_Init(void) {
|
void OLED_Init(void) {
|
||||||
|
|
||||||
OLED_SendCmd(0xAE); /*关闭显示 display off*/
|
OLED_SendCmd(0xAE); /*关闭显示 display off*/
|
||||||
|
|
||||||
OLED_SendCmd(0x20);//设置显示模式
|
OLED_SendCmd(0x20);//设置显示模式
|
||||||
OLED_SendCmd(0x10);//设置为页显示模式
|
OLED_SendCmd(0x10);//设置为页显示模式
|
||||||
OLED_SendCmd(0xB0);//设置起始页的地址模式0-7
|
OLED_SendCmd(0xB0);//设置起始页的地址模式0-7
|
||||||
|
|
||||||
OLED_SendCmd(0xC0);// 0xc0上下反置 0xc8正常
|
OLED_SendCmd(0xC0);// 0xc0上下反置 0xc8正常
|
||||||
|
|
||||||
OLED_SendCmd(0x00);
|
OLED_SendCmd(0x00);
|
||||||
OLED_SendCmd(0x10);
|
OLED_SendCmd(0x10);
|
||||||
|
|
||||||
OLED_SendCmd(0x40);//--set start line address,从RAM中哪一行起读取显示内容
|
OLED_SendCmd(0x40);//--set start line address,从RAM中哪一行起读取显示内容
|
||||||
|
|
||||||
OLED_SendCmd(0x81);//设置对比度
|
OLED_SendCmd(0x81);//设置对比度
|
||||||
|
|
||||||
OLED_SendCmd(0xFF);//亮度调节 0x00~0xff
|
OLED_SendCmd(0xFF);//亮度调节 0x00~0xff
|
||||||
OLED_SendCmd(0xA0);// 0xa0左右反置 0xa1正常
|
OLED_SendCmd(0xA0);// 0xa0左右反置 0xa1正常
|
||||||
|
|
||||||
OLED_SendCmd(0xA6);//设置显示方式;bit0:1,反相显示;0,正常显示
|
OLED_SendCmd(0xA6);//设置显示方式;bit0:1,反相显示;0,正常显示
|
||||||
OLED_SendCmd(0xA8);
|
OLED_SendCmd(0xA8);
|
||||||
|
|
||||||
OLED_SendCmd(0x3F);
|
OLED_SendCmd(0x3F);
|
||||||
|
|
||||||
OLED_SendCmd(0xA4);//全局显示开启;0xa4正常,0xa5无视命令点亮全屏
|
OLED_SendCmd(0xA4);//全局显示开启;0xa4正常,0xa5无视命令点亮全屏
|
||||||
|
|
||||||
OLED_SendCmd(0xD3);
|
OLED_SendCmd(0xD3);
|
||||||
OLED_SendCmd(0x00);
|
OLED_SendCmd(0x00);
|
||||||
|
|
||||||
OLED_SendCmd(0xD5);
|
OLED_SendCmd(0xD5);
|
||||||
OLED_SendCmd(0xF0);
|
OLED_SendCmd(0xF0);
|
||||||
|
|
||||||
OLED_SendCmd(0xD9);
|
OLED_SendCmd(0xD9);
|
||||||
OLED_SendCmd(0x22);
|
OLED_SendCmd(0x22);
|
||||||
|
|
||||||
OLED_SendCmd(0xDA);
|
OLED_SendCmd(0xDA);
|
||||||
OLED_SendCmd(0x12);
|
OLED_SendCmd(0x12);
|
||||||
|
|
||||||
OLED_SendCmd(0xDB);
|
OLED_SendCmd(0xDB);
|
||||||
OLED_SendCmd(0x20);
|
OLED_SendCmd(0x20);
|
||||||
|
|
||||||
OLED_SendCmd(0x8D);//设置电荷泵开关
|
OLED_SendCmd(0x8D);//设置电荷泵开关
|
||||||
OLED_SendCmd(0x14); // 开启电荷泵
|
OLED_SendCmd(0x14); // 开启电荷泵
|
||||||
|
|
||||||
OLED_NewFrame();
|
OLED_NewFrame();
|
||||||
OLED_ShowFrame();
|
OLED_ShowFrame();
|
||||||
|
|
||||||
OLED_SendCmd(0xAF); // 点亮屏幕
|
OLED_SendCmd(0xAF); // 点亮屏幕
|
||||||
|
|
||||||
OLED_NewFrame();
|
OLED_NewFrame();
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include "usart.h"
|
#include "usart.h"
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include "app.h"
|
#include "app.h"
|
||||||
|
#include "Uart1.h"
|
||||||
// HAL_UART_Transmit( &huartx, &data, timeout )//不带中断,不连续传输
|
// HAL_UART_Transmit( &huartx, &data, timeout )//不带中断,不连续传输
|
||||||
// HAL_UART_Receive( &huartx, &data, timeout )
|
// HAL_UART_Receive( &huartx, &data, timeout )
|
||||||
// HAL_UART_Transmit_IT( &huartx, &data, data_size )//带中断,连续传输
|
// HAL_UART_Transmit_IT( &huartx, &data, data_size )//带中断,连续传输
|
||||||
|
@ -17,23 +17,35 @@
|
||||||
|
|
||||||
|
|
||||||
// 使用LP-300-SP的Type-A接口与计算机进行通信
|
// 使用LP-300-SP的Type-A接口与计算机进行通信
|
||||||
|
// DATA_MAX defined in serial_port.h
|
||||||
|
char text_r[20] = {0};
|
||||||
|
char text_t[20] = {0};
|
||||||
|
unsigned char text_r8 = 0;
|
||||||
|
unsigned char uart_rx_temp[DATA_MAX];
|
||||||
|
char uart_rx_flag = 0;
|
||||||
|
|
||||||
//char text_r[20] = {0};
|
unsigned int OrderNum = 0xF001;
|
||||||
//char text_t[20] = {0};
|
unsigned int addr = 0x00A100B1;
|
||||||
|
unsigned char sData[9] = {0x00,0x01,0x01,0x00,0x01,0x03,0xE8,0x00,0x10};
|
||||||
|
|
||||||
|
void uart_test(void)
|
||||||
|
{
|
||||||
|
if( it_1000ms_flag == 1)
|
||||||
|
{
|
||||||
|
it_1000ms_flag = 0;
|
||||||
|
send_set_resp(OrderNum,addr,9,sData);
|
||||||
|
}
|
||||||
|
|
||||||
//void uart_test(void)
|
// if(uart_rx_flag == 0)
|
||||||
//{
|
|
||||||
|
|
||||||
// if( it_1000ms_flag == 1)
|
|
||||||
// {
|
// {
|
||||||
// it_1000ms_flag = 0;
|
// uart_rx_flag = 1;
|
||||||
//
|
// HAL_UART_Receive_IT( &huart1,&text_r8, 1);
|
||||||
// strcpy(text_t," Hello World! ");
|
|
||||||
// //HAL_UART_Receive_IT( &huart1, (uint8_t*)text_r, 20);
|
|
||||||
|
|
||||||
// HAL_UART_Transmit_IT( &huart1, (uint8_t *)text_t, 20);
|
|
||||||
// }
|
// }
|
||||||
//
|
|
||||||
//}
|
// if(uart_rx_flag == 2)
|
||||||
|
// {
|
||||||
|
// HAL_UART_Transmit_IT( &huart1,uart_rx_temp, 20);
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,9 @@
|
||||||
#include "spi.h"
|
#include "spi.h"
|
||||||
#include "delay.h"
|
#include "delay.h"
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
|
#include "key.h"
|
||||||
|
#include "stdlib.h"
|
||||||
|
#include "app.h"
|
||||||
|
|
||||||
// CS2置于 “低电平” 使能SPI
|
// CS2置于 “低电平” 使能SPI
|
||||||
// 写的时候高位地址要加上 0x80
|
// 写的时候高位地址要加上 0x80
|
||||||
|
@ -50,12 +53,21 @@ void TMC5160A_Init_Gpio(void)
|
||||||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*************常用参数配置***************/
|
||||||
|
uint32_t rampmode = 0x00000000; //斜坡运动模式 0-位置;1-速度
|
||||||
|
int xtarget = 0x00000000; //位置模式的目标位置,51200/圈
|
||||||
|
uint32_t speed_1 = 0x0000186A; //V1 过渡阶段的目标速度
|
||||||
|
uint32_t speed_max = 0x000061A8; //VMAX 目标速度
|
||||||
|
uint32_t acc_1 = 0x000003E8; //A1 过渡阶段的加速度
|
||||||
|
uint32_t acc_max = 0x000001F4; //AMAX 最大加速度
|
||||||
|
uint32_t dcr_1 = 0x000007D0; //D1 过渡阶段的减速度
|
||||||
|
uint32_t dcr_max = 0x000003E8; //DMAX 最大减速度
|
||||||
|
/*************常用参数配置***************/
|
||||||
|
|
||||||
void tmc5160_init(void)
|
void tmc5160_init(void)
|
||||||
{
|
{
|
||||||
// 纯SPI模式
|
// 纯SPI模式
|
||||||
TMC5160_SPIWriteInt(0x00, 0x00000004,1); // writing value 0x0000000C = 12 = 0.0 to address 0 = 0x00(GCONF) 0x00000008 不能移动 会左右抖动
|
TMC5160_SPIWriteInt(0x00, 0x00000004,1); // writing value 0x0000000C = 12 = 0.0 to address 0 = 0x00(GCONF) 0x00000008 不能移动 会左右抖动
|
||||||
// TMC5160_SPIWriteInt(0x03, 0x00000000,1); // writing value 0x00000000 = 0 = 0.0 to address 1 = 0x03(SLAVECONF)
|
// TMC5160_SPIWriteInt(0x03, 0x00000000,1); // writing value 0x00000000 = 0 = 0.0 to address 1 = 0x03(SLAVECONF)
|
||||||
// TMC5160_SPIWriteInt(0x05, 0x00000000,1); // writing value 0x00000000 = 0 = 0.0 to address 2 = 0x05(X_COMPARE)
|
// TMC5160_SPIWriteInt(0x05, 0x00000000,1); // writing value 0x00000000 = 0 = 0.0 to address 2 = 0x05(X_COMPARE)
|
||||||
// TMC5160_SPIWriteInt(0x06, 0x00000000,1); // writing value 0x00000000 = 0 = 0.0 to address 3 = 0x06(OTP_PROG)
|
// TMC5160_SPIWriteInt(0x06, 0x00000000,1); // writing value 0x00000000 = 0 = 0.0 to address 3 = 0x06(OTP_PROG)
|
||||||
|
@ -64,24 +76,24 @@ void tmc5160_init(void)
|
||||||
// TMC5160_SPIWriteInt(0x0A, 0x00080400,1); // writing value 0x00080400 = 525312 = 0.0 to address 6 = 0x0A(DRV_CONF)
|
// TMC5160_SPIWriteInt(0x0A, 0x00080400,1); // writing value 0x00080400 = 525312 = 0.0 to address 6 = 0x0A(DRV_CONF)
|
||||||
// TMC5160_SPIWriteInt(0x0B, 0x00000000,1); // writing value 0x00000000 = 0 = 0.0 to address 7 = 0x0B(GLOBAL_SCALER)
|
// TMC5160_SPIWriteInt(0x0B, 0x00000000,1); // writing value 0x00000000 = 0 = 0.0 to address 7 = 0x0B(GLOBAL_SCALER)
|
||||||
// 速度相关的驱动控制寄存器
|
// 速度相关的驱动控制寄存器
|
||||||
TMC5160_SPIWriteInt(0x10, 0x00070A03,1); // IHOLD_IRUN
|
TMC5160_SPIWriteInt(0x10, 0x00070E02,1); // IHOLD->0~7bit; IRUN->12~8bit
|
||||||
TMC5160_SPIWriteInt(0x11, 0x0000000A,1); // writing value 0x0000000A = 10 = 0.0 to address 9 = 0x11(TPOWERDOWN)
|
TMC5160_SPIWriteInt(0x11, 0x0000000A,1); // writing value 0x0000000A = 10 = 0.0 to address 9 = 0x11(TPOWERDOWN)
|
||||||
TMC5160_SPIWriteInt(0x13, 0x000001F4,1); // writing value 0x00000041 = 65 = 0.0 to address 10 = 0x13(TPWMTHRS)
|
// TMC5160_SPIWriteInt(0x13, 0x000001F4,1); // writing value 0x00000041 = 65 = 0.0 to address 10 = 0x13(TPWMTHRS)
|
||||||
// TMC5160_SPIWriteInt(0x14, 0x00000010,1); // writing value 0x00004189 = 16777 = 0.0 to address 11 = 0x14(TCOOLTHRS)
|
TMC5160_SPIWriteInt(0x14, 0x00000010,1); // writing value 0x00004189 = 16777 = 0.0 to address 11 = 0x14(TCOOLTHRS)
|
||||||
// TMC5160_SPIWriteInt(0x15, 0x00000010,1); // writing value 0x00000000 = 0 = 0.0 to address 12 = 0x15(THIGH)
|
TMC5160_SPIWriteInt(0x15, 0x00000010,1); // writing value 0x00000000 = 0 = 0.0 to address 12 = 0x15(THIGH)
|
||||||
// 斜波发生器运动寄存器
|
// 斜波发生器运动寄存器
|
||||||
TMC5160_SPIWriteInt(0x20, 0x00000000,1); // writing value 0x00000000 = 0 = 0.0 to address 13 = 0x20(RAMPMODE)
|
TMC5160_SPIWriteInt(RAMPMODE_ADDR, rampmode,1); // writing value 0x00000000 = 0 = 0.0 to address 13 = 0x20(RAMPMODE)
|
||||||
TMC5160_SPIWriteInt(0x21, 0x00000000,1); // writing value 0xFFCC12F0 = 0 = 0.0 to address 14 = 0x21(XACTUAL)
|
TMC5160_SPIWriteInt(XACTUAL_ADDR, 0x00000000,1); // writing value 0xFFCC12F0 = 0 = 0.0 to address 14 = 0x21(XACTUAL)
|
||||||
TMC5160_SPIWriteInt(0x23, 0x00000000,1); // writing value 0x00000000 = 0 = 0.0 to address 15 = 0x23(VSTART)
|
TMC5160_SPIWriteInt(0x23, 0x00000000,1); // writing value 0x00000000 = 0 = 0.0 to address 15 = 0x23(VSTART)
|
||||||
TMC5160_SPIWriteInt(0x24, 0x000003E8,1); // A1
|
TMC5160_SPIWriteInt(A1_ADDR, acc_1,1); // A1
|
||||||
TMC5160_SPIWriteInt(0x26, 0x000001F4,1); // AMAX
|
TMC5160_SPIWriteInt(AMAX_ADDR, acc_max,1); // AMAX
|
||||||
TMC5160_SPIWriteInt(0x25, 0x0000186A,1); // V1
|
TMC5160_SPIWriteInt(V1_ADDR, speed_1,1); // V1
|
||||||
TMC5160_SPIWriteInt(0x27, 0x000061A8,1); // VMAX
|
TMC5160_SPIWriteInt(VMAX_ADDR, speed_max,1); // VMAX
|
||||||
TMC5160_SPIWriteInt(0x2A, 0x000003E8,1); // D1
|
TMC5160_SPIWriteInt(D1_ADDR, dcr_1,1); // D1
|
||||||
TMC5160_SPIWriteInt(0x28, 0x000001F4,1); // DMAX
|
TMC5160_SPIWriteInt(DMAX_ADDR, dcr_max,1); // DMAX
|
||||||
TMC5160_SPIWriteInt(0x2B, 0x00000010,1); // VSTOP >= 0x0000000A
|
TMC5160_SPIWriteInt(0x2B, 0x00000010,1); // VSTOP >= 0x0000000A
|
||||||
TMC5160_SPIWriteInt(0x2C, 0x00003FFF,1); // TZEROWAIT
|
TMC5160_SPIWriteInt(0x2C, 0x00003FFF,1); // TZEROWAIT
|
||||||
TMC5160_SPIWriteInt(0x2D, 0x00000000,1); // writing value 0xFFCC12F0 = 0 = 0.0 to address 24 = 0x2D(XTARGET)
|
TMC5160_SPIWriteInt(XTARGET_ADDR, xtarget,1); // writing value 0xFFCC12F0 = 0 = 0.0 to address 24 = 0x2D(XTARGET)
|
||||||
|
|
||||||
// TMC5160_SPIWriteInt(0x33, 0x00000000,1); // writing value 0x00000000 = 0 = 0.0 to address 25 = 0x33(VDCMIN)
|
// TMC5160_SPIWriteInt(0x33, 0x00000000,1); // writing value 0x00000000 = 0 = 0.0 to address 25 = 0x33(VDCMIN)
|
||||||
// TMC5160_SPIWriteInt(0x34, 0x00000000,1); // writing value 0x00000400 = 1024 = 0.0 to address 26 = 0x34(SW_MODE)
|
// TMC5160_SPIWriteInt(0x34, 0x00000000,1); // writing value 0x00000400 = 1024 = 0.0 to address 26 = 0x34(SW_MODE)
|
||||||
|
@ -102,10 +114,10 @@ void tmc5160_init(void)
|
||||||
// TMC5160_SPIWriteInt(0x68, 0xFFFF8056,1); // writing value 0xFFFF8056 = 0 = 0.0 to address 39 = 0x68(MSLUTSEL)
|
// TMC5160_SPIWriteInt(0x68, 0xFFFF8056,1); // writing value 0xFFFF8056 = 0 = 0.0 to address 39 = 0x68(MSLUTSEL)
|
||||||
// TMC5160_SPIWriteInt(0x69, 0x00F70000,1); // writing value 0x00F70000 = 16187392 = 0.0 to address 40 = 0x69(MSLUTSTART)
|
// TMC5160_SPIWriteInt(0x69, 0x00F70000,1); // writing value 0x00F70000 = 16187392 = 0.0 to address 40 = 0x69(MSLUTSTART)
|
||||||
// // 电机驱动寄存器-驱动寄存器组
|
// // 电机驱动寄存器-驱动寄存器组
|
||||||
TMC5160_SPIWriteInt(0x6C, 0x000100C3,1); // writing value 0x00410153 = 4260179 = 0.0 to address 41 = 0x6C(CHOPCONF)
|
TMC5160_SPIWriteInt(0x6C, 0x000100C3,1); // writing value 0x00410153 = 4260179 = 0.0 to address 41 = 0x6C(CHOPCONF)
|
||||||
// TMC5160_SPIWriteInt(0x6D, 0x00000000,1); // writing value 0x00030000 = 196608 = 0.0 to address 42 = 0x6D(COOLCONF)
|
TMC5160_SPIWriteInt(0x6D, 0x00000000,1); // writing value 0x00030000 = 196608 = 0.0 to address 42 = 0x6D(COOLCONF)
|
||||||
// TMC5160_SPIWriteInt(0x6E, 0x00000000,1); // writing value 0x00000000 = 0 = 0.0 to address 43 = 0x6E(DCCTRL)
|
// TMC5160_SPIWriteInt(0x6E, 0x00000000,1); // writing value 0x00000000 = 0 = 0.0 to address 43 = 0x6E(DCCTRL)
|
||||||
// TMC5160_SPIWriteInt(0x70, 0xC40C001E,1); // writing value 0xC40C001E = 0 = 0.0 to address 44 = 0x70(PWMCONF)
|
TMC5160_SPIWriteInt(0x70, 0xC40C001E,1); // writing value 0xC40C001E = 0 = 0.0 to address 44 = 0x70(PWMCONF)
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t data_r[5] = {0};//存放接收到的数据
|
uint8_t data_r[5] = {0};//存放接收到的数据
|
||||||
|
@ -201,49 +213,57 @@ void TMC5160_SPIReadInt(uint8_t addr, uint8_t record[5])//从addr寄存器读取
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t XA[5]={0},VA[5]={0};
|
uint8_t XA[5]={0},VA[5]={0};
|
||||||
uint32_t XA_32 = 0,VA_32 = 0;
|
signed int XA_32 = 0,VA_32 = 0; //有正负
|
||||||
char tmc5160_sw =0;
|
char tmc5160_sw =0;
|
||||||
void tmc5160_act()
|
void tmc5160_act()
|
||||||
{
|
{
|
||||||
TMC5160_SPIReadInt(0x21,XA);//读取实际位置XACTUAL
|
TMC5160_SPIReadInt(XACTUAL_ADDR,XA);//读取实际位置XACTUAL
|
||||||
XA_32 = Raw_32(XA);
|
XA_32 = Raw_32(XA);
|
||||||
TMC5160_SPIReadInt(0x22,VA);//读取实际速度VACTUAL
|
TMC5160_SPIReadInt(VACTUAL_ADDR,VA);//读取实际速度VACTUAL
|
||||||
VA_32 = Raw_32(VA);
|
VA_32 = Raw_32(VA);
|
||||||
|
|
||||||
if(tmc5160_sw == 1)
|
if(tmc5160_sw == 1)
|
||||||
{
|
{
|
||||||
HAL_GPIO_TogglePin(LED_ERR_GPIO_Port,LED_ERR_Pin); //电机运行时蓝灯闪烁
|
HAL_GPIO_WritePin(LED_ERR_GPIO_Port,LED_ERR_Pin,GPIO_PIN_RESET); //蓝灯常亮
|
||||||
|
|
||||||
if( XA_32 == 0x00000000 )
|
rampmode = 0x00000001;
|
||||||
{
|
TMC5160_SPIWriteInt(RAMPMODE_ADDR,rampmode,1); //开启速度模式
|
||||||
TMC5160_SPIWriteInt(0x2D,0x00025800,1); //正向转动3圈
|
|
||||||
}
|
|
||||||
|
|
||||||
if( XA_32== 0x00025800 )
|
// rampmode = 0x00000000;
|
||||||
{
|
// TMC5160_SPIWriteInt(RAMPMODE_ADDR,rampmode,1); //开启位置模式
|
||||||
TMC5160_SPIWriteInt(0x2D,0x00000000,1); //返回起点
|
// if( XA_32 == 0x00000000 )
|
||||||
}
|
// {
|
||||||
|
// xtarget = 0x00025800;
|
||||||
|
// TMC5160_SPIWriteInt(XTARGET_ADDR, xtarget,1); //正向转动3圈
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if( XA_32== 0x00025800 )
|
||||||
|
// {
|
||||||
|
// xtarget = 0x00000000;
|
||||||
|
// TMC5160_SPIWriteInt(XTARGET_ADDR, xtarget,1); //接着反向转3圈(返回起点)
|
||||||
|
// }
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
TMC5160_SPIWriteInt(0x2D,XA_32,1); //把当前位置设定为目标位置,进入减速阶段
|
TMC5160_SPIWriteInt(XTARGET_ADDR,XA_32,1); //把当前位置设定为目标位置,进入减速阶段
|
||||||
|
|
||||||
if(VA_32 < 0x00000005)
|
if( abs(VA_32) <= 0x0000000A ) // 视作已经停止
|
||||||
{
|
{
|
||||||
TMC5160_SPIWriteInt(0x21,0x00000000,1); //电机静止时蓝灯常亮
|
HAL_GPIO_TogglePin(LED_ERR_GPIO_Port,LED_ERR_Pin); //蓝灯闪烁
|
||||||
HAL_GPIO_WritePin(LED_ERR_GPIO_Port,LED_ERR_Pin,GPIO_PIN_RESET);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t Raw_32(uint8_t raw[5]) //把5*8bit数据中的0~32位拼接成1*32bit的数值并返回
|
signed int Raw_32(uint8_t raw[5]) //把5*8bit数据中的0~31位拼接成1*32bit的数值并返回
|
||||||
{
|
{
|
||||||
uint32_t result = 0;
|
uint32_t result = 0;
|
||||||
|
|
||||||
result |= raw[1];
|
result |= raw[1];
|
||||||
result <<= 8;
|
result <<= 8;
|
||||||
result |= raw[2];
|
result |= raw[2];
|
||||||
result <<= 8;
|
result <<= 8;
|
||||||
result|= raw[3];
|
result|= raw[3];
|
||||||
result <<= 8;
|
result <<= 8;
|
||||||
|
|
|
@ -0,0 +1,72 @@
|
||||||
|
#include "main.h"
|
||||||
|
|
||||||
|
extern uint8_t ttl_receive_flag;
|
||||||
|
extern uint8_t ttl_receive_cnt;
|
||||||
|
extern uint8_t ttl_receive_interval;
|
||||||
|
|
||||||
|
//微秒延时
|
||||||
|
extern void DelayUs(unsigned int delay);
|
||||||
|
|
||||||
|
//毫秒延时
|
||||||
|
extern void DelayMs(unsigned int delay);
|
||||||
|
|
||||||
|
|
||||||
|
//接收数据判断(放置串口接收数据内)
|
||||||
|
extern void Do_Receive_Uart_For_Module(unsigned char ch);
|
||||||
|
|
||||||
|
//单独发送
|
||||||
|
extern void UART1_SendData(uint8_t dat);
|
||||||
|
|
||||||
|
//发送数据
|
||||||
|
extern void UART1_Send_Char(uint8_t dat);
|
||||||
|
|
||||||
|
//发送一个字符串
|
||||||
|
//extern void send_string(uchar *p);
|
||||||
|
|
||||||
|
//初始化
|
||||||
|
extern void InitUart_Data(void);
|
||||||
|
|
||||||
|
//接收串口1
|
||||||
|
extern void start_ttl_receive_timer(uint32_t ms);
|
||||||
|
|
||||||
|
extern void over_ttl_receive_timer(void);
|
||||||
|
|
||||||
|
extern void clear_ttl_receive_timer(void);
|
||||||
|
|
||||||
|
|
||||||
|
//返回串口屏应答是否接收完成的结果
|
||||||
|
//0:没超时 1:超时
|
||||||
|
extern uint8_t judge_ttl_receive_timer(void);
|
||||||
|
|
||||||
|
//放在大循环中的计时器里
|
||||||
|
extern void process_ttl_receive_timer(void);
|
||||||
|
|
||||||
|
//放串口中断内,接收数据
|
||||||
|
extern void receive_ttl_data(uint8_t rx_data);
|
||||||
|
|
||||||
|
//CRC校验
|
||||||
|
extern unsigned int ModbusCRC16(unsigned char *data_value, unsigned char length);
|
||||||
|
|
||||||
|
//异或校验
|
||||||
|
extern unsigned char VerfiyRC(unsigned char data_value[], unsigned char length);
|
||||||
|
|
||||||
|
//发送延时
|
||||||
|
extern void Uart_Send_Delay(unsigned int delay);
|
||||||
|
|
||||||
|
//发送数据
|
||||||
|
extern void send_set_resp(unsigned int OrderNum, unsigned int addr, unsigned char Num, unsigned char sData[]);
|
||||||
|
|
||||||
|
//分析地址是否为本地址
|
||||||
|
extern uint8_t Check_Resive_Addr(uint16_t addr);
|
||||||
|
|
||||||
|
//接收数据判断(放置串口接收数据内)
|
||||||
|
extern void Do_Receive_Uart_For_Module(unsigned char ch);
|
||||||
|
|
||||||
|
//数据长度
|
||||||
|
extern uint8_t Get_Data_Len(void);
|
||||||
|
|
||||||
|
//检查校验
|
||||||
|
extern unsigned char Check_VerfiyData(void);
|
||||||
|
|
||||||
|
//数据接收分析(放置大循环内)
|
||||||
|
extern void Deal_Uart_Data_For_Module(void);
|
|
@ -13,7 +13,7 @@ extern int it_1000ms_cnt ,it_1000ms_flag;
|
||||||
|
|
||||||
extern float X_ads1220;
|
extern float X_ads1220;
|
||||||
extern float TEMP;
|
extern float TEMP;
|
||||||
|
extern float X_ads1220_prc;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -148,29 +148,37 @@
|
||||||
<Name>-U53FF6B064884525650271587 -O2254 -SF1800 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8004 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC800 -FN1 -FF0STM32F10x_512.FLM -FS08000000 -FL040000 -FP0($$Device:STM32F103RC$Flash\STM32F10x_512.FLM) -WA0 -WE0 -WVCE4 -WS2710 -WM0 -WP2 -WK0</Name>
|
<Name>-U53FF6B064884525650271587 -O2254 -SF1800 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8004 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC800 -FN1 -FF0STM32F10x_512.FLM -FS08000000 -FL040000 -FP0($$Device:STM32F103RC$Flash\STM32F10x_512.FLM) -WA0 -WE0 -WVCE4 -WS2710 -WM0 -WP2 -WK0</Name>
|
||||||
</SetRegEntry>
|
</SetRegEntry>
|
||||||
</TargetDriverDllRegistry>
|
</TargetDriverDllRegistry>
|
||||||
<Breakpoint>
|
<Breakpoint/>
|
||||||
<Bp>
|
|
||||||
<Number>0</Number>
|
|
||||||
<Type>0</Type>
|
|
||||||
<LineNumber>302</LineNumber>
|
|
||||||
<EnabledFlag>1</EnabledFlag>
|
|
||||||
<Address>0</Address>
|
|
||||||
<ByteObject>0</ByteObject>
|
|
||||||
<HtxType>0</HtxType>
|
|
||||||
<ManyObjects>0</ManyObjects>
|
|
||||||
<SizeOfObject>0</SizeOfObject>
|
|
||||||
<BreakByAccess>0</BreakByAccess>
|
|
||||||
<BreakIfRCount>0</BreakIfRCount>
|
|
||||||
<Filename>../Src/stm32f1xx_it.c</Filename>
|
|
||||||
<ExecCommand></ExecCommand>
|
|
||||||
<Expression></Expression>
|
|
||||||
</Bp>
|
|
||||||
</Breakpoint>
|
|
||||||
<WatchWindow1>
|
<WatchWindow1>
|
||||||
<Ww>
|
<Ww>
|
||||||
<count>0</count>
|
<count>0</count>
|
||||||
<WinNumber>1</WinNumber>
|
<WinNumber>1</WinNumber>
|
||||||
<ItemText>it_1000ms_cnt</ItemText>
|
<ItemText>ttl_receive_buff</ItemText>
|
||||||
|
</Ww>
|
||||||
|
<Ww>
|
||||||
|
<count>1</count>
|
||||||
|
<WinNumber>1</WinNumber>
|
||||||
|
<ItemText>speed_max</ItemText>
|
||||||
|
</Ww>
|
||||||
|
<Ww>
|
||||||
|
<count>2</count>
|
||||||
|
<WinNumber>1</WinNumber>
|
||||||
|
<ItemText>VA_32</ItemText>
|
||||||
|
</Ww>
|
||||||
|
<Ww>
|
||||||
|
<count>3</count>
|
||||||
|
<WinNumber>1</WinNumber>
|
||||||
|
<ItemText>XA_32</ItemText>
|
||||||
|
</Ww>
|
||||||
|
<Ww>
|
||||||
|
<count>4</count>
|
||||||
|
<WinNumber>1</WinNumber>
|
||||||
|
<ItemText>X_ads1220</ItemText>
|
||||||
|
</Ww>
|
||||||
|
<Ww>
|
||||||
|
<count>5</count>
|
||||||
|
<WinNumber>1</WinNumber>
|
||||||
|
<ItemText>X_ads1220_prc</ItemText>
|
||||||
</Ww>
|
</Ww>
|
||||||
</WatchWindow1>
|
</WatchWindow1>
|
||||||
<Tracepoint>
|
<Tracepoint>
|
||||||
|
@ -695,6 +703,18 @@
|
||||||
<RteFlg>0</RteFlg>
|
<RteFlg>0</RteFlg>
|
||||||
<bShared>0</bShared>
|
<bShared>0</bShared>
|
||||||
</File>
|
</File>
|
||||||
|
<File>
|
||||||
|
<GroupNumber>5</GroupNumber>
|
||||||
|
<FileNumber>37</FileNumber>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<tvExp>0</tvExp>
|
||||||
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
|
<bDave2>0</bDave2>
|
||||||
|
<PathWithFileName>..\App\Src\Uart1.c</PathWithFileName>
|
||||||
|
<FilenameWithoutPath>Uart1.c</FilenameWithoutPath>
|
||||||
|
<RteFlg>0</RteFlg>
|
||||||
|
<bShared>0</bShared>
|
||||||
|
</File>
|
||||||
</Group>
|
</Group>
|
||||||
|
|
||||||
<Group>
|
<Group>
|
||||||
|
|
|
@ -1655,6 +1655,11 @@
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>..\App\Src\misc.c</FilePath>
|
<FilePath>..\App\Src\misc.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>Uart1.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\App\Src\Uart1.c</FilePath>
|
||||||
|
</File>
|
||||||
</Files>
|
</Files>
|
||||||
</Group>
|
</Group>
|
||||||
<Group>
|
<Group>
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -43,3 +43,4 @@ mfps\app.o: ..\App\Inc\oled.h
|
||||||
mfps\app.o: ..\App\Inc\MyLib.h
|
mfps\app.o: ..\App\Inc\MyLib.h
|
||||||
mfps\app.o: ..\App\Inc\ads1220.h
|
mfps\app.o: ..\App\Inc\ads1220.h
|
||||||
mfps\app.o: ..\App\Inc\tmc5160.h
|
mfps\app.o: ..\App\Inc\tmc5160.h
|
||||||
|
mfps\app.o: ..\Inc\uart1.h
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -42,3 +42,4 @@ mfps\main.o: ..\App\Inc\ads1220.h
|
||||||
mfps\main.o: ..\App\Inc\tmc5160.h
|
mfps\main.o: ..\App\Inc\tmc5160.h
|
||||||
mfps\main.o: ..\App\Inc\m1820.h
|
mfps\main.o: ..\App\Inc\m1820.h
|
||||||
mfps\main.o: ..\App\Inc\delay.h
|
mfps\main.o: ..\App\Inc\delay.h
|
||||||
|
mfps\main.o: ..\Inc\Uart1.h
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -21,15 +21,15 @@ Target DLL: STLink\ST-LINKIII-KEIL_SWO.dll V3.2.0.0
|
||||||
Dialog DLL: TCM.DLL V1.56.4.0
|
Dialog DLL: TCM.DLL V1.56.4.0
|
||||||
|
|
||||||
<h2>Project:</h2>
|
<h2>Project:</h2>
|
||||||
F:\Desktop\Work\2024.04\2024.4.17\mfps\MDK-ARM\mfps.uvprojx
|
F:\Desktop\Work\2024.04\2024.4.24\mfps\MDK-ARM\mfps.uvprojx
|
||||||
Project File Date: 04/17/2024
|
Project File Date: 04/22/2024
|
||||||
|
|
||||||
<h2>Output:</h2>
|
<h2>Output:</h2>
|
||||||
*** Using Compiler 'V5.06 update 7 (build 960)', folder: 'E:\Softwares\Keil_v5\ARM\ARMCC\Bin'
|
*** Using Compiler 'V5.06 update 7 (build 960)', folder: 'E:\Softwares\Keil_v5\ARM\ARMCC\Bin'
|
||||||
Build target 'mfps'
|
Build target 'mfps'
|
||||||
compiling stm32f1xx_it.c...
|
compiling app.c...
|
||||||
linking...
|
linking...
|
||||||
Program Size: Code=23980 RO-data=3984 RW-data=120 ZI-data=3432
|
Program Size: Code=25082 RO-data=3982 RW-data=196 ZI-data=3468
|
||||||
FromELF: creating hex file...
|
FromELF: creating hex file...
|
||||||
"mfps\mfps.axf" - 0 Error(s), 0 Warning(s).
|
"mfps\mfps.axf" - 0 Error(s), 0 Warning(s).
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -35,6 +35,7 @@
|
||||||
"mfps\mylib.o"
|
"mfps\mylib.o"
|
||||||
"mfps\tmc5160.o"
|
"mfps\tmc5160.o"
|
||||||
"mfps\misc.o"
|
"mfps\misc.o"
|
||||||
|
"mfps\uart1.o"
|
||||||
--strict --scatter "mfps\mfps.sct"
|
--strict --scatter "mfps\mfps.sct"
|
||||||
--summary_stderr --info summarysizes --map --load_addr_map_info --xref --callgraph --symbols
|
--summary_stderr --info summarysizes --map --load_addr_map_info --xref --callgraph --symbols
|
||||||
--info sizes --info totals --info unused --info veneers
|
--info sizes --info totals --info unused --info veneers
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,10 +1,10 @@
|
||||||
Dependencies for Project 'mfps', Target 'mfps': (DO NOT MODIFY !)
|
Dependencies for Project 'mfps', Target 'mfps': (DO NOT MODIFY !)
|
||||||
CompilerVersion: 5060960::V5.06 update 7 (build 960)::.\ARMCC
|
CompilerVersion: 5060960::V5.06 update 7 (build 960)::.\ARMCC
|
||||||
F (startup_stm32f103xe.s)(0x660BB232)(--cpu Cortex-M3 -g --apcs=interwork
-I.\RTE\_mfps
-IE:\Softwares\Arm\Packs\ARM\CMSIS\5.9.0\CMSIS\Core\Include
-IE:\Softwares\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include
--pd "__UVISION_VERSION SETA 539" --pd "_RTE_ SETA 1" --pd "STM32F10X_HD SETA 1" --pd "_RTE_ SETA 1"
--list startup_stm32f103xe.lst --xref -o mfps\startup_stm32f103xe.o --depend mfps\startup_stm32f103xe.d)
|
F (startup_stm32f103xe.s)(0x660BB232)(--cpu Cortex-M3 -g --apcs=interwork
-I.\RTE\_mfps
-IE:\Softwares\Arm\Packs\ARM\CMSIS\5.9.0\CMSIS\Core\Include
-IE:\Softwares\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include
--pd "__UVISION_VERSION SETA 539" --pd "_RTE_ SETA 1" --pd "STM32F10X_HD SETA 1" --pd "_RTE_ SETA 1"
--list startup_stm32f103xe.lst --xref -o mfps\startup_stm32f103xe.o --depend mfps\startup_stm32f103xe.d)
|
||||||
F (../Src/main.c)(0x661F7BD2)(--c99 -c --cpu Cortex-M3 -g -O3 --apcs=interwork --split_sections -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ..\Inc -I ..\Src -I ..\App\Inc -I ..\App\Src
-I.\RTE\_mfps
-IE:\Softwares\Arm\Packs\ARM\CMSIS\5.9.0\CMSIS\Core\Include
-IE:\Softwares\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include
-D__UVISION_VERSION="539" -D_RTE_ -DSTM32F10X_HD -D_RTE_ -DSTM32F103xE -DUSE_HAL_DRIVER
-o mfps\main.o --omf_browse mfps\main.crf --depend mfps\main.d)
|
F (../Src/main.c)(0x6625BAF9)(--c99 -c --cpu Cortex-M3 -g -O3 --apcs=interwork --split_sections -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ..\Inc -I ..\Src -I ..\App\Inc -I ..\App\Src
-I.\RTE\_mfps
-IE:\Softwares\Arm\Packs\ARM\CMSIS\5.9.0\CMSIS\Core\Include
-IE:\Softwares\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include
-D__UVISION_VERSION="539" -D_RTE_ -DSTM32F10X_HD -D_RTE_ -DSTM32F103xE -DUSE_HAL_DRIVER
-o mfps\main.o --omf_browse mfps\main.crf --depend mfps\main.d)
|
||||||
I (../Inc/main.h)(0x660A29E6)
|
I (..\Inc\main.h)(0x660A29E6)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h)(0x66011732)
|
||||||
I (../Inc/stm32f1xx_hal_conf.h)(0x660A2CEE)
|
I (..\Inc\stm32f1xx_hal_conf.h)(0x660A2CEE)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h)(0x66011732)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h)(0x66011732)
|
||||||
I (../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h)(0x66011732)
|
I (../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h)(0x66011732)
|
||||||
|
@ -32,18 +32,19 @@ I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_spi.h)(0x66011732)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h)(0x66011732)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h)(0x66011732)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h)(0x66011732)
|
||||||
I (../Inc/i2c.h)(0x66035A28)
|
I (..\Inc\i2c.h)(0x66035A28)
|
||||||
I (../Inc/spi.h)(0x660BB230)
|
I (..\Inc\spi.h)(0x660BB230)
|
||||||
I (../Inc/tim.h)(0x66035A28)
|
I (..\Inc\tim.h)(0x66035A28)
|
||||||
I (../Inc/usart.h)(0x660A2CEE)
|
I (..\Inc\usart.h)(0x660A2CEE)
|
||||||
I (../Inc/gpio.h)(0x66035A04)
|
I (..\Inc\gpio.h)(0x66035A04)
|
||||||
I (../Inc/app.h)(0x661E2E8F)
|
I (..\Inc\app.h)(0x661E2E8F)
|
||||||
I (..\App\Inc\oled.h)(0x661E2E8F)
|
I (..\App\Inc\oled.h)(0x661E2E8F)
|
||||||
I (..\App\Inc\MyLib.h)(0x660B9CD2)
|
I (..\App\Inc\MyLib.h)(0x660B9CD2)
|
||||||
I (..\App\Inc\ads1220.h)(0x661629CA)
|
I (..\App\Inc\ads1220.h)(0x661629CA)
|
||||||
I (..\App\Inc\tmc5160.h)(0x661F3B06)
|
I (..\App\Inc\tmc5160.h)(0x66275C39)
|
||||||
I (..\App\Inc\m1820.h)(0x661E2349)
|
I (..\App\Inc\m1820.h)(0x661E2349)
|
||||||
I (..\App\Inc\delay.h)(0x6614F624)
|
I (..\App\Inc\delay.h)(0x6614F624)
|
||||||
|
I (..\Inc\Uart1.h)(0x6625BD3B)
|
||||||
F (../Src/gpio.c)(0x660BB22E)(--c99 -c --cpu Cortex-M3 -g -O3 --apcs=interwork --split_sections -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ..\Inc -I ..\Src -I ..\App\Inc -I ..\App\Src
-I.\RTE\_mfps
-IE:\Softwares\Arm\Packs\ARM\CMSIS\5.9.0\CMSIS\Core\Include
-IE:\Softwares\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include
-D__UVISION_VERSION="539" -D_RTE_ -DSTM32F10X_HD -D_RTE_ -DSTM32F103xE -DUSE_HAL_DRIVER
-o mfps\gpio.o --omf_browse mfps\gpio.crf --depend mfps\gpio.d)
|
F (../Src/gpio.c)(0x660BB22E)(--c99 -c --cpu Cortex-M3 -g -O3 --apcs=interwork --split_sections -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ..\Inc -I ..\Src -I ..\App\Inc -I ..\App\Src
-I.\RTE\_mfps
-IE:\Softwares\Arm\Packs\ARM\CMSIS\5.9.0\CMSIS\Core\Include
-IE:\Softwares\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include
-D__UVISION_VERSION="539" -D_RTE_ -DSTM32F10X_HD -D_RTE_ -DSTM32F103xE -DUSE_HAL_DRIVER
-o mfps\gpio.o --omf_browse mfps\gpio.crf --depend mfps\gpio.d)
|
||||||
I (../Inc/gpio.h)(0x66035A04)
|
I (../Inc/gpio.h)(0x66035A04)
|
||||||
I (../Inc/main.h)(0x660A29E6)
|
I (../Inc/main.h)(0x660A29E6)
|
||||||
|
@ -140,7 +141,7 @@ I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_spi.h)(0x66011732)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h)(0x66011732)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h)(0x66011732)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h)(0x66011732)
|
||||||
F (../Src/tim.c)(0x660BA902)(--c99 -c --cpu Cortex-M3 -g -O3 --apcs=interwork --split_sections -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ..\Inc -I ..\Src -I ..\App\Inc -I ..\App\Src
-I.\RTE\_mfps
-IE:\Softwares\Arm\Packs\ARM\CMSIS\5.9.0\CMSIS\Core\Include
-IE:\Softwares\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include
-D__UVISION_VERSION="539" -D_RTE_ -DSTM32F10X_HD -D_RTE_ -DSTM32F103xE -DUSE_HAL_DRIVER
-o mfps\tim.o --omf_browse mfps\tim.crf --depend mfps\tim.d)
|
F (../Src/tim.c)(0x6620D922)(--c99 -c --cpu Cortex-M3 -g -O3 --apcs=interwork --split_sections -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ..\Inc -I ..\Src -I ..\App\Inc -I ..\App\Src
-I.\RTE\_mfps
-IE:\Softwares\Arm\Packs\ARM\CMSIS\5.9.0\CMSIS\Core\Include
-IE:\Softwares\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include
-D__UVISION_VERSION="539" -D_RTE_ -DSTM32F10X_HD -D_RTE_ -DSTM32F103xE -DUSE_HAL_DRIVER
-o mfps\tim.o --omf_browse mfps\tim.crf --depend mfps\tim.d)
|
||||||
I (../Inc/tim.h)(0x66035A28)
|
I (../Inc/tim.h)(0x66035A28)
|
||||||
I (../Inc/main.h)(0x660A29E6)
|
I (../Inc/main.h)(0x660A29E6)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h)(0x66011732)
|
||||||
|
@ -204,7 +205,7 @@ I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_spi.h)(0x66011732)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h)(0x66011732)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h)(0x66011732)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h)(0x66011732)
|
||||||
F (../Src/stm32f1xx_it.c)(0x66207565)(--c99 -c --cpu Cortex-M3 -g -O3 --apcs=interwork --split_sections -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ..\Inc -I ..\Src -I ..\App\Inc -I ..\App\Src
-I.\RTE\_mfps
-IE:\Softwares\Arm\Packs\ARM\CMSIS\5.9.0\CMSIS\Core\Include
-IE:\Softwares\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include
-D__UVISION_VERSION="539" -D_RTE_ -DSTM32F10X_HD -D_RTE_ -DSTM32F103xE -DUSE_HAL_DRIVER
-o mfps\stm32f1xx_it.o --omf_browse mfps\stm32f1xx_it.crf --depend mfps\stm32f1xx_it.d)
|
F (../Src/stm32f1xx_it.c)(0x662850B1)(--c99 -c --cpu Cortex-M3 -g -O3 --apcs=interwork --split_sections -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ..\Inc -I ..\Src -I ..\App\Inc -I ..\App\Src
-I.\RTE\_mfps
-IE:\Softwares\Arm\Packs\ARM\CMSIS\5.9.0\CMSIS\Core\Include
-IE:\Softwares\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include
-D__UVISION_VERSION="539" -D_RTE_ -DSTM32F10X_HD -D_RTE_ -DSTM32F103xE -DUSE_HAL_DRIVER
-o mfps\stm32f1xx_it.o --omf_browse mfps\stm32f1xx_it.crf --depend mfps\stm32f1xx_it.d)
|
||||||
I (..\Inc\main.h)(0x660A29E6)
|
I (..\Inc\main.h)(0x660A29E6)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h)(0x66011732)
|
||||||
I (..\Inc\stm32f1xx_hal_conf.h)(0x660A2CEE)
|
I (..\Inc\stm32f1xx_hal_conf.h)(0x660A2CEE)
|
||||||
|
@ -238,6 +239,8 @@ I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h)(0x66011732)
|
||||||
I (..\Inc\stm32f1xx_it.h)(0x660BB230)
|
I (..\Inc\stm32f1xx_it.h)(0x660BB230)
|
||||||
I (..\Inc\app.h)(0x661E2E8F)
|
I (..\Inc\app.h)(0x661E2E8F)
|
||||||
I (E:\Softwares\Keil_v5\ARM\ARMCC\include\string.h)(0x5E8E3CC2)
|
I (E:\Softwares\Keil_v5\ARM\ARMCC\include\string.h)(0x5E8E3CC2)
|
||||||
|
I (..\App\Inc\serial_port.h)(0x6625D9EB)
|
||||||
|
I (..\Inc\Uart1.h)(0x6625BD3B)
|
||||||
F (../Src/stm32f1xx_hal_msp.c)(0x6603B078)(--c99 -c --cpu Cortex-M3 -g -O3 --apcs=interwork --split_sections -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ..\Inc -I ..\Src -I ..\App\Inc -I ..\App\Src
-I.\RTE\_mfps
-IE:\Softwares\Arm\Packs\ARM\CMSIS\5.9.0\CMSIS\Core\Include
-IE:\Softwares\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include
-D__UVISION_VERSION="539" -D_RTE_ -DSTM32F10X_HD -D_RTE_ -DSTM32F103xE -DUSE_HAL_DRIVER
-o mfps\stm32f1xx_hal_msp.o --omf_browse mfps\stm32f1xx_hal_msp.crf --depend mfps\stm32f1xx_hal_msp.d)
|
F (../Src/stm32f1xx_hal_msp.c)(0x6603B078)(--c99 -c --cpu Cortex-M3 -g -O3 --apcs=interwork --split_sections -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ..\Inc -I ..\Src -I ..\App\Inc -I ..\App\Src
-I.\RTE\_mfps
-IE:\Softwares\Arm\Packs\ARM\CMSIS\5.9.0\CMSIS\Core\Include
-IE:\Softwares\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include
-D__UVISION_VERSION="539" -D_RTE_ -DSTM32F10X_HD -D_RTE_ -DSTM32F103xE -DUSE_HAL_DRIVER
-o mfps\stm32f1xx_hal_msp.o --omf_browse mfps\stm32f1xx_hal_msp.crf --depend mfps\stm32f1xx_hal_msp.d)
|
||||||
I (../Inc/main.h)(0x660A29E6)
|
I (../Inc/main.h)(0x660A29E6)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h)(0x66011732)
|
||||||
|
@ -779,7 +782,7 @@ I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_spi.h)(0x66011732)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h)(0x66011732)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h)(0x66011732)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h)(0x66011732)
|
||||||
F (..\App\Src\app.c)(0x662073A3)(--c99 -c --cpu Cortex-M3 -g -O3 --apcs=interwork --split_sections -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ..\Inc -I ..\Src -I ..\App\Inc -I ..\App\Src
-I.\RTE\_mfps
-IE:\Softwares\Arm\Packs\ARM\CMSIS\5.9.0\CMSIS\Core\Include
-IE:\Softwares\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include
-D__UVISION_VERSION="539" -D_RTE_ -DSTM32F10X_HD -D_RTE_ -DSTM32F103xE -DUSE_HAL_DRIVER
-o mfps\app.o --omf_browse mfps\app.crf --depend mfps\app.d)
|
F (..\App\Src\app.c)(0x66285FCA)(--c99 -c --cpu Cortex-M3 -g -O3 --apcs=interwork --split_sections -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ..\Inc -I ..\Src -I ..\App\Inc -I ..\App\Src
-I.\RTE\_mfps
-IE:\Softwares\Arm\Packs\ARM\CMSIS\5.9.0\CMSIS\Core\Include
-IE:\Softwares\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include
-D__UVISION_VERSION="539" -D_RTE_ -DSTM32F10X_HD -D_RTE_ -DSTM32F103xE -DUSE_HAL_DRIVER
-o mfps\app.o --omf_browse mfps\app.crf --depend mfps\app.d)
|
||||||
I (..\Inc\main.h)(0x660A29E6)
|
I (..\Inc\main.h)(0x660A29E6)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h)(0x66011732)
|
||||||
I (..\Inc\stm32f1xx_hal_conf.h)(0x660A2CEE)
|
I (..\Inc\stm32f1xx_hal_conf.h)(0x660A2CEE)
|
||||||
|
@ -815,14 +818,15 @@ I (..\Inc\spi.h)(0x660BB230)
|
||||||
I (..\Inc\tim.h)(0x66035A28)
|
I (..\Inc\tim.h)(0x66035A28)
|
||||||
I (..\Inc\usart.h)(0x660A2CEE)
|
I (..\Inc\usart.h)(0x660A2CEE)
|
||||||
I (..\Inc\gpio.h)(0x66035A04)
|
I (..\Inc\gpio.h)(0x66035A04)
|
||||||
I (..\App\Inc\key.h)(0x66151004)
|
I (..\App\Inc\key.h)(0x66271314)
|
||||||
I (..\Inc\app.h)(0x661E2E8F)
|
I (..\Inc\app.h)(0x661E2E8F)
|
||||||
I (..\App\Inc\serial_port.h)(0x66206FB9)
|
I (..\App\Inc\serial_port.h)(0x6625D9EB)
|
||||||
I (..\App\Inc\m1820.h)(0x661E2349)
|
I (..\App\Inc\m1820.h)(0x661E2349)
|
||||||
I (..\App\Inc\oled.h)(0x661E2E8F)
|
I (..\App\Inc\oled.h)(0x661E2E8F)
|
||||||
I (..\App\Inc\MyLib.h)(0x660B9CD2)
|
I (..\App\Inc\MyLib.h)(0x660B9CD2)
|
||||||
I (..\App\Inc\ads1220.h)(0x661629CA)
|
I (..\App\Inc\ads1220.h)(0x661629CA)
|
||||||
I (..\App\Inc\tmc5160.h)(0x661F3B06)
|
I (..\App\Inc\tmc5160.h)(0x66275C39)
|
||||||
|
I (..\Inc\uart1.h)(0x6625BD3B)
|
||||||
F (..\App\Src\delay.c)(0x6614FF58)(--c99 -c --cpu Cortex-M3 -g -O3 --apcs=interwork --split_sections -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ..\Inc -I ..\Src -I ..\App\Inc -I ..\App\Src
-I.\RTE\_mfps
-IE:\Softwares\Arm\Packs\ARM\CMSIS\5.9.0\CMSIS\Core\Include
-IE:\Softwares\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include
-D__UVISION_VERSION="539" -D_RTE_ -DSTM32F10X_HD -D_RTE_ -DSTM32F103xE -DUSE_HAL_DRIVER
-o mfps\delay.o --omf_browse mfps\delay.crf --depend mfps\delay.d)
|
F (..\App\Src\delay.c)(0x6614FF58)(--c99 -c --cpu Cortex-M3 -g -O3 --apcs=interwork --split_sections -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ..\Inc -I ..\Src -I ..\App\Inc -I ..\App\Src
-I.\RTE\_mfps
-IE:\Softwares\Arm\Packs\ARM\CMSIS\5.9.0\CMSIS\Core\Include
-IE:\Softwares\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include
-D__UVISION_VERSION="539" -D_RTE_ -DSTM32F10X_HD -D_RTE_ -DSTM32F103xE -DUSE_HAL_DRIVER
-o mfps\delay.o --omf_browse mfps\delay.crf --depend mfps\delay.d)
|
||||||
I (..\App\Inc\delay.h)(0x6614F624)
|
I (..\App\Inc\delay.h)(0x6614F624)
|
||||||
I (../Inc/main.h)(0x660A29E6)
|
I (../Inc/main.h)(0x660A29E6)
|
||||||
|
@ -857,11 +861,11 @@ I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h)(0x66011732)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h)(0x66011732)
|
||||||
I (../Inc/tim.h)(0x66035A28)
|
I (../Inc/tim.h)(0x66035A28)
|
||||||
I (../Inc/app.h)(0x661E2E8F)
|
I (../Inc/app.h)(0x661E2E8F)
|
||||||
F (..\App\Src\key.c)(0x661F3FB2)(--c99 -c --cpu Cortex-M3 -g -O3 --apcs=interwork --split_sections -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ..\Inc -I ..\Src -I ..\App\Inc -I ..\App\Src
-I.\RTE\_mfps
-IE:\Softwares\Arm\Packs\ARM\CMSIS\5.9.0\CMSIS\Core\Include
-IE:\Softwares\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include
-D__UVISION_VERSION="539" -D_RTE_ -DSTM32F10X_HD -D_RTE_ -DSTM32F103xE -DUSE_HAL_DRIVER
-o mfps\key.o --omf_browse mfps\key.crf --depend mfps\key.d)
|
F (..\App\Src\key.c)(0x6628544F)(--c99 -c --cpu Cortex-M3 -g -O3 --apcs=interwork --split_sections -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ..\Inc -I ..\Src -I ..\App\Inc -I ..\App\Src
-I.\RTE\_mfps
-IE:\Softwares\Arm\Packs\ARM\CMSIS\5.9.0\CMSIS\Core\Include
-IE:\Softwares\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include
-D__UVISION_VERSION="539" -D_RTE_ -DSTM32F10X_HD -D_RTE_ -DSTM32F103xE -DUSE_HAL_DRIVER
-o mfps\key.o --omf_browse mfps\key.crf --depend mfps\key.d)
|
||||||
I (..\App\Inc\key.h)(0x66151004)
|
I (..\App\Inc\key.h)(0x66271314)
|
||||||
I (../Inc/main.h)(0x660A29E6)
|
I (..\Inc\main.h)(0x660A29E6)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h)(0x66011732)
|
||||||
I (../Inc/stm32f1xx_hal_conf.h)(0x660A2CEE)
|
I (..\Inc\stm32f1xx_hal_conf.h)(0x660A2CEE)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h)(0x66011732)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h)(0x66011732)
|
||||||
I (../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h)(0x66011732)
|
I (../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h)(0x66011732)
|
||||||
|
@ -889,12 +893,12 @@ I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_spi.h)(0x66011732)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h)(0x66011732)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h)(0x66011732)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h)(0x66011732)
|
||||||
I (..\App\Inc\tmc5160.h)(0x661F3B06)
|
I (..\App\Inc\tmc5160.h)(0x66275C39)
|
||||||
I (..\App\Inc\oled.h)(0x661E2E8F)
|
I (..\App\Inc\oled.h)(0x661E2E8F)
|
||||||
I (..\App\Inc\MyLib.h)(0x660B9CD2)
|
I (..\App\Inc\MyLib.h)(0x660B9CD2)
|
||||||
I (..\App\Inc\delay.h)(0x6614F624)
|
I (..\App\Inc\delay.h)(0x6614F624)
|
||||||
F (..\App\Src\serial_port.c)(0x662073D4)(--c99 -c --cpu Cortex-M3 -g -O3 --apcs=interwork --split_sections -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ..\Inc -I ..\Src -I ..\App\Inc -I ..\App\Src
-I.\RTE\_mfps
-IE:\Softwares\Arm\Packs\ARM\CMSIS\5.9.0\CMSIS\Core\Include
-IE:\Softwares\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include
-D__UVISION_VERSION="539" -D_RTE_ -DSTM32F10X_HD -D_RTE_ -DSTM32F103xE -DUSE_HAL_DRIVER
-o mfps\serial_port.o --omf_browse mfps\serial_port.crf --depend mfps\serial_port.d)
|
F (..\App\Src\serial_port.c)(0x662705B7)(--c99 -c --cpu Cortex-M3 -g -O3 --apcs=interwork --split_sections -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ..\Inc -I ..\Src -I ..\App\Inc -I ..\App\Src
-I.\RTE\_mfps
-IE:\Softwares\Arm\Packs\ARM\CMSIS\5.9.0\CMSIS\Core\Include
-IE:\Softwares\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include
-D__UVISION_VERSION="539" -D_RTE_ -DSTM32F10X_HD -D_RTE_ -DSTM32F103xE -DUSE_HAL_DRIVER
-o mfps\serial_port.o --omf_browse mfps\serial_port.crf --depend mfps\serial_port.d)
|
||||||
I (..\App\Inc\serial_port.h)(0x66206FB9)
|
I (..\App\Inc\serial_port.h)(0x6625D9EB)
|
||||||
I (..\Inc\main.h)(0x660A29E6)
|
I (..\Inc\main.h)(0x660A29E6)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h)(0x66011732)
|
||||||
I (..\Inc\stm32f1xx_hal_conf.h)(0x660A2CEE)
|
I (..\Inc\stm32f1xx_hal_conf.h)(0x660A2CEE)
|
||||||
|
@ -928,7 +932,8 @@ I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h)(0x66011732)
|
||||||
I (..\Inc\usart.h)(0x660A2CEE)
|
I (..\Inc\usart.h)(0x660A2CEE)
|
||||||
I (E:\Softwares\Keil_v5\ARM\ARMCC\include\string.h)(0x5E8E3CC2)
|
I (E:\Softwares\Keil_v5\ARM\ARMCC\include\string.h)(0x5E8E3CC2)
|
||||||
I (..\Inc\app.h)(0x661E2E8F)
|
I (..\Inc\app.h)(0x661E2E8F)
|
||||||
F (..\App\Src\oled.c)(0x661E386B)(--c99 -c --cpu Cortex-M3 -g -O3 --apcs=interwork --split_sections -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ..\Inc -I ..\Src -I ..\App\Inc -I ..\App\Src
-I.\RTE\_mfps
-IE:\Softwares\Arm\Packs\ARM\CMSIS\5.9.0\CMSIS\Core\Include
-IE:\Softwares\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include
-D__UVISION_VERSION="539" -D_RTE_ -DSTM32F10X_HD -D_RTE_ -DSTM32F103xE -DUSE_HAL_DRIVER
-o mfps\oled.o --omf_browse mfps\oled.crf --depend mfps\oled.d)
|
I (..\Inc\Uart1.h)(0x6625BD3B)
|
||||||
|
F (..\App\Src\oled.c)(0x662712B5)(--c99 -c --cpu Cortex-M3 -g -O3 --apcs=interwork --split_sections -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ..\Inc -I ..\Src -I ..\App\Inc -I ..\App\Src
-I.\RTE\_mfps
-IE:\Softwares\Arm\Packs\ARM\CMSIS\5.9.0\CMSIS\Core\Include
-IE:\Softwares\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include
-D__UVISION_VERSION="539" -D_RTE_ -DSTM32F10X_HD -D_RTE_ -DSTM32F103xE -DUSE_HAL_DRIVER
-o mfps\oled.o --omf_browse mfps\oled.crf --depend mfps\oled.d)
|
||||||
I (..\App\Inc\oled.h)(0x661E2E8F)
|
I (..\App\Inc\oled.h)(0x661E2E8F)
|
||||||
I (../Inc/main.h)(0x660A29E6)
|
I (../Inc/main.h)(0x660A29E6)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h)(0x66011732)
|
||||||
|
@ -1063,11 +1068,11 @@ I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_spi.h)(0x66011732)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h)(0x66011732)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h)(0x66011732)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h)(0x66011732)
|
||||||
F (..\App\Src\tmc5160.c)(0x661F80DF)(--c99 -c --cpu Cortex-M3 -g -O3 --apcs=interwork --split_sections -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ..\Inc -I ..\Src -I ..\App\Inc -I ..\App\Src
-I.\RTE\_mfps
-IE:\Softwares\Arm\Packs\ARM\CMSIS\5.9.0\CMSIS\Core\Include
-IE:\Softwares\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include
-D__UVISION_VERSION="539" -D_RTE_ -DSTM32F10X_HD -D_RTE_ -DSTM32F103xE -DUSE_HAL_DRIVER
-o mfps\tmc5160.o --omf_browse mfps\tmc5160.crf --depend mfps\tmc5160.d)
|
F (..\App\Src\tmc5160.c)(0x662859F2)(--c99 -c --cpu Cortex-M3 -g -O3 --apcs=interwork --split_sections -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ..\Inc -I ..\Src -I ..\App\Inc -I ..\App\Src
-I.\RTE\_mfps
-IE:\Softwares\Arm\Packs\ARM\CMSIS\5.9.0\CMSIS\Core\Include
-IE:\Softwares\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include
-D__UVISION_VERSION="539" -D_RTE_ -DSTM32F10X_HD -D_RTE_ -DSTM32F103xE -DUSE_HAL_DRIVER
-o mfps\tmc5160.o --omf_browse mfps\tmc5160.crf --depend mfps\tmc5160.d)
|
||||||
I (..\App\Inc\tmc5160.h)(0x661F3B06)
|
I (..\App\Inc\tmc5160.h)(0x66275C39)
|
||||||
I (../Inc/main.h)(0x660A29E6)
|
I (..\Inc\main.h)(0x660A29E6)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h)(0x66011732)
|
||||||
I (../Inc/stm32f1xx_hal_conf.h)(0x660A2CEE)
|
I (..\Inc\stm32f1xx_hal_conf.h)(0x660A2CEE)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h)(0x66011732)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h)(0x66011732)
|
||||||
I (../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h)(0x66011732)
|
I (../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h)(0x66011732)
|
||||||
|
@ -1095,10 +1100,12 @@ I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_spi.h)(0x66011732)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h)(0x66011732)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h)(0x66011732)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h)(0x66011732)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h)(0x66011732)
|
||||||
I (../Inc/gpio.h)(0x66035A04)
|
I (..\Inc\gpio.h)(0x66035A04)
|
||||||
I (../Inc/spi.h)(0x660BB230)
|
I (..\Inc\spi.h)(0x660BB230)
|
||||||
I (..\App\Inc\delay.h)(0x6614F624)
|
I (..\App\Inc\delay.h)(0x6614F624)
|
||||||
I (E:\Softwares\Keil_v5\ARM\ARMCC\include\string.h)(0x5E8E3CC2)
|
I (E:\Softwares\Keil_v5\ARM\ARMCC\include\string.h)(0x5E8E3CC2)
|
||||||
|
I (..\App\Inc\key.h)(0x66271314)
|
||||||
|
I (E:\Softwares\Keil_v5\ARM\ARMCC\include\stdlib.h)(0x5E8E3CC2)
|
||||||
F (..\App\Src\misc.c)(0x661F7271)(--c99 -c --cpu Cortex-M3 -g -O3 --apcs=interwork --split_sections -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ..\Inc -I ..\Src -I ..\App\Inc -I ..\App\Src
-I.\RTE\_mfps
-IE:\Softwares\Arm\Packs\ARM\CMSIS\5.9.0\CMSIS\Core\Include
-IE:\Softwares\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include
-D__UVISION_VERSION="539" -D_RTE_ -DSTM32F10X_HD -D_RTE_ -DSTM32F103xE -DUSE_HAL_DRIVER
-o mfps\misc.o --omf_browse mfps\misc.crf --depend mfps\misc.d)
|
F (..\App\Src\misc.c)(0x661F7271)(--c99 -c --cpu Cortex-M3 -g -O3 --apcs=interwork --split_sections -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ..\Inc -I ..\Src -I ..\App\Inc -I ..\App\Src
-I.\RTE\_mfps
-IE:\Softwares\Arm\Packs\ARM\CMSIS\5.9.0\CMSIS\Core\Include
-IE:\Softwares\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include
-D__UVISION_VERSION="539" -D_RTE_ -DSTM32F10X_HD -D_RTE_ -DSTM32F103xE -DUSE_HAL_DRIVER
-o mfps\misc.o --omf_browse mfps\misc.crf --depend mfps\misc.d)
|
||||||
I (..\Inc\misc.h)(0x661F73D7)
|
I (..\Inc\misc.h)(0x661F73D7)
|
||||||
I (E:\Softwares\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h)(0x661E19E4)
|
I (E:\Softwares\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h)(0x661E19E4)
|
||||||
|
@ -1109,3 +1116,37 @@ I (../Drivers/CMSIS/Include/cmsis_version.h)(0x6601172A)
|
||||||
I (../Drivers/CMSIS/Include/cmsis_compiler.h)(0x6601172A)
|
I (../Drivers/CMSIS/Include/cmsis_compiler.h)(0x6601172A)
|
||||||
I (../Drivers/CMSIS/Include/cmsis_armcc.h)(0x6601172A)
|
I (../Drivers/CMSIS/Include/cmsis_armcc.h)(0x6601172A)
|
||||||
I (E:\Softwares\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\system_stm32f10x.h)(0x661E19E4)
|
I (E:\Softwares\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\system_stm32f10x.h)(0x661E19E4)
|
||||||
|
F (..\App\Src\Uart1.c)(0x66277936)(--c99 -c --cpu Cortex-M3 -g -O3 --apcs=interwork --split_sections -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ..\Inc -I ..\Src -I ..\App\Inc -I ..\App\Src
-I.\RTE\_mfps
-IE:\Softwares\Arm\Packs\ARM\CMSIS\5.9.0\CMSIS\Core\Include
-IE:\Softwares\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include
-D__UVISION_VERSION="539" -D_RTE_ -DSTM32F10X_HD -D_RTE_ -DSTM32F103xE -DUSE_HAL_DRIVER
-o mfps\uart1.o --omf_browse mfps\uart1.crf --depend mfps\uart1.d)
|
||||||
|
I (E:\Softwares\Keil_v5\ARM\ARMCC\include\stdio.h)(0x5E8E3CC2)
|
||||||
|
I (..\Inc\main.h)(0x660A29E6)
|
||||||
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h)(0x66011732)
|
||||||
|
I (..\Inc\stm32f1xx_hal_conf.h)(0x660A2CEE)
|
||||||
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h)(0x66011732)
|
||||||
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h)(0x66011732)
|
||||||
|
I (../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h)(0x66011732)
|
||||||
|
I (../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xe.h)(0x66011732)
|
||||||
|
I (../Drivers/CMSIS/Include/core_cm3.h)(0x6601172A)
|
||||||
|
I (E:\Softwares\Keil_v5\ARM\ARMCC\include\stdint.h)(0x5E8E3CC2)
|
||||||
|
I (../Drivers/CMSIS/Include/cmsis_version.h)(0x6601172A)
|
||||||
|
I (../Drivers/CMSIS/Include/cmsis_compiler.h)(0x6601172A)
|
||||||
|
I (../Drivers/CMSIS/Include/cmsis_armcc.h)(0x6601172A)
|
||||||
|
I (../Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h)(0x66011732)
|
||||||
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h)(0x66011732)
|
||||||
|
I (E:\Softwares\Keil_v5\ARM\ARMCC\include\stddef.h)(0x5E8E3CC2)
|
||||||
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h)(0x66011732)
|
||||||
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h)(0x66011732)
|
||||||
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h)(0x66011732)
|
||||||
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_exti.h)(0x66011732)
|
||||||
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h)(0x66011732)
|
||||||
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h)(0x66011732)
|
||||||
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h)(0x66011732)
|
||||||
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h)(0x66011732)
|
||||||
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h)(0x66011732)
|
||||||
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h)(0x66011732)
|
||||||
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h)(0x66011732)
|
||||||
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_spi.h)(0x66011732)
|
||||||
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h)(0x66011732)
|
||||||
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h)(0x66011732)
|
||||||
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h)(0x66011732)
|
||||||
|
I (..\Inc\Uart1.h)(0x6625BD3B)
|
||||||
|
I (..\Inc\usart.h)(0x660A2CEE)
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -34,3 +34,4 @@ mfps\serial_port.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h
|
||||||
mfps\serial_port.o: ..\Inc\usart.h
|
mfps\serial_port.o: ..\Inc\usart.h
|
||||||
mfps\serial_port.o: E:\Softwares\Keil_v5\ARM\ARMCC\Bin\..\include\string.h
|
mfps\serial_port.o: E:\Softwares\Keil_v5\ARM\ARMCC\Bin\..\include\string.h
|
||||||
mfps\serial_port.o: ..\Inc\app.h
|
mfps\serial_port.o: ..\Inc\app.h
|
||||||
|
mfps\serial_port.o: ..\Inc\Uart1.h
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -33,3 +33,5 @@ mfps\stm32f1xx_it.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h
|
||||||
mfps\stm32f1xx_it.o: ..\Inc\stm32f1xx_it.h
|
mfps\stm32f1xx_it.o: ..\Inc\stm32f1xx_it.h
|
||||||
mfps\stm32f1xx_it.o: ..\Inc\app.h
|
mfps\stm32f1xx_it.o: ..\Inc\app.h
|
||||||
mfps\stm32f1xx_it.o: E:\Softwares\Keil_v5\ARM\ARMCC\Bin\..\include\string.h
|
mfps\stm32f1xx_it.o: E:\Softwares\Keil_v5\ARM\ARMCC\Bin\..\include\string.h
|
||||||
|
mfps\stm32f1xx_it.o: ..\App\Inc\serial_port.h
|
||||||
|
mfps\stm32f1xx_it.o: ..\Inc\Uart1.h
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -35,3 +35,5 @@ mfps\tmc5160.o: ..\Inc\gpio.h
|
||||||
mfps\tmc5160.o: ..\Inc\spi.h
|
mfps\tmc5160.o: ..\Inc\spi.h
|
||||||
mfps\tmc5160.o: ..\App\Inc\delay.h
|
mfps\tmc5160.o: ..\App\Inc\delay.h
|
||||||
mfps\tmc5160.o: E:\Softwares\Keil_v5\ARM\ARMCC\Bin\..\include\string.h
|
mfps\tmc5160.o: E:\Softwares\Keil_v5\ARM\ARMCC\Bin\..\include\string.h
|
||||||
|
mfps\tmc5160.o: ..\App\Inc\key.h
|
||||||
|
mfps\tmc5160.o: E:\Softwares\Keil_v5\ARM\ARMCC\Bin\..\include\stdlib.h
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,35 @@
|
||||||
|
mfps\uart1.o: ..\App\Src\Uart1.c
|
||||||
|
mfps\uart1.o: E:\Softwares\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h
|
||||||
|
mfps\uart1.o: ..\Inc\main.h
|
||||||
|
mfps\uart1.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h
|
||||||
|
mfps\uart1.o: ..\Inc\stm32f1xx_hal_conf.h
|
||||||
|
mfps\uart1.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h
|
||||||
|
mfps\uart1.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h
|
||||||
|
mfps\uart1.o: ../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h
|
||||||
|
mfps\uart1.o: ../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xe.h
|
||||||
|
mfps\uart1.o: ../Drivers/CMSIS/Include/core_cm3.h
|
||||||
|
mfps\uart1.o: E:\Softwares\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
|
||||||
|
mfps\uart1.o: ../Drivers/CMSIS/Include/cmsis_version.h
|
||||||
|
mfps\uart1.o: ../Drivers/CMSIS/Include/cmsis_compiler.h
|
||||||
|
mfps\uart1.o: ../Drivers/CMSIS/Include/cmsis_armcc.h
|
||||||
|
mfps\uart1.o: ../Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h
|
||||||
|
mfps\uart1.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h
|
||||||
|
mfps\uart1.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h
|
||||||
|
mfps\uart1.o: E:\Softwares\Keil_v5\ARM\ARMCC\Bin\..\include\stddef.h
|
||||||
|
mfps\uart1.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h
|
||||||
|
mfps\uart1.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h
|
||||||
|
mfps\uart1.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h
|
||||||
|
mfps\uart1.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_exti.h
|
||||||
|
mfps\uart1.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h
|
||||||
|
mfps\uart1.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h
|
||||||
|
mfps\uart1.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h
|
||||||
|
mfps\uart1.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h
|
||||||
|
mfps\uart1.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h
|
||||||
|
mfps\uart1.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h
|
||||||
|
mfps\uart1.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h
|
||||||
|
mfps\uart1.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_spi.h
|
||||||
|
mfps\uart1.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h
|
||||||
|
mfps\uart1.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h
|
||||||
|
mfps\uart1.o: ../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h
|
||||||
|
mfps\uart1.o: ..\Inc\Uart1.h
|
||||||
|
mfps\uart1.o: ..\Inc\usart.h
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,756 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include "main.h"
|
||||||
|
|
||||||
|
//#include "SC_Init.h" //MCU Init header,Include all IC resource headers
|
||||||
|
//#include "SC_it.h"
|
||||||
|
//#include "..\Drivers\SCDriver_list.h"
|
||||||
|
//#include "HeadFiles\SysFunVarDefine.h"
|
||||||
|
|
||||||
|
#include "Uart1.h"
|
||||||
|
#include "usart.h"
|
||||||
|
//#include "Motor.h"
|
||||||
|
|
||||||
|
////微秒延时
|
||||||
|
//void DelayUs(unsigned int delay)
|
||||||
|
//{
|
||||||
|
// unsigned int i = 0, j = 0;
|
||||||
|
// for(i = 0; i < delay; i++)
|
||||||
|
// {
|
||||||
|
// for(j = 0; j < 125; j++);
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
////毫秒延时
|
||||||
|
//void DelayMs(unsigned int delay)
|
||||||
|
//{
|
||||||
|
// unsigned int i = 0;
|
||||||
|
// for(i = 0; i < delay; i++)
|
||||||
|
// {
|
||||||
|
// DelayUs(1000);
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
#define HD_VER 0001 //硬件版本
|
||||||
|
#define SW_VER 0001 //软件版本
|
||||||
|
|
||||||
|
#define TTL_SEND_BUFF_LEN 60 //发送数据长度
|
||||||
|
#define TTL_RECEIVE_BUFF_LEN 60 //接收数据长度
|
||||||
|
|
||||||
|
//----------------------------------------------------------------
|
||||||
|
//uart1用于接收usb转ttl的串口
|
||||||
|
//----------------------------------------------------------------
|
||||||
|
|
||||||
|
//存放发送的数据内容
|
||||||
|
//uint8_t xdata motor_data[10];
|
||||||
|
|
||||||
|
//发送buff
|
||||||
|
uint8_t ttl_send_len = 0;
|
||||||
|
uint8_t ttl_send_buff[TTL_SEND_BUFF_LEN] = {0};
|
||||||
|
|
||||||
|
//接收buff
|
||||||
|
uint8_t ttl_receive_len = 0;
|
||||||
|
uint8_t ttl_receive_buff[TTL_RECEIVE_BUFF_LEN] = {0};
|
||||||
|
|
||||||
|
//接收超时
|
||||||
|
uint8_t ttl_receive_flag = 0;
|
||||||
|
uint8_t ttl_receive_cnt = 0;
|
||||||
|
uint8_t ttl_receive_interval = 0;
|
||||||
|
|
||||||
|
#define DATA_LEN TTL_RECEIVE_BUFF_LEN //一般数据长度
|
||||||
|
#define UART_ORDER_SOF 0x05 //起始字
|
||||||
|
#define UART_ORDER_END 0x1B //结束字
|
||||||
|
#define FIXED_LEN 0x0B //固定长度 //取消RW
|
||||||
|
|
||||||
|
uint16_t SUR_DEVICE_ADDR = 0x00A1; //PC //0x00A1; //设备
|
||||||
|
uint16_t OBJ_DEVICE_ADDR = 0x00B1; //主板 //0x00B1; //PC群发 FFFF 0000
|
||||||
|
|
||||||
|
uint8_t order_flag = 0;
|
||||||
|
unsigned int checksum = 0, re_status = 0, rec_len = 0, data_len = 0, shouldaccept = 0;
|
||||||
|
|
||||||
|
//单独发送
|
||||||
|
void UART1_SendData(uint8_t dat)
|
||||||
|
{
|
||||||
|
//SSI_UART1_SendData8(dat);
|
||||||
|
HAL_UART_Transmit_IT(&huart1,&dat,1);
|
||||||
|
}
|
||||||
|
|
||||||
|
//发送数据
|
||||||
|
void UART1_Send_Char(uint8_t dat)
|
||||||
|
{
|
||||||
|
//SSI_UART1_SendData8(dat);
|
||||||
|
HAL_UART_Transmit_IT(&huart1,&dat,1);
|
||||||
|
}
|
||||||
|
|
||||||
|
//初始化
|
||||||
|
void InitUart_Data(void)
|
||||||
|
{
|
||||||
|
order_flag = 0;
|
||||||
|
rec_len = 0;
|
||||||
|
re_status = 0;
|
||||||
|
shouldaccept = 0;
|
||||||
|
|
||||||
|
ttl_receive_flag = 0;
|
||||||
|
ttl_receive_cnt = 0;
|
||||||
|
|
||||||
|
checksum = 0;
|
||||||
|
|
||||||
|
for(data_len = 0; data_len < DATA_LEN; data_len++)
|
||||||
|
{
|
||||||
|
ttl_receive_buff[data_len] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
data_len = 0;
|
||||||
|
|
||||||
|
// UART_Send_Char(0xdd);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Private function prototypes -----------------------------------------------*/
|
||||||
|
/* Private functions ---------------------------------------------------------*/
|
||||||
|
//----------------------------------------------------------------
|
||||||
|
//接收串口1
|
||||||
|
//----------------------------------------------------------------
|
||||||
|
/****************************************************************************************************
|
||||||
|
* @brief Download a file via serial port
|
||||||
|
* @param None
|
||||||
|
* @retval None
|
||||||
|
**************************************************************************************************/
|
||||||
|
void start_ttl_receive_timer(uint32_t ms)
|
||||||
|
{
|
||||||
|
if(ms == 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ttl_receive_flag = 1;
|
||||||
|
ttl_receive_cnt = 0;
|
||||||
|
ttl_receive_interval = ms;
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************************
|
||||||
|
* @brief Upload a file via serial port.
|
||||||
|
* @param None
|
||||||
|
* @retval None
|
||||||
|
**************************************************************************************************/
|
||||||
|
void over_ttl_receive_timer(void)
|
||||||
|
{
|
||||||
|
ttl_receive_flag = 0;
|
||||||
|
ttl_receive_cnt = 0;
|
||||||
|
ttl_receive_interval = 0;
|
||||||
|
|
||||||
|
InitUart_Data();
|
||||||
|
|
||||||
|
// UART2_Send_Char(0xed);
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************************
|
||||||
|
* @brief Display the Main Menu on HyperTerminal
|
||||||
|
* @param None
|
||||||
|
* @retval None
|
||||||
|
**************************************************************************************************/
|
||||||
|
void clear_ttl_receive_timer(void)
|
||||||
|
{
|
||||||
|
uint16_t i = 0;
|
||||||
|
ttl_receive_len = 0;
|
||||||
|
ttl_receive_flag = 0;
|
||||||
|
ttl_receive_cnt = 0;
|
||||||
|
ttl_receive_interval = 0;
|
||||||
|
|
||||||
|
for(i = 0; i < TTL_RECEIVE_BUFF_LEN; i++)
|
||||||
|
{
|
||||||
|
ttl_receive_buff[i] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//返回串口屏应答是否接收完成的结果
|
||||||
|
//0:没超时 1:超时
|
||||||
|
uint8_t judge_ttl_receive_timer(void)
|
||||||
|
{
|
||||||
|
if(ttl_receive_flag == 2)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************************
|
||||||
|
* @brief Display the Main Menu on HyperTerminal
|
||||||
|
* @param None
|
||||||
|
* @retval None
|
||||||
|
**************************************************************************************************/
|
||||||
|
//放在大循环中的计时器里
|
||||||
|
void process_ttl_receive_timer(void)
|
||||||
|
{
|
||||||
|
if(ttl_receive_flag == 1)
|
||||||
|
{
|
||||||
|
ttl_receive_cnt++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if((ttl_receive_interval > 0) && (ttl_receive_cnt >= ttl_receive_interval))
|
||||||
|
{
|
||||||
|
over_ttl_receive_timer();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#define TTL_OVER_TIME 10
|
||||||
|
/****************************************************************************************************
|
||||||
|
* @brief Display the Main Menu on HyperTerminal
|
||||||
|
* @param None
|
||||||
|
* @retval None
|
||||||
|
**************************************************************************************************/
|
||||||
|
//放串口中断内,接收数据
|
||||||
|
void receive_ttl_data(uint8_t rx_data)
|
||||||
|
{
|
||||||
|
//不能超过数组的最大长度
|
||||||
|
if(ttl_receive_len < TTL_RECEIVE_BUFF_LEN)
|
||||||
|
{
|
||||||
|
//开始计时
|
||||||
|
start_ttl_receive_timer(TTL_OVER_TIME);
|
||||||
|
|
||||||
|
//串口接收数据分析
|
||||||
|
Do_Receive_Uart_For_Module(rx_data);
|
||||||
|
}
|
||||||
|
else //超过上限则抛弃后面的数据
|
||||||
|
{
|
||||||
|
//超时处理
|
||||||
|
over_ttl_receive_timer();
|
||||||
|
|
||||||
|
InitUart_Data();
|
||||||
|
|
||||||
|
//UART_Send_Char(0xcc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#define CRC_PRESET 0xFFFF
|
||||||
|
#define CRC_POLYNOM 0x4204
|
||||||
|
/*---------------------------------------------------------------------------
|
||||||
|
调用方式:unsigned int ModbusCRC16(unsigned char *data_value, unsigned char length)
|
||||||
|
函数说明:CRC校验
|
||||||
|
---------------------------------------------------------------------------*/
|
||||||
|
unsigned int ModbusCRC16(unsigned char *data_value, unsigned char length)
|
||||||
|
{
|
||||||
|
unsigned int crc_value = CRC_PRESET;
|
||||||
|
unsigned char i;
|
||||||
|
data_value++;
|
||||||
|
while(length-- != 0)
|
||||||
|
{//ModbusCRC16(PData, Num + FIXED_LEN - 3);
|
||||||
|
for(i = 0x01; i != 0; i <<= 1)
|
||||||
|
{
|
||||||
|
if((crc_value & 0x0001) != 0)
|
||||||
|
{
|
||||||
|
crc_value >>= 1;
|
||||||
|
crc_value ^= CRC_POLYNOM;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
crc_value >>= 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if((*data_value & i) != 0)
|
||||||
|
{
|
||||||
|
crc_value ^= CRC_POLYNOM;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
data_value++;
|
||||||
|
}
|
||||||
|
return(crc_value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------
|
||||||
|
调用方式:unsigned int VerfiyRC(unsigned char *data_value, unsigned char length)
|
||||||
|
函数说明:异或校验
|
||||||
|
除了头尾固定,不校验外,其他的校验
|
||||||
|
-----------------------------------------------------------------------------*/
|
||||||
|
unsigned char VerfiyRC(unsigned char data_value[], unsigned char length) //不用异或校验,用crc校验
|
||||||
|
{
|
||||||
|
unsigned char i;
|
||||||
|
unsigned char V_b = data_value[1];
|
||||||
|
|
||||||
|
for(i = 0x00; i < length; i++)
|
||||||
|
{
|
||||||
|
//异或校验
|
||||||
|
V_b ^= data_value[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
return(V_b);
|
||||||
|
}
|
||||||
|
|
||||||
|
//发送延时
|
||||||
|
void Uart_Send_Delay(unsigned int delay)
|
||||||
|
{
|
||||||
|
unsigned int i = 0, j = 0;
|
||||||
|
|
||||||
|
for(i = 0; i < delay; i++)
|
||||||
|
{
|
||||||
|
for(j = 0; j < 125; j++);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//校验 + 0X1B
|
||||||
|
#define VERFIY_TYPE 0
|
||||||
|
|
||||||
|
/*
|
||||||
|
SOF: 1个字节 0x05 起始字节
|
||||||
|
Len: 2个字节 长度
|
||||||
|
Fou_adr: 2个字节 源地址
|
||||||
|
Com_adr: 2个字节 目标地址,0ff为广播地址
|
||||||
|
Cmd16: 2个字节 命令字
|
||||||
|
Request-data: N字节 数据
|
||||||
|
XOR: 2个字节 校验
|
||||||
|
END: 0x1B 结束字节
|
||||||
|
*/
|
||||||
|
|
||||||
|
//发送数据
|
||||||
|
void send_set_resp(unsigned int OrderNum, unsigned int addr, unsigned char Num, unsigned char sData[])
|
||||||
|
{
|
||||||
|
unsigned int xor_data = 0;
|
||||||
|
unsigned char PData[TTL_SEND_BUFF_LEN];
|
||||||
|
unsigned char i = 0;
|
||||||
|
|
||||||
|
PData[0] = UART_ORDER_SOF; //第一个字节
|
||||||
|
PData[1] = (Num + FIXED_LEN) / 0x100; //长度 高8位
|
||||||
|
PData[2] = (Num + FIXED_LEN) % 0x100; //长度 低8位
|
||||||
|
PData[3] = (addr >> 8) & 0xff; //源地址
|
||||||
|
PData[4] = addr & 0xff; //源地址
|
||||||
|
PData[5] = (SUR_DEVICE_ADDR >> 8) & 0xff; //目标地址
|
||||||
|
PData[6] = SUR_DEVICE_ADDR & 0xff; //目标地址
|
||||||
|
PData[7] = (OrderNum >> 8) & 0xff; //命令字 -1
|
||||||
|
PData[8] = OrderNum & 0xff; //命令字 -2
|
||||||
|
|
||||||
|
// PData[6] = RW_Flag; //读写标志
|
||||||
|
|
||||||
|
for(i = 0; i < Num; i++) //发送数据
|
||||||
|
{
|
||||||
|
PData[FIXED_LEN - 2 + i] = sData[i]; //数据
|
||||||
|
}
|
||||||
|
|
||||||
|
//校验
|
||||||
|
if(VERFIY_TYPE) //异或校验 + 末尾字节 2字节
|
||||||
|
{
|
||||||
|
xor_data = VerfiyRC(PData, Num + FIXED_LEN - 2);
|
||||||
|
PData[FIXED_LEN + Num - 2] = xor_data;
|
||||||
|
PData[FIXED_LEN + Num - 1] = 00;
|
||||||
|
}
|
||||||
|
else //CRC校验 2字节
|
||||||
|
{
|
||||||
|
xor_data = ModbusCRC16(PData, Num + FIXED_LEN - 3);
|
||||||
|
PData[FIXED_LEN + Num - 2] = (xor_data) & 0xff;
|
||||||
|
PData[FIXED_LEN + Num - 1] = (xor_data >> 8) & 0xff;
|
||||||
|
}
|
||||||
|
|
||||||
|
PData[FIXED_LEN + Num] = UART_ORDER_END; // 末尾字节
|
||||||
|
|
||||||
|
//全部发送
|
||||||
|
for(i = 0; i < (Num + FIXED_LEN + 1); i++) //一次性发送所有数据
|
||||||
|
{
|
||||||
|
UART1_Send_Char(PData[i]);
|
||||||
|
//增加延时
|
||||||
|
Uart_Send_Delay(50);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//分析地址是否为本地址
|
||||||
|
uint8_t Check_Resive_Addr(uint16_t addr)
|
||||||
|
{
|
||||||
|
//确定是否为接收地址
|
||||||
|
if((OBJ_DEVICE_ADDR == addr) || (0xFFFF == addr) || (0x0000 == addr) || (0x00B1 == addr))
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
InitUart_Data(); //2清数据
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//接收数据判断(放置串口接收数据内)
|
||||||
|
void Do_Receive_Uart_For_Module(unsigned char ch)
|
||||||
|
{
|
||||||
|
switch(re_status)
|
||||||
|
{
|
||||||
|
case 0 : //0x05 1字节 起始字
|
||||||
|
{
|
||||||
|
if(ch == UART_ORDER_SOF)
|
||||||
|
{
|
||||||
|
rec_len = 0;
|
||||||
|
ttl_receive_buff[rec_len] = ch;
|
||||||
|
re_status = 1;
|
||||||
|
shouldaccept = 0;
|
||||||
|
// UART2_Send_Char(0xaa);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 1: //长度 2字节
|
||||||
|
{
|
||||||
|
rec_len++;
|
||||||
|
ttl_receive_buff[rec_len] = ch;
|
||||||
|
|
||||||
|
if(rec_len >= 2)
|
||||||
|
{
|
||||||
|
re_status = 2;
|
||||||
|
shouldaccept = ttl_receive_buff[1] * 0x100 + ttl_receive_buff[2];
|
||||||
|
|
||||||
|
if(shouldaccept >= TTL_RECEIVE_BUFF_LEN - 1)
|
||||||
|
{
|
||||||
|
InitUart_Data();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 2: //命令字 2个字节 05 00 0B 00 C1 00 A1 F0 01 87 1B
|
||||||
|
{
|
||||||
|
rec_len++;
|
||||||
|
|
||||||
|
if(rec_len >= TTL_RECEIVE_BUFF_LEN - 1)
|
||||||
|
{
|
||||||
|
InitUart_Data();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ttl_receive_buff[rec_len] = ch; //接收
|
||||||
|
|
||||||
|
if(rec_len >= shouldaccept) //判断是否接收完成
|
||||||
|
{
|
||||||
|
// uint8_t i = 0;
|
||||||
|
// UART2_Send_Char(0x30);
|
||||||
|
// UART2_Send_Char(rec_len);
|
||||||
|
// UART2_Send_Char(shouldaccept);
|
||||||
|
// UART2_Send_Char(FIXED_LEN - 1);
|
||||||
|
|
||||||
|
// UART2_Send_Char(rec_len);
|
||||||
|
// for( i = 0;i < shouldaccept;i++) UART2_Send_Char(ttl_receive_buff[i]);
|
||||||
|
|
||||||
|
//等待处理分析,至少要大于固定长度
|
||||||
|
// if(rec_len >= FIXED_LEN - 1)
|
||||||
|
// {
|
||||||
|
//判断接收目标地址是否是自己
|
||||||
|
// int adr = ttl_receive_buff[3];
|
||||||
|
// adr = adr << 8;
|
||||||
|
// adr |= ttl_receive_buff[4];
|
||||||
|
int adr = ttl_receive_buff[5];
|
||||||
|
adr = adr << 8;
|
||||||
|
adr |= ttl_receive_buff[6];
|
||||||
|
|
||||||
|
//UART2_TxByte(0xAA);
|
||||||
|
//UART2_TxByte(ttl_receive_buff[3]);
|
||||||
|
//UART2_TxByte(ttl_receive_buff[4]);
|
||||||
|
//
|
||||||
|
if(Check_Resive_Addr(adr))
|
||||||
|
{
|
||||||
|
//命令字
|
||||||
|
unsigned int order = 0;
|
||||||
|
order = ttl_receive_buff[7];
|
||||||
|
order = order << 8;
|
||||||
|
order += ttl_receive_buff[8];
|
||||||
|
|
||||||
|
// //目标地址
|
||||||
|
// OBJ_DEVICE_ADDR = ttl_receive_buff[3];
|
||||||
|
// OBJ_DEVICE_ADDR <<= 8;
|
||||||
|
// OBJ_DEVICE_ADDR += ttl_receive_buff[4];
|
||||||
|
|
||||||
|
//UART2_Send_Char(order / 0x100);
|
||||||
|
//UART2_Send_Char(order % 0x100);
|
||||||
|
//UART2_TxByte(0xBB);
|
||||||
|
//UART2_TxByte(ttl_receive_buff[7]);
|
||||||
|
//UART2_TxByte(ttl_receive_buff[8]);
|
||||||
|
|
||||||
|
switch(order)
|
||||||
|
{
|
||||||
|
//=================== ===================================================
|
||||||
|
//设备接收数据
|
||||||
|
//======================================================================
|
||||||
|
case 0xF001 : //解析数据
|
||||||
|
{
|
||||||
|
order_flag = 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0xF0C1 : //设置设备加密信息
|
||||||
|
{
|
||||||
|
order_flag = 2;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
//======================================================================
|
||||||
|
//设备信息
|
||||||
|
//======================================================================
|
||||||
|
case 0xF111 : //控制参数
|
||||||
|
{
|
||||||
|
order_flag = 3;
|
||||||
|
// UART2_Send_Char(0x33);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
//======================================================================
|
||||||
|
//设备信息
|
||||||
|
//======================================================================
|
||||||
|
case 0xF112 : //读 状态与温度
|
||||||
|
{
|
||||||
|
order_flag = 4;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 0xF102 : //读 状态与温度
|
||||||
|
{
|
||||||
|
order_flag = 4;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
//======================================================================
|
||||||
|
//
|
||||||
|
//======================================================================
|
||||||
|
default :
|
||||||
|
{
|
||||||
|
InitUart_Data();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
InitUart_Data();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default :
|
||||||
|
InitUart_Data();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//数据长度
|
||||||
|
uint8_t Get_Data_Len(void)
|
||||||
|
{
|
||||||
|
uint16_t Re_Len = 0;
|
||||||
|
Re_Len = (ttl_receive_buff[1] * 0x100 + ttl_receive_buff[2]) - FIXED_LEN;
|
||||||
|
return Re_Len;
|
||||||
|
}
|
||||||
|
|
||||||
|
//检查校验
|
||||||
|
unsigned char Check_VerfiyData(void)
|
||||||
|
{
|
||||||
|
return 1; //调试期间,不用验证
|
||||||
|
|
||||||
|
if(VERFIY_TYPE) //异或校验 + 末尾字节
|
||||||
|
{
|
||||||
|
unsigned char v_A = 0;
|
||||||
|
unsigned char v_B = 0;
|
||||||
|
v_A = ttl_receive_buff[shouldaccept];
|
||||||
|
v_B = VerfiyRC(ttl_receive_buff, shouldaccept - 2);
|
||||||
|
|
||||||
|
if(v_A == v_B) //数据的完整性
|
||||||
|
{
|
||||||
|
//结尾数据相同
|
||||||
|
if(ttl_receive_buff[shouldaccept + 1] == UART_ORDER_END)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else //判断CRC校验
|
||||||
|
{
|
||||||
|
unsigned int CRC16 = 0;
|
||||||
|
unsigned int Get_CRC16 = 0;
|
||||||
|
CRC16 = ttl_receive_buff[shouldaccept];
|
||||||
|
CRC16 = CRC16 << 8;
|
||||||
|
CRC16 += ttl_receive_buff[shouldaccept - 1];
|
||||||
|
|
||||||
|
Get_CRC16 = ModbusCRC16(ttl_receive_buff, shouldaccept - 2);
|
||||||
|
|
||||||
|
if(CRC16 == Get_CRC16) //数据的完整性
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
InitUart_Data();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//数据接收分析(放置大循环内)
|
||||||
|
void Deal_Uart_Data_For_Module(void)
|
||||||
|
{
|
||||||
|
if(order_flag) //有接收的指令
|
||||||
|
{
|
||||||
|
//校验
|
||||||
|
if(Check_VerfiyData() == 1) //测试
|
||||||
|
{
|
||||||
|
switch(order_flag)
|
||||||
|
{
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
case 1 : //数据解析
|
||||||
|
{
|
||||||
|
uint8_t i = 0; //临时变量
|
||||||
|
uint8_t len = 0; //长度
|
||||||
|
uint8_t temp[DATA_LEN];
|
||||||
|
|
||||||
|
//发送标志
|
||||||
|
//send_flag = 0;
|
||||||
|
|
||||||
|
//数据长度
|
||||||
|
len = Get_Data_Len();
|
||||||
|
|
||||||
|
//解析数据
|
||||||
|
for(i = 0; i < len; i++)
|
||||||
|
{
|
||||||
|
temp[i] = ttl_receive_buff[i + FIXED_LEN - 2];
|
||||||
|
}
|
||||||
|
|
||||||
|
// //角行程 、直行程
|
||||||
|
// Travle_Flag = temp[0]; //0 直 1 角
|
||||||
|
// Motor_Run = temp[1]; //0 停止 1 运行 2 运行到起始点 3 运行到结束点
|
||||||
|
// Run_Mode = temp[2]; //0 点动 1 方案一 2 方案二
|
||||||
|
//
|
||||||
|
// Run_Step = temp[3]; //电机运行多少圈为一个步长
|
||||||
|
// Run_Step <<= 8;
|
||||||
|
// Run_Step += temp[4];
|
||||||
|
//
|
||||||
|
// Run_Inter = temp[5]; //电机运行间隔时长
|
||||||
|
// Run_Inter <<= 8;
|
||||||
|
// Run_Inter += temp[6];
|
||||||
|
//
|
||||||
|
// Run_Stop = temp[7]; //到“结束点”后,停止时间
|
||||||
|
// Run_Stop <<= 8;
|
||||||
|
// Run_Stop += temp[8];
|
||||||
|
//
|
||||||
|
// ClrRunmotorStep();//清除电机标记
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2 : //
|
||||||
|
{
|
||||||
|
uint8_t i = 0;
|
||||||
|
uint8_t len = 0;
|
||||||
|
uint8_t temp[DATA_LEN];
|
||||||
|
|
||||||
|
send_set_resp(0xF0C1, OBJ_DEVICE_ADDR, len, temp);
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
//LED 控制
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
case 3 : //F111 05 00 0C 00 A1 00 C1 F1 01 05 03 50 87 1B
|
||||||
|
{
|
||||||
|
uint8_t addr = 0;
|
||||||
|
addr = ttl_receive_buff[FIXED_LEN - 2];
|
||||||
|
if(addr == ((SUR_DEVICE_ADDR & 0xf0) == 0xC0))
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
//======================================================================
|
||||||
|
//
|
||||||
|
//======================================================================
|
||||||
|
case 4 : //
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
//实时信息
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
case 5 : //
|
||||||
|
{
|
||||||
|
uint8_t len = 0;
|
||||||
|
uint8_t temp[DATA_LEN];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
temp[0] = (SUR_DEVICE_ADDR >> 8) & 0xff;
|
||||||
|
temp[1] = (SUR_DEVICE_ADDR >> 0) & 0xff;
|
||||||
|
|
||||||
|
// //版本号 4
|
||||||
|
temp[2] = HD_VER >> 8; //HD_VER 0101 //硬件版本号
|
||||||
|
temp[3] = HD_VER & 0xff;
|
||||||
|
|
||||||
|
temp[4] = SW_VER >> 8; //SW_VER 0101 //软件版本号
|
||||||
|
temp[5] = SW_VER & 0xff;
|
||||||
|
|
||||||
|
len = 6;
|
||||||
|
send_set_resp(0xF113, OBJ_DEVICE_ADDR, len, temp);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 6 : // 设置 地址 + 版本号 F1D3 05 00 0D 00 A1 00 00 F1 D3 00 C1 07 A9 1B
|
||||||
|
{
|
||||||
|
|
||||||
|
uint8_t i = 0;
|
||||||
|
uint8_t len = 0;
|
||||||
|
uint8_t temp[DATA_LEN];
|
||||||
|
|
||||||
|
//数据长度
|
||||||
|
len = Get_Data_Len();
|
||||||
|
|
||||||
|
for(i = 0; i < len; i++)
|
||||||
|
{
|
||||||
|
temp[i] = ttl_receive_buff[i + FIXED_LEN - 2];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
send_set_resp(0xF1C3, OBJ_DEVICE_ADDR, len, temp);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 7 : //更新程序
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
//设备信息
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
case 10 : //F115 05 00 0A 00 C1 00 A1 F1 05 50 87 1B
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
default :
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//清空数据
|
||||||
|
InitUart_Data();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
17
Src/main.c
17
Src/main.c
|
@ -32,7 +32,7 @@
|
||||||
#include "tmc5160.h"
|
#include "tmc5160.h"
|
||||||
#include "m1820.h"
|
#include "m1820.h"
|
||||||
#include "delay.h"
|
#include "delay.h"
|
||||||
|
#include "Uart1.h"
|
||||||
/* USER CODE END Includes */
|
/* USER CODE END Includes */
|
||||||
|
|
||||||
/* Private typedef -----------------------------------------------------------*/
|
/* Private typedef -----------------------------------------------------------*/
|
||||||
|
@ -104,21 +104,22 @@ int main(void)
|
||||||
MX_USART3_UART_Init();
|
MX_USART3_UART_Init();
|
||||||
/* USER CODE BEGIN 2 */
|
/* USER CODE BEGIN 2 */
|
||||||
|
|
||||||
delay_init(); //延时函数初始化
|
delay_init(); //延时函数初始化
|
||||||
|
|
||||||
HAL_GPIO_WritePin(LED_NOR_GPIO_Port, LED_NOR_Pin, GPIO_PIN_RESET); // 绿灯初始为亮
|
HAL_GPIO_WritePin(LED_NOR_GPIO_Port, LED_NOR_Pin, GPIO_PIN_RESET); // 绿灯初始为亮
|
||||||
HAL_GPIO_WritePin(LED_ERR_GPIO_Port, LED_ERR_Pin, GPIO_PIN_RESET); // 蓝灯初始为亮
|
HAL_GPIO_WritePin(LED_ERR_GPIO_Port, LED_ERR_Pin, GPIO_PIN_RESET); // 蓝灯初始为亮
|
||||||
|
|
||||||
M1820_GPIO_Init(); //温度传感器接口初始化
|
M1820_GPIO_Init(); //温度传感器接口初始化
|
||||||
M1820_Init(); //温度传感器初始化
|
M1820_Init(); //温度传感器初始化
|
||||||
|
|
||||||
OLED_Init(); //显示屏初始化
|
OLED_Init(); //显示屏初始化
|
||||||
|
|
||||||
ADS1220_GPIOInit(); //ADS1220 SPI1端口初始化
|
ADS1220_GPIOInit(); //ADS1220 SPI1端口初始化
|
||||||
|
|
||||||
TMC5160A_Init_Gpio(); //电机端口初始化
|
TMC5160A_Init_Gpio(); //电机端口初始化
|
||||||
tmc5160_init(); //电机参数初始化
|
tmc5160_init(); //电机参数初始化
|
||||||
|
|
||||||
|
InitUart_Data(); //串口通信初始化
|
||||||
|
|
||||||
/* USER CODE END 2 */
|
/* USER CODE END 2 */
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,8 @@
|
||||||
|
|
||||||
#include "app.h"
|
#include "app.h"
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
|
#include "serial_port.h"
|
||||||
|
#include "Uart1.h"
|
||||||
|
|
||||||
/* USER CODE END Includes */
|
/* USER CODE END Includes */
|
||||||
|
|
||||||
|
@ -46,8 +48,6 @@
|
||||||
/* Private variables ---------------------------------------------------------*/
|
/* Private variables ---------------------------------------------------------*/
|
||||||
/* USER CODE BEGIN PV */
|
/* USER CODE BEGIN PV */
|
||||||
|
|
||||||
char text_r[20] = {0};
|
|
||||||
char text_t[20] = {0};
|
|
||||||
|
|
||||||
/* USER CODE END PV */
|
/* USER CODE END PV */
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ extern UART_HandleTypeDef huart3;
|
||||||
static volatile uint8_t txcplt_flag = 0; // 发送完成标志,1完成0未完成
|
static volatile uint8_t txcplt_flag = 0; // 发送完成标志,1完成0未完成
|
||||||
static volatile uint8_t rxcplt_flag = 0; // 接收完成标志,1完成0未完成
|
static volatile uint8_t rxcplt_flag = 0; // 接收完成标志,1完成0未完成
|
||||||
|
|
||||||
static volatile uint8_t rx_data = 0;
|
uint8_t rx_data = 0;
|
||||||
static volatile uint8_t test_buffer[10];
|
static volatile uint8_t test_buffer[10];
|
||||||
|
|
||||||
/* USER CODE END EV */
|
/* USER CODE END EV */
|
||||||
|
@ -287,28 +287,17 @@ void USART1_IRQHandler(void)
|
||||||
|
|
||||||
// HAL_UART_IRQHandler(&huart1); // HAL库中的UART统一中断服务函数,通过形参判断是要处理谁的中?
|
// HAL_UART_IRQHandler(&huart1); // HAL库中的UART统一中断服务函数,通过形参判断是要处理谁的中?
|
||||||
|
|
||||||
// unsigned char c = 0;
|
|
||||||
// if((USART1->SR &(1<<5)) != 0) // 判断USART1的状态寄存器的第五位即RXNE位是否被置位
|
|
||||||
// {
|
|
||||||
// c = USART1->DR; // RXNE=1,表明DR寄存器有值,就将它读出来保存到临时变量中;
|
|
||||||
// //ring_buffer_write(c, &test_buffer); // 将数据保存到环形缓冲区中
|
|
||||||
//
|
|
||||||
// HAL_GPIO_TogglePin(LED_ERR_GPIO_Port,LED_ERR_Pin);//蓝灯闪烁
|
|
||||||
//
|
|
||||||
// test_buffer[0] = c;
|
|
||||||
// HAL_UART_Transmit_IT( &huart1, (uint8_t*)test_buffer, 1);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if( it_1000ms_flag == 1)
|
if((USART1->SR &(1<<5)) != 0) // 判断USART1的状态寄存器的第五位即RXNE位是否被置位
|
||||||
// {
|
{
|
||||||
// it_1000ms_flag = 0;
|
rx_data = USART1->DR; // RXNE=1,表明DR寄存器有值,就将它读出来保存到临时变量中;
|
||||||
//
|
|
||||||
// strcpy(text_t," Hello World! ");
|
|
||||||
//
|
|
||||||
// HAL_UART_Receive_IT( &huart1, (uint8_t*)text_r, 20);
|
|
||||||
|
|
||||||
// HAL_UART_Transmit_IT( &huart1, (uint8_t *)text_t, 20);
|
// HAL_UART_Receive_IT(&huart1,&rx_data,1);
|
||||||
// }
|
|
||||||
|
receive_ttl_data(rx_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
// HAL_UART_Transmit_IT( &huart1, (uint8_t *)text_r, 20);
|
||||||
|
|
||||||
/* USER CODE END USART1_IRQn 1 */
|
/* USER CODE END USART1_IRQn 1 */
|
||||||
}
|
}
|
||||||
|
@ -375,4 +364,27 @@ void HAL_TIM_PeriodElapsedCallback (TIM_HandleTypeDef *htim)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) //HAL_UART_Receive_IT call back function
|
||||||
|
{
|
||||||
|
if(huart->Instance == USART1)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart) //HAL_UART_Receive_IT call back function
|
||||||
|
{
|
||||||
|
if(huart->Instance == USART1)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* USER CODE END 1 */
|
/* USER CODE END 1 */
|
||||||
|
|
|
@ -43,7 +43,7 @@ void MX_TIM1_Init(void)
|
||||||
htim1.Instance = TIM1;
|
htim1.Instance = TIM1;
|
||||||
htim1.Init.Prescaler = 36-1;
|
htim1.Init.Prescaler = 36-1;
|
||||||
htim1.Init.CounterMode = TIM_COUNTERMODE_UP;
|
htim1.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||||
htim1.Init.Period = 1000;
|
htim1.Init.Period = 1000-1;
|
||||||
htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||||
htim1.Init.RepetitionCounter = 0;
|
htim1.Init.RepetitionCounter = 0;
|
||||||
htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE;
|
htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE;
|
||||||
|
|
Reference in New Issue