Go to the source code of this file.
◆ SPI1_DISABLE
#define SPI1_DISABLE GPIOA->BSRR |= GPIO_BSRR_BS4 |
◆ SPI1_ENABLE
#define SPI1_ENABLE GPIOA->BSRR |= GPIO_BSRR_BR4 |
◆ SPI_BR_PRESCALER_128
#define SPI_BR_PRESCALER_128 (0x6 << 3U) |
◆ SPI_BR_PRESCALER_16
#define SPI_BR_PRESCALER_16 (0x3 << 3U) |
◆ spi2Init()
Initializes SPI1.
- Returns
- Void.
◆ spi2ReadBytes()
void spi2ReadBytes |
( |
uint8_t |
reg, |
|
|
uint8_t * |
pData, |
|
|
uint8_t |
size |
|
) |
| |
Reads multiple bytes of data in.
- Parameters
-
reg | The hex value of the first register to read from. |
*pData | A pointer to location where you want to read data to. |
size | The amount of bytes to be read. |
- Returns
- Void.
◆ spi2ReadOneByte()
void spi2ReadOneByte |
( |
uint8_t |
reg, |
|
|
uint8_t * |
pData |
|
) |
| |
Reads one byte of data in.
- Parameters
-
reg | The hex value of the register to read from. |
*pData | A pointer to location where you want to read data to. |
- Returns
- Void.
◆ spi2WriteBytes()
void spi2WriteBytes |
( |
uint8_t * |
pData, |
|
|
uint8_t |
size |
|
) |
| |
Writes multiple bytes of data in.
- Parameters
-
reg | The hex value of the register to write to. |
*pData | A pointer to the data you want to write. |
size | The amount of bytes to write. |
- Returns
- Void.
◆ spi2WriteOneByte()
void spi2WriteOneByte |
( |
uint8_t |
reg, |
|
|
uint8_t |
data |
|
) |
| |
Writes one byte of data.
- Parameters
-
reg | The hex value of the register to write to. |
data | The data to write. |
- Returns
- Void.