#include <assert.h>
#include <mempool.h>
#include <physmem.h>
#include <util.h>
#include <usb/request.h>
#include <app/config_usb.h>

Go to the source code of this file.
Functions | |
| void | usb_req_init (struct usb_request *req) |
| Initialize a USB request. | |
| struct usb_request * | usb_req_alloc (void) |
| Allocate and initialize a USB request structure. | |
| void | usb_req_free (struct usb_request *req) |
| Free a USB request structure. | |
| struct usb_request * | usb_req_alloc_single_tx (const void *data, size_t len) |
| Allocate a USB request and initialize with a single buffer for transmission. | |
| struct usb_request * | usb_req_alloc_single_rx (void *data, size_t len) |
| Allocate a USB request and initialize with a single buffer for reception. | |
| void | usb_req_free_all (struct usb_request *req) |
| Free a USB request and all associated buffers. | |
| void | usb_init (void) |
| Initialize the USB core subsystem. | |
This file contains hardware-independent USB utility functions.
Definition in file usb_lib.c.
| void usb_init | ( | void | ) |
Initialize the USB core subsystem.
This function will initialize the USB buffer pool.
Definition at line 179 of file usb_lib.c.
References CONFIG_USB_NR_REQUESTS, cpu_sram_pool, and mem_pool_init_physmem().

| struct usb_request* usb_req_alloc | ( | void | ) | [read] |
Allocate and initialize a USB request structure.
Definition at line 75 of file usb_lib.c.
References mem_pool_alloc(), and usb_req_init().
Referenced by msc_submit_write_data_req(), usb_req_alloc_single_rx(), and usb_req_alloc_single_tx().

| struct usb_request* usb_req_alloc_single_rx | ( | void * | data, | |
| size_t | len | |||
| ) | [read] |
Allocate a USB request and initialize with a single buffer for reception.
| data | Data area for the buffer | |
| len | Length of the data area in bytes |
Definition at line 137 of file usb_lib.c.
References buffer_init_rx(), usb_req_add_buffer(), and usb_req_alloc().

| struct usb_request* usb_req_alloc_single_tx | ( | const void * | data, | |
| size_t | len | |||
| ) | [read] |
Allocate a USB request and initialize with a single buffer for transmission.
| data | Data area for the buffer | |
| len | Length of the data area in bytes |
Definition at line 107 of file usb_lib.c.
References buffer_init_tx(), usb_req_add_buffer(), and usb_req_alloc().

| void usb_req_free | ( | struct usb_request * | req | ) |
Free a USB request structure.
| req | The request to be released back to the pool. |
Definition at line 91 of file usb_lib.c.
References mem_pool_free().
Referenced by msc_submit_write_data_req(), and usb_req_free_all().

| void usb_req_free_all | ( | struct usb_request * | req | ) |
Free a USB request and all associated buffers.
| req | The request to be freed |
Definition at line 162 of file usb_lib.c.
References dbg_printf, usb_req_for_each_buffer_safe, and usb_req_free().

| void usb_req_init | ( | struct usb_request * | req | ) |
Initialize a USB request.
This initializes a USB request and makes sure that it doesn't have any special flags set, and that it doesn't have any other buffers associated with it.
| req | The USB request to be initialized. |
Definition at line 62 of file usb_lib.c.
References usb_request::buf_list, usb_request::bytes_xfered, usb_request::flags, and slist_init().
Referenced by usb_func_get_descriptor(), and usb_req_alloc().

1.5.8