Llosa de Viango Tollos – tollosDebug.c

Introduction

Features

Getting started

Download


Libraries

  Tollos libraries

  Device libraries

    boards

    microcontrollers

    peripherals


Background

  Sample application

  Troubleshooting

tollosDebug.c – debug functions for Tollos

The debug device uses a serial channel to communicate with a terminal device (usually a termulator emulator application on a PC).

Using any debug function automatically initializes the debug communication device. The default baud rate for the device is TOLLOS_DEBUG_BAUD, normally 115200 baud.
Functions
 debugBaud   set debug baud rate
 debugf   a mini printf to send a string
 debugGet   get character from host

debugBaud – set debug baud rate

void debugBaud(uint baud);

baud – baud rate to use for debug

It is recommend that a ‘standard’ baud rate be used, for example, 9600 or 115200. At 9600 baud about 38 characters can be sent in 40ms (one default tick) at 115200, 460 characters can be sent.

debugf – a mini printf to send a string

int debugf(const char *format, ...);

format – format and data string

... – other arguments as required

returns the number (count) of characters sent

See the tollosUtil strf function for a description of supported format strings (a subset of the C printf rules).

debugGet – get character from host

int debugGet(void);

returns a character read, or −1 if none pending

If a character was read the value returned will always be non-negative (hence all values >=0 might be possible).

Note that some keyboard keys may generate more than one character: an escape followed by some code, for example.

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 2011-01-01 by c2wiki.