SPI emulation module.
More...
#include <stdbool.h>
#include <stdint.h>
#include <util/delay.h>
#include "gpio.h"
#include "spi.h"
◆ init_spi_module()
void init_spi_module |
( |
const struct spi_config * |
config | ) |
|
Configures the SPI module.
Initializes all specified GPIO ports and the clock line
- Parameters
-
config | the SPI configuration |
◆ spi_select()
void spi_select |
( |
bool |
select | ) |
|
Controls the chip select line.
- Parameters
-
select | if true , the line is pulled down |
◆ spi_transceive()
uint16_t spi_transceive |
( |
uint16_t |
output | ) |
|
Sends and receives a word (full duplex)
- Parameters
-
- Returns
- the received word, if any
◆ spi_config
Internal pointer to the SPI configuration.