-
Notifications
You must be signed in to change notification settings - Fork 9
/
mb-link.h
39 lines (27 loc) · 822 Bytes
/
mb-link.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
37
38
39
#ifndef _MB_LINK_H_
#define _MB_LINK_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
//#define MB_LINK_DEBUG
#define MB_LINK_Rx_Buffer_Size 32
#define MB_LINK_Tx_Buffer_Size 32
#define MB_LINK_Rx_MDBL (MB_LINK_Rx_Buffer_Size-9)
typedef enum{
MB_LINK_OK,
MB_LINK_ERROR_Address,
MB_LINK_ERROR_Data_Size,
MB_LINK_ERROR_CRC,
MB_LINK_ERROR_FUNC
}mb_link_error_e;
void mb_link_check_new_data(uint8_t oneByte);
void mb_link_send(uint8_t *Data,uint8_t Len);
void mb_link_reset_rx_buffer(void);
void mb_link_prepare_tx_data(mb_packet_s Packet);
mb_packet_s mb_rx_packet_split(uint8_t *Packet_Buffer,mb_packet_type_e Packet_Type);
mb_packet_type_e mb_get_packet_type(mb_functions_e Func);
#ifdef __cplusplus
}
#endif
#endif