4#include "../Inc/Utils/LUT.h"
23 if (min == NULL || max == NULL) {
45 for (uint16_t n = 0; n < count; ++n) {
61 if (!all_reference_points) {
149 if (in == min->
input) {
154 if (in == max->
input) {
int point_compare(const void *a, const void *b)
Compares two points by input.
uint16_t table_search(const table *table, double in)
bool table_is_initialized(table *table)
Checks if the table has been fully initialized, with all reference points added.
bool table_sample(table *table, float in, float *out)
Samples a output value from the table for an input value.
bool table_init(table *table, uint16_t count)
Initializes the table.
const point * table_min_point(table *table)
Retrieves the point in the table with the least input value.
bool can_interpolate(const point *min, const point *max, float in)
bool table_can_sample(table *table, float in)
Checks if the input input is valid for the table.
bool point_is_between(const point *min, const point *max, float in)
Determines if the input value is between the input of two points.
const point * table_max_point(table *table)
Retrieves the point in the table with the greatest input value.
bool table_add_reference_point(table *table, float in, float out)
Adds a reference point to the table.
void table_sort(table *table)
point points_[TABLE_CAPACITY]