µracoli Manual Version foo

- µracoli
- User Guide
- Reference Guide

HostInterface API

Communicating with the host computer.
More...

## Detailed Description

### Overview

HostInterface API in liburacoli_<board>.a

Usage

Examples
  - xmpl_hif.c
  - xmpl_hif_echo.c

## Functions

void hif_dump | ( | uint16_t | sz,
|  | uint8_t * | d
| ) |  |

Parameters

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

Examples:
  xmpl_i2c.c.

void hif_echo | ( | FLASH_STRING_T | str | ) |

Parameters

  str | string, which is located in flash memory

Examples:
  xmpl_hif.c, and xmpl_hif_echo.c.

uint8_t hif_get_blk | ( | unsigned char * | data,
|  | uint8_t | max_size
| ) |  |

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

static int hif_get_dec_number | ( | void |  | ) |
| static

Returns
  integer value of the negative number.

Examples:
  xmpl_isl29020.c, and xmpl_lm73.c.

Definition at line 192 of file hif.h.

static uint16_t hif_get_number | ( | int8_t | base | ) |
| static

Enter a integer number.

Parameters

  base | base value for the number conversion, e.g. 10 for entering a decimal number.

Returns
  16 bit unsigned integer value.

Definition at line 237 of file hif.h.

int hif_getc | ( | void |  | ) |

Returns
  The Character or EOF in case of error or end-of-file

Examples:
  xmpl_hif.c, xmpl_hif_echo.c, xmpl_i2c.c, xmpl_isl29020.c, xmpl_lm73.c, xmpl_ow.c, and xmpl_tsl2550.c.

void hif_init | ( | const uint32_t | baudrate | ) |

Parameters

  baudrate | data rate of the interface in bit/s

Examples:
  xmpl_hif.c, xmpl_hif_echo.c, xmpl_i2c.c, xmpl_isl29020.c, xmpl_linbuf_rx.c, xmpl_lm73.c, xmpl_ow.c, xmpl_radio_range.c, xmpl_sensor.c, xmpl_timer_callback.c, and xmpl_tsl2550.c.

void hif_printf | ( | FLASH_STRING_T | fmt,
|  |  | ...
| ) |  |

Parameters

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

Examples:
  xmpl_hif.c, and xmpl_hif_echo.c.

uint8_t hif_put_blk | ( | unsigned char * | data,
|  | uint8_t | size
| ) |  |

Parameters

  data | pointer to the data array.
  size | size of the block.

Returns
  num number of bytes, which was send.

Examples:
  xmpl_hif.c, and xmpl_linbuf_rx.c.

int hif_putc | ( | int | c | ) |

Parameters

  data | Character to send

Returns
  The Character or EOF in case of error

Examples:
  xmpl_hif.c, xmpl_hif_echo.c, xmpl_i2c.c, and xmpl_ow.c.

void hif_puts | ( | const char * | s | ) |

Parameters

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

Examples:
  xmpl_i2c.c.

void hif_puts_p | ( | const char * | progmem_s | ) |

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

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)

Examples:
  xmpl_i2c.c, and xmpl_ow.c.

Definition at line 162 of file hif.h.

## Defines

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

Wrapper macro for hif_dump()

Examples:
  xmpl_hif.c.

Definition at line 58 of file hif.h.

#define HIF_AT90USB (31)

Identifier for HIF type USB/ATmega1287

Definition at line 240 of file const.h.

#define HIF_FT245 (30)

Identifier for HIF type USB/FT245

Definition at line 239 of file const.h.

#define HIF_NONE (0)

Identifier for no host interface

Definition at line 229 of file const.h.

#define HIF_SERCOM0 (40)

Identifier for HIF type SERCOM0

Definition at line 243 of file const.h.

#define HIF_UART_0 (10)

Identifier for HIF type UART 0

Definition at line 232 of file const.h.

#define HIF_UART_1 (11)

Identifier for HIF type UART 1

Definition at line 233 of file const.h.

#define HIF_USARTD0 (20)

Identifier for HIF type USARTD0

Definition at line 236 of file const.h.

#define HIF_USARTE0 (21)

Identifier for HIF type USARTD0

Definition at line 237 of file const.h.

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

Wrapper macro for hif_echo()

Examples:
  xmpl_i2c.c, xmpl_isl29020.c, xmpl_lm73.c, xmpl_ow.c, and xmpl_tsl2550.c.

Definition at line 56 of file hif.h.

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

Wrapper macro for hif_printf()

Examples:
  xmpl_hif.c, xmpl_hif_echo.c, xmpl_i2c.c, xmpl_isl29020.c, xmpl_lm73.c, xmpl_ow.c, xmpl_radio_range.c, xmpl_sensor.c, xmpl_timer_callback.c, and xmpl_tsl2550.c.

Definition at line 54 of file hif.h.

#define URACOLI_USB_PID (2183)

uracoli USB Product ID see also USB_VID_URACOLI

Definition at line 259 of file const.h.

#define URACOLI_USB_VID (5824)

uracoli USB Vendor ID

The pair of the uracoli vendor id, device id are obtained by

- http://www.voti.nl/pids/
- http://www.frank-buss.de/pid.txt

Definition at line 254 of file const.h.