arduino-audio-driver
Loading...
Searching...
No Matches
STM32F411Disco.h
Go to the documentation of this file.
1#pragma once
7#include "AudioBoard.h"
8
9namespace audio_driver {
10
17 public:
19
20#if defined(IS_ZEPHYR)
21 // add i2c codec pins: scl, sda, port, frequency
22 addI2C(PinFunction::CODEC, DEVICE_DT_GET(DT_ALIAS(i2c_1)));
23 // add i2s pins: mclk, bck, ws,data_out, data_in ,(port)
24 addI2S(PinFunction::CODEC, DEVICE_DT_GET(DT_ALIAS(i2s_1)));
25
26 // add other pins
27 addPin(PinFunction::KEY, GPIO_DT_SPEC_GET(DT_ALIAS(key1), gpios), PinLogic::Output); // user button
28 addPin(PinFunction::LED, GPIO_DT_SPEC_GET(DT_ALIAS(led1), gpios), PinLogic::Output, 0); // green
29 addPin(PinFunction::LED, GPIO_DT_SPEC_GET(DT_ALIAS(led2), gpios), PinLogic::Output, 1); // red
30 addPin(PinFunction::LED, GPIO_DT_SPEC_GET(DT_ALIAS(led3), gpios), PinLogic::Output, 2); // orange
31 addPin(PinFunction::LED, GPIO_DT_SPEC_GET(DT_ALIAS(led4), gpios), PinLogic::Output, 3); // red
32 addPin(PinFunction::LED, GPIO_DT_SPEC_GET(DT_ALIAS(led5), gpios), PinLogic::Output, 4); // blue
33 addPin(PinFunction::PA, GPIO_DT_SPEC_GET(DT_ALIAS(pa), gpios), PinLogic::Output); // reset pin (active high)
34
35#else
36
37 // add i2c codec pins: scl, sda, port, frequency
38 addI2C(PinFunction::CODEC, PB6, PB9);
39 // add i2s pins: mclk, bck, ws,data_out, data_in ,(port)
40 addI2S(PinFunction::CODEC, PC7, PC10, PA4, PC12, PC3);
41
42 // add other pins
43 addPin(PinFunction::KEY, PA0, PinLogic::Output); // user button
44 addPin(PinFunction::LED, PD12, PinLogic::Output, 0); // green
46 addPin(PinFunction::LED, PD13, PinLogic::Output, 2); // orange
48 addPin(PinFunction::LED, PD15, PinLogic::Output, 4); // blue
49 addPin(PinFunction::PA, PD4, PinLogic::Output); // reset pin (active high)
50 // addPin(PinFunction::CODEC_ADC, PC3, PinLogic::Input); // Microphone
51#endif
52 }
53};
54
57
60
61} // namespace audio_driver
Defitintion for audio board pins and an audio driver.
Definition AudioBoard.h:13
All pins for i2s, spi, i2c and other pins.
Definition DriverDeviceInfo.h:20
bool addI2C(InfoI2C pin)
Definition DriverDeviceInfo.h:56
bool addI2S(InfoI2S pin)
Definition DriverDeviceInfo.h:26
bool addPin(InfoGPIO pin)
Definition DriverDeviceInfo.h:86
Pins the STM32F411Disco board using the CS43L22 codec.
Definition STM32F411Disco.h:16
PinsSTM32F411DiscoClass()
Definition STM32F411Disco.h:18
static AudioBoard STM32F411Disco
Definition STM32F411Disco.h:59
static PinsSTM32F411DiscoClass PinsSTM32F411Disco
Definition STM32F411Disco.h:56
static AudioDriverCS43l22Class AudioDriverCS43l22
Definition AudioDriver.h:2150
Namespace for audio driver components.
Definition AudioBoard.h:5