Post Go back to editing

Controlling SS+ parameters from within the DSP firmware

Thread Summary

The user is controlling parameters in real-time from the DSP firmware using the ADSP-21569 and SigmaStudio+. The code snippet provided successfully updates the gain parameter, and the use of `uint32_t*` to cast the address of a float is confirmed as correct. The `SIGMASTUDIOTYPE_FLOAT_CONVERT` macro in `schematic_PARAM.h` is for converting parameter values for MCU control.
AI Generated Content
Category: Software
Product Number: ADSP-21569
Software Version: CCES 3.0.3.0

Hello,

I integrated a SigmaStudio+ schematics in an ADSP-21569 firmware by exporting system files and adding them to the project. It works fine.

Now I would like to control some parameters directly from the DSP firmware in realtime. I parse some UART messages coming from an STM32 and depending on those messages I will act on the SS+ parameters.

The following code returns ADI_SS_SUCCESS and I hear the effect on the sound, so it works. Could you confirm me this is the right way to do and SS+ is supposed to be controlled that way in realtime? I would like to avoid future glitches and issues.

uint32_t MOD_VOLUMEC_UI_GAIN_ADDR = 466U;
float gain = 0.4f;
ADI_SS_RESULT eResult = adi_ss_updateParam(hSSnHandle, (uint32_t*)&gain, MOD_VOLUMEC_UI_GAIN_ADDR, 1U);
if(eResult != ADI_SS_SUCCESS){
    printf("Problem when setting the parameter gain: %f\n", gain);
    exit(-1);
}

In "schematic_PARAM.h" I have the following code:

/* Module volumeGeneral_UI - Single Control Volume */
#define MOD_VOLUMEGENERAL_UI_COUNT             2
#define MOD_VOLUMEGENERAL_UI_SCHEMATIC         "DiffDXESchematic_3"
#define MOD_VOLUMEGENERAL_UI_GAIN_ADDR         4
#define MOD_VOLUMEGENERAL_UI_GAIN_FIXPT        0x3F8CCCCD
#define MOD_VOLUMEGENERAL_UI_GAIN_VALUE        SIGMASTUDIOTYPE_FLOAT_CONVERT(1.1)
#define MOD_VOLUMEGENERAL_UI_GAIN_TYPE         SIGMASTUDIOTYPE_FLOAT
#define MOD_VOLUMEGENERAL_UI_SLEWRATE_ADDR     3
#define MOD_VOLUMEGENERAL_UI_SLEWRATE_FIXPT    0x39800000
#define MOD_VOLUMEGENERAL_UI_SLEWRATE_VALUE    SIGMASTUDIOTYPE_FLOAT_CONVERT(0.000244140625)
#define MOD_VOLUMEGENERAL_UI_SLEWRATE_TYPE     SIGMASTUDIOTYPE_FLOAT

From what I understand this code is for a possible MCU controling the parameters, and 

SIGMASTUDIOTYPE_FLOAT_CONVERT is just an example of a possible convertion needed by this MCU. Could you please confirm this?
I am particularly curious about the uint32_t* cast to pass the address of a float in my previous code. I guess the type uint32_t is used but it could have been void*.
Thank you,
Fabien
Parents Reply Children
No Data