CoffeePi
Coffee machine control for Raspberry Pi
Macros | Functions
spi.h File Reference
#include <inttypes.h>

Go to the source code of this file.

Macros

#define SHIFT_SCLR   21
 
#define SHIFT_RCK   22
 
#define SHIFT_G   26
 

Functions

uint8_t spi_readwrite (uint8_t data)
 Writes the data on the SPI bus and returns the reply. More...
 
void spi_init (void)
 Initializes the SPI bus. More...
 
void shift_init (void)
 Initializes the shift register. More...
 
void shift_data (uint8_t data)
 Sends a byte to the shift register. More...
 

Macro Definition Documentation

#define SHIFT_G   26
#define SHIFT_RCK   22
#define SHIFT_SCLR   21

Function Documentation

void shift_data ( uint8_t  data)

Sends a byte to the shift register.

Parameters
dataData byte
void shift_init ( void  )

Initializes the shift register.

void spi_init ( void  )

Initializes the SPI bus.

uint8_t spi_readwrite ( uint8_t  data)

Writes the data on the SPI bus and returns the reply.

Parameters
databyte to write to the bus
Returns
byte read from the bus