By connecting to the "ACM" port exposed on the USB of the STM32 (used as a service and connected to a PC) it is possible to send alphanumeric command (eg with "minicom") in order to perform: -Digital Output. -Switched pulse. -Digittal Input. -Analogic Input. -Request of a brief (returned by the serial line): 'H' or '?'. Note that all the commands can be given on a single string and it will be executed readily just at the instant each one is completely received.
Revision 3:a425b8b0a4c2, committed 2018-01-17
- Comitter:
- lsola
- Date:
- Wed Jan 17 07:35:05 2018 +0000
- Parent:
- 2:59f9abdd702e
- Commit message:
- Come mistakes fixed in header comments.
Changed in this revision
USBDevice.lib | Show diff for this revision Revisions of this file |
src/main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 59f9abdd702e -r a425b8b0a4c2 USBDevice.lib --- a/USBDevice.lib Sun Dec 31 15:17:58 2017 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -http://os.mbed.com/users/mbed_official/code/USBDevice/#53949e6131f6
diff -r 59f9abdd702e -r a425b8b0a4c2 src/main.cpp --- a/src/main.cpp Sun Dec 31 15:17:58 2017 +0000 +++ b/src/main.cpp Wed Jan 17 07:35:05 2018 +0000 @@ -23,9 +23,9 @@ * By connecting to the "ACM" port exposed on the USB of the STM32 (used as a service and connected to a PC) it is possible to send the * following commands in text format (eg. with "minicom"). * -Digital Output: command 'DO P<portName [B-G]> *<pinNumber [0-15]> <value [01]>;'. - * -Switch Pulse: combo 'DP P<portName> *<pinNumber [0-15]> <time>;'. + * -Digital Pulse: command 'DP P<portName> *<pinNumber [0-15]> <time>;'. * Where <time> is a float value with a maximum accuracy of 10 ^ -3 Sec (eg: 0.00x is valildo, 0.000x is not valid). * - * From the moment the specified output is called, it is denied until the specified time expires. + * From the moment the specified comand is given, the corresponding digital output is swhitched until the specified time expires. * Note that it can be called reentrant and burst: the effect is exactly the one programmed: many "Timeouts" are instantiated every request and disallowed * after the expiration of its time. * -Digital Input: command 'DI P<portName> *<pinNumber [0-15]>;'. Return '[01];' according to the voltage level present on the specified pin (0 or 1).