Lookup Maps

1-D linear and 2-D bilinear interpolation tables.

Header: core/ecu_map.h

float ecu_map1d_lookup(const ecu_map1d_t *map, float x)

1-D lookup with linear interpolation.

Values outside the table range are clamped to the nearest endpoint.

Parameters:
  • map[in] Pointer to a 1-D map.

  • x[in] Input value.

Returns:

Interpolated output.

float ecu_map2d_lookup(const ecu_map2d_t *map, float row_key, float col_key)

2-D lookup with bilinear interpolation.

Parameters:
  • map[in] Pointer to a 2-D map.

  • row_key[in] Row (Y-axis) input.

  • col_key[in] Column (X-axis) input.

Returns:

Interpolated output.

MAP_MAX_POINTS

Maximum breakpoints in a 1-D map.

MAP2D_MAX_ROWS

Maximum row keys in a 2-D map.

MAP2D_MAX_COLS

Maximum column keys in a 2-D map.

struct ecu_map1d_t
#include <ecu_map.h>

1-D interpolation table (x → y).

Public Members

float x[16]

X-axis breakpoints (ascending).

float y[16]

Corresponding Y values.

int count

Number of populated breakpoints.

struct ecu_map2d_t
#include <ecu_map.h>

2-D interpolation table (row, col → value).

Public Members

float row_keys[8]

Y-axis keys (ascending).

float col_keys[8]

X-axis keys (ascending).

float values[8][8]

Table values.

int rows

Number of row keys.

int cols

Number of column keys.