#include "pic_utils.h"
Go to the source code of this file.
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 pic_usb.h.
#define BC8 0 |
Definition at line 73 of file pic_usb.h.
Referenced by usb_cdc_handle_tx(), usb_configure_endpoints(), usb_handle_reset(), usb_handle_transaction(), usb_prime_ep0_out(), usb_send_data(), and usb_send_data_chunk().
#define BC9 1 |
Definition at line 72 of file pic_usb.h.
Referenced by usb_cdc_handle_tx(), usb_configure_endpoints(), usb_handle_reset(), usb_handle_transaction(), usb_prime_ep0_out(), usb_send_data(), and usb_send_data_chunk().
#define BSTALL 2 |
Definition at line 71 of file pic_usb.h.
Referenced by usb_cdc_handle_tx(), usb_configure_endpoints(), usb_handle_reset(), usb_handle_transaction(), usb_prime_ep0_out(), usb_send_data(), usb_send_data_chunk(), and usb_stall_ep0().
#define DTS 6 |
Definition at line 67 of file pic_usb.h.
Referenced by usb_cdc_handle_tx(), usb_configure_endpoints(), usb_handle_reset(), usb_handle_standard_request(), usb_handle_transaction(), usb_prime_ep0_out(), usb_send_data(), usb_send_data_chunk(), usb_send_empty_data_pkt(), and usb_send_one_byte().
#define DTSEN 3 |
Definition at line 70 of file pic_usb.h.
Referenced by usb_cdc_handle_tx(), usb_configure_endpoints(), usb_handle_reset(), usb_handle_transaction(), usb_prime_ep0_out(), usb_send_data(), and usb_send_data_chunk().
#define INCDIS 4 |
Definition at line 69 of file pic_usb.h.
Referenced by usb_cdc_handle_tx(), usb_configure_endpoints(), usb_handle_reset(), usb_handle_transaction(), usb_prime_ep0_out(), usb_send_data(), and usb_send_data_chunk().
#define KEN 5 |
Definition at line 68 of file pic_usb.h.
Referenced by usb_cdc_handle_tx(), usb_configure_endpoints(), usb_handle_reset(), usb_handle_transaction(), usb_prime_ep0_out(), usb_send_data(), and usb_send_data_chunk().
#define pid_ACK 0b00000010 |
#define pid_IN 0b00001001 |
#define pid_OUT 0b00000001 |
#define pid_SETUP 0b00001101 |
#define req_Get_Descriptor 0x06 |
#define req_Get_Interface 0x0a |
#define req_Get_Status 0x00 |
#define req_Set_Address 0x05 |
#define req_Set_Configuration 0x09 |
#define REQUEST_TYPE0 5 |
#define REQUEST_TYPE1 6 |
#define UOWN 7 |
Definition at line 66 of file pic_usb.h.
Referenced by usb_cdc_handle_tx(), usb_configure_endpoints(), usb_handle_reset(), usb_handle_transaction(), usb_prime_ep0_out(), usb_send_data(), usb_send_data_chunk(), and usb_stall_ep0().
#define usb_send_status_ack | ( | ) | usb_send_empty_data_pkt() |
Definition at line 261 of file pic_usb.h.
Referenced by usb_handle_class_request(), usb_handle_ctrl_write_class(), and usb_handle_standard_request().
typedef struct _buffer_descriptor buffer_descriptor |
typedef struct _CDC_ACM_functional_descriptor CDC_ACM_functional_descriptor |
typedef struct _CDC_union_functional_descriptor CDC_union_functional_descriptor |
typedef struct _configuration_descriptor configuration_descriptor |
typedef enum _control_mode_type control_mode_type |
typedef struct _device_descriptor device_descriptor |
typedef enum _direction_type direction_type |
typedef struct _endpoint_descriptor endpoint_descriptor |
typedef struct _hid_descriptor hid_descriptor |
typedef struct _interface_descriptor interface_descriptor |
typedef struct _setup_data_packet setup_data_packet |
typedef enum _usb_state_type usb_state_type |
typedef enum _usb_status_type usb_status_type |
enum _control_mode_type |
enum _direction_type |
enum _usb_state_type |
enum _usb_status_type |
void usb_device_configured_callback | ( | ) |
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().
void usb_ep_data_out_callback | ( | uns8 | end_point, | |
uns8 * | buffer_location, | |||
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().
void usb_get_descriptor_callback | ( | uns8 | descriptor_type, | |
uns8 | descriptor_num, | |||
uns8 ** | rtn_descriptor_ptr, | |||
uns16 * | rtn_descriptor_size | |||
) |
usb_state_type usb_get_state | ( | ) |
void usb_handle_class_request | ( | setup_data_packet | sdp | ) |
Definition at line 70 of file usb_cdc_class.c.
References _setup_data_packet::bRequest, class_data, cm_CTRL_READ_DATA_STAGE_CLASS, cm_CTRL_WRITE_DATA_STAGE_CLASS, cm_CTRL_WRITE_SENDING_STATUS, control_mode, req_GET_IDLE, req_GET_LINE_CODING, req_GET_PROTOCOL, req_GET_REPORT, req_SET_CONTROL_LINE_STATE, req_SET_IDLE, req_SET_LINE_CODING, req_SET_PROTOCOL, req_SET_REPORT, serial_print_int(), serial_print_int_hex(), serial_print_str(), usb_send_data(), usb_send_status_ack, usb_stall_ep0(), and _setup_data_packet::wValue.
Referenced by usb_handle_transaction().
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.
Referenced by usb_handle_transaction().
void usb_handle_ctrl_write_class | ( | uns8 * | data, | |
uns16 | count | |||
) |
Definition at line 98 of file usb_cdc_class.c.
References _long_union::as_byte_array, _setup_data_packet::bRequest, class_data, cm_CTRL_WRITE_SENDING_STATUS, control_mode, _line_coding::data_bits, _line_coding::dte_rate, _line_coding::parity, req_SET_LINE_CODING, serial_print_int(), serial_print_int_hex(), serial_print_str(), _line_coding::stop_bits, usb_sdp, and usb_send_status_ack.
Referenced by usb_handle_transaction().
void usb_send_data | ( | uns8 | ep, | |
uns8 * | data, | |||
uns8 | send_count, | |||
bit | first | |||
) |
Definition at line 183 of file pic_usb.c.
References _buffer_descriptor::addr, BC8, BC9, BSTALL, _buffer_descriptor::count, DTS, DTSEN, ep_in_bd_location, ep_in_buffer_location, INCDIS, KEN, serial_print_str(), serial_putc(), _buffer_descriptor::stat, uns16, uns8, and UOWN.
Referenced by usb_handle_class_request().
void usb_send_empty_data_pkt | ( | ) |
Definition at line 278 of file pic_usb.c.
References bd0in, buffer_0_in, delivery_buffer, delivery_buffer_size, delivery_bytes_max_send, delivery_bytes_sent, delivery_bytes_to_send, delivery_ptr, DTS, _buffer_descriptor::stat, uns8, and usb_send_data_chunk().
void usb_setup | ( | ) |
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().
void usb_stall_ep0 | ( | ) |
Definition at line 175 of file pic_usb.c.
References bd0in, bd0out, BSTALL, _buffer_descriptor::stat, and UOWN.
Referenced by usb_handle_class_request(), and usb_handle_standard_request().
Definition at line 29 of file pic_usb.c.
Referenced by usb_handle_class_request(), usb_handle_ctrl_read_class(), usb_handle_ctrl_write_class(), usb_handle_reset(), usb_handle_standard_request(), usb_handle_transaction(), and usb_send_data_chunk().
uns8 usb_address |
Definition at line 26 of file pic_usb.c.
Referenced by usb_handle_ctrl_read_class(), and usb_handle_ctrl_write_class().