You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

129 lines
4.7 KiB

!61 修改 sdmmc 协议框架,合入 freemodbus,修改 parameters 命名 * Merge branch 'sdmmc_1117' into 'new_master' * 修改 SD 协议栈,合入 FATFS 0.1.4 支持同时使用多种介质上的文件系统 * Merge branch 'modbus' into 'new_master' * Modbus * Merge branch 'd2000x_1128_stand' into 'new_master' * 统一参数命名,增加 DX 的部分适配 * Merge branch 'sync20221104' into 'new_master' * Merge branch 'pub20221104' into sync20221104 * Merge branch 'new_master' into 'new_master' * 发布前修改文档错误,添加配置项 * Merge branch '0.4.0_test' into 'new_master' * 修改部分readme * Merge branch 'test' into 'new_master' * test modified including readme.md sdkconfig ADD ft2004eg64 or 32 d20… * Merge branch 'release_1102' into 'new_master' * 添加例程图片和说明,补全部分例程的配置文件 * Merge branch 'v0.4.0release_11_04' into 'new_master' * V0.4.0release 11 04 * Merge branch '0_4_0_test' into 'new_master' * 完善部分测试例程,如adc,pcie等 * Merge branch 'release_1028' into 'new_master' * GPIO/SPI/SDIO/USB 等例程支持 E2000Q Demo 板,修复部分驱动中的bug * Merge branch 'rtt_1025' into 'new_master' * 以 f 开头重命名系统文件名,增加一键导出 RT-Thread BSP 的脚本,修改 Kconfig 适应 scons * Merge branch 'sync_1021' into 'new_master' * Merge branch 'pub_1021' into sync_1021 * Merge branch 'sata_0926' into 'new_master' * E2000 Sata控制器完善,适配demo板,对can的部分代码进行一些整理 * 新增soft pwm 与 sdk用户使用手册 * 新增soft pwm 与 sdk用户使用手册 * Merge branch 'sync_1019' into 'new_master' * Merge branch 'pub_1019' into sync_1019 * E2000支持USB XHCI, 支持轮询模式下获取键盘输入 * E2000支持USB XHCI, 支持轮询模式下获取键盘输入 * Merge branch 'dev' into 'new_master' * Gmac和Xmac bug解决 * Merge branch 'new_master' into 'new_master' * UART example add flaw control and ddma * Merge branch 'can_loopback_0915' into 'new_master' * 裸机can驱动完善 * Merge branch 'sync_0909' into 'new_master' * Merge branch 'pub_0909' into sync_0909 * Merge branch 'sata_0831' into 'new_master' * 完善Sata和Qspi的接口,增加博雅flash的quad读适配 * Merge branch 'new_master' into 'new_master' * release board commit * Merge branch 'adc_qspi_0824' into 'new_master' * Adc适配Freertos造成的裸机驱动修改 * add cherry usb * Merge branch 'sync_0827' into 'new_master' * Merge branch 'pub_0827' into sync_0827 * Merge branch 'sync' into 'new_master' * Merge branch 'sync' of https://gitlab.phytium.com.cn/zhugengyu/phytium… * Merge branch 'pub' into sync * Merge branch 'pub' into sync * Merge branch 'e2000q_adapt_0815' into 'new_master' * E2000q adapt pwm * 补充E2000测试例程(gpio_test/spi_ddma/spi_loopback),完成FT2004回归测试(sdmmc_cmd) * 补充E2000测试例程(gpio_test/spi_ddma/spi_loopback),完成FT2004回归测试(sdmmc_cmd) * Merge branch 'new_master' into 'new_master' * E2000Q 支持更新 * Merge branch 'readme_v' into 'new_master' * update files * Merge branch 'gitee_v0.3.0' into 'new_master' * !49 v0.3.0 更新 * Merge branch 'E2000_TEST' into 'new_master' * E2000 v0.3 发布 * Merge branch 'v0_2_0_gitee' into 'new_master' * Merge branch '0_2_0' into 'new_master' * build all, before push to gitee 0.2.0 * Merge branch 'gmac_phy_0526' into 'new_master' * 完善gmac驱动,完善裸机lwip测试,适配freertos的lwip测试 * Merge branch 'new_master' into 'new_master' * iic_timer_tacho * Merge branch 'debug_0609' into 'new_master' * 支持汇编调试打印,修改异常打印,增加例程用于异常调试 * Merge branch 'nand_0512' into 'new_master' * Nand 0512 * 重构SDIO驱动,支持SD 2.0协议和DMA读写 * 重构SDIO驱动,支持SD 2.0协议和DMA读写 * 合入Seamphore驱动,完成GDMA驱动重构 * 合入Seamphore驱动,完成GDMA驱动重构 * Merge branch 'pwm_0525' into 'new_master' * 重构CAN驱动,新增E2000 PWM、ADC驱动 * 合入DDMA驱动,新增DDMA+SPI回环例程,更新PR Check list和编码规范 * 合入DDMA驱动,新增DDMA+SPI回环例程,更新PR Check list和编码规范 * Merge branch 'new_master' into 'new_master' * fi2c_slave * Merge branch 'revert-425e915e' into 'new_master' * Revert "Merge branch 'revert' into 'new_master'" * Merge branch 'revert' into 'new_master' * revert version * Merge branch 'fi2c_0429' into 'new_master' * Fi2c 0429 * Merge branch 'new_master' into 'new_master' * add fi2c_master * Merge branch 'xmac_gmac' into 'new_master' * Gmac and Xmac Restruct * Merge branch 'new_gic' into 'new_master' * New gic * Merge branch 'spi_0413' into 'new_master' * 支持 LittleFS 和 Spiffs,新增 SPI 回环测试 * Merge branch '0_1_17' into 'new_master' * !40 Release v0.1.17 * Merge branch 'new_master' into 'new_master' * add uart file * Merge branch '0_1_17' into 'new_master' * v0.1.17发布前覆盖测试 * 解决Issue:I2C 驱动速度无法调节至3.4M * 解决Issue:I2C 驱动速度无法调节至3.4M * Merge branch 'wdt_restruct' into 'new_master' * watchdog驱动重构与验证 * Merge branch 'qspi' into 'new_master' * 重构QSPI驱动,解耦驱动和FLASH关联,完善功能特性支持和测试例程 * 重构芯片引脚控制和GPIO驱动,新增引脚控制相关例程 * 重构芯片引脚控制和GPIO驱动,新增引脚控制相关例程 * Merge branch 'ctest-pr-0317' into 'new_master' * redefine assert and shell cmd to support ctest * Merge branch 'openamp_update' into 'new_master' * Openamp update * Release v0.1.16, Support USB and SATA * Release v0.1.16, Support USB and SATA * Merge branch 'release_0218' into 'new_master' * Release 0.1.16 进行发布例程功能测试,修改许可证为Phytium Public License 1.0 * 合入FUSB和FXHCI驱动,支持通过FATFS读写U盘 * 合入FUSB和FXHCI驱动,支持通过FATFS读写U盘 * Merge branch 'back' into 'new_master' * 修改多核问题,删除glibc * Merge branch 'sata' into 'new_master' * add pcie & sata driver and example test * Merge branch 'rm_some_right' into 'new_master' * Rm some right
2 years ago
/*
* FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU.
* Copyright (c) 2006-2018 Christian Walter <cwalter@embedded-solutions.at>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef _MB_PORT_H
#define _MB_PORT_H
#ifdef __cplusplus
PR_BEGIN_EXTERN_C
#endif
/* ----------------------- Type definitions ---------------------------------*/
typedef enum
{
EV_READY, /*!< Startup finished. */
EV_FRAME_RECEIVED, /*!< Frame received. */
EV_EXECUTE, /*!< Execute function. */
EV_FRAME_SENT /*!< Frame sent. */
} eMBEventType;
/*! \ingroup modbus
* \brief Parity used for characters in serial mode.
*
* The parity which should be applied to the characters sent over the serial
* link. Please note that this values are actually passed to the porting
* layer and therefore not all parity modes might be available.
*/
typedef enum
{
MB_PAR_NONE, /*!< No parity. */
MB_PAR_ODD, /*!< Odd parity. */
MB_PAR_EVEN /*!< Even parity. */
} eMBParity;
/* ----------------------- Supporting functions -----------------------------*/
BOOL xMBPortEventInit( void );
BOOL xMBPortEventPost( eMBEventType eEvent );
BOOL xMBPortEventGet( /*@out@ */ eMBEventType * eEvent );
/* ----------------------- Serial port functions ----------------------------*/
BOOL xMBPortSerialInit( UCHAR ucPort, ULONG ulBaudRate,
UCHAR ucDataBits, eMBParity eParity );
void FModBusPortClose( void );
void xMBPortSerialClose( void );
void vMBPortSerialEnable( BOOL xRxEnable, BOOL xTxEnable );
BOOL xMBPortSerialGetByte( CHAR * pucByte );
BOOL xMBPortSerialPutByte( CHAR ucByte );
/* ----------------------- Timers functions ---------------------------------*/
BOOL xMBPortTimersInit( USHORT usTimeOut50us );
void xMBPortTimersClose( void );
void vMBPortTimersEnable( void );
void vMBPortTimersDisable( void );
void vMBPortTimersDelay( USHORT usTimeOutMS );
/* ----------------------- Callback for the protocol stack ------------------*/
/*!
* \brief Callback function for the porting layer when a new byte is
* available.
*
* Depending upon the mode this callback function is used by the RTU or
* ASCII transmission layers. In any case a call to xMBPortSerialGetByte()
* must immediately return a new character.
*
* \return <code>TRUE</code> if a event was posted to the queue because
* a new byte was received. The port implementation should wake up the
* tasks which are currently blocked on the eventqueue.
*/
extern BOOL( *pxMBFrameCBByteReceived ) ( void );
extern BOOL( *pxMBFrameCBTransmitterEmpty ) ( void );
extern BOOL( *pxMBPortCBTimerExpired ) ( void );
/* ----------------------- TCP port functions -------------------------------*/
BOOL xMBTCPPortInit( USHORT usTCPPort );
void vMBTCPPortClose( void );
void vMBTCPPortDisable( void );
BOOL xMBTCPPortGetRequest( UCHAR **ppucMBTCPFrame, USHORT * usTCPLength );
BOOL xMBTCPPortSendResponse( const UCHAR *pucMBTCPFrame, USHORT usTCPLength );
#ifdef __cplusplus
PR_END_EXTERN_C
#endif
#endif