SerialUSB: Unterschied zwischen den Versionen
Siro (Diskussion | Beiträge) KKeine Bearbeitungszusammenfassung |
Siro (Diskussion | Beiträge) (+more description) |
||
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 = | |||
}} __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> | |||
== Download == | |||
To view the source code use our TRAC:<br> | |||
[https://www.das-labor.org/trac/browser/microcontroller/src-stm32f4xx/serialUSB]<br> | |||
To checkout use Subversion: | To checkout use Subversion: |
Version vom 23. April 2013, 13:03 Uhr
SerialUSB Release status: stable [box doku] | |
---|---|
Description | Code Example for STM32F4xx |
Author(s) | siro (siro) |
Platform | STM32F4xx |
License | mixed |
Overview
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).
Download
To view the source code use our TRAC:
[1]
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