Swadge 2024 2.0.0
APIs to develop games for the Magfest Swadge
Loading...
Searching...
No Matches
advanced_usb_control.c File Reference

Macros

#define ULOG(x...)
 
#define AUPB_SIZE   4096
 

Functions

int handle_advanced_usb_control_get (uint8_t *data, int reqLen)
 Accept a "get" feature report command from a USB host and write back whatever is needed to send back.
 
int advanced_usb_write_log_printf (const char *fmt, va_list args)
 vaprintf stand-in for USB logging.
 
int uprintf (const char *fmt,...)
 vaprintf stand-in for USB logging.
 
int handle_advanced_usb_terminal_get (uint8_t *data, int reqLen)
 USB request to get text in buffer.
 
void IRAM_ATTR handle_advanced_usb_control_set (const uint8_t *data, int datalen)
 Accept a "send" feature report command from a USB host and interpret it. executing whatever needs to be executed.
 

Macro Definition Documentation

◆ ULOG

#define ULOG ( x...)

◆ AUPB_SIZE

#define AUPB_SIZE   4096

Function Documentation

◆ handle_advanced_usb_control_get()

int handle_advanced_usb_control_get ( uint8_t * data,
int reqLen )

Accept a "get" feature report command from a USB host and write back whatever is needed to send back.

Parameters
reqLenNumber of bytes host is requesting from us.
dataPointer to a feature get request for the command set.
Returns
Number of bytes that will be returned.

◆ advanced_usb_write_log_printf()

int advanced_usb_write_log_printf ( const char * fmt,
va_list args )

vaprintf stand-in for USB logging.

Parameters
fmtvaprintf format
argsvaprintf args
Returns
size Number of characters that were written.

◆ uprintf()

int uprintf ( const char * fmt,
... )

vaprintf stand-in for USB logging.

Parameters
fmtvaprintf format
...vaprintf args
Returns
size Number of characters that were written.

◆ handle_advanced_usb_terminal_get()

int handle_advanced_usb_terminal_get ( uint8_t * data,
int reqLen )

USB request to get text in buffer.

Parameters
reqLenThe number of bytes the host is requesting from us.
dataThe data that we will write back into
Returns
size Number of bytes to be returned to the host.

◆ handle_advanced_usb_control_set()

void IRAM_ATTR handle_advanced_usb_control_set ( const uint8_t * data,
int datalen )

Accept a "send" feature report command from a USB host and interpret it. executing whatever needs to be executed.

Parameters
datalenTotal length of the buffer (command ID included)
dataPointer to full command