usb_cdc_class.c File Reference

Pic CDC USB routines. More...

#include "config.h"
#include "pic_usb.h"
#include "pic_usb_buffer_mgt.h"
#include "pic_serial.h"
#include "usb_cdc_class.h"
#include "memory.h"

Include dependency graph for usb_cdc_class.c:

Go to the source code of this file.

Data Structures

struct  _line_coding
union  _long_union

Defines

#define req_CLEAR_COMM_FEATURE   0x04
#define req_GET_COMM_FEATURE   0x03
#define req_GET_ENCAPSULATED_RESPONSE   0x01
#define req_GET_LINE_CODING   0x21
#define req_SEND_BREAK   0x23
#define req_SEND_ENCAPSULATED_COMMAND   0x00
#define req_SET_COMM_FEATURE   0x02
#define req_SET_CONTROL_LINE_STATE   0x22
#define req_SET_LINE_CODING   0x20

Typedefs

typedef struct _line_coding line_coding
typedef union _long_union long_union

Functions

void usb_cdc_handle_tx ()
void usb_cdc_print_str (char *str)
void usb_cdc_putc (uns8 c)
uns8 usb_cdc_rx_avail ()
void usb_cdc_setup ()
uns8 usb_cdc_tx_empty ()
void usb_ep_data_in_callback (uns8 end_point, uns16 byte_count)
void usb_ep_data_out_callback (uns8 end_point, uns8 *buffer, uns16 byte_count)
void usb_handle_class_request (setup_data_packet sdp)
void usb_handle_ctrl_read_class ()
void usb_handle_ctrl_write_class (uns8 *data, uns16 count)
void usb_SOF_callback (uns16 frame)

Variables

uns8 cdc_rx_buffer [CDC_RX_BUFFER_SIZE]
uns8 cdc_rx_end = 0
uns8 cdc_rx_start = 0
uns8 cdc_tx_buffer [CDC_TX_BUFFER_SIZE]
uns8 cdc_tx_end = 0
uns8 cdc_tx_start = 0
uns8 class_data [8]


Detailed Description

Communication Device Class USB routines

Ian Harris 2008 imharris [at] gmail.com

Released under the "do whatever you like with this but if it breaks, you get to keep both pieces" license

Definition in file usb_cdc_class.c.


Define Documentation

#define req_CLEAR_COMM_FEATURE   0x04

Definition at line 34 of file usb_cdc_class.c.

#define req_GET_COMM_FEATURE   0x03

Definition at line 33 of file usb_cdc_class.c.

#define req_GET_ENCAPSULATED_RESPONSE   0x01

Definition at line 31 of file usb_cdc_class.c.

#define req_GET_LINE_CODING   0x21

Definition at line 36 of file usb_cdc_class.c.

Referenced by usb_handle_class_request(), and usb_handle_ctrl_read_class().

#define req_SEND_BREAK   0x23

Definition at line 38 of file usb_cdc_class.c.

#define req_SEND_ENCAPSULATED_COMMAND   0x00

Definition at line 30 of file usb_cdc_class.c.

#define req_SET_COMM_FEATURE   0x02

Definition at line 32 of file usb_cdc_class.c.

#define req_SET_CONTROL_LINE_STATE   0x22

Definition at line 37 of file usb_cdc_class.c.

Referenced by usb_handle_class_request().

#define req_SET_LINE_CODING   0x20

Definition at line 35 of file usb_cdc_class.c.

Referenced by usb_handle_class_request(), and usb_handle_ctrl_write_class().


Typedef Documentation

typedef struct _line_coding line_coding

typedef union _long_union long_union


Function Documentation

void usb_cdc_handle_tx (  ) 

void usb_cdc_print_str ( char *  str  ) 

Definition at line 250 of file usb_cdc_class.c.

References uns8, and usb_cdc_putc().

Here is the call graph for this function:

void usb_cdc_putc ( uns8  c  ) 

Definition at line 169 of file usb_cdc_class.c.

References cdc_tx_buffer, cdc_tx_end, cdc_tx_start, kill_interrupts, and uns8.

Referenced by usb_cdc_print_str().

Here is the caller graph for this function:

uns8 usb_cdc_rx_avail (  ) 

Definition at line 247 of file usb_cdc_class.c.

References cdc_rx_end, and cdc_rx_start.

void usb_cdc_setup (  ) 

uns8 usb_cdc_tx_empty (  ) 

Definition at line 248 of file usb_cdc_class.c.

References cdc_tx_end, and cdc_tx_start.

void usb_ep_data_in_callback ( uns8  end_point,
uns16  byte_count 
)

Definition at line 162 of file usb_cdc_class.c.

References usb_cdc_handle_tx().

Referenced by usb_handle_transaction().

Here is the call graph for this function:

Here is the caller graph for this function:

void usb_ep_data_out_callback ( uns8  end_point,
uns8 *  buffer,
uns16  byte_count 
)

Definition at line 138 of file usb_cdc_class.c.

References cdc_rx_buffer, cdc_rx_end, cdc_rx_start, serial_print_int(), serial_print_str(), and uns8.

Referenced by usb_handle_transaction().

Here is the call graph for this function:

Here is the caller graph for this function:

void usb_handle_class_request ( setup_data_packet  sdp  ) 

void usb_handle_ctrl_read_class (  ) 

Definition at line 125 of file usb_cdc_class.c.

References _setup_data_packet::bRequest, cm_CTRL_READ_AWAITING_STATUS, control_mode, req_GET_LINE_CODING, serial_print_int(), serial_print_str(), and usb_sdp.

Here is the call graph for this function:

void usb_handle_ctrl_write_class ( uns8 *  data,
uns16  count 
)

void usb_SOF_callback ( uns16  frame  ) 

Definition at line 269 of file usb_cdc_class.c.

References usb_cdc_handle_tx().

Referenced by usb_handle_isr().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

uns8 cdc_rx_buffer[CDC_RX_BUFFER_SIZE]

Receive fifo

Definition at line 61 of file usb_cdc_class.c.

Referenced by usb_ep_data_out_callback().

uns8 cdc_rx_end = 0

Receive fifo end point

Definition at line 65 of file usb_cdc_class.c.

Referenced by usb_cdc_rx_avail(), and usb_ep_data_out_callback().

uns8 cdc_rx_start = 0

Receive fifo start point

Definition at line 63 of file usb_cdc_class.c.

Referenced by usb_cdc_rx_avail(), and usb_ep_data_out_callback().

uns8 cdc_tx_buffer[CDC_TX_BUFFER_SIZE]

Transmit fifo

Definition at line 54 of file usb_cdc_class.c.

Referenced by usb_cdc_handle_tx(), and usb_cdc_putc().

uns8 cdc_tx_end = 0

Transmit fifo end point

Definition at line 58 of file usb_cdc_class.c.

Referenced by usb_cdc_handle_tx(), usb_cdc_putc(), and usb_cdc_tx_empty().

uns8 cdc_tx_start = 0

Transmit fifo start point

Definition at line 56 of file usb_cdc_class.c.

Referenced by usb_cdc_handle_tx(), usb_cdc_putc(), and usb_cdc_tx_empty().

uns8 class_data[8]


Generated on Tue Jul 22 09:32:59 2008 for Pic Pack by  doxygen 1.5.5