Functions | |
void | host_disable_all_pipes (void) |
------------—— HOST ---------------------------——More... | |
U32 | host_read_p_rxpacket (U8 p, void *rxbuf, U32 data_length, void **prxbuf) |
host_read_p_rxpacket More... | |
U32 | host_set_p_txpacket (U8 p, U8 txbyte, U32 data_length) |
host_set_p_txpacket More... | |
U32 | host_write_p_txpacket (U8 p, const void *txbuf, U32 data_length, const void **ptxbuf) |
host_write_p_txpacket More... | |
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... | |
void host_disable_all_pipes | ( | void | ) |
host_disable_all_pipes
This function disables all pipes for the host controller. Useful to execute upon disconnection.
References cpu_irq_disable, cpu_irq_enable, cpu_irq_is_enabled, Host_disable_pipe, Host_disable_pipe_interrupt, Host_reset_pipe, Host_unallocate_memory, Is_host_pipe_enabled, and MAX_PEP_NB.
Referenced by usb_general_interrupt_non_naked(), and usb_host_task().
host_read_p_rxpacket
This function reads the selected pipe FIFO to the buffer pointed to by rxbuf, using as few accesses as possible.
p | Number of the addressed pipe |
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, Host_byte_count, min, Test_align, UnionPtr::u16ptr, UnionCPtr::u16ptr, UnionCVPtr::u16ptr, UnionPtr::u32ptr, UnionCPtr::u32ptr, UnionCVPtr::u32ptr, UnionPtr::u64ptr, UnionCPtr::u64ptr, UnionCVPtr::u64ptr, UnionPtr::u8ptr, UnionVPtr::u8ptr, UnionCPtr::u8ptr, and UnionCVPtr::u8ptr.
Referenced by host_get_data(), and host_transfer_control().
host_set_p_txpacket
This function fills the selected pipe FIFO with a constant byte, using as few accesses as possible.
p | Number of the addressed pipe |
txbyte | Byte to fill the pipe with |
data_length | Number of bytes to write |
References Align_down, Host_byte_count, Host_get_pipe_size, 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, and UnionCVPtr::u8ptr.
host_write_p_txpacket
This function writes the buffer pointed to by txbuf to the selected pipe FIFO, using as few accesses as possible.
p | Number of the addressed pipe |
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, Host_byte_count, Host_get_pipe_size, min, Test_align, UnionVPtr::u16ptr, UnionCPtr::u16ptr, UnionVPtr::u32ptr, UnionCPtr::u32ptr, UnionVPtr::u64ptr, UnionCPtr::u64ptr, UnionVPtr::u8ptr, and UnionCPtr::u8ptr.
Referenced by host_send_data(), and host_transfer_control().
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_non_naked(), 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, 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.
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, 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 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.