#include <stdio.h>
#include "compiler.h"
#include "host_cdc_task.h"
#include "usart.h"
#include "conf_usb.h"
#include "board.h"
#include "cdc.h"
#include "usb_drv.h"
#include "usb_host_enum.h"
#include "usb_host_task.h"
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 | |
volatile bool | cdc_connected |
uint8_t | cdc_interface_comm |
volatile bool | cdc_new_device_connected |
uint8_t | cdc_stream_in_array [CDC_STREAM_IN_SIZE] |
uint8_t | cdc_stream_out_array [CDC_STREAM_OUT_SIZE] |
uint8_t | host_rx_cnt |
uint8_t | host_tx_cnt |
uint8_t | pipe_cdc_comm_int |
uint8_t | pipe_cdc_data_bulkin |
uint8_t | pipe_cdc_data_bulkout |
static volatile uint16_t | sof_cnt |
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 c, 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, configTSK_USB_HCDC_PERIOD, 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, i, 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, 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, usart_test_hit(), vTaskDelayUntil(), and xTaskGetTickCount().
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, configTSK_USB_HCDC_NAME, configTSK_USB_HCDC_PRIORITY, configTSK_USB_HCDC_STACK_SIZE, host_cdc_task(), host_rx_cnt, host_tx_cnt, NULL, sof_cnt, and xTaskCreate.
Referenced by main().
uint8_t cdc_interface_comm |
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().
uint8_t host_rx_cnt |
Referenced by host_cdc_task(), and host_cdc_task_init().
uint8_t host_tx_cnt |
Referenced by cdc_pipe_out_usb_flush(), host_cdc_task(), and host_cdc_task_init().
uint8_t pipe_cdc_comm_int |
Referenced by host_cdc_task().
uint8_t pipe_cdc_data_bulkin |
Referenced by cdc_pipe_out_usb_flush(), and host_cdc_task().
uint8_t pipe_cdc_data_bulkout |
Referenced by cdc_pipe_out_usb_flush(), and host_cdc_task().
|
static |
Referenced by host_cdc_task(), host_cdc_task_init(), and host_sof_action().