Implement sim devices for ADXL345, ADXL362, ADXRS450, Ultrasonic

This makes the halsim_adx_gyro_accelerometer simulation plugin and
the accelerometer part of lowfi_simulation obsolete.
This commit is contained in:
Peter Johnson
2019-09-29 00:57:16 -07:00
parent aa90645865
commit a9f0e46680
42 changed files with 371 additions and 1337 deletions

View File

@@ -7,6 +7,8 @@
#pragma once
#include <hal/SimDevice.h>
#include "frc/ErrorBase.h"
#include "frc/I2C.h"
#include "frc/interfaces/Accelerometer.h"
@@ -78,6 +80,12 @@ class ADXL345_I2C : public ErrorBase,
protected:
I2C m_i2c;
hal::SimDevice m_simDevice;
hal::SimEnum m_simRange;
hal::SimDouble m_simX;
hal::SimDouble m_simY;
hal::SimDouble m_simZ;
static constexpr int kAddress = 0x1D;
static constexpr int kPowerCtlRegister = 0x2D;
static constexpr int kDataFormatRegister = 0x31;