Plugin development - Interrupt advice

Writing software that inputs and/or outputs audio and performs DSP algorithms such as filters, new codecs or audio effects.
Post Reply
lorenzo318
Senior User
Posts: 62
Joined: Mon 2021-03-01 23:01

Plugin development - Interrupt advice

Post by lorenzo318 »

Hello.

I was wondering if it was possible, in a plugin, to intercept changes of the SCI_ * registers required by a write made by an MCU via SPI.

The intention is not to change the behavior of the ROM in correspondence with a change in the registers, but only to be informed about which register has been modified. I am imaging a case where in correspondence of a change of sample rate or volume o AGC, the plugin may modify same internal status variable to do something.

I would like to avoid polling registers of interest to each cycle in loop.

I only read from datasheet (VS1063) how to change the ISR routine to be executed in corrispondence of a specific SCI interrupt. But I don't want to change the behaviour of the ROM when AICTRLn registry is changed. I just want to be informed.

Is it possibile and how?

Thanks a lot,
BR,
Lorenzo
User avatar
pasi
VLSI Staff
Posts: 2019
Joined: Thu 2010-07-15 16:04

Re: Plugin development - Interrupt advice

Post by pasi »

The SCI Interrupt will call the applAddr() function (is not NULL) for reads and writes to the SCI_AICTRLx registers.

applAddr() is also called when samplerate changes (including when SCI_AIADDR is written) with APPL_RESET as the mode a parameter.

Code: Select all

s_int16 ApplAddr(register __i0 s_int16 **d, register __a1 s_int16 mode, register __a0 s_int16 n) {
    if (mode == APPL_AUDIO) {
        /*Samples are output*/
    } else if (mode == APPL_RESET) {
    	/*Samplerate changed*/
    } else if (mode == APPL_W0) { //write to AICTRL0
    } else if (mode == APPL_W1) { //write to AICTRL1
    } else if (mode == APPL_W2) { //write to AICTRL2
    } else if (mode == APPL_W3) { //write to AICTRL3
    } else if (mode == APPL_R0) { //read from AICTRL0
    	/* Note that this is called after the AICTRL0 value has already been sent by the SCI hardware. */
    } else if (mode == APPL_R1) { //read from AICTRL1
    } else if (mode == APPL_R2) { //read from AICTRL2
    } else if (mode == APPL_R3) { //read from AICTRL3
    }
    return n;
}
...
void main() {
    applAddr = ApplAddr;
    while (1)
      ;
}
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
Post Reply