MAV'RIC
Public Member Functions
Spi_avr32 Class Reference

Implementation of spi peripheral for avr32. More...

#include <spi_avr32.hpp>

Inheritance diagram for Spi_avr32:
Inheritance graph
[legend]
Collaboration diagram for Spi_avr32:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Spi_avr32 (spi_avr32_conf_t config)
 Initialises the peripheral.
bool init (void)
 Hardware initialization.
bool write (const uint8_t *bytes, const uint32_t size=1)
 Write bytes on the spi line.
bool read (uint16_t command, uint8_t *bytes, const uint32_t size=1)
 Read bytes from the spi line.
bool transfer (uint8_t *out_buffer, uint8_t *in_buffer, uint32_t nbytes)
 Write and Read data to/from the SPI bus.

Detailed Description

Implementation of spi peripheral for avr32.


Constructor & Destructor Documentation

Initialises the peripheral.

Parameters:
configDevice configuration

Member Function Documentation

bool Spi_avr32::init ( void  ) [virtual]

Hardware initialization.

Returns:
true Success
false Error

Implements Spi.

bool Spi_avr32::read ( uint16_t  command,
uint8_t *  bytes,
const uint32_t  size = 1 
)

Read bytes from the spi line.

Parameters:
commandReading command
bytesIncoming bytes
sizeNumber of bytes to read
Returns:
true Data successfully read
false Data not read
bool Spi_avr32::transfer ( uint8_t *  out_buffer,
uint8_t *  in_buffer,
uint32_t  nbytes 
) [virtual]

Write and Read data to/from the SPI bus.

Parameters:
out_bufferData buffer (output)
in_bufferData buffer (input)
nbytesNumber of bytes to write/read
Returns:
true Success
false Failed

Implements Spi.

bool Spi_avr32::write ( const uint8_t *  bytes,
const uint32_t  size = 1 
)

Write bytes on the spi line.

Parameters:
byteOutgoing bytes
sizeNumber of bytes to write
Returns:
true Data successfully written
false Data not written

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines