forked from liyanboy74/modbus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mb-table.h
36 lines (25 loc) · 908 Bytes
/
mb-table.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef _MB_TABLE_H_
#define _MB_TABLE_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "mb.h"
#if(MB_MODE==MB_MODE_SLAVE)
#define TBALE_Discretes_Input_Size 1 // x TABLE_Sel_BitSize
#define TBALE_Coils_Size 1 // x TABLE_Sel_BitSize
#define TBALE_Input_Registers_Size 16
#define TABLE_Holding_Registers_Size 16
#define TABLE_Sel_BitSize 16 // Don't Change
extern uint16_t TBALE_Discretes_Input [];
extern uint16_t TBALE_Coils [];
extern uint16_t TBALE_Input_Registers [];
extern uint16_t TABLE_Holding_Registers[];
void mb_table_write(uint16_t *Table,uint16_t Index,uint16_t Value);
uint16_t mb_table_read(uint16_t *Table,uint16_t Index);
void mb_table_write_bit(uint16_t *TABLE,uint16_t Bit_Index,uint8_t Bit_Value);
uint8_t mb_table_read_bit(uint16_t *TABLE,uint16_t Bit_Index);
#endif
#ifdef __cplusplus
}
#endif
#endif