Microchip® Advanced Software Framework

host_cdc_task.h File Reference
#include "conf_usb.h"
#include "usb_host_task.h"

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 *pvParameters)
 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 !)

Note
: Irrelevant when CDC_USE_UART is false.

Referenced by host_cdc_task().

#define CDC_STREAM_OUT_SIZE   0x10

Size of transmit buffer (must be less or equal than pipe size !)

Note
: Irrelevant when CDC_USE_UART is false.

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  )
void host_cdc_get_line_coding ( void  )
void host_cdc_task_init ( void  )

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]
volatile bool ms_connected