@web-font-path: "roboto-debian.css";
v2.2.0 (RP2040)
Loading...
Searching...
No Matches
interp_config
hardware_interp

Interpolator configuration. More...

## Functions

static void | interp_config_set_shift (interp_config *c, uint shift)
| Set the interpolator shift value.
static void | interp_config_set_mask (interp_config *c, uint mask_lsb, uint mask_msb)
| Set the interpolator mask range.
static void | interp_config_set_cross_input (interp_config *c, bool cross_input)
| Enable cross input.
static void | interp_config_set_cross_result (interp_config *c, bool cross_result)
| Enable cross results.
static void | interp_config_set_signed (interp_config *c, bool _signed)
| Set sign extension.
static void | interp_config_set_add_raw (interp_config *c, bool add_raw)
| Set raw add option.
static void | interp_config_set_blend (interp_config *c, bool blend)
| Set blend mode.
static void | interp_config_set_clamp (interp_config *c, bool clamp)
| Set interpolator clamp mode (Interpolator 1 only).
static void | interp_config_set_force_bits (interp_config *c, uint bits)
| Set interpolator Force bits.
static interp_config | interp_default_config (void)
| Get a default configuration.
static void | interp_set_config (interp_hw_t *interp, uint lane, interp_config *config)
| Send configuration to a lane.

## Detailed Description

Interpolator configuration.

Each interpolator needs to be configured, these functions provide handy helpers to set up configuration structures.

## Function Documentation

## interp_config_set_add_raw()

void interp_config_set_add_raw | ( | interp_config * | c,
|  | bool | add_raw )

inline static

Set raw add option.

When enabled, mask + shift is bypassed for LANE0 result. This does not affect the FULL result.

Parameters

  c | Pointer to interpolation config
  add_raw | If true, enable raw add option.

## interp_config_set_blend()

void interp_config_set_blend | ( | interp_config * | c,
|  | bool | blend )

inline static

Set blend mode.

If enabled, LANE1 result is a linear interpolation between BASE0 and BASE1, controlled by the 8 LSBs of lane 1 shift and mask value (a fractional number between 0 and 255/256ths)

LANE0 result does not have BASE0 added (yields only the 8 LSBs of lane 1 shift+mask value)

FULL result does not have lane 1 shift+mask value added (BASE2 + lane 0 shift+mask)

LANE1 SIGNED flag controls whether the interpolation is signed or unsig

Parameters

  c | Pointer to interpolation config
  blend | Set true to enable blend mode.

## interp_config_set_clamp()

void interp_config_set_clamp | ( | interp_config * | c,
|  | bool | clamp )

inline static

Set interpolator clamp mode (Interpolator 1 only).

Only present on INTERP1 on each core. If CLAMP mode is enabled:

- LANE0 result is a shifted and masked ACCUM0, clamped by a lower bound of BASE0 and an upper bound of BASE1.
- Signedness of these comparisons is determined by LANE0_CTRL_SIGNED

Parameters

  c | Pointer to interpolation config
  clamp | Set true to enable clamp mode

## interp_config_set_cross_input()

void interp_config_set_cross_input | ( | interp_config * | c,
|  | bool | cross_input )

inline static

Enable cross input.

Allows feeding of the accumulator content from the other lane back in to this lanes shift+mask hardware. This will take effect even if the interp_config_set_add_raw option is set as the cross input mux is before the shift+mask bypass

Parameters

  c | Pointer to interpolation config
  cross_input | If true, enable the cross input.

## interp_config_set_cross_result()

void interp_config_set_cross_result | ( | interp_config * | c,
|  | bool | cross_result )

inline static

Enable cross results.

Allows feeding of the other lane’s result into this lane’s accumulator on a POP operation.

Parameters

  c | Pointer to interpolation config
  cross_result | If true, enables the cross result

## interp_config_set_force_bits()

void interp_config_set_force_bits | ( | interp_config * | c,
|  | uint | bits )

inline static

Set interpolator Force bits.

ORed into bits 29:28 of the lane result presented to the processor on the bus.

No effect on the internal 32-bit datapath. Handy for using a lane to generate sequence of pointers into flash or SRAM

Parameters

  c | Pointer to interpolation config
  bits | Sets the force bits to that specified. Range 0-3 (two bits)

## interp_config_set_mask()

void interp_config_set_mask | ( | interp_config * | c,
|  | uint | mask_lsb,
|  | uint | mask_msb )

inline static

Set the interpolator mask range.

Sets the range of bits (least to most) that are allowed to pass through the interpolator

Parameters

  c | Pointer to interpolation config
  mask_lsb | The least significant bit allowed to pass
  mask_msb | The most significant bit allowed to pass

## interp_config_set_shift()

void interp_config_set_shift | ( | interp_config * | c,
|  | uint | shift )

inline static

Set the interpolator shift value.

Sets the number of bits the accumulator is shifted before masking, on each iteration.

Parameters

  c | Pointer to an interpolator config
  shift | Number of bits

## interp_config_set_signed()

void interp_config_set_signed | ( | interp_config * | c,
|  | bool | _signed )

inline static

Set sign extension.

Enables signed mode, where the shifted and masked accumulator value is sign-extended to 32 bits before adding to BASE1, and LANE1 PEEK/POP results appear extended to 32 bits when read by processor.

Parameters

  c | Pointer to interpolation config
  _signed | If true, enables sign extension

## interp_default_config()

interp_config interp_default_config | ( | void |  | ) |

inline static

Get a default configuration.

Returns
  A default interpolation configuration

## interp_set_config()

void interp_set_config | ( | interp_hw_t * | interp,
|  | uint | lane,
|  | interp_config * | config )

inline static

Send configuration to a lane.

If an invalid configuration is specified (ie a lane specific item is set on wrong lane), depending on setup this function can panic.

Parameters

  interp | Interpolator instance, interp0 or interp1.
  lane | The lane to set
  config | Pointer to interpolation config