SPI Bus
[Device Drivers]


Defines

#define dev_open_DEV_SPI()   mos_mutex_lock(&spi_mutex)
 gain an exclusive lock on the SPI Bus. Any other threads calling dev_open_DEV_SPI() will block until the owner calls dev_close_DEV_SPI().
#define dev_close_DEV_SPI()   mos_mutex_unlock(&spi_mutex)
 release exclusive lock on the SPI Bus. Any other thread blocking on dev_open_DEV_SPI() will now unblock.

Functions

uint16_t dev_read_DEV_SPI (void *buf, uint16_t count)
 read from the SPI Bus into buf.
uint16_t dev_write_DEV_SPI (const void *buf, uint16_t count)
 write from buf to the SPI Bus.
uint8_t dev_mode_DEV_SPI (uint8_t md)
 not supported for the SPI Bus.
uint8_t dev_ioctl_DEV_SPI (int8_t request,...)
 send an IO Control to the SPI Bus. Accepted parameters are:
  1. SPI_SET_SLAVE_SELECT, [slave device]
  2. SPI_CLEAR_SLAVE_SELECT


Variables

mos_mutex_t spi_mutex

Detailed Description

This group contains functions associated with the SPI Bus driver. Other drivers may use the SPI Bus to communicate with hardware located on it, such as the CC2420 radio. In general, application programmers should not need to use this device, Unless a there is an unsupported device attached to the SPI Bus.

Function Documentation

uint8_t dev_ioctl_DEV_SPI int8_t  request,
  ...
 

Parameters:
request The requested action.
... any required arguments for the specified IOCTL.
Returns:
DEV_OK or DEV_BAD_IOCTL.

uint8_t dev_mode_DEV_SPI uint8_t  md  ) 
 

Parameters:
md ignored.
Returns:
DEV_UNSUPPORTED

uint16_t dev_read_DEV_SPI void *  buf,
uint16_t  count
 

Parameters:
count the number of bytes to read. A value of '2' will read a 16-bit value; any other value will read an array of bytes.
buf the buffer to store the result in.
Returns:
the number of bytes read.

uint16_t dev_write_DEV_SPI const void *  buf,
uint16_t  count
 

Parameters:
count the number of bytes to write. A value of '2' will write a 16-bit value; any other value will write an array of bytes.
buf the buffer containing the bytes to be written.
Returns:
the number of bytes written.


Variable Documentation

mos_mutex_t spi_mutex
 

For internal use only.

Used by the dev_open and dev_close functions.


Generated on Sun Nov 22 06:26:00 2009 for MANTIS by  doxygen 1.4.6