SerialUSB: Unterschied zwischen den Versionen
Siro (Diskussion | Beiträge) KKeine Bearbeitungszusammenfassung |
(svn -> github) |
||
(Eine dazwischenliegende Version von einem anderen Benutzer wird nicht angezeigt) | |||
Zeile 1: | Zeile 1: | ||
== Code Example for STM32F4xx == | {{ProjektInfoBox | ||
|name = SerialUSB | |||
|status = stable | |||
|image = | |||
|description = Code Example for STM32F4xx | |||
|author = [[Benutzer:siro|siro]] | |||
|username = siro | |||
|version = | |||
|update = | |||
|platform = STM32F4xx | |||
|license = mixed | |||
|download = [https://github.com/das-labor/SerialUSB] | |||
}} __NOTOC__ | |||
== Overview == | |||
serialUSB is a c code-example for STM32F4xx.<br> | |||
It will create a virtual com port '''VCP''' using the built in USB device stack. On the host PC the '''VCP''' acts like a physical terminal (COM-port).<br> | |||
The default device name is /dev/ttyACM0 .<br> | |||
Make sute to blacklist the device and/or shut down modem-manager as it tries to sent AT-commands to it.<br> | |||
/dev/ttyACM0 can be accessed like any other terminal /dev/tty0 (physical) or /dev/ttyUSB0 (PL2303).<br> | |||
=== Virtual Com Port === | === Virtual Com Port === |
Aktuelle Version vom 25. Mai 2015, 19:25 Uhr
SerialUSB Release status: stable [box doku] | |
---|---|
Description | Code Example for STM32F4xx |
Author(s) | siro (siro) |
Platform | STM32F4xx |
License | mixed |
Download | [1] |
Overview[Bearbeiten | Quelltext bearbeiten]
serialUSB is a c code-example for STM32F4xx.
It will create a virtual com port VCP using the built in USB device stack. On the host PC the VCP acts like a physical terminal (COM-port).
The default device name is /dev/ttyACM0 .
Make sute to blacklist the device and/or shut down modem-manager as it tries to sent AT-commands to it.
/dev/ttyACM0 can be accessed like any other terminal /dev/tty0 (physical) or /dev/ttyUSB0 (PL2303).
Virtual Com Port[Bearbeiten | Quelltext bearbeiten]
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