|
Last change
on this file was
83,
checked in by Zed, 9 months ago
|
|
Modbus Master and Slave Hardware were tested.
|
|
File size:
765 bytes
|
| Line | |
|---|
| 1 | #ifndef __COMMON_H_ |
|---|
| 2 | #define __COMMON_H_ |
|---|
| 3 | |
|---|
| 4 | #include <stdint.h> |
|---|
| 5 | |
|---|
| 6 | typedef union bword |
|---|
| 7 | { |
|---|
| 8 | uint16_t w; |
|---|
| 9 | int16_t sw; |
|---|
| 10 | uint8_t lb; |
|---|
| 11 | int8_t slb; |
|---|
| 12 | uint8_t b[2]; |
|---|
| 13 | int8_t sb[2]; |
|---|
| 14 | } bword_t; |
|---|
| 15 | |
|---|
| 16 | typedef enum mb_error_codes_enum |
|---|
| 17 | { |
|---|
| 18 | MB_ERROR_NOTHING = 0, |
|---|
| 19 | MB_ERROR_TIMEOUT = 1, |
|---|
| 20 | MB_ERROR_CRC = 2, |
|---|
| 21 | MB_ERROR_SLAVE_ADRESS = 3, |
|---|
| 22 | MB_ERROR_FUNCTION_CODE = 4, |
|---|
| 23 | MB_ERROR_BYTE_COUNT = 5, |
|---|
| 24 | MB_ERROR_START_ADRESS = 6, |
|---|
| 25 | MB_ERROR_UART_PE = 7, //Parity |
|---|
| 26 | MB_ERROR_UART_NE = 8, //Noise |
|---|
| 27 | MB_ERROR_UART_FE = 9, //Frame |
|---|
| 28 | MB_ERROR_UART_ORE = 10, //Overrun |
|---|
| 29 | } |
|---|
| 30 | mb_error_codes_t; |
|---|
| 31 | |
|---|
| 32 | #endif // __COMMON_H_ |
|---|
Note: See
TracBrowser
for help on using the repository browser.