Macros | |
#define | CDC_NB_MS_BEFORE_FLUSH 5 |
Data Pipe flush timeout in milli-second. More... | |
#define | CDC_STREAM_IN_SIZE 0x10 |
Size of receive buffer (must be less or equal than pipe size !) More... | |
#define | CDC_STREAM_OUT_SIZE 0x10 |
Size of transmit buffer (must be less or equal than pipe size !) More... | |
#define | CDC_USE_MANAGEMENT_INTERFACE true |
Enable or not the access to Management Element (Interrupt Pipe) More... | |
#define | CDC_USE_UART true |
Enable or not the USART to USB gateway features & functions. More... | |
#define | ENCAPSULATED_PACKET_LENGTH 0x0A |
Set here the length of your encapsulated command (user defined) More... | |
#define | Is_host_cdc_configured() (cdc_connected && !Is_host_suspended()) |
#define | LED_HOST_CDC_B0 LED_MONO0_GREEN |
#define | LED_HOST_CDC_B1 LED_MONO1_GREEN |
#define | LED_HOST_CDC_B2 LED_MONO2_GREEN |
#define | LED_HOST_CDC_B3 LED_MONO3_GREEN |
Functions | |
void | cdc_pipe_out_usb_flush (void) |
cdc_pipe_out_usb_flush More... | |
void | host_cdc_get_encapsulated_response (void) |
This function requests a format-specific packet. More... | |
void | host_cdc_get_line_coding (void) |
This function requests the communication settings from the device. More... | |
void | host_cdc_send_encapsulated_command (void) |
This function sends a format-specific packet. More... | |
void | host_cdc_set_line_coding (void) |
This function set communication settings on the device. More... | |
void | host_cdc_task (void) |
This function manages the host CDC task. More... | |
void | host_cdc_task_init (void) |
This function initializes the host CDC task. More... | |
void | host_sof_action (void) |
host_sof_action More... | |
Variables | |
uint8_t | cdc_stream_in_array [CDC_STREAM_IN_SIZE] |
uint8_t | cdc_stream_out_array [CDC_STREAM_OUT_SIZE] |
volatile bool | ms_connected |
#define CDC_NB_MS_BEFORE_FLUSH 5 |
Data Pipe flush timeout in milli-second.
Referenced by host_cdc_task().
#define CDC_STREAM_IN_SIZE 0x10 |
Size of receive buffer (must be less or equal than pipe size !)
Referenced by host_cdc_task().
#define CDC_STREAM_OUT_SIZE 0x10 |
Size of transmit buffer (must be less or equal than pipe size !)
Referenced by host_cdc_task().
#define CDC_USE_MANAGEMENT_INTERFACE true |
Enable or not the access to Management Element (Interrupt Pipe)
Possible values true or false
#define CDC_USE_UART true |
Enable or not the USART to USB gateway features & functions.
Possible values true or false
#define ENCAPSULATED_PACKET_LENGTH 0x0A |
Set here the length of your encapsulated command (user defined)
Referenced by host_cdc_get_encapsulated_response(), and host_cdc_send_encapsulated_command().
#define Is_host_cdc_configured | ( | ) | (cdc_connected && !Is_host_suspended()) |
Referenced by host_cdc_task().
#define LED_HOST_CDC_B0 LED_MONO0_GREEN |
Referenced by host_cdc_task().
#define LED_HOST_CDC_B1 LED_MONO1_GREEN |
Referenced by host_cdc_task().
#define LED_HOST_CDC_B2 LED_MONO2_GREEN |
#define LED_HOST_CDC_B3 LED_MONO3_GREEN |
void cdc_pipe_out_usb_flush | ( | void | ) |
cdc_pipe_out_usb_flush
This function sends the data stored in the temporary transmit buffer. This function does nothing if there is no data in the buffer.
References cdc_stream_out_array, Host_freeze_pipe, host_send_data(), host_tx_cnt, Host_unfreeze_pipe, pipe_cdc_data_bulkin, pipe_cdc_data_bulkout, and PIPE_GOOD.
Referenced by host_cdc_task().
void host_cdc_get_encapsulated_response | ( | void | ) |
This function requests a format-specific packet.
References S_usb_setup_data::bmRequestType, S_usb_setup_data::bRequest, cdc_interface_comm, data_stage, ENCAPSULATED_PACKET_LENGTH, GET_ENCAPSULATED_COMMAND, host_transfer_control(), S_usb_setup_data::incomplete_read, usb_request, S_usb_setup_data::wIndex, S_usb_setup_data::wLength, and S_usb_setup_data::wValue.
void host_cdc_get_line_coding | ( | void | ) |
This function requests the communication settings from the device.
References S_usb_setup_data::bmRequestType, S_usb_setup_data::bRequest, cdc_interface_comm, data_stage, GET_LINE_CODING, host_transfer_control(), S_usb_setup_data::incomplete_read, usb_request, S_usb_setup_data::wIndex, S_usb_setup_data::wLength, and S_usb_setup_data::wValue.
void host_cdc_send_encapsulated_command | ( | void | ) |
This function sends a format-specific packet.
References S_usb_setup_data::bmRequestType, S_usb_setup_data::bRequest, cdc_interface_comm, data_stage, ENCAPSULATED_PACKET_LENGTH, host_transfer_control(), S_usb_setup_data::incomplete_read, SEND_ENCAPSULATED_COMMAND, usb_request, S_usb_setup_data::wIndex, S_usb_setup_data::wLength, and S_usb_setup_data::wValue.
void host_cdc_set_line_coding | ( | void | ) |
This function set communication settings on the device.
References S_usb_setup_data::bmRequestType, S_usb_setup_data::bRequest, cdc_interface_comm, data_stage, host_transfer_control(), S_usb_setup_data::incomplete_read, SET_LINE_CODING, usb_request, S_usb_setup_data::wIndex, S_usb_setup_data::wLength, and S_usb_setup_data::wValue.
void host_cdc_task | ( | void | ) |
This function manages the host CDC task.
References CDC_COMM_CLASS, CDC_COMM_V25ter_PROTOCOL, cdc_connected, CDC_DATA_CLASS, cdc_interface_comm, CDC_NB_MS_BEFORE_FLUSH, cdc_new_device_connected, cdc_pipe_out_usb_flush(), cdc_stream_in_array, CDC_STREAM_IN_SIZE, cdc_stream_out_array, CDC_STREAM_OUT_SIZE, DBG_USART, Get_class, Get_ep_pipe, Get_nb_supported_interface, Get_protocol, Host_ack_in_received, Host_byte_count, Host_enable_continuous_in_mode, Host_free_in, Host_read_pipe_data, Host_reset_pipe_fifo_access, host_rx_cnt, host_tx_cnt, Host_unfreeze_pipe, Is_ep_in, Is_host_cdc_configured, Is_host_in_received, Is_host_ready, Is_host_stall, LED_HOST_CDC_B0, LED_HOST_CDC_B1, LED_Toggle(), NO_PROTOCOL, pipe_cdc_comm_int, pipe_cdc_data_bulkin, pipe_cdc_data_bulkout, sof_cnt, usart_putchar(), usart_read_char(), usart_reset_status(), USART_SUCCESS, and usart_test_hit().
Referenced by host_cdc_task_init(), and main().
void host_cdc_task_init | ( | void | ) |
This function initializes the host CDC task.
References cdc_connected, cdc_interface_comm, cdc_new_device_connected, host_cdc_task(), host_rx_cnt, host_tx_cnt, and sof_cnt.
Referenced by main().
uint8_t cdc_stream_in_array[CDC_STREAM_IN_SIZE] |
Referenced by host_cdc_task().
uint8_t cdc_stream_out_array[CDC_STREAM_OUT_SIZE] |
Referenced by cdc_pipe_out_usb_flush(), and host_cdc_task().
volatile bool ms_connected |