fsfw-hal/stm32h7/devicetest/GyroL3GD20H.h

35 lines
730 B
C
Raw Normal View History

2021-05-31 20:40:16 +02:00
#ifndef FSFW_HAL_STM32H7_DEVICETEST_GYRO_L3GD20H_H_
#define FSFW_HAL_STM32H7_DEVICETEST_GYRO_L3GD20H_H_
#include "stm32h7xx_hal.h"
#include "stm32h7xx_hal_spi.h"
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
2021-06-03 14:00:50 +02:00
#include <cstdint>
#include <array>
enum class TransferStates {
IDLE,
WAIT,
SUCCESS,
FAILURE
};
2021-05-31 20:40:16 +02:00
class GyroL3GD20H {
public:
GyroL3GD20H(SPI_HandleTypeDef* spiHandle);
2021-06-03 14:00:50 +02:00
ReturnValue_t initialize();
2021-05-31 20:40:16 +02:00
ReturnValue_t performOperation();
2021-06-03 14:00:50 +02:00
2021-05-31 20:40:16 +02:00
private:
2021-06-03 14:00:50 +02:00
2021-05-31 20:40:16 +02:00
SPI_HandleTypeDef* spiHandle;
static constexpr size_t recvBufferSize = 32 * 10;
2021-06-03 14:00:50 +02:00
static std::array<uint8_t, recvBufferSize> rxBuffer;
std::array<uint8_t, 32> txBuffer;
2021-05-31 20:40:16 +02:00
};
#endif /* FSFW_HAL_STM32H7_DEVICETEST_GYRO_L3GD20H_H_ */