USBUS control endpoint module.
More...
USBUS control endpoint module.
USBUS control endpoint module interface
- Author
- Koen Zandberg koen@.nosp@m.berg.nosp@m.zand..nosp@m.net
Definition in file control.h.
Go to the source code of this file.
◆ USBUS_CONTROL_EP_IN_REQUIRED_NUMOF
#define USBUS_CONTROL_EP_IN_REQUIRED_NUMOF 1 |
Number of IN EPs required for the control interface.
Definition at line 27 of file control.h.
◆ USBUS_CONTROL_EP_OUT_REQUIRED_NUMOF
#define USBUS_CONTROL_EP_OUT_REQUIRED_NUMOF 1 |
Number of IN EPs required for the control interface.
Definition at line 32 of file control.h.
◆ usbus_control_get_out_data()
uint8_t * usbus_control_get_out_data |
( |
usbus_t * |
usbus, |
|
|
size_t * |
len |
|
) |
| |
Retrieve the data from the OUT pipe of the control endpoint.
- Precondition
- usbus->state == USBUS_CONTROL_REQUEST_STATE_OUTDATA
- Parameters
-
[in] | usbus | USBUS context |
[out] | len | Length of the data part |
- Returns
- pointer to the data buffer
◆ usbus_control_init()
Initialize the control endpoint handler.
- Parameters
-
[in] | usbus | USBUS context |
[in] | handler | control handler to initialize |
◆ usbus_control_slicer_nextslice()
int usbus_control_slicer_nextslice |
( |
usbus_t * |
usbus | ) |
|
Initialize the next slice of the control message.
- Parameters
-
- Returns
- 1 when there is a next slice
-
0 when the data is fully transferred
◆ usbus_control_slicer_put_bytes()
size_t usbus_control_slicer_put_bytes |
( |
usbus_t * |
usbus, |
|
|
const uint8_t * |
buf, |
|
|
size_t |
len |
|
) |
| |
Helper function for adding bytes to the current control message part.
- Parameters
-
[in] | usbus | USBUS context |
[in] | buf | Buffer to add bytes from |
[in] | len | Length of buf |
- Returns
- Actual number of bytes written
◆ usbus_control_slicer_put_char()
size_t usbus_control_slicer_put_char |
( |
usbus_t * |
usbus, |
|
|
char |
c |
|
) |
| |
Helper function for adding single bytes to the current control message part.
- Parameters
-
[in] | usbus | USBUS context |
[in] | c | byte to add |
- Returns
- Actual number of bytes written
◆ usbus_control_slicer_ready()
void usbus_control_slicer_ready |
( |
usbus_t * |
usbus | ) |
|
Helper function to signal the end of the control message.
- Parameters
-