Core
Loading...
Searching...
No Matches
spi.h
Go to the documentation of this file.
1
8#ifndef CORE_SPI_H
9#define CORE_SPI_H
10
11#include <stdint.h>
12#include <stdbool.h>
13#include <stm32g4xx_hal.h>
14
15
22bool core_SPI_init(SPI_TypeDef *spi, GPIO_TypeDef *cs_port, uint16_t cs_pin);
23
36bool core_SPI_read_write(SPI_TypeDef *spi, uint8_t *txbuf, uint32_t txbuflen, uint8_t *rxbuf, uint32_t rxbuflen);
37
42bool core_SPI_start(SPI_TypeDef *spi);
43
48bool core_SPI_stop(SPI_TypeDef *spi);
49
50#endif
bool core_SPI_start(SPI_TypeDef *spi)
Set the CS pin for an SPI bus low.
Definition spi.c:150
bool core_SPI_read_write(SPI_TypeDef *spi, uint8_t *txbuf, uint32_t txbuflen, uint8_t *rxbuf, uint32_t rxbuflen)
Transmit data from a buffer on the given SPI bus and store the incoming data in a separate buffer.
Definition spi.c:130
bool core_SPI_init(SPI_TypeDef *spi, GPIO_TypeDef *cs_port, uint16_t cs_pin)
Initialize an SPI module and set up a CS pin for it.
Definition spi.c:20
bool core_SPI_stop(SPI_TypeDef *spi)
Set the CS pin for an SPI bus high.
Definition spi.c:170