arduino-audio-driver
Loading...
Searching...
No Matches
src
AudioBoards
STM32F411Disco.h
Go to the documentation of this file.
1
#pragma once
7
#include "
AudioBoard.h
"
8
9
namespace
audio_driver
{
10
16
class
PinsSTM32F411DiscoClass
:
public
DriverDeviceInfo
{
17
public
:
18
PinsSTM32F411DiscoClass
() {
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
45
addPin
(
PinFunction::LED
, PD5,
PinLogic::Output
, 1);
// red
46
addPin
(
PinFunction::LED
, PD13,
PinLogic::Output
, 2);
// orange
47
addPin
(
PinFunction::LED
, PD14,
PinLogic::Output
, 3);
// red
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
56
static
PinsSTM32F411DiscoClass
PinsSTM32F411Disco
;
57
59
static
AudioBoard
STM32F411Disco
{
AudioDriverCS43l22
,
PinsSTM32F411Disco
};
60
61
}
// namespace audio_driver
AudioBoard.h
audio_driver::AudioBoard
Defitintion for audio board pins and an audio driver.
Definition
AudioBoard.h:13
audio_driver::DriverDeviceInfo
All pins for i2s, spi, i2c and other pins.
Definition
DriverDeviceInfo.h:20
audio_driver::DriverDeviceInfo::addI2C
bool addI2C(InfoI2C pin)
Definition
DriverDeviceInfo.h:56
audio_driver::DriverDeviceInfo::addI2S
bool addI2S(InfoI2S pin)
Definition
DriverDeviceInfo.h:26
audio_driver::DriverDeviceInfo::addPin
bool addPin(InfoGPIO pin)
Definition
DriverDeviceInfo.h:86
audio_driver::PinsSTM32F411DiscoClass
Pins the STM32F411Disco board using the CS43L22 codec.
Definition
STM32F411Disco.h:16
audio_driver::PinsSTM32F411DiscoClass::PinsSTM32F411DiscoClass
PinsSTM32F411DiscoClass()
Definition
STM32F411Disco.h:18
audio_driver::STM32F411Disco
static AudioBoard STM32F411Disco
Definition
STM32F411Disco.h:59
audio_driver::PinsSTM32F411Disco
static PinsSTM32F411DiscoClass PinsSTM32F411Disco
Definition
STM32F411Disco.h:56
audio_driver::AudioDriverCS43l22
static AudioDriverCS43l22Class AudioDriverCS43l22
Definition
AudioDriver.h:2150
audio_driver
Namespace for audio driver components.
Definition
AudioBoard.h:5
audio_driver::PinLogic::Output
@ Output
audio_driver::PinFunction::PA
@ PA
audio_driver::PinFunction::KEY
@ KEY
audio_driver::PinFunction::CODEC
@ CODEC
audio_driver::PinFunction::LED
@ LED
Generated by
1.9.8