Interpolator configuration.
More...
|
static void | interp_config_set_shift (interp_config *c, uint shift) |
| Set the interpolator shift value. More...
|
|
static void | interp_config_set_mask (interp_config *c, uint mask_lsb, uint mask_msb) |
| Set the interpolator mask range. More...
|
|
static void | interp_config_set_cross_input (interp_config *c, bool cross_input) |
| Enable cross input. More...
|
|
static void | interp_config_set_cross_result (interp_config *c, bool cross_result) |
| Enable cross results. More...
|
|
static void | interp_config_set_signed (interp_config *c, bool _signed) |
| Set sign extension. More...
|
|
static void | interp_config_set_add_raw (interp_config *c, bool add_raw) |
| Set raw add option. More...
|
|
static void | interp_config_set_blend (interp_config *c, bool blend) |
| Set blend mode. More...
|
|
static void | interp_config_set_clamp (interp_config *c, bool clamp) |
| Set interpolator clamp mode (Interpolator 1 only) More...
|
|
static void | interp_config_set_force_bits (interp_config *c, uint bits) |
| Set interpolator Force bits. 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 lane. More...
|
|
Interpolator configuration.
Each interpolator needs to be configured, these functions provide handy helpers to set up configuration structures.
◆ interp_config_set_add_raw()
static void interp_config_set_add_raw |
( |
interp_config * |
c, |
|
|
bool |
add_raw |
|
) |
| |
|
inlinestatic |
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()
static void interp_config_set_blend |
( |
interp_config * |
c, |
|
|
bool |
blend |
|
) |
| |
|
inlinestatic |
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()
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
-
c | Pointer to interpolation config |
clamp | Set 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 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()
static void interp_config_set_cross_result |
( |
interp_config * |
c, |
|
|
bool |
cross_result |
|
) |
| |
|
inlinestatic |
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()
static void interp_config_set_force_bits |
( |
interp_config * |
c, |
|
|
uint |
bits |
|
) |
| |
|
inlinestatic |
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()
static void interp_config_set_mask |
( |
interp_config * |
c, |
|
|
uint |
mask_lsb, |
|
|
uint |
mask_msb |
|
) |
| |
|
inlinestatic |
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()
static void interp_config_set_shift |
( |
interp_config * |
c, |
|
|
uint |
shift |
|
) |
| |
|
inlinestatic |
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()
static void interp_config_set_signed |
( |
interp_config * |
c, |
|
|
bool |
_signed |
|
) |
| |
|
inlinestatic |
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()
Get a default configuration.
- Returns
- A default interpolation configuration
◆ interp_set_config()
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 |