Interpolator configuration. More...
Data Structures | |
| struct | interp_config |
| Holds the configuration for an interpolator lane. 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. | |
Interpolator configuration.
Each interpolator needs to be configured, these functions provide handy helpers to set up configuration structures.
|
inlinestatic |
Set raw add option.
When enabled, mask + shift is bypassed for LANE0 result. This does not affect the FULL result.
| c | Pointer to interpolation config |
| add_raw | If true, enable raw add option. |
|
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
| c | Pointer to interpolation config |
| blend | Set true to enable blend mode. |
|
inlinestatic |
Set interpolator clamp mode (Interpolator 1 only).
Only present on INTERP1 on each core. If CLAMP mode is enabled:
| c | Pointer to interpolation config |
| clamp | Set true to enable clamp mode |
|
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
| c | Pointer to interpolation config |
| cross_input | If true, enable the cross input. |
|
inlinestatic |
Enable cross results.
Allows feeding of the other lane's result into this lane's accumulator on a POP operation.
| c | Pointer to interpolation config |
| cross_result | If true, enables the cross result |
|
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
| c | Pointer to interpolation config |
| bits | Sets the force bits to that specified. Range 0-3 (two bits) |
|
inlinestatic |
Set the interpolator mask range.
Sets the range of bits (least to most) that are allowed to pass through the interpolator
| c | Pointer to interpolation config |
| mask_lsb | The least significant bit allowed to pass |
| mask_msb | The most significant bit allowed to pass |
|
inlinestatic |
Set the interpolator shift value.
Sets the number of bits the accumulator is shifted before masking, on each iteration.
| c | Pointer to an interpolator config |
| shift | Number of bits |
|
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.
| c | Pointer to interpolation config |
| _signed | If true, enables sign extension |
|
inlinestatic |
Get a default configuration.
|
inlinestatic |
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.
| interp | Interpolator instance, interp0 or interp1. |
| lane | The lane to set |
| config | Pointer to interpolation config |