4.8.2.3 Metrology DSP State Control APIs
The Demo Meter application controls the states of Metrology DSP with:
static void _metrology_set_ctrl_status(DSP_CTRL_ST_CTRL_TYPE iSStatus)
Example:
_metrology_set_ctrl_status(iSInit);
_metrology_set_ctrl_status(iSRun);
The parameter type DSP_CTRL_ST_CTRL_TYPE controls the Metrology DSP status. After powering on the MCU, the Demo Meter application activates the Metrology DSP by following these steps:
- Wait for DSP to complete RESET.
- Write control registers.
- Set control status to INIT.
- Wait for DSP to complete initialization.
- Set control status to RUN.
- Wait until DSP is RUNNING.
The Demo Meter application reads the Metrology DSP status, accessing the status registers buffer. The available Metrology statuses are defined in the “PIC32CXMTx Metrology Data Sheet”.