Llosa de Viango Tollos – pri2Debug.c



Getting started



  Tollos libraries

  Device libraries





  Sample application


pri2Debug.c – debug device I/O functions

The debug functions communicate with the host computer using a serial link over a USB Virtual COM port.

For primer2, this is via the “STM32” USB connection.

Note that on Windows a driver must be installed for this to work; this should be automatic (using Internet search).
 debugGetcIO   get character
 debugInitIO   initialize port for I/O
 debugPutcIO   send character to debug terminal

debugGetcIO – get character

int debugGetcIO(void);

returns character read from host, or −1 if none there

This function does not block.

debugInitIO – initialize port for I/O

void debugInitIO(uint baud);

baud – rate to run debug communications

The baud rate is ignored because this is a Virtual COM port.

debugPutcIO – send character to debug terminal

void debugPutcIO(int ch);

ch – character to send

This does not block; if too many characters are sent they will be quietly discarded.

Tollos and these web pages were written by Mike Cowlishaw; Please send me any corrections, suggestions, etc.
All content © Mike Cowlishaw, 2010–2012, except where marked otherwise. All rights reserved. The pages here are for non-commercial use only (see the separate licence for Tollos source code). Privacy policy: the Speleotrove website records no personal information and sets no ‘cookies’. However, statistics, etc. might be recorded by the web hosting service.

This page was last updated on 2010-12-20 by c2wiki.