Functions | |
Status_bool_t | usb_init_device (void) |
------------—— DEVICE -------------------------——More... | |
U32 | usb_read_ep_rxpacket (U8 ep, void *rxbuf, U32 data_length, void **prxbuf) |
usb_read_ep_rxpacket More... | |
U32 | usb_set_ep_txpacket (U8 ep, U8 txbyte, U32 data_length) |
usb_set_ep_txpacket More... | |
U32 | usb_write_ep_txpacket (U8 ep, const void *txbuf, U32 data_length, const void **ptxbuf) |
usb_write_ep_txpacket More... | |
Variables | |
UnionVPtr | pep_fifo [MAX_PEP_NB] |
Pointers to the FIFO data registers of pipes/endpoints Use aggregated pointers to have several alignments available for a same address. More... | |
Status_bool_t usb_init_device | ( | void | ) |
usb_init_device
This function initializes the USB device controller and configures the Default Control Endpoint.
References DIRECTION_OUT, EP_CONTROL, EP_CONTROL_LENGTH, Is_usb_endpoint_enabled, Is_usb_id_device, SINGLE_BANK, TYPE_CONTROL, and Usb_configure_endpoint.
Referenced by usb_general_interrupt(), and usb_start_device().
usb_read_ep_rxpacket
This function reads the selected endpoint FIFO to the buffer pointed to by rxbuf, using as few accesses as possible.
ep | Number of the addressed endpoint |
rxbuf | Address of buffer to write |
data_length | Number of bytes to read |
prxbuf | NULL or pointer to the buffer address to update |
References Align_down, Get_align, min, rxbuf, Test_align, UnionPtr::u16ptr, UnionCVPtr::u16ptr, StructCPtr::u16ptr, UnionPtr::u32ptr, UnionCVPtr::u32ptr, StructCPtr::u32ptr, UnionPtr::u64ptr, UnionCVPtr::u64ptr, StructCPtr::u64ptr, UnionPtr::u8ptr, UnionVPtr::u8ptr, UnionCVPtr::u8ptr, StructCPtr::u8ptr, and Usb_byte_count.
Referenced by hid_report_out().
usb_set_ep_txpacket
This function fills the selected endpoint FIFO with a constant byte, using as few accesses as possible.
ep | Number of the addressed endpoint |
txbyte | Byte to fill the endpoint with |
data_length | Number of bytes to write |
References Align_down, min, Test_align, Union64::u16, UnionVPtr::u16ptr, UnionCVPtr::u16ptr, Union64::u32, UnionVPtr::u32ptr, UnionCVPtr::u32ptr, Union64::u64, UnionVPtr::u64ptr, UnionCVPtr::u64ptr, u8, Union64::u8, UnionVPtr::u8ptr, UnionCVPtr::u8ptr, Usb_byte_count, and Usb_get_endpoint_size.
usb_write_ep_txpacket
This function writes the buffer pointed to by txbuf to the selected endpoint FIFO, using as few accesses as possible.
ep | Number of the addressed endpoint |
txbuf | Address of buffer to read |
data_length | Number of bytes to write |
ptxbuf | NULL or pointer to the buffer address to update |
References Align_down, Get_align, min, Test_align, txbuf, UnionVPtr::u16ptr, UnionCPtr::u16ptr, UnionVPtr::u32ptr, UnionCPtr::u32ptr, UnionVPtr::u64ptr, UnionCPtr::u64ptr, UnionVPtr::u8ptr, UnionCPtr::u8ptr, Usb_byte_count, and Usb_get_endpoint_size.
Referenced by hid_get_descriptor(), hid_report_in(), usb_get_descriptor(), and usb_set_feature().
UnionVPtr pep_fifo[MAX_PEP_NB] |
Pointers to the FIFO data registers of pipes/endpoints Use aggregated pointers to have several alignments available for a same address.