- 1、本文档共6页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
freemodbus程序解读之portserial.c
/*
* FreeModbus Libary: LPC214X Port
* Copyright (C) 2007 Tiago Prado Lone tiago@.br
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* File: $Id: portserial.c,v 1.1 2007/04/24 23:15:18 wolti Exp $
*/
//串行口配置,硬件
#include LPC214X.h
#include port.h
/* ----------------------- Modbus includes ----------------------------------*/
#include mb.h
#include mbport.h
/* ----------------------- static functions ---------------------------------*/
static void
sio_irq( void )
__irq;
static void prvvUARTTxReadyISR( void );
static void prvvUARTRxISR( void );
/* ----------------------- Start implementation -----------------------------*/
void vMBPortSerialEnable( BOOL xRxEnable, BOOL xTxEnable ) //reference in mbport.h
//控制接收和传送使能,//TXD使能后,RTU模式下执行xMBRTUTransmitFSM(void) 函数
{
if( xRxEnable )
{
U1IER |= 0x01; //ensable the Receive Data Available interrupt
}
else
{
U1IER = ~0x01; //DISable the Receive Data Available interrupt
}
if( xTxEnable )
{
U1IER |= 0x02; //Enable the THRE interrupts
prvvUARTTxReadyISR( ); // 执行pxMBFrameCBTransmitterEmpty( ),
// 映射到mbrtu.c的xMBRTUTransmitFSM函数
}
else
{
U1IER = ~0x02; //disable the THRE interru
您可能关注的文档
- 南师大中北学院jsp试题.doc
- DBHelper类.doc
- 实验报告(面向对象程序设计 (Java))(14级物联网工程31号谢学伟).doc
- 浙江工商大学-2011-2012-学年第-一-学期考试试卷(A卷).doc
- 数据库SQL Server2000 迁移至 SQL Server2005 查询性能优化总结.doc
- 第四章课后题答案.doc
- F5草帽白光.doc
- 路由器配置详解.doc
- Java课程第三次实验报告.doc
- 简易英文简历模板.docx
- 河北省定州中学2017-2018学年高二(承智班)下学期期中考试物理试题.doc
- Unit3TheInternetkeywordslanguagepoints知识点讲解课件高中英语人教版(2020).pptx
- 2025年中考语文一轮专题复习名著导读《红岩》.docx
- Unit1GrowingUpUsinglanguageReading课件高二英语选择性.pptx
- 5.1硫及其化合物(第一课时)课件高一下学期化学人教版 3.pptx
- 黑龙江省教育学会示范性高中专业委员会高三下学期第一次模拟考试生物试卷.docx
- 一切都是最好的安排课件山东省邹城市第一中学高三下学期二模考试分析家长会.pptx
- 2024年中考物理一轮复习课件电路识别与作图电路故障分析【03】.pptx
- Unit2SpecialDaysLesson1(课件)人教新起点版英语五年级下册 4.pptx
- Unit5LanguagesaroundtheWorldReadingandThinking课件高一上学期英语人教版.pptx
文档评论(0)