APIs relating specifically to management of endpoint zero.
◆ cyhal_usb_dev_ep0_get_max_packet()
Get wMaxPacketSize of endpoint 0.
The endpoint 0 has dedicated buffer.
- Parameters
-
[in,out] | obj | The USB device object |
- Returns
- The size allocated for endpoint 0
◆ cyhal_usb_dev_ep0_setup_read_result()
void cyhal_usb_dev_ep0_setup_read_result |
( |
cyhal_usb_dev_t * |
obj, |
|
|
uint8_t * |
buffer, |
|
|
uint32_t |
size |
|
) |
| |
Read the contents of the SETUP packet.
- Parameters
-
[in,out] | obj | The USB device object |
[in] | buffer | Buffer to fill with data |
[in] | size | Size of buffer passed in |
◆ cyhal_usb_dev_ep0_read()
void cyhal_usb_dev_ep0_read |
( |
cyhal_usb_dev_t * |
obj, |
|
|
uint8_t * |
buffer, |
|
|
uint32_t |
size |
|
) |
| |
Start receiving a packet of up to wMaxPacketSize on endpoint 0.
- Parameters
-
[in,out] | obj | The USB device object |
[in] | buffer | Buffer to fill with the data read |
[in] | size | Size of buffer |
◆ cyhal_usb_dev_ep0_read_result()
Read the contents of a received packet.
- Parameters
-
[in,out] | obj | The USB device object |
- Returns
- Actual number of bytes that was read
◆ cyhal_usb_dev_ep0_write()
uint32_t cyhal_usb_dev_ep0_write |
( |
cyhal_usb_dev_t * |
obj, |
|
|
uint8_t * |
buffer, |
|
|
uint32_t |
size |
|
) |
| |
Write a packet on endpoint 0.
- Parameters
-
[in,out] | obj | The USB device object |
[in] | buffer | Buffer fill with data to send |
[in] | size | Size of data to send |
- Returns
- The number of bytes that were written.
◆ cyhal_usb_dev_ep0_stall()
Protocol stall on endpoint 0.
Stall all IN and OUT packets on endpoint 0 until a SETUP packet is received.
- Parameters
-
[in,out] | obj | The USB device object |
- Note
- The stall is cleared automatically when a setup packet is received