-
Notifications
You must be signed in to change notification settings - Fork 0
/
yaw.h
41 lines (28 loc) · 990 Bytes
/
yaw.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//************************************************************************
// yaw.c
// Helicopter project
// Group: A03 Group 10
// Last Edited: 31-5-18
//
// Purpose: Handles the yaw of the helicopter
//************************************************************************
#ifndef YAW_H_
#define YAW_H_
#include <stdint.h>
#include <stdbool.h>
// Initiate Calibration
// Enables yaw calibration interrupt
void yawCalibrate(void);
// Return true if yaw has been calibrated against the reference position
bool yawIsCalibrated(void);
// Initialize quadrature encoder and configure yaw reference GPIO pin and interrupt
void yawInit(void);
// Return the current yaw in degrees
//
// Parameters:
// int32_t precision scale factor for retaining accuracy with integers
int32_t yawGetDegrees(int32_t precision);
// Remove excess factors of 360 degrees from yaw
// Returns true if the adjusted yaw value is less than 180 degree
void yawClipTo360Degrees(void);
#endif /*YAW_H_*/