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

Functions

static void interp_config_set_shift (interp_config *c, uint shift)
 Set the interpolator shift valueSets the number of bits the accumulator is shifted before masking, on each iteration. More...
 
static void interp_config_set_mask (interp_config *c, uint mask_lsb, uint mask_msb)
 Set the interpolator mask rangeSets the range of bits (least to most) that are allowed to pass through the interpolator. More...
 
static void interp_config_set_cross_input (interp_config *c, bool cross_input)
 Enable cross inputAllows 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. More...
 
static void interp_config_set_cross_result (interp_config *c, bool cross_result)
 Enable cross resultsAllows feeding of the other lane’s result into this lane’s accumulator on a POP operation. More...
 
static void interp_config_set_signed (interp_config *c, bool _signed)
 Set sign extensionEnables 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. More...
 
static void interp_config_set_add_raw (interp_config *c, bool add_raw)
 Set raw add optionWhen enabled, mask + shift is bypassed for LANE0 result. This does not affect the FULL result. More...
 
static void interp_config_set_blend (interp_config *c, bool blend)
 Set blend modeIf 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) More...
 
static void interp_config_set_clamp (interp_config *c, bool clamp)
 Set interpolator clamp mode (Interpolator 1 only)Only present on INTERP1 on each core. If CLAMP mode is enabled: More...
 
static void interp_config_set_force_bits (interp_config *c, uint bits)
 Set interpolator Force bitsORed into bits 29:28 of the lane result presented to the processor on the bus. More...
 
static interp_config interp_default_config (void)
 Get a default configuration. More...
 
static void interp_set_config (interp_hw_t *interp, uint lane, interp_config *config)
 Send configuration to a laneIf an invalid configuration is specified (ie a lane specific item is set on wrong lane), depending on setup this function can panic. More...
 

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()

static void interp_config_set_add_raw ( interp_config c,
bool  add_raw 
)
inlinestatic

Set raw add optionWhen enabled, mask + shift is bypassed for LANE0 result. This does not affect the FULL result.

Parameters
cPointer to interpolation config
add_rawIf true, enable raw add option.

◆ interp_config_set_blend()

static void interp_config_set_blend ( interp_config c,
bool  blend 
)
inlinestatic

Set blend modeIf 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
cPointer to interpolation config
blendSet true to enable blend mode.

◆ interp_config_set_clamp()

static void interp_config_set_clamp ( interp_config c,
bool  clamp 
)
inlinestatic

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
cPointer to interpolation config
clampSet true to enable clamp mode

◆ interp_config_set_cross_input()

static void interp_config_set_cross_input ( interp_config c,
bool  cross_input 
)
inlinestatic

Enable cross inputAllows 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
cPointer to interpolation config
cross_inputIf true, enable the cross input.

◆ interp_config_set_cross_result()

static void interp_config_set_cross_result ( interp_config c,
bool  cross_result 
)
inlinestatic

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

Parameters
cPointer to interpolation config
cross_resultIf true, enables the cross result

◆ interp_config_set_force_bits()

static void interp_config_set_force_bits ( interp_config c,
uint  bits 
)
inlinestatic

Set interpolator Force bitsORed 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
cPointer to interpolation config
bitsSets the force bits to that specified. Range 0-3 (two bits)

◆ interp_config_set_mask()

static void interp_config_set_mask ( interp_config c,
uint  mask_lsb,
uint  mask_msb 
)
inlinestatic

Set the interpolator mask rangeSets the range of bits (least to most) that are allowed to pass through the interpolator.

Parameters
cPointer to interpolation config
mask_lsbThe least significant bit allowed to pass
mask_msbThe most significant bit allowed to pass

◆ interp_config_set_shift()

static void interp_config_set_shift ( interp_config c,
uint  shift 
)
inlinestatic

Set the interpolator shift valueSets the number of bits the accumulator is shifted before masking, on each iteration.

Parameters
cPointer to an interpolator config
shiftNumber of bits

◆ interp_config_set_signed()

static void interp_config_set_signed ( interp_config c,
bool  _signed 
)
inlinestatic

Set sign extensionEnables 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
cPointer to interpolation config
_signedIf true, enables sign extension

◆ interp_default_config()

static interp_config interp_default_config ( void  )
inlinestatic

Get a default configuration.

Returns
A default interpolation configuration

◆ interp_set_config()

static void interp_set_config ( interp_hw_t interp,
uint  lane,
interp_config config 
)
inlinestatic

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

Parameters
interpInterpolator instance, interp0 or interp1.
laneThe lane to set
configPointer to interpolation config