bleSDK_expansion_board/projects/blezongkong/src/app_modbus.h

26 lines
527 B
C

#ifndef _APP_MODBUS_H_
#define _APP_MODBUS_H_
#include <stdint.h>
//MODBUS从机地址(广播地址0)
#define MODBUS_ADDR sys_conf.Modbus_addr
void app_modbus_Init(uint32_t baudrate, uint8_t io_tx, uint8_t io_rx);
// Empty RingBuffer to reset.
void app_modbus_Rb_Reset(void);
// Get Length of data in RB.
uint16_t app_modbus_Rb_Len(void);
// Read data from RB, return the Length of data copied.
uint16_t app_modbus_Rb_Read(uint8_t *buff, uint16_t max);
// Uart Data procedure
void app_modbus_procedure(void);
#endif