亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? porting.dox

?? modbus開發程序包
?? DOX
字號:
/*! \page sec_porting_serial Porting for RTU/ASCII

The first steps should always be to create a new directory for the port. The recommended layout is to create a top level directory, e.g. <tt>demo/PLATFORM</tt> which hold the application and project files. In addition a subdirectory <tt>port</tt> should be created for the port specific files.
\verbatim
demo/PLATFORM/Makefile
demo/PLATFORM/main.c
demo/PLATFORM/port/portserial.c
demo/PLATFORM/port/porttimer.c
demo/PLATFORM/port/portother.c
demo/PLATFORM/port/port.h
\endverbatim
You can use <tt>demo/BARE</tt> as a starting point. Simply copy the directory and rename it to a name of your choice.

\section sec_porting_types Platform specifics (port.h)
You should first check the file <tt>port.h</tt> and check the if the examples are already suitable for your platform. You must at least define the macros for enabling <code>ENTER_CRITICAL_SECTION</code> and disabling <code>EXIT_CRITICAL_SECTION</code> interrupts.

\section sec_porting_timers Implementation of the timer functions (porttimer.c)
The Modbus protocol stacks needs a timer to detect the end of the frame. The timers should have a resolution of half the time of a serial character. For example for 38400 baud the character time is approx. 280us assuming 11bits for a single character. The smallest timeout used by the protocol stack is 3.5 times the character timeout. 
<p>You should start by implementing the function <code>xMBPortTimersInit( USHORT usTim1Timerout50us )</code> and <code>vMBPortTimersEnable(  )</code>. Test the function with the following sample code:
\code
vMBPortTimersInit( 20 );
vMBPortTimersEnable( );
for( ;; );
\endcode
Place a breakpoint or toggle an LED in the interrupt handler which calls <code>pxMBPortCBTimerExpired</code>. The ISR should occur approx. 1ms after the call to <code>vMBPortTimersEnable()</code>. You should also check that <code>vMBPortTimersDisable( )</code> works as expected. 
</p>
\note If you use Modbus ASCII the timers are in the range of seconds because the timeouts are much larger there. Make sure you can handle a value of 20000 for <code>usTim1Timerout50us</code> which corresponds to an one second timeout. See <tt>mbconfig.h</tt> for the value of the timeout defined by <code>MB_ASCII_TIMEOUT_SEC</code>.

\section sec_porting_serial Implementation of the serial functions (portserial.c)
The serial porting layer must be capable of initializing the UART, disabling and enabling the receiver and transmitter components as well as performing callbacks if a character has been received or can be transmitted. You should start by implementing <code>xMBPortSerialInit( UCHAR ucPORT, ULONG ulBaudRate, UCHAR ucDataBits, eMBParity eParity )</code> and <code>vMBPortSerialEnable(  BOOL xRxEnable, BOOL xTxEnable )</code>. 
In addition you need to create two interrupt service routines for you communication devices. It is usually simpler to start with the receive interrupt. 
<p>Create an interrupt handler for the receive interrupt, set a breakpoint there and check if <code>xMBPortSerialGetByte( CHAR * pucByte )</code> correctly returns the character. This can be tested by the following code:
\code
/* Initialize COM device 0 with 38400 baud, 8 data bits and no parity. */
if( xMBPortSerialInit( 0, 38400, 8, MB_PAR_NONE ) == FALSE )
{
  fprintf(stderr, "error: com init failed");
}
else
{
  /* Enable the receiver. */ 
  vMBPortSerialEnable( TRUE, FALSE );
  /* Now block. Any character received should cause an interrupt now. */
  for( ;; );
}
\endcode
And your serial character received ISR should look like:
\code
static void prvvUARTTxReadyISR( void )
{
    CHAR cByte;
    ( void )xMBPortSerialGetByte( &cByte );
    /* Now cByte should contain the character received. */
}
\endcode
</p>
<p>
Next you should check that the transmitter part is actually working as expected. Open a terminal program and simply call <code>xMBPortSerialPutByte( 'a' )</code> in the transmit buffer empty ISR. If you use the sample code from below exactly 10 characters should be received.
\code
/* Initialize COM device 0 with 38400 baud, 8 data bits and no parity. */
if( xMBPortSerialInit( 0, 38400, 8, MB_PAR_NONE ) == FALSE )
{
  fprintf(stderr, "error: com init failed");
}
else
{
  /* Enable the transmitter. */ 
  vMBPortSerialEnable( FALSE, TRUE );
  /* Now block. Any character received should cause an interrupt now. */
  for( ;; );
}
\endcode
And you serial transmit buffer empty ISR should look like:
\code
static unsigned int uiCnt = 0;

void prvvUARTTxReadyISR( void )
{
    if( uiCnt++ < 10 )
    {
        ( void )xMBPortSerialPutByte( 'a' );
    }
    else
    {
        vMBPortSerialDisable( FALSE, FALSE );
    }
}
\endcode
</p>
<p>
If you are sure everything works correctly change the interrupt routines back to the examples shown in <tt>portserial.c</tt>
</p>

\section sec_porting_event Implementing the event queue (portevent.c)
If you are not using an operating system the port is already finished and the demo application should work as expected. If you in the luck of having an operating system usage of the FreeModbus protocol stack differs in the following way:

 - Create another task at startup which calls eMBPoll( ) in a loop. This should look like:
   \code
for( ;; )
{
    ( void )eMBPoll(  );
}
   \endcode
   See the STR71x port for an FreeRTOS example.

 - Change the function <code>xMBPortEventPost</code> to post an event to a queue. Note that this function will be called from an ISR so check your RTOS documentation for that.

 - Change the <code>xMBPortEventGet</code> to retrieve an event from that queue. The function <code>eMBPoll</code> periodically calls it. The function should block until an event has been posted to the queue.

In addition the serial and timer interrupt function must be modified. Whenever the protocol handler callback functions <code>pxMBFrameCBByteReceived</code>, <code>pxMBFrameCBTransmitterEmpty</code> and <code>pxMBPortCBTimerExpired</code> return <code>TRUE</code> a context switch should be made after exiting the ISR because an event has been posted to the queue. Forgetting to do this will result in slow performance of the protocol stack.
*/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合久久久久| 国产日韩精品一区二区三区在线| 欧美日韩成人一区| 国产亚洲一本大道中文在线| 一区二区三区中文字幕精品精品 | 青娱乐精品视频| 99精品欧美一区| 久久久久99精品国产片| 国产一区二区免费看| 欧美日韩精品福利| 中文字幕一区二区三区在线播放 | 中文字幕在线不卡一区二区三区| 婷婷六月综合网| 色综合久久久久综合体桃花网| 亚洲精品在线三区| 日本不卡视频在线观看| 色噜噜久久综合| 国产精品天干天干在观线| 久久国产精品99精品国产| 欧美日韩一区高清| 一二三区精品视频| 91老司机福利 在线| 国产精品网曝门| 国产99久久久国产精品免费看| 日韩一区二区免费高清| 亚洲va欧美va国产va天堂影院| 色综合天天综合在线视频| 中文字幕在线不卡视频| 成人激情免费视频| 国产精品国产三级国产有无不卡 | 日本韩国一区二区三区| **网站欧美大片在线观看| 成熟亚洲日本毛茸茸凸凹| 久久午夜老司机| 国产成人综合精品三级| 国产亚洲成av人在线观看导航| 国内精品伊人久久久久av影院 | 久久久久久**毛片大全| 国产呦萝稀缺另类资源| 久久综合色婷婷| 国产成人综合精品三级| 国产精品久久久一区麻豆最新章节| 国产成人高清在线| 亚洲欧洲精品天堂一级| 91久久国产综合久久| 亚洲国产精品视频| 欧美精品tushy高清| 免费在线观看一区| 久久久久国色av免费看影院| 成人一级片网址| 一二三区精品福利视频| 777a∨成人精品桃花网| 精品一区免费av| 国产精品国产三级国产a| 色欧美日韩亚洲| 蜜桃在线一区二区三区| 久久久久久亚洲综合影院红桃| 成人性生交大片免费| 亚洲在线成人精品| 精品理论电影在线观看 | 丝袜a∨在线一区二区三区不卡| 欧美精品久久久久久久久老牛影院| 美女被吸乳得到大胸91| 欧美韩国日本综合| 欧美日韩激情一区| 国产黄人亚洲片| 亚洲国产成人av网| 2021国产精品久久精品| 91在线云播放| 麻豆成人av在线| 极品销魂美女一区二区三区| 国产欧美一二三区| 欧美日韩国产三级| 高清久久久久久| 天堂久久久久va久久久久| 国产亚洲精品超碰| 欧美福利一区二区| www.日韩在线| 久久99久国产精品黄毛片色诱| 国产精品福利一区| 日韩免费在线观看| 欧美体内she精视频| 国产一二精品视频| 无码av免费一区二区三区试看 | 国产亚洲成av人在线观看导航| 日本乱码高清不卡字幕| 国产一区二三区| 亚洲午夜精品一区二区三区他趣| 久久久99精品免费观看| 91精品国产免费| 在线观看亚洲精品| 不卡视频在线观看| 国产剧情一区二区| 另类小说图片综合网| 亚洲一线二线三线久久久| 中文久久乱码一区二区| 精品国产乱码久久久久久夜甘婷婷 | 97久久精品人人爽人人爽蜜臀| 久久精品国产在热久久| 午夜精品免费在线观看| 亚洲视频一区在线| 欧美国产日产图区| 精品国一区二区三区| 制服.丝袜.亚洲.中文.综合| 色域天天综合网| 99视频国产精品| 成人精品一区二区三区中文字幕| 久久国产精品一区二区| 秋霞影院一区二区| 日韩一区精品视频| 亚洲无线码一区二区三区| 亚洲女爱视频在线| 亚洲色图欧洲色图| 韩国在线一区二区| 亚洲v日本v欧美v久久精品| 日韩一区在线播放| 久久亚洲影视婷婷| 久久久久97国产精华液好用吗| 久久亚洲精华国产精华液| 精品精品国产高清a毛片牛牛| 日韩天堂在线观看| 精品国产91亚洲一区二区三区婷婷| 欧美精品久久久久久久多人混战 | 色视频欧美一区二区三区| 91免费观看在线| 欧美综合亚洲图片综合区| 91福利在线免费观看| 欧美日韩一区二区不卡| 欧美一级电影网站| 2020国产精品自拍| 中文无字幕一区二区三区| 自拍偷拍亚洲欧美日韩| 亚洲综合一二三区| 蜜桃免费网站一区二区三区| 久久精品国产久精国产爱| 狠狠狠色丁香婷婷综合激情 | 欧美成人一区二区三区片免费| 久久综合九色综合欧美亚洲| 久久久久免费观看| 亚洲素人一区二区| 日韩精品一区第一页| 国产精品一二三四| 色猫猫国产区一区二在线视频| 欧美美女激情18p| 久久久久久久网| 一区二区久久久| 精品制服美女久久| 91看片淫黄大片一级在线观看| 欧洲亚洲国产日韩| 久久亚洲综合色| 艳妇臀荡乳欲伦亚洲一区| 久久99久久久久| 色综合中文字幕国产 | 99国产精品久久久久久久久久| 一本色道综合亚洲| 日韩视频在线永久播放| 国产精品久久99| 日本亚洲欧美天堂免费| 成人免费va视频| 91精品国产91久久久久久最新毛片| 国产午夜精品一区二区| 亚洲一区二区三区在线看| 久久99精品国产.久久久久久| 久久亚洲一级片| 一区二区高清免费观看影视大全| 激情综合网天天干| 欧美性色欧美a在线播放| 欧美精品一区二区三区蜜桃 | 久久一留热品黄| 午夜伊人狠狠久久| 99久久久无码国产精品| 欧美电视剧在线观看完整版| 一区二区高清免费观看影视大全| 国产麻豆成人传媒免费观看| 欧美日韩国产系列| 亚洲精品欧美在线| 国产+成+人+亚洲欧洲自线| 91麻豆精品国产91久久久更新时间| 国产精品久久久久久久久快鸭| 另类小说视频一区二区| 欧美午夜不卡视频| 亚洲视频在线一区观看| 国产99久久久国产精品潘金 | 91福利小视频| 国产精品麻豆久久久| 国产在线精品免费| 欧美一区二区三区白人| 亚洲一区二区三区影院| 99久久精品国产一区二区三区| 国产亚洲一区二区三区| 韩国理伦片一区二区三区在线播放| 欧美日韩综合在线免费观看| 亚洲精品综合在线| 99久久久国产精品免费蜜臀| 国产欧美日韩亚州综合| 国产宾馆实践打屁股91| 图片区日韩欧美亚洲| 在线精品视频一区二区三四| 综合久久久久久| 91久久香蕉国产日韩欧美9色|