µracoli Manual Version foo

- µracoli
- User Guide
- Reference Guide

Data Structures
Board Definitions

## Data Structures
struct | node_config_t

## Detailed Description

A detailed list of the supported boards can be found in section ref pgBoards

The boards are defined in the file `Config/board.cfg`

## Functions

static uint8_t get_node_config | ( | node_config_t * | ncfg | ) |
| static

Read the node_config_t structure from the end of the flash memory.

Parameters

  ncfg | Pointer to the node config structure that is read from FLASH END.

Returns
  Returns 0 if the crc over the structure is correct.

Examples:
  xmpl_radio_range.c.

Definition at line 258 of file board.h.

static uint8_t get_node_config_eeprom | ( | node_config_t * | ncfg,
|  | uint8_t * | offset
| ) |  |
| static

Read the node_config_t structure from an offset in the EEPROM.

Parameters

  ncfg | Pointer to the node config structure that is read from EEPROM.
  offset | EEPROM offset, at where the structure is read from.

Returns
  Returns 0 if the crc over the structure is correct.

Definition at line 296 of file board.h.

static void jump_to_bootloader | ( | void |  | ) |
| static

Jump to the bootloader code.

Definition at line 342 of file board.h.

static void mcu_init | ( | void |  | ) |
| static

Do initialization of MCU. Here is the place for clock init, oscillator calibration, ...

Examples:
  xmpl_dbg.c, xmpl_hif.c, xmpl_hif_echo.c, xmpl_i2c.c, xmpl_isl29020.c, xmpl_key_events.c, xmpl_keys.c, xmpl_leds.c, xmpl_linbuf_rx.c, xmpl_linbuf_tx.c, xmpl_lm73.c, xmpl_ow.c, xmpl_radio_range.c, xmpl_radio_stream.c, xmpl_rtc.c, xmpl_sensor.c, xmpl_timer.c, xmpl_timer_callback.c, xmpl_trx_base.c, xmpl_trx_echo.c, xmpl_trx_rx.c, xmpl_trx_rxaack.c, xmpl_trx_tx.c, xmpl_trx_txaret.c, and xmpl_tsl2550.c.

Definition at line 396 of file board.h.

static void store_node_config_eeprom | ( | node_config_t * | ncfg,
|  | uint8_t * | offset
| ) |  |
| static

Read the node_config_t structure from an offset in the EEPROM.

Parameters

  ncfg | Pointer to the node config structure that is written to EEPROM. The crc byte is computed within this function.
  offset | EEPROM offset, at which the structure is stored.

Definition at line 325 of file board.h.

## Data Structure Documentation

struct node_config_t

Structure for preconfigured constants that are stored at FLASHEND in program memory or in the EEPROM.

See also get_node_config(), get_node_config_eeprom() and store_node_config_eeprom().

Examples:
  xmpl_radio_range.c.

Definition at line 233 of file board.h.

Data Fields
uint8_t | _reserved_[2] | For future extensions, but can be used to store user data.
uint8_t | channel | The radio channel.
uint8_t | crc | Ibutton CRC to validate if the structure is correct.
uint64_t | ieee_addr | The MAC address of the node (EUI64).
uint16_t | pan_id | The PAN ID (network ID) of the node.
uint16_t | short_addr | The short address of the node.

## Defines

#define DEFAULT_SPI_RATE (SPI_RATE_1_2)

Typical for AVR running on 8 MHz If AVR runs on >8 MHz or synchronous to transceiver, overwrite this macro in appropiate board*.h

Also for RFA interface devices, which for them serves as dummy

Definition at line 147 of file board.h.

#define DELAY_US | ( |  | x | ) | _delay_ms(x/1000.0)

The avr-libc internal _delay_us() function allows delays up to 255us. Since the radio needs some delays, which are above this value, _delay_ms is used. As long as the argument for the DELAY_US macro is a compile time constant, no large overhead is produced, because the compiler performs the division.

Examples:
  xmpl_lm73.c, xmpl_trx_base.c, xmpl_trx_echo.c, xmpl_trx_rx.c, xmpl_trx_rxaack.c, xmpl_trx_tx.c, xmpl_trx_txaret.c, and xmpl_tsl2550.c.

Definition at line 89 of file board.h.

#define HIF_IO_ENABLE | ( |  | ) | do{}while(0)

This macro is used to enable the interface circuit of the HIF

Definition at line 133 of file board.h.

#define MCU_IRQ_DISABLE cli

This must be used to construct atomic blocks

Examples:
  xmpl_radio_stream.c.

Definition at line 75 of file board.h.

#define MCU_IRQ_ENABLE sei

This must be used to construct atomic blocks

Examples:
  xmpl_hif.c, xmpl_hif_echo.c, xmpl_i2c.c, xmpl_isl29020.c, xmpl_key_events.c, xmpl_linbuf_rx.c, xmpl_linbuf_tx.c, xmpl_lm73.c, xmpl_ow.c, xmpl_radio_range.c, xmpl_radio_stream.c, xmpl_rtc.c, xmpl_sensor.c, xmpl_timer.c, xmpl_timer_callback.c, xmpl_trx_base.c, xmpl_trx_echo.c, xmpl_trx_rx.c, xmpl_trx_rxaack.c, xmpl_trx_tx.c, xmpl_trx_txaret.c, and xmpl_tsl2550.c.

Definition at line 68 of file board.h.

#define NO_HIF (1)

Macro is defined, if there is no HIF definition in appropriate board*.h

Definition at line 127 of file board.h.

#define PULLUP_KEYS (0)

The internal pull-up resistors in the MCU are used, if this macro is defined to 1 in the board definition file

Definition at line 99 of file board.h.

#define SLEEP_ON_IDLE | ( |  | ) |

Value:
do{\
set_sleep_mode(SLEEP_MODE_IDLE);\
sleep_mode();\
}while(0);

Set MCU into idle mode.

Examples:
  xmpl_key_events.c, and xmpl_rtc.c.

Definition at line 106 of file board.h.

#define TRX_RESET_HIGH | ( |  | ) | PORT_TRX_RESET |= MASK_TRX_RESET

set RESET pin to high level

Examples:
  xmpl_trx_base.c, xmpl_trx_echo.c, xmpl_trx_rx.c, xmpl_trx_rxaack.c, xmpl_trx_tx.c, and xmpl_trx_txaret.c.

Definition at line 158 of file board.h.

#define TRX_RESET_INIT | ( |  | ) | DDR_TRX_RESET |= MASK_TRX_RESET

RESET pin IO initialization

Definition at line 153 of file board.h.

#define TRX_RESET_LOW | ( |  | ) | PORT_TRX_RESET &= ~MASK_TRX_RESET

set RESET pin to low level

Examples:
  xmpl_trx_base.c, xmpl_trx_echo.c, xmpl_trx_rx.c, xmpl_trx_rxaack.c, xmpl_trx_tx.c, and xmpl_trx_txaret.c.

Definition at line 163 of file board.h.

#define TRX_SLPTR_HIGH | ( |  | ) | PORT_TRX_SLPTR |= MASK_TRX_SLPTR

set SLEEP_TR pin to high level

Examples:
  xmpl_trx_echo.c, xmpl_trx_tx.c, and xmpl_trx_txaret.c.

Definition at line 173 of file board.h.

#define TRX_SLPTR_INIT | ( |  | ) | DDR_TRX_SLPTR |= MASK_TRX_SLPTR

SLEEP_TR pin IO initialization

Definition at line 168 of file board.h.

#define TRX_SLPTR_LOW | ( |  | ) | PORT_TRX_SLPTR &= ~MASK_TRX_SLPTR

set SLEEP_TR pin to low level

Examples:
  xmpl_trx_base.c, xmpl_trx_echo.c, xmpl_trx_rx.c, xmpl_trx_rxaack.c, xmpl_trx_tx.c, and xmpl_trx_txaret.c.

Definition at line 178 of file board.h.