Allocate a memory area to use for data transfers
#include <sys/usbdi.h> void *usbd_alloc( size_t size );
libusbdi
The usbd_alloc() function allocates a memory area that can then be used for data transfers. You should use the memory area allocated by this function, because it's allocated efficiently and because its physical address is quickly obtained via usbd_mphys().
To free the memory, use usbd_free().
A pointer to the start of the allocated memory, or NULL if there's not enough memory.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | No |
Thread | Yes |