HostInterface functions
[IO Utility Library libio_<board>.a]


Detailed Description

Transmitting bytes between a host computer an the AVR.


Files

file  hif.h
 Interface for HostInterface functions.

Defines

#define DUMP(sz, ptr)   hif_dump(sz,ptr)
#define FLASH_STRING(x)   PSTR(x)
#define FLASH_STRING_T   PGM_P
#define HIF_PUTS_NEWLINE()   hif_puts_p(FLASH_STRING("\n\r"))
#define PRINT(fmt)   hif_echo(FLASH_STRING(fmt))
#define PRINTF(fmt,...)   hif_printf(FLASH_STRING(fmt), __VA_ARGS__)

Functions

void hif_dump (uint16_t sz, uint8_t *d)
 Print hexdump of a data array to the interface.
void hif_echo (FLASH_STRING_T str)
 Print a string to the interface.
uint8_t hif_get_blk (unsigned char *data, uint8_t max_size)
 Get a block of bytes from the host interface.
unsigned int hif_getc (void)
 Get a charakter byte from the host interface.
void hif_init (const uint16_t baudrate)
 Initialize host interface.
void hif_printf (FLASH_STRING_T fmt,...)
 Print a formated string to the interface.
uint8_t hif_put_blk (unsigned char *data, uint8_t size)
 Send a block of characters to the interface.
void hif_putc (unsigned char data)
 Send a character to the interface.
void hif_puts (const char *s)
 Send string to the interface.
void hif_puts_p (const char *progmem_s)
 Send a programm memory string to the interface.
static int hif_split_args (char *txtline, int maxargs, char **argv)
 Split a null terminated string.


Define Documentation

#define DUMP ( sz,
ptr   )     hif_dump(sz,ptr)

Wrapper macro for hif_dump()

Definition at line 53 of file hif.h.

#define PRINT ( fmt   )     hif_echo(FLASH_STRING(fmt))

Wrapper macro for hif_echo()

Definition at line 51 of file hif.h.

#define PRINTF ( fmt,
...   )     hif_printf(FLASH_STRING(fmt), __VA_ARGS__)

Wrapper macro for hif_printf()

Definition at line 49 of file hif.h.


Function Documentation

void hif_dump ( uint16_t  sz,
uint8_t *  d 
)

Print hexdump of a data array to the interface.

Parameters:
sz number of bytes, that will be dumped.
d pointer to the data array, that will be dumped.

void hif_echo ( FLASH_STRING_T  str  ) 

Print a string to the interface.

Parameters:
str string, which is located in flash memory

uint8_t hif_get_blk ( unsigned char *  data,
uint8_t  max_size 
)

Get a block of bytes from the host interface.

Parameters:
data buffer where the bytes are stored
max_size maximum number of bytes, which can be stored in the buffer.
Returns:
number of bytes stored in the buffer

unsigned int hif_getc ( void   ) 

Get a charakter byte from the host interface.

Returns:
16 bit value, lower byte contains character, high byte contains error code, if 0, no error occured.

void hif_init ( const uint16_t  baudrate  ) 

Initialize host interface.

Parameters:
baudrate data rate of the interface in bit/s

void hif_printf ( FLASH_STRING_T  fmt,
  ... 
)

Print a formated string to the interface.

Parameters:
fmt format string, which is located in flash memory
... variable argument list

uint8_t hif_put_blk ( unsigned char *  data,
uint8_t  size 
)

Send a block of characters to the interface.

Parameters:
data pointer to the data array.
size size of the block.
Returns:
num number of bytes, which was send.

void hif_putc ( unsigned char  data  ) 

Send a character to the interface.

Parameters:
data 8 bit value, which is transfered.

void hif_puts ( const char *  s  ) 

Send string to the interface.

Parameters:
s pointer to a null terminated string, which is located in RAM.

void hif_puts_p ( const char *  progmem_s  ) 

Send a programm memory string to the interface.

Parameters:
progmem_s pointer to a null terminated string, which is located in program memory.

static int hif_split_args ( char *  txtline,
int  maxargs,
char **  argv 
) [static]

Split a null terminated string.

This function creates argc,argv style data from a null terminated string. The splitting is done on the base of spaces (ASCII 32).

Parameters:
txtline string to split
maxargs maximum number of arguments to split
Return values:
argv array of pointers, that store the arguments
Returns:
number of arguments splitted (argc)

Definition at line 151 of file hif.h.


This documentation for µracoli was generated on 21 Jan 2010 by  doxygen 1.5.5