27 #ifndef MODBUS_MAX_ADU_SIZE
28 #define MODBUS_MAX_ADU_SIZE 12
30 #ifndef MODBUS_QUEUE_LENGTH
31 #define MODBUS_QUEUE_LENGTH 8
37 #define MODBUS_SET_MSB16(v) ((v) >> 8)
38 #define MODBUS_SET_LSB16(v) ((v) & 0xFF)
69 void (*on_rx_exception)(uint8_t code,
void *context);
modbus_function_t
Definition: modbus.h:46
@ ModBus_WriteCoil
Definition: modbus.h:51
@ ModBus_ReadHoldingRegisters
Definition: modbus.h:49
@ ModBus_WriteRegisters
Definition: modbus.h:56
@ ModBus_Diagnostics
Definition: modbus.h:54
@ ModBus_ReadCoils
Definition: modbus.h:47
@ ModBus_WriteCoils
Definition: modbus.h:55
@ ModBus_ReadInputRegisters
Definition: modbus.h:50
@ ModBus_WriteRegister
Definition: modbus.h:52
@ ModBus_ReadExceptionStatus
Definition: modbus.h:53
@ ModBus_ReadDiscreteInputs
Definition: modbus.h:48
void(* modbus_flush_queue_ptr)(void)
Definition: modbus.h:85
#define MODBUS_MAX_ADU_SIZE
Definition: modbus.h:28
void(* modbus_set_silence_ptr)(const modbus_silence_timeout_t *timeout)
Definition: modbus.h:86
void modbus_write_u16(uint8_t *p, uint16_t value)
Definition: modbus.c:80
bool(* modbus_send_ptr)(modbus_message_t *msg, const modbus_callbacks_t *callbacks, bool block)
Definition: modbus.h:87
modbus_if_t
Definition: modbus.h:40
@ Modbus_InterfaceASCII
Definition: modbus.h:42
@ Modbus_InterfaceTCP
Definition: modbus.h:43
@ Modbus_InterfaceRTU
Definition: modbus.h:41
bool modbus_isup(void)
Definition: modbus.c:33
bool modbus_register_api(const modbus_api_t *api)
Definition: modbus.c:86
bool modbus_send(modbus_message_t *msg, const modbus_callbacks_t *callbacks, bool block)
Definition: modbus.c:65
void modbus_set_silence(const modbus_silence_timeout_t *timeout)
Definition: modbus.c:59
uint16_t modbus_read_u16(uint8_t *p)
Definition: modbus.c:75
bool modbus_enabled(void)
Definition: modbus.c:45
void modbus_flush_queue(void)
Definition: modbus.c:50
bool(* modbus_is_up_ptr)(void)
Definition: modbus.h:84
modbus_set_silence_ptr set_silence
Definition: modbus.h:93
modbus_flush_queue_ptr flush_queue
Definition: modbus.h:92
modbus_send_ptr send
Definition: modbus.h:94
modbus_if_t interface
Definition: modbus.h:90
modbus_is_up_ptr is_up
Definition: modbus.h:91
uint8_t rx_length
Definition: modbus.h:63
uint8_t tx_length
Definition: modbus.h:62
bool crc_check
Definition: modbus.h:61
void * context
Definition: modbus.h:60
uint16_t b9600
Definition: modbus.h:77
uint16_t b38400
Definition: modbus.h:79
uint16_t b19200
Definition: modbus.h:78
uint16_t b115200
Definition: modbus.h:80
uint16_t b2400
Definition: modbus.h:75
uint16_t b4800
Definition: modbus.h:76