SerialUSB

Aus LaborWiki
Wechseln zu: Navigation, Suche

Code Example for STM32F4xx

To checkout use Subversion:

svn co https://www.das-labor.org/svn/microcontroller/src-stm32f4xx/serialUSB

To build simply type

make

Virtual Com Port

void VCP_send_str(uint8_t* buf)

will sent a string to host
note: too long strings may cause buffer overrun

void VCP_put_char(uint8_t buf)

will sent a single char to host

uint8_t VCP_get_char(uint8_t *buf)

nonblocking:
return 1 on success, 0 otherwise
on success buf contains the read character

uint8_t VCP_get_string(uint8_t *buf)

nonblocking:
return read bytes on success, 0 otherwise
on success buf contains the read characters