00001
00002
00011
00012 #ifndef __BOARD_COMMONS_H
00013 #define __BOARD_COMMONS_H
00014
00016
00018 #include <stdio.h>
00019
00020 #include "common_defs.h"
00021 #include "com_phy_layer.h"
00022
00024
00026
00028
00033
00034 typedef struct
00035 {
00036 const char* m_cmd_string;
00037 int m_min_value;
00038 int m_max_value;
00039 } cmd_table;
00040
00041 #define LAST_SEND_CMD_SIZE 256
00042
00044
00050
00051 typedef struct
00052 {
00053 CPL_OBJ* m_p_cpl_object;
00054 const cmd_table* m_p_cmd_table;
00055 char* m_p_last_sent_cmd;
00056 } board_data;
00057
00059
00061
00063
00065
00067
00074
00075 UINT8 ror_bits( UINT8 data, int num_bits);
00076
00078
00084
00085 UINT8 swap_bits( UINT8 data);
00086
00088
00093
00094 void delay(int msec);
00095
00097
00102
00103 UINT32 get_time( );
00104
00106
00107
00108
00110
00112
00123
00124 DLL_API BOOL board_open( board_data* p_data, const CPLConfig *p_com_config, const cmd_table* p_cmd_table);
00125
00127
00136
00137 DLL_API BOOL board_close( board_data* p_data);
00138
00140
00141
00142
00144
00146
00154
00155 DLL_API BOOL send_buffer( board_data* p_data, const UINT8* buff, UINT16 buff_size);
00156
00158
00167
00168 DLL_API BOOL receive_buffer( board_data* p_data, UINT8* buff, UINT16 *buff_size, int timeout_msec);
00169
00171
00172
00173
00175
00177
00185
00186 DLL_API BOOL send_cmd( board_data* p_data, int cmd_index, int cmd_value);
00187
00189
00190
00191
00193
00195
00196
00197
00199
00200 #endif // __BOARD_COMMONS_H