TestDoxygen  1.0.21
Test for Doxygen
Defines | Functions
TestMAX7456/SPI.h File Reference

Header for SPI master with ATmega48/88/168/328, no interrupt. More...

#include <avr/io.h>
#include <inttypes.h>

Go to the source code of this file.

Defines

#define SPI_PORT   PORTB
#define SPI_DDR   DDRB
#define SPI_PINR   PINB
#define SPI_SS   PB2
#define SPI_MOSI   PB3
#define SPI_MISO   PB4
#define SPI_SCK   PB5

Functions

uint8_t SPIread (void)
uint8_t SPIwrite (uint8_t data)
 Write to slave SPI device.

Detailed Description

Header for SPI master with ATmega48/88/168/328, no interrupt.


Define Documentation

#define SPI_DDR   DDRB

Data direction register for SPI

#define SPI_MISO   PB4

enable SPI makes this an input

#define SPI_MOSI   PB3

Set to output, data to slave

#define SPI_PINR   PINB

Pin register for SPI

#define SPI_PORT   PORTB

Port for all SPI pins

#define SPI_SCK   PB5

Clock output

#define SPI_SS   PB2

Chip select, user control when master


Function Documentation

uint8_t SPIread ( void  )
Returns:
SPDR, this is the previous value from the slave
uint8_t SPIwrite ( uint8_t  data)

Write to slave SPI device.

Parameters:
[in]dataValue to be written to the slave
Returns:
SPDR, the data from the slave
 All Data Structures Files Functions Variables Enumerations Defines