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

  data | Data 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

  data | byte to write to the bus

Returns
  byte read from the bus