Skip to content
Snippets Groups Projects
Commit 4ece68e1 authored by burneykb's avatar burneykb
Browse files
parents c015e5f9 84dd0658
No related branches found
No related tags found
No related merge requests found
#ifndef FRONTEND_COMMON_H
#define FRONTEND_COMMON_H
#include <stdlib.h>
struct backend_conn;
......@@ -16,6 +17,6 @@ void ucart_backendDisconnect(struct backend_conn * conn);
char * ucart_backendGetline(struct backend_conn * conn);
/* Write a line to the backend */
void ucart_backendWrite(struct backend_conn * backend, const char * line);
size_t ucart_backendWrite(struct backend_conn * backend, const char * line);
#endif
#ifndef FRONTEND_GETPID_H
#define FRONTEND_GETPID_H
#include "frontend_common.h"
#include "pid_common.h"
/* Get a specified PID.
*
* Example:
*
* struct frontend_pid_data pid_data;
* pid_data.pid = PITCH;
* if (frontend_getpid(conn, &pid_data)) {
* error
* } else {
* pid_data.p, pid_data.i, and pid_data.d are filled
* }
*
* Returns 0 on success, 1 on error
*/
int frontend_getpid(
struct backend_conn * conn,
struct frontend_pid_data * pid_data);
#endif
#ifndef PID_COMMON_H
#define PID_COMMON_H
enum frontend_pid {
PITCH,
ROLL,
YAW,
NUM_PIDS
};
struct frontend_pid_data {
enum frontend_pid pid;
float p;
float i;
float d;
};
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment