I wrote a stand-alone application for my VS1063 that:
- streams MP3 audio throught UART
- accepts a couple of commands via UART
- monitors continuously if the volume is above a certain threshold - if it is, it fires a GPIO.
To do so, I need to pause the encoding, set the new values and then restart it - that's where I'm currently stuck.
In my UserHook routine:
Code: Select all
/* Processing serial input (if any) */
if (flg_cmd_valid == 1) {
if (cmd_type == TYPE_ACTION) {
if (cmd_action == ACTION_START) {
[..] /* Some stuff */
USEX (SCI_MODE) &= (1<<SCIMB_CANCEL);
SET_LED_3_ON;
((void (*)(void))(0x0050))();
} else if (cmd_action == ACTION_STOP) {
[..] /* Other stuff */
USEX (SCI_MODE) |= (1<<SCIMB_CANCEL);
SET_LED_3_OFF;
} else if (cmd_action == ACTION_RESET) {
/* TODO */
}
}
}
I am attaching the whole project for your convenience, it is still under heavy development.
Any hints on this would be highly appreciated.