Data Structures | |
struct | hid_frames |
Macros | |
#define | ACK_MESSAGE 0x40 |
#define | MAX_RX_PACKET_NUMBER 15 |
#define | MAX_TX_PACKET_NUMBER 15 |
#define | MESSAGE_ERROR -1 |
#define | MESSAGE_PENDING 1 |
#define | MESSAGE_READY 2 |
#define | NACK_MESSAGE 0x80 |
#define | NOMRAL_MESSAGE 0X00 |
#define | PAYLOAD_SIZE 60 |
#define | PROTOCOL_ID 0x01 |
#define | SPARE_MESSAGE 0xC0 |
Typedefs | |
typedef struct hid_frames | hid_frames |
Functions | |
int | get_message (struct hid_frames frame) |
This function get a messages from USB and rebuild it in a single. More... | |
void | send_message (char *message, unsigned int size) |
This function split message received from USART to USB frame messages. More... | |
Variables | |
struct hid_frames | hid_rx_frame [MAX_TX_PACKET_NUMBER] |
struct hid_frames | hid_tx_frame [MAX_RX_PACKET_NUMBER] |
unsigned int | rx_index |
char | serial_rx_frame [MAX_TX_PACKET_NUMBER *PAYLOAD_SIZE] |
char | serial_tx_frame [MAX_TX_PACKET_NUMBER *PAYLOAD_SIZE] |
unsigned int | tx_index |
#define ACK_MESSAGE 0x40 |
Referenced by hid_report_in().
#define MAX_RX_PACKET_NUMBER 15 |
#define MAX_TX_PACKET_NUMBER 15 |
Referenced by send_message().
#define MESSAGE_ERROR -1 |
Referenced by get_message().
#define MESSAGE_PENDING 1 |
Referenced by get_message().
#define MESSAGE_READY 2 |
Referenced by get_message(), and hid_report_out().
#define NACK_MESSAGE 0x80 |
Referenced by hid_report_in().
#define NOMRAL_MESSAGE 0X00 |
#define PAYLOAD_SIZE 60 |
Referenced by device_generic_hid_task_init(), get_message(), and send_message().
#define PROTOCOL_ID 0x01 |
Referenced by device_generic_hid_task_init(), get_message(), and send_message().
#define SPARE_MESSAGE 0xC0 |
typedef struct hid_frames hid_frames |
int get_message | ( | struct hid_frames | frame | ) |
This function get a messages from USB and rebuild it in a single.
References hid_tx_frame, MESSAGE_ERROR, MESSAGE_PENDING, MESSAGE_READY, hid_frames::packetCount, hid_frames::packetNumber, hid_frames::payload, PAYLOAD_SIZE, PROTOCOL_ID, hid_frames::protocol_id, serial_tx_frame, and tx_index.
Referenced by hid_report_out().
void send_message | ( | char * | message, |
unsigned int | size | ||
) |
This function split message received from USART to USB frame messages.
References hid_rx_frame, MAX_TX_PACKET_NUMBER, hid_frames::packetCount, hid_frames::packetNumber, hid_frames::payload, PAYLOAD_SIZE, PROTOCOL_ID, hid_frames::protocol_id, hid_frames::spare_byte1, and hid_frames::spare_byte2.
Referenced by fill_tx_buffer().
struct hid_frames hid_rx_frame[MAX_TX_PACKET_NUMBER] |
Referenced by hid_report_in(), and send_message().
struct hid_frames hid_tx_frame[MAX_RX_PACKET_NUMBER] |
Referenced by get_message().
unsigned int rx_index |
char serial_rx_frame[MAX_TX_PACKET_NUMBER *PAYLOAD_SIZE] |
Referenced by fill_tx_buffer().
char serial_tx_frame[MAX_TX_PACKET_NUMBER *PAYLOAD_SIZE] |
Referenced by device_generic_hid_task_init(), get_message(), and hid_report_out().
unsigned int tx_index |
Referenced by get_message().