Generic communication interface between the wireless board (mote) and the sensor board. Any kind of sensor board can be connected to the mote using this specification given it provides a SPI peripheral, one input pin with interrupt capability and one digital output. The sensor board must implement a special register set from which all required information can be retrieved. Protocol: http://is.gd/wuQorh Github: http://is.gd/ySj1L9

Dependencies:   mbed-src

Embed: (wiki syntax)

« Back to documentation index

buf_io.c File Reference

buf_io.c File Reference

Several functions for handling data in buffers. More...

Go to the source code of this file.

Functions

uint16_t buf_io_swap16 (uint16_t orig_value)
 Swaps a 16 bits unsigned integer.
uint32_t buf_io_swap32 (uint32_t orig_value)
 Swaps a 32 bits unsigned integer.
void buf_io_swap16p (uint8_t *buf)
 Swaps a 16 bits unsigned integer inside a buffer.
void buf_io_swap32p (uint8_t *buf)
 Swaps a 32 bits unsigned integer inside a buffer.
uint8_t buf_io_swap8b (uint8_t orig_value)
 Swaps 8 bits unsigned integer in a byte.

Detailed Description

Several functions for handling data in buffers.

Basic functions:

buf_io_[get|put][8|16|32|64|f|d]_[f|t][b|l]_ap[r]

Notation:

8|16|32|64|f|d = data size (f for float, d for double) [f|t][b|l] = from/to big/little ap[r] = add pointer [reference] at the end

Check buf_io.c for a proper implementation of these functions for your platform.

Definition in file buf_io.c.


Function Documentation

uint16_t buf_io_swap16 ( uint16_t  usShort )

Swaps a 16 bits unsigned integer.

Parameters:
ucShort16 bits unsigned integer to be swapped
Returns:
16 bits unsigned integer swapped

Definition at line 6 of file buf_io.c.

void buf_io_swap16p ( uint8_t *  pucPtr )

Swaps a 16 bits unsigned integer inside a buffer.

Parameters:
pucPtrPointer where 16 bits unsigned integer is stored.

Definition at line 22 of file buf_io.c.

uint32_t buf_io_swap32 ( uint32_t  ulLong )

Swaps a 32 bits unsigned integer.

Parameters:
ulLong32 bits unsigned integer to be swapped
Returns:
32 bits unsigned integer swapped

Definition at line 13 of file buf_io.c.

void buf_io_swap32p ( uint8_t *  pucPtr )

Swaps a 32 bits unsigned integer inside a buffer.

Parameters:
pucPtrPointer where 32 bits unsigned integer is stored.

Definition at line 31 of file buf_io.c.

uint8_t buf_io_swap8b ( uint8_t  ucChar )

Swaps 8 bits unsigned integer in a byte.

Parameters:
ucChar8 bits unsigned integer to be bit swapped
Returns:
8 bits unsigned integer swapped

Definition at line 44 of file buf_io.c.