Firmware  0.4.1
Loading...
Searching...
No Matches
intf::usb Namespace Reference

Namespaces

namespace  anonymous_namespace{init.cpp}
 
namespace  anonymous_namespace{rx_task_function.cpp}
 
namespace  anonymous_namespace{tx_task_function.cpp}
 

Classes

struct  RxStreamBuffer
 
struct  TxStreamBuffer
 

Functions

 TASK (rx_task, "intf::usb::rx", 3072uz, 5u, APP_CPU_NUM, 100u)
 
 TASK (tx_task, "intf::usb::tx", 3072uz, 1u, APP_CPU_NUM, 20u)
 
esp_err_t init ()
 Initialize USB.
 
bool any_service_task_active ()
 Check if any USB service task is active.
 
void transmit_ping ()
 Execute ping command.
 
void rx_task_function (void *)
 USB receive task function.
 
void transmit_ok ()
 Transmit "OK\r" to the CDC device queue.
 
void transmit_not_ok ()
 Transmit "NOT OK\r" to the CDC device queue.
 
void tx_task_function (void *)
 USB transmit task function.
 

Variables

bool volatile rts {}
 
constexpr auto vbus_gpio_num {GPIO_NUM_7}
 
constexpr auto buffer_size {512uz}
 
struct intf::usb::RxStreamBuffer rx_stream_buffer
 
struct intf::usb::TxStreamBuffer tx_stream_buffer
 

Function Documentation

◆ any_service_task_active()

bool intf::usb::any_service_task_active ( )
Return values
trueif any service task is active
falseif no service task is active

◆ init()

esp_err_t intf::usb::init ( )

Initialization takes place in init(). This function creates a CDC device on the TinyUSB stack, a receive- and transmit buffer as well as receive- and transmit tasks.

◆ rx_task_function()

void intf::usb::rx_task_function ( void * )

The receive task scans the CDC character stream for commands. Those commands could either be general ones (e.g. PING\r) or protocol entry strings. When a protocol entry string is detected the corrsponding task is created and the receive task destroys itself.

Currently supported protocols are:

◆ TASK() [1/2]

intf::usb::TASK ( rx_task ,
"intf::usb::rx" ,
3072uz ,
5u ,
APP_CPU_NUM ,
100u  )
inline

◆ TASK() [2/2]

intf::usb::TASK ( tx_task ,
"intf::usb::tx" ,
3072uz ,
1u ,
APP_CPU_NUM ,
20u  )
inline

◆ transmit_not_ok()

void intf::usb::transmit_not_ok ( )

◆ transmit_ok()

void intf::usb::transmit_ok ( )

◆ transmit_ping()

void intf::usb::transmit_ping ( )

Transmit device name and semantic version to the CDC device queue.

◆ tx_task_function()

void intf::usb::tx_task_function ( void * )

The transmit task receives data from tx_stream_buffer and transmit it to the CDC device queue.

Variable Documentation

◆ buffer_size

auto intf::usb::buffer_size {512uz}
inlineconstexpr

◆ rts

bool volatile intf::usb::rts {}
inline

◆ rx_stream_buffer

struct intf::usb::RxStreamBuffer intf::usb::rx_stream_buffer

◆ tx_stream_buffer

struct intf::usb::TxStreamBuffer intf::usb::tx_stream_buffer

◆ vbus_gpio_num

auto intf::usb::vbus_gpio_num {GPIO_NUM_7}
inlineconstexpr