#include <stdio.h>
#include "common_defs.h"
#include "com_phy_layer.h"
Go to the source code of this file.
Data Structures | |
| struct | cmd_table |
| Board commands table entry. More... | |
| struct | board_data |
| Data common to every board. More... | |
Functions | |
| UINT8 | ror_bits (UINT8 data, int num_bits) |
| Perfoms a num_bits bitwise right rotation of data byte. | |
| UINT8 | swap_bits (UINT8 data) |
| Swaps the bits of the source byte. | |
| void | delay (int msec) |
| Waits for specified time. | |
| UINT32 | get_time () |
| Gets the time in milliseconds since first procedure call. | |
| DLL_API BOOL | board_open (board_data *p_data, const CPLConfig *p_com_config, const cmd_table *p_cmd_table) |
| Basic board open. | |
| DLL_API BOOL | board_close (board_data *p_data) |
| Basic board close. | |
| DLL_API BOOL | send_buffer (board_data *p_data, const UINT8 *buff, UINT16 buff_size) |
| Sends a data buffer to board. | |
| DLL_API BOOL | receive_buffer (board_data *p_data, UINT8 *buff, UINT16 *buff_size, int timeout_msec) |
| Read up to *buff_size BYTEs from board. | |
| DLL_API BOOL | send_cmd (board_data *p_data, int cmd_index, int cmd_value) |
| Sends a command to the board. | |
Definition in file board_commons.h.
| DLL_API BOOL board_close | ( | board_data * | p_data | ) |
Basic board close.
Provides basic handling for board closing, common to all the boards. It tries to close the communication channel, too.
| p_data | Pointer to board data |
Definition at line 217 of file board_commons.c.
References FALSE, board_data::m_p_cpl_object, board_data::m_p_last_sent_cmd, and TRUE.
Referenced by N1568_close().
| DLL_API BOOL board_open | ( | board_data * | p_data, | |
| const CPLConfig * | p_com_config, | |||
| const cmd_table * | p_cmd_table | |||
| ) |
Basic board open.
Provides basic handling for board opening, common to all the boards. It tries to open the communication channel, too.
| p_data | Pointer to board data | |
| p_com_config | The communication physical layer device settings | |
| p_cmd_table | The board specific command table pointer |
Definition at line 190 of file board_commons.c.
References FALSE, board_data::m_p_cmd_table, board_data::m_p_cpl_object, board_data::m_p_last_sent_cmd, and TRUE.
Referenced by N1568_open().
| void delay | ( | int | msec | ) |
Waits for specified time.
| msec | The time delay to wait (msec) |
Definition at line 74 of file board_commons.c.
| UINT32 get_time | ( | ) |
Gets the time in milliseconds since first procedure call.
Definition at line 88 of file board_commons.c.
| DLL_API BOOL receive_buffer | ( | board_data * | p_data, | |
| UINT8 * | buff, | |||
| UINT16 * | buff_size, | |||
| int | timeout_msec | |||
| ) |
Read up to *buff_size BYTEs from board.
| p_data | Pointer to board data | |
| buff | The user allocated buffer | |
| buff_size | The user allocated buffer size (on enter) and the number of BYTEs read (on exit) | |
| timeout_msec | The timeout between bytes receive (msec) |
Definition at line 263 of file board_commons.c.
References FALSE, board_data::m_p_cpl_object, and TRUE.
Referenced by N1568_export(), N1568_send_cmd(), and N1568_set_module().
| UINT8 ror_bits | ( | UINT8 | data, | |
| int | num_bits | |||
| ) |
Perfoms a num_bits bitwise right rotation of data byte.
| data | The source byte to rotate | |
| num_bits | The number of bits to rotate |
Definition at line 48 of file board_commons.c.
| DLL_API BOOL send_buffer | ( | board_data * | p_data, | |
| const UINT8 * | buff, | |||
| UINT16 | buff_size | |||
| ) |
Sends a data buffer to board.
| p_data | Pointer to board data | |
| buff | The data buffer to send | |
| buff_size | The data buffer size (BYTEs) |
Definition at line 243 of file board_commons.c.
References FALSE, board_data::m_p_cpl_object, and TRUE.
Referenced by send_cmd().
| DLL_API BOOL send_cmd | ( | board_data * | p_data, | |
| int | cmd_index, | |||
| int | cmd_value | |||
| ) |
Sends a command to the board.
| p_data | Pointer to board data | |
| cmd_index | The index of the command (as from the board specific COMMANDS enumerator) | |
| cmd_value | The value of the command |
Definition at line 305 of file board_commons.c.
References FALSE, cmd_table::m_cmd_string, cmd_table::m_max_value, board_data::m_p_cmd_table, board_data::m_p_last_sent_cmd, and send_buffer().
Referenced by N1568_export(), N1568_send_cmd(), and N1568_set_module().
| UINT8 swap_bits | ( | UINT8 | data | ) |
Swaps the bits of the source byte.
| data | The source byte to swap |
Definition at line 60 of file board_commons.c.
1.5.6