Moves Gyros to the HAL (#131)

This commit is contained in:
Thad House
2016-07-07 21:31:45 -07:00
committed by Peter Johnson
parent b036bf2e34
commit 0a983eeeb8
12 changed files with 632 additions and 127 deletions

View File

@@ -0,0 +1,32 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2016. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include <stdint.h>
#include "HAL/Handles.h"
extern "C" {
HalGyroHandle initializeAnalogGyro(HalAnalogInputHandle handle,
int32_t* status);
void setupAnalogGyro(HalGyroHandle handle, int32_t* status);
void freeAnalogGyro(HalGyroHandle handle);
void setAnalogGyroParameters(HalGyroHandle handle,
float voltsPerDegreePerSecond, float offset,
uint32_t center, int32_t* status);
void setAnalogGyroVoltsPerDegreePerSecond(HalGyroHandle handle,
float voltsPerDegreePerSecond,
int32_t* status);
void resetAnalogGyro(HalGyroHandle handle, int32_t* status);
void calibrateAnalogGyro(HalGyroHandle handle, int32_t* status);
void setAnalogGyroDeadband(HalGyroHandle handle, float volts, int32_t* status);
float getAnalogGyroAngle(HalGyroHandle handle, int32_t* status);
double getAnalogGyroRate(HalGyroHandle handle, int32_t* status);
float getAnalogGyroOffset(HalGyroHandle handle, int32_t* status);
uint32_t getAnalogGyroCenter(HalGyroHandle handle, int32_t* status);
}

View File

@@ -11,6 +11,7 @@
#include "Accelerometer.h"
#include "AnalogAccumulator.h"
#include "AnalogGyro.h"
#include "AnalogInput.h"
#include "AnalogOutput.h"
#include "AnalogTrigger.h"

View File

@@ -40,3 +40,5 @@ typedef HalHandle HalSolenoidHandle;
typedef HalHandle HalFPGAEncoderHandle;
typedef HalHandle HalEncoderHandle;
typedef HalHandle HalGyroHandle;