tinyusb  0.4
Click here to lend your support to tinyusb donation and make a donation at pledgie.com
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Application - Stack API

Non-Class driver API. More...

Functions

void tusb_isr (uint8_t coreid)
 USB interrupt handler. More...
 
tusb_error_t tusb_init (void)
 Initialize the usb stack. More...
 
void tusb_task_runner (void)
 Run all tinyusb's internal tasks (e.g host task, device task). More...
 

Detailed Description

Non-Class driver API.

Function Documentation

tusb_error_t tusb_init ( void  )

Initialize the usb stack.

Returns
Error Code of the TUSB_ERROR enum
Note
Function will initialize the stack according to configuration in the configure file (tusb_config.h)

Definition at line 43 of file tusb.c.

void tusb_isr ( uint8_t  coreid)

USB interrupt handler.

Parameters
[in]coreidController ID where the interrupt happened
Note
This function must be called by HAL layer or Application for the stack to manage USB events/transfers.

Definition at line 71 of file tusb.c.

void tusb_task_runner ( void  )

Run all tinyusb's internal tasks (e.g host task, device task).

Note
This function is only required when using no RTOS (TUSB_CFG_OS == TUSB_OS_NONE). All the stack functions & callback are invoked within this function, so it should be called periodically within the mainloop
int main(void)
{
your_init_code();
while(1) // the mainloop
{
your_application_code();
tusb_task_runner(); // handle tinyusb event, task etc ...
}
}

Definition at line 84 of file tusb.c.