Functions

SPI.c File Reference

#include "SPI.h"

Functions

void spi0_init_master (void)
 Initializes spi0 as master.
uint8_t spi0_master_rw8 (uint8_t to_slave)
 Writes and reads an 8-bit byte via SPI.
uint16_t spi0_master_rw16 (uint16_t to_slave)
 Writes and reads a 16-bit word via SPI.
void spi0_hard_init_master (void)
 Initializes the AVR hardware SPI for spi0.
uint8_t spi0_hard_master_rw8 (uint8_t to_slave)
 Writes and reads an 8-bit byte via hardware SPI for spi0.
uint16_t spi0_hard_master_rw16 (uint16_t to_slave)
 Writes and reads a 16-bit word via hardware SPI for spi0.

Function Documentation

void spi0_hard_init_master ( void   ) 

Initializes the AVR hardware SPI for spi0.

Author:
Joe Pardue
Date:
October 29, 2010
Version:
1.00
uint16_t spi0_hard_master_rw16 ( uint16_t  to_slave  ) 

Writes and reads a 16-bit word via hardware SPI for spi0.

Note:
Blocks waiting for send to complete
Returns:
16-bit word from the slave device.
Parameters:
to_slave - 16-bit word to send to the slave device.
Author:
Joe Pardue
Date:
October 29, 2010
Version:
1.00
uint8_t spi0_hard_master_rw8 ( uint8_t  to_slave  ) 

Writes and reads an 8-bit byte via hardware SPI for spi0.

Note:
Blocks waiting for send to complete
Returns:
8-bit byte from the slave device.
Parameters:
to_slave - 8-bit byte to send to the slave device.
Author:
Joe Pardue
Date:
October 29, 2010
Version:
1.00
void spi0_init_master ( void   ) 

Initializes spi0 as master.

Note:
Selects hardware or software SPI based on constant defintion SPI0_SOFT.
Author:
Joe Pardue
Date:
October 29, 2010
Version:
1.00
uint16_t spi0_master_rw16 ( uint16_t  to_slave  ) 

Writes and reads a 16-bit word via SPI.

Note:
Selects hardware or software SPI based on constant defintion SPI0_SOFT.
Author:
Joe Pardue
Date:
October 29, 2010
Version:
1.00
uint8_t spi0_master_rw8 ( uint8_t  to_slave  ) 

Writes and reads an 8-bit byte via SPI.

Note:
Selects hardware or software SPI based on constant defintion SPI0_SOFT.
Author:
Joe Pardue
Date:
October 29, 2010
Version:
1.00