additional include and warning fixes
This commit is contained in:
parent
ee875460e7
commit
9d20b8878e
@ -517,6 +517,7 @@ uint8_t GyroL3GD20H::readRegPolling(uint8_t reg) {
|
|||||||
txBuf[0] = reg | STM_READ_MASK;
|
txBuf[0] = reg | STM_READ_MASK;
|
||||||
HAL_GPIO_WritePin(GPIOD, GPIO_PIN_14, GPIO_PIN_RESET);
|
HAL_GPIO_WritePin(GPIOD, GPIO_PIN_14, GPIO_PIN_RESET);
|
||||||
auto result = HAL_SPI_TransmitReceive(spiHandle, txBuf, rxBuf, 2, 1000);
|
auto result = HAL_SPI_TransmitReceive(spiHandle, txBuf, rxBuf, 2, 1000);
|
||||||
|
if(result) {};
|
||||||
HAL_GPIO_WritePin(GPIOD, GPIO_PIN_14, GPIO_PIN_SET);
|
HAL_GPIO_WritePin(GPIOD, GPIO_PIN_14, GPIO_PIN_SET);
|
||||||
return rxBuf[1];
|
return rxBuf[1];
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#include "gpio.h"
|
#include "gpio.h"
|
||||||
|
|
||||||
|
#include "stm32h7xx_hal_rcc.h"
|
||||||
|
|
||||||
void gpio::initializeGpioClock(GPIO_TypeDef* gpioPort) {
|
void gpio::initializeGpioClock(GPIO_TypeDef* gpioPort) {
|
||||||
#ifdef GPIOA
|
#ifdef GPIOA
|
||||||
if(gpioPort == GPIOA) {
|
if(gpioPort == GPIOA) {
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
SpiCookie::SpiCookie(address_t deviceAddress, spi::SpiBus spiIdx, spi::TransferModes transferMode,
|
SpiCookie::SpiCookie(address_t deviceAddress, spi::SpiBus spiIdx, spi::TransferModes transferMode,
|
||||||
spi::MspCfgBase* mspCfg, uint32_t spiSpeed, spi::SpiModes spiMode,
|
spi::MspCfgBase* mspCfg, uint32_t spiSpeed, spi::SpiModes spiMode,
|
||||||
uint16_t chipSelectGpioPin, GPIO_TypeDef* chipSelectGpioPort, size_t maxRecvSize):
|
uint16_t chipSelectGpioPin, GPIO_TypeDef* chipSelectGpioPort, size_t maxRecvSize):
|
||||||
deviceAddress(deviceAddress), spiIdx(spiIdx), transferMode(transferMode),
|
deviceAddress(deviceAddress), spiIdx(spiIdx), spiSpeed(spiSpeed), spiMode(spiMode),
|
||||||
spiSpeed(spiSpeed), spiMode(spiMode), chipSelectGpioPin(chipSelectGpioPin),
|
transferMode(transferMode), chipSelectGpioPin(chipSelectGpioPin),
|
||||||
chipSelectGpioPort(chipSelectGpioPort), mspCfg(mspCfg), maxRecvSize(maxRecvSize) {
|
chipSelectGpioPort(chipSelectGpioPort), mspCfg(mspCfg), maxRecvSize(maxRecvSize) {
|
||||||
spiHandle.Init.DataSize = SPI_DATASIZE_8BIT;
|
spiHandle.Init.DataSize = SPI_DATASIZE_8BIT;
|
||||||
spiHandle.Init.FirstBit = SPI_FIRSTBIT_MSB;
|
spiHandle.Init.FirstBit = SPI_FIRSTBIT_MSB;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user