continued stm32 spi code
This commit is contained in:
@ -3,19 +3,32 @@
|
||||
|
||||
#include "stm32h7xx_hal.h"
|
||||
#include "stm32h7xx_hal_spi.h"
|
||||
#include <cstdint>
|
||||
|
||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <array>
|
||||
|
||||
enum class TransferStates {
|
||||
IDLE,
|
||||
WAIT,
|
||||
SUCCESS,
|
||||
FAILURE
|
||||
};
|
||||
|
||||
class GyroL3GD20H {
|
||||
public:
|
||||
GyroL3GD20H(SPI_HandleTypeDef* spiHandle);
|
||||
|
||||
ReturnValue_t initialize();
|
||||
ReturnValue_t performOperation();
|
||||
|
||||
private:
|
||||
|
||||
SPI_HandleTypeDef* spiHandle;
|
||||
static constexpr size_t recvBufferSize = 32 * 10;
|
||||
static uint8_t recvBuffer[recvBufferSize];
|
||||
static std::array<uint8_t, recvBufferSize> rxBuffer;
|
||||
std::array<uint8_t, 32> txBuffer;
|
||||
};
|
||||
|
||||
#endif /* FSFW_HAL_STM32H7_DEVICETEST_GYRO_L3GD20H_H_ */
|
||||
|
Reference in New Issue
Block a user