もっと今更、SC-88ProにS/PDIFを付けよう
もっと今更、SC-88ProにS/PDIFを付けよう
STM32F103C8T6 ARM STM32 (blue pill)
- モデル:STM32F103C8T6
- コア:ARM 32 Cortex-M3 CPU
- 72MHz頻度を作動させる
- 64Kフラッシュメモリ、20K SRAM
- 2.0-3.6Vパワー、I/O
というやつ。
詳細はwikiの説明に
https://developer.mbed.org/users/peu605/code/DIT88proSTM32F1/wiki/説明
しまったなぁ、wikiのタイトル、漢字にしてしまったよ…
STM32F103C8T6, Roland, SC-88pro, S/PDIF, SPIDF, デジタル出力
Revision 5:1141ebe337d8, committed 2017-09-05
- Comitter:
- peu605
- Date:
- Tue Sep 05 14:36:40 2017 +0000
- Parent:
- 4:c7c69c9b3cac
- Child:
- 6:669e7d1eac35
- Commit message:
- try to use stdio
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Sep 05 12:44:45 2017 +0000 +++ b/main.cpp Tue Sep 05 14:36:40 2017 +0000 @@ -50,6 +50,8 @@ // SPI bit delay volatile uint32_t spiDelay = 0; +// Serial pc(PA_2, PA_3); + extern "C" void DMA1_Channel4_IRQHandler(void) { @@ -357,46 +359,42 @@ #ifdef _DEBUG_CONSOLE void debugOut() { - static char str[17]; - static Serial pc(PA_2, PA_3); + + char str[32]; -// pc.printf("SystemCoreClock =%d\n", SystemCoreClock); +// printf("SystemCoreClock =%d\n", SystemCoreClock); -/* - // dump raw data - uint16_t tmp = spiRxBuff[0].ltCh[6]; - toBinary(&tmp, (char*) &str); - pc.printf("Delay:%02d %s ", spiDelay, str); - tmp = spiRxBuff[0].ltCh[7]; - toBinary(&tmp, (char*) &str); - pc.printf("%s\n", str); - HAL_Delay(200); -*/ +// // dump raw data +// uint16_t tmp = spiRxBuff[0].ltCh[6]; +// toBinary(&tmp, (char*) &str); +// printf("Delay:%02d %s ", spiDelay, str); +// tmp = spiRxBuff[0].ltCh[7]; +// toBinary(&tmp, (char*) &str); +// printf("%s\n", str); +// HAL_Delay(200); // dump shifted data int32_t val = (spiRxBuff[0].ltCh[6] << 16) | (spiRxBuff[0].ltCh[7]); val >>= spiDelay; uint16_t tmp = (val & 0xffff0000) >> 16; toBinary(&tmp, (char*) &str); - pc.printf("Delay:%02d %s ", spiDelay, str); + printf("Delay:%02d %s ", spiDelay, str); tmp = val & 0xffff; toBinary(&tmp, (char*) &str); - pc.printf("%s\n", str); + printf("%s\n", str); HAL_Delay(200); -/* - // find loud 18bit data - int32_t val = (spiRxBuff[0].ltCh[6] << 16) | (spiRxBuff[0].ltCh[7]); - val >>= spiDelay; - uint16_t tmp = (val & 0xffff0000) >> 16; - if ((tmp & 0b1111) == 0b1110 || (tmp & 0b1111) == 0b0001) { - toBinary(&tmp, (char*) &str); - pc.printf("Delay:%02d %s ", spiDelay, str); - tmp = val & 0xffff; - toBinary(&tmp, (char*) &str); - pc.printf("%s\n", str); - } -*/ +// // find loud 18bit data +// int32_t val = (spiRxBuff[0].ltCh[6] << 16) | (spiRxBuff[0].ltCh[7]); +// val >>= spiDelay; +// uint16_t tmp = (val & 0xffff0000) >> 16; +// if ((tmp & 0b1111) == 0b1110 || (tmp & 0b1111) == 0b0001) { +// toBinary(&tmp, (char*) &str); +// printf("Delay:%02d %s ", spiDelay, str); +// tmp = val & 0xffff; +// toBinary(&tmp, (char*) &str); +// printf("%s\n", str); +// } } #endif @@ -454,8 +452,10 @@ /* Update CMSIS variable (which can be updated also through SystemCoreClockUpdate function) */ LL_SetSystemCoreClock(72000000); - // re-set baud rate. + // Set baud rate again. // pc.baud(9600); + extern serial_t stdio_uart; + serial_baud(&stdio_uart, 9600); }