Vehicle Control Unit 0.01
This is the c library for controlling the car.
|
#include <stdbool.h>
#include <stdint.h>
Go to the source code of this file.
Classes | |
struct | point |
struct | table |
Macros | |
#define | TABLE_CAPACITY 64 |
Functions | |
int | point_compare (const void *a, const void *b) |
Compares two points by input. More... | |
bool | point_is_between (const point *min, const point *max, float in) |
Determines if the input value is between the input of two points. More... | |
bool | table_init (table *table, uint16_t count) |
Initializes the table. More... | |
bool | table_add_reference_point (table *table, float in, float out) |
Adds a reference point to the table. More... | |
bool | table_is_initialized (table *table) |
Checks if the table has been fully initialized, with all reference points added. More... | |
const point * | table_min_point (table *table) |
Retrieves the point in the table with the least input value. More... | |
const point * | table_max_point (table *table) |
Retrieves the point in the table with the greatest input value. More... | |
bool | table_can_sample (table *table, float in) |
Checks if the input input is valid for the table. More... | |
bool | table_sample (table *table, float in, float *out) |
Samples a output value from the table for an input value. More... | |
int point_compare | ( | const void * | a, |
const void * | b | ||
) |
Compares two points by input.
a | The first point to compare. |
b | The second point to compare. |
Definition at line 6 of file LUT.c.
Determines if the input value is between the input of two points.
min | A point with an input less than the input of max. |
max | A point with an input greater than the input of min. |
in | An input value to test with the two points. |
Definition at line 16 of file LUT.c.
bool table_add_reference_point | ( | table * | table, |
float | in, | ||
float | out | ||
) |
Adds a reference point to the table.
table | A pointer to the table to add the point to. |
in | The input ("from") value. |
out | The output ("to") value at the input value. |
Definition at line 79 of file LUT.c.
bool table_can_sample | ( | table * | table, |
float | in | ||
) |
Checks if the input input is valid for the table.
table | A pointer to the table to check. |
in | The input value to check. |
Definition at line 107 of file LUT.c.
bool table_init | ( | table * | table, |
uint16_t | count | ||
) |
Initializes the table.
table | A pointer to the table to initialize. |
count | The number of reference points in the table. |
Definition at line 31 of file LUT.c.
bool table_is_initialized | ( | table * | table | ) |
Checks if the table has been fully initialized, with all reference points added.
table | A pointer to the table to check. |
Definition at line 53 of file LUT.c.
Retrieves the point in the table with the greatest input value.
table | A pointer to the table. |
Definition at line 101 of file LUT.c.
Retrieves the point in the table with the least input value.
table | A pointer to the table. |
Definition at line 95 of file LUT.c.
bool table_sample | ( | table * | table, |
float | in, | ||
float * | out | ||
) |
Samples a output value from the table for an input value.
table | A pointer to the table to sample. |
in | The input value to sample. |
out | A pointer to the destination of the output value. |
Definition at line 137 of file LUT.c.