資源簡(jiǎn)介
stm32+modbus項(xiàng)目實(shí)例源碼 ,一個(gè)很好的例子源代碼。

代碼片段和文件信息
/******************************************************************************
?*????????????????????????????zshangan@icloud.com?????????????????????????????*
?*?????????????? ???Copyright?(c)?2016?All?rights?reserved????????????????*
?******************************************************************************
?*?File?name??:?com.c?????????????????????????????????????????????????????????*
?*????????????????????????????????????????????????????????????????????????????*
?*?Description:?communication?and?so?so ??????*
?*????????????????????????????????????????????????????????????????????????????*
?*?Author?????:?zshangan??????????????????????????????????????????????????????*
?*????????????????????????????????????????????????????????????????????????????*
?*?Version????:?v1.0.0????????????????????????????????????????????????????????*
?*????????????????????????????????????????????????????????????????????????????*
?*?modification?history???????????????????????????????????????????????????????*
?*?--------------------???????????????????????????????????????????????????????*
?*?Version????:?v1.0.0?zshangan?C?2016-10-05???????????????????????????????*
?*????????????????????????????????????????????????????????????????????????????*
?*????????????????????????????????????????????????????????????????????????????*
******************************************************************************/
#include?“driver.h“
#include?“com.h“
#include?“system.h“
#include?“mb.h“
st_com_blk g_com_blk[UART_MAX_NUM];
extern?st_sys_blk g_sys_blk;
const?uint16?g_com_speed[]?=?
{???
600
????1200
????2400
????4800
????9600
????19200
????38400
};
static?void?com_rs485_direction(uint8?port?bool?direction);
/******************************************************************************
**?Function?Name????:?UART_RS485_DIR
**?Descriptions?????:?
**?input?parameters?:?None
**?Returned?value???:?None
**?Global?variables?:?None
******************************************************************************/
static?void?com_rs485_direction(uint8?port?bool?direction)
{
#if?0
switch(port)
{
case?UART_1:
case?UART_2:
break;
case?UART_4:
direction???UART4_DIR_SEND()?:?UART4_DIR_RECV();
break;
case?UART_5:
direction???UART5_DIR_SEND()?:?UART5_DIR_RECV();
break;
default:
break;
}
#endif
}
/******************************************************************************
**?Function?Name????:?com_proc_rxd
**?Descriptions?????:?process?UART?receive?interrputer
**?input?parameters?:?None
**?Returned?value???:?None
**?Global?variables?:?None
******************************************************************************/
void?com_proc_rxd(uint8?port)
{ ?
st_com_blk_ptr com_blk =?&g_com_blk[port];
st_sys_blk_ptr sys_blk?=?&g_sys_blk;
uint8???byte?=?UART_Recv_Data(port);
????
????switch(com_blk->recv_state)
????{
??????
?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????目錄???????????0??2018-11-08?09:59??stm32+modbus項(xiàng)目實(shí)例源碼\
?????文件???????15230??2018-11-05?09:03??stm32+modbus項(xiàng)目實(shí)例源碼\com.c
?????文件????????5925??2018-11-05?09:03??stm32+modbus項(xiàng)目實(shí)例源碼\com.h
?????文件????????3527??2018-11-05?09:03??stm32+modbus項(xiàng)目實(shí)例源碼\config.h
?????文件????????1621??2018-11-05?09:03??stm32+modbus項(xiàng)目實(shí)例源碼\driver.h
?????文件????????1835??2018-11-05?09:03??stm32+modbus項(xiàng)目實(shí)例源碼\main.c
?????文件????????7506??2018-11-05?09:03??stm32+modbus項(xiàng)目實(shí)例源碼\mb.c
?????文件???????10290??2018-11-05?09:03??stm32+modbus項(xiàng)目實(shí)例源碼\mb.h
?????文件????????4829??2018-11-05?09:03??stm32+modbus項(xiàng)目實(shí)例源碼\mb_crc.c
?????文件????????2515??2018-11-05?09:03??stm32+modbus項(xiàng)目實(shí)例源碼\mb_crc.h
?????文件???????11508??2018-11-05?09:03??stm32+modbus項(xiàng)目實(shí)例源碼\mb_func.c
?????文件????????9588??2018-11-05?09:03??stm32+modbus項(xiàng)目實(shí)例源碼\mb_func.h
?????文件???????32715??2018-11-05?09:03??stm32+modbus項(xiàng)目實(shí)例源碼\stm32f10x_it.c
?????文件????????4544??2018-11-05?09:03??stm32+modbus項(xiàng)目實(shí)例源碼\system.c
?????文件????????2617??2018-11-05?09:03??stm32+modbus項(xiàng)目實(shí)例源碼\system.h
評(píng)論
共有 條評(píng)論