Hardware Interpolator API. More...
Topics | |
| interp_config | |
| Interpolator configuration. | |
Data Structures | |
| struct | interp_hw_save_t |
| Saved interpolator hardware state. More... | |
Functions | |
| void | interp_claim_lane (interp_hw_t *interp, uint lane) |
| Claim the interpolator lane specified. | |
| void | interp_claim_lane_mask (interp_hw_t *interp, uint lane_mask) |
| Claim the interpolator lanes specified in the mask. | |
| void | interp_unclaim_lane (interp_hw_t *interp, uint lane) |
| Release a previously claimed interpolator lane. | |
| bool | interp_lane_is_claimed (interp_hw_t *interp, uint lane) |
| Determine if an interpolator lane is claimed. | |
| void | interp_unclaim_lane_mask (interp_hw_t *interp, uint lane_mask) |
| Release previously claimed interpolator lanes, see interp_claim_lane_mask. | |
| static void | interp_set_force_bits (interp_hw_t *interp, uint lane, uint bits) |
| Directly set the force bits on a specified lane. | |
| void | interp_save (interp_hw_t *interp, interp_hw_save_t *saver) |
| Save the specified interpolator state. | |
| void | interp_restore (interp_hw_t *interp, interp_hw_save_t *saver) |
| Restore an interpolator state. | |
| static void | interp_set_base (interp_hw_t *interp, uint index, uint32_t val) |
| Sets the interpolator base register by index. | |
| static uint32_t | interp_get_base (interp_hw_t *interp, uint index) |
| Gets the content of interpolator base register by index. | |
| static void | interp_set_base_both (interp_hw_t *interp, uint32_t val) |
| Sets the interpolator base registers simultaneously. | |
| static void | interp_set_accumulator (interp_hw_t *interp, uint lane, uint32_t val) |
| Sets the interpolator accumulator register by lane. | |
| static uint32_t | interp_get_accumulator (interp_hw_t *interp, uint lane) |
| Gets the content of the interpolator accumulator register by lane. | |
| static uint32_t | interp_pop_lane_result (interp_hw_t *interp, uint lane) |
| Read lane result, and write lane results to both accumulators to update the interpolator. | |
| static uint32_t | interp_peek_lane_result (interp_hw_t *interp, uint lane) |
| Read lane result. | |
| static uint32_t | interp_pop_full_result (interp_hw_t *interp) |
| Read lane result, and write lane results to both accumulators to update the interpolator. | |
| static uint32_t | interp_peek_full_result (interp_hw_t *interp) |
| Read lane result. | |
| static void | interp_add_accumulator (interp_hw_t *interp, uint lane, uint32_t val) |
| Add to accumulator. | |
| static uint32_t | interp_get_raw (interp_hw_t *interp, uint lane) |
| Get raw lane value. | |
Hardware Interpolator API.
Each core is equipped with two interpolators (INTERP0 and INTERP1) which can be used to accelerate tasks by combining certain pre-configured simple operations into a single processor cycle. Intended for cases where the pre-configured operation is repeated a large number of times, this results in code which uses both fewer CPU cycles and fewer CPU registers in the time critical sections of the code.
The interpolators are used heavily to accelerate audio operations within the SDK, but their flexible configuration make it possible to optimise many other tasks such as quantization and dithering, table lookup address generation, affine texture mapping, decompression and linear feedback.
Please refer to the appropriate RP-series microcontroller datasheet for more information on the HW interpolators and how they work.
|
inlinestatic |
Add to accumulator.
Atomically add the specified value to the accumulator on the specified lane
| interp | Interpolator instance, interp0 or interp1. |
| lane | The lane number, 0 or 1 |
| val | Value to add |
| void interp_claim_lane | ( | interp_hw_t * | interp, |
| uint | lane ) |
Claim the interpolator lane specified.
Use this function to claim exclusive access to the specified interpolator lane.
This function will panic if the lane is already claimed.
| interp | Interpolator on which to claim a lane. interp0 or interp1 |
| lane | The lane number, 0 or 1. |
| void interp_claim_lane_mask | ( | interp_hw_t * | interp, |
| uint | lane_mask ) |
Claim the interpolator lanes specified in the mask.
| interp | Interpolator on which to claim lanes. interp0 or interp1 |
| lane_mask | Bit pattern of lanes to claim (only bits 0 and 1 are valid) |
|
inlinestatic |
Gets the content of the interpolator accumulator register by lane.
| interp | Interpolator instance, interp0 or interp1. |
| lane | The lane number, 0 or 1 |
|
inlinestatic |
Gets the content of interpolator base register by index.
| interp | Interpolator instance, interp0 or interp1. |
| index | The base register index, 0 or 1 or 2 |
|
inlinestatic |
Get raw lane value.
Returns the raw shift and mask value from the specified lane, BASE0/BASE1 is NOT added
| interp | Interpolator instance, interp0 or interp1. |
| lane | The lane number, 0 or 1 |
| bool interp_lane_is_claimed | ( | interp_hw_t * | interp, |
| uint | lane ) |
Determine if an interpolator lane is claimed.
| interp | Interpolator whose lane to check |
| lane | The lane number, 0 or 1 |
|
inlinestatic |
Read lane result.
| interp | Interpolator instance, interp0 or interp1. |
|
inlinestatic |
Read lane result.
| interp | Interpolator instance, interp0 or interp1. |
| lane | The lane number, 0 or 1 |
|
inlinestatic |
Read lane result, and write lane results to both accumulators to update the interpolator.
| interp | Interpolator instance, interp0 or interp1. |
|
inlinestatic |
Read lane result, and write lane results to both accumulators to update the interpolator.
| interp | Interpolator instance, interp0 or interp1. |
| lane | The lane number, 0 or 1 |
| void interp_restore | ( | interp_hw_t * | interp, |
| interp_hw_save_t * | saver ) |
Restore an interpolator state.
| interp | Interpolator instance, interp0 or interp1. |
| saver | Pointer to save structure to reapply to the specified interpolator |
| void interp_save | ( | interp_hw_t * | interp, |
| interp_hw_save_t * | saver ) |
Save the specified interpolator state.
Can be used to save state if you need an interpolator for another purpose, state can then be recovered afterwards and continue from that point
| interp | Interpolator instance, interp0 or interp1. |
| saver | Pointer to the save structure to fill in |
|
inlinestatic |
Sets the interpolator accumulator register by lane.
| interp | Interpolator instance, interp0 or interp1. |
| lane | The lane number, 0 or 1 |
| val | The value to apply to the register |
|
inlinestatic |
Sets the interpolator base register by index.
| interp | Interpolator instance, interp0 or interp1. |
| index | The base register index, 0 or 1 or 2 |
| val | The value to apply to the register |
|
inlinestatic |
Sets the interpolator base registers simultaneously.
The lower 16 bits go to BASE0, upper bits to BASE1 simultaneously. Each half is sign-extended to 32 bits if that lane's SIGNED flag is set.
| interp | Interpolator instance, interp0 or interp1. |
| val | The value to apply to the register |
|
inlinestatic |
Directly set the force bits on a specified lane.
These bits are ORed into bits 29:28 of the lane result presented to the processor on the bus. There is no effect on the internal 32-bit datapath.
Useful for using a lane to generate sequence of pointers into flash or SRAM, saving a subsequent OR or add operation.
| interp | Interpolator instance, interp0 or interp1. |
| lane | The lane to set |
| bits | The bits to set (bits 0 and 1, value range 0-3) |
| void interp_unclaim_lane | ( | interp_hw_t * | interp, |
| uint | lane ) |
Release a previously claimed interpolator lane.
| interp | Interpolator on which to release a lane. interp0 or interp1 |
| lane | The lane number, 0 or 1 |
| void interp_unclaim_lane_mask | ( | interp_hw_t * | interp, |
| uint | lane_mask ) |
Release previously claimed interpolator lanes, see interp_claim_lane_mask.
| interp | Interpolator on which to release lanes. interp0 or interp1 |
| lane_mask | Bit pattern of lanes to unclaim (only bits 0 and 1 are valid) |