16bit resolution PWM wave player with SD card, super lite version.

Dependencies:   mbed DirectSPI FastPWM

Supported boards (confirmed):
Nucleo-F030R8
Nucleo-L152RE
Nucleo-F401RE
Nucleo-F411RE

Only compilation is OK (unchecked, but may work):
Nucleo-L073RZ
Nucleo-F334R8
Nucleo-F303RE
Nucleo-F429ZI
Nucleo-F446RE
Nucleo-F446ZE
Nucleo-L476RG

Supported SD card:
SDSC/SDHC card,
FAT16 and FAT32.
(1) At first, format SD card using SD Card Formatter
https://www.sdcard.org/downloads/formatter_4/index.html
(2) Copy PCM wav files to the SD card.
Supported file:
PCM wave file that have file extension ".wav" on root directory.
16bit/8bit, fs(sampling rate)=32kHz,44.1kHz,48kHz.
Stereo/Mono.

Hardware setting:
Refer to the file port_setting.txt
PWM output port:
Left upper(Hi) PWM 8bit out: PB_5 (TM3_CH2)
Right upper(Hi) PWM 8bit out: PB4 (TM3_CH1)
Left lower(Low) PWM 8bit out: PC_9 (TM3_CH4)
Right lower(Low) PWM 8bit out: PC_8 (TM3_CH3)
http://mpu.up.seesaa.net/image/16bit-wave-player-output-schema.png
USER_BUTTON: PC_13(default button)
Next song: One click in Play mode.
Pause : Push long time .
Play : One click from Pause.

port_setting.txt

Committer:
mimi3
Date:
2020-10-09
Revision:
21:dc161a192ba7
Parent:
14:c87938f5ab01

File content as of revision 21:dc161a192ba7:

### Button SW      PC13
### LED indicator  PB10
### TEST PORT ###
#define TEST_PORT       PA_8    # D7

### USART2 ###
# PA2     ------> USART2_TX
# PA3     ------> USART2_RX

### PWM With TIM3 ###
// Use PWM3-1,PWM3-2 with TIM3
#define PWM_PORT_LEFT_HI    PB_5    // TIM3_CH2
#define PWM_PORT_RIGHT_HI   PB_4    // TIM3_CH1

// Use PWM3-3,PWM3-4 with TIM3
#define PWM_PORT_LEFT_LOW   PC_9    // TIM3_CH4
#define PWM_PORT_RIGHT_LOW  PC_8    // TIM3_CH3

### SPI1 ###
# PB6(CS) chip select port
# PA5(SCK)
# PA6(MISO)
# PA7(MOSI)