uni project for eq system
Fork of AUDIO_DISCO_F746NG by
AUDIO_DISCO_F746NG.cpp@1:7046ce26b7ed, 2017-03-22 (annotated)
- Committer:
- Jerome Coutant
- Date:
- Wed Mar 22 11:06:58 2017 +0100
- Revision:
- 1:7046ce26b7ed
- Parent:
- 0:6f035eff38e4
STM32Cube_FW_F7_V1.6.0 BSP_DISCO_F746NG
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
adustm | 0:6f035eff38e4 | 1 | /* Copyright (c) 2010-2016 mbed.org, MIT License |
adustm | 0:6f035eff38e4 | 2 | * |
adustm | 0:6f035eff38e4 | 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software |
adustm | 0:6f035eff38e4 | 4 | * and associated documentation files (the "Software"), to deal in the Software without |
adustm | 0:6f035eff38e4 | 5 | * restriction, including without limitation the rights to use, copy, modify, merge, publish, |
adustm | 0:6f035eff38e4 | 6 | * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the |
adustm | 0:6f035eff38e4 | 7 | * Software is furnished to do so, subject to the following conditions: |
adustm | 0:6f035eff38e4 | 8 | * |
adustm | 0:6f035eff38e4 | 9 | * The above copyright notice and this permission notice shall be included in all copies or |
adustm | 0:6f035eff38e4 | 10 | * substantial portions of the Software. |
adustm | 0:6f035eff38e4 | 11 | * |
adustm | 0:6f035eff38e4 | 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING |
adustm | 0:6f035eff38e4 | 13 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
adustm | 0:6f035eff38e4 | 14 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
adustm | 0:6f035eff38e4 | 15 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
adustm | 0:6f035eff38e4 | 16 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
adustm | 0:6f035eff38e4 | 17 | */ |
adustm | 0:6f035eff38e4 | 18 | |
adustm | 0:6f035eff38e4 | 19 | #include "AUDIO_DISCO_F746NG.h" |
adustm | 0:6f035eff38e4 | 20 | |
adustm | 0:6f035eff38e4 | 21 | // Constructor |
adustm | 0:6f035eff38e4 | 22 | AUDIO_DISCO_F746NG::AUDIO_DISCO_F746NG() |
adustm | 0:6f035eff38e4 | 23 | { |
Jerome Coutant
1:7046ce26b7ed
|
24
|
BSP_AUDIO_IN_OUT_Init(INPUT_DEVICE_DIGITAL_MICROPHONE_2, OUTPUT_DEVICE_HEADPHONE, DEFAULT_AUDIO_IN_FREQ, DEFAULT_AUDIO_IN_BIT_RESOLUTION, DEFAULT_AUDIO_IN_CHANNEL_NBR);
|
|
adustm | 0:6f035eff38e4 | 25 | } |
adustm | 0:6f035eff38e4 | 26 | |
adustm | 0:6f035eff38e4 | 27 | // Destructor |
adustm | 0:6f035eff38e4 | 28 | AUDIO_DISCO_F746NG::~AUDIO_DISCO_F746NG() |
adustm | 0:6f035eff38e4 | 29 | { |
adustm | 0:6f035eff38e4 | 30 | |
adustm | 0:6f035eff38e4 | 31 | } |
adustm | 0:6f035eff38e4 | 32 | |
adustm | 0:6f035eff38e4 | 33 | //================================================================================================================= |
adustm | 0:6f035eff38e4 | 34 | // Public methods |
adustm | 0:6f035eff38e4 | 35 | //================================================================================================================= |
adustm | 0:6f035eff38e4 | 36 | |
adustm | 0:6f035eff38e4 | 37 | uint8_t AUDIO_DISCO_F746NG::OUT_Init(uint16_t OutputDevice, uint8_t Volume, uint32_t AudioFreq) |
adustm | 0:6f035eff38e4 | 38 | { |
Jerome Coutant
1:7046ce26b7ed
|
39
|
return BSP_AUDIO_OUT_Init(OutputDevice, Volume, AudioFreq);
|
|
adustm | 0:6f035eff38e4 | 40 | } |
adustm | 0:6f035eff38e4 | 41 | |
adustm | 0:6f035eff38e4 | 42 | uint8_t AUDIO_DISCO_F746NG::OUT_Play(uint16_t* pBuffer, uint32_t Size) |
adustm | 0:6f035eff38e4 | 43 | { |
Jerome Coutant
1:7046ce26b7ed
|
44
|
return BSP_AUDIO_OUT_Play(pBuffer, Size);
|
|
adustm | 0:6f035eff38e4 | 45 | } |
adustm | 0:6f035eff38e4 | 46 | |
adustm | 0:6f035eff38e4 | 47 | void AUDIO_DISCO_F746NG::OUT_ChangeBuffer(uint16_t *pData, uint16_t Size) |
adustm | 0:6f035eff38e4 | 48 | { |
Jerome Coutant
1:7046ce26b7ed
|
49
|
BSP_AUDIO_OUT_ChangeBuffer(pData, Size);
|
|
adustm | 0:6f035eff38e4 | 50 | } |
adustm | 0:6f035eff38e4 | 51 | |
adustm | 0:6f035eff38e4 | 52 | uint8_t AUDIO_DISCO_F746NG::OUT_Pause(void) |
adustm | 0:6f035eff38e4 | 53 | { |
Jerome Coutant
1:7046ce26b7ed
|
54
|
return BSP_AUDIO_OUT_Pause();
|
|
adustm | 0:6f035eff38e4 | 55 | } |
adustm | 0:6f035eff38e4 | 56 | |
adustm | 0:6f035eff38e4 | 57 | uint8_t AUDIO_DISCO_F746NG::OUT_Resume(void) |
adustm | 0:6f035eff38e4 | 58 | { |
Jerome Coutant
1:7046ce26b7ed
|
59
|
return BSP_AUDIO_OUT_Resume();
|
|
adustm | 0:6f035eff38e4 | 60 | } |
adustm | 0:6f035eff38e4 | 61 | |
adustm | 0:6f035eff38e4 | 62 | uint8_t AUDIO_DISCO_F746NG::OUT_Stop(uint32_t Option) |
adustm | 0:6f035eff38e4 | 63 | { |
Jerome Coutant
1:7046ce26b7ed
|
64
|
return BSP_AUDIO_OUT_Stop(Option);
|
|
adustm | 0:6f035eff38e4 | 65 | } |
adustm | 0:6f035eff38e4 | 66 | |
adustm | 0:6f035eff38e4 | 67 | uint8_t AUDIO_DISCO_F746NG::OUT_SetVolume(uint8_t Volume) |
adustm | 0:6f035eff38e4 | 68 | { |
Jerome Coutant
1:7046ce26b7ed
|
69
|
return BSP_AUDIO_OUT_SetVolume(Volume);
|
|
adustm | 0:6f035eff38e4 | 70 | } |
adustm | 0:6f035eff38e4 | 71 | |
adustm | 0:6f035eff38e4 | 72 | uint8_t AUDIO_DISCO_F746NG::OUT_SetMute(uint32_t Cmd) |
adustm | 0:6f035eff38e4 | 73 | { |
Jerome Coutant
1:7046ce26b7ed
|
74
|
return BSP_AUDIO_OUT_SetMute(Cmd);
|
|
adustm | 0:6f035eff38e4 | 75 | } |
adustm | 0:6f035eff38e4 | 76 | |
adustm | 0:6f035eff38e4 | 77 | uint8_t AUDIO_DISCO_F746NG::OUT_SetOutputMode(uint8_t Output) |
adustm | 0:6f035eff38e4 | 78 | { |
Jerome Coutant
1:7046ce26b7ed
|
79
|
return BSP_AUDIO_OUT_SetOutputMode(Output);
|
|
adustm | 0:6f035eff38e4 | 80 | } |
adustm | 0:6f035eff38e4 | 81 | |
adustm | 0:6f035eff38e4 | 82 | void AUDIO_DISCO_F746NG::OUT_SetFrequency(uint32_t AudioFreq) |
adustm | 0:6f035eff38e4 | 83 | { |
Jerome Coutant
1:7046ce26b7ed
|
84
|
BSP_AUDIO_OUT_SetFrequency(AudioFreq);
|
|
adustm | 0:6f035eff38e4 | 85 | } |
adustm | 0:6f035eff38e4 | 86 | |
adustm | 0:6f035eff38e4 | 87 | void AUDIO_DISCO_F746NG::OUT_SetAudioFrameSlot(uint32_t AudioFrameSlot) |
adustm | 0:6f035eff38e4 | 88 | { |
Jerome Coutant
1:7046ce26b7ed
|
89
|
BSP_AUDIO_OUT_SetAudioFrameSlot(AudioFrameSlot);
|
|
adustm | 0:6f035eff38e4 | 90 | } |
adustm | 0:6f035eff38e4 | 91 | |
adustm | 0:6f035eff38e4 | 92 | void AUDIO_DISCO_F746NG::OUT_DeInit(void) |
adustm | 0:6f035eff38e4 | 93 | { |
Jerome Coutant
1:7046ce26b7ed
|
94
|
BSP_AUDIO_OUT_DeInit();
|
|
adustm | 0:6f035eff38e4 | 95 | } |
adustm | 0:6f035eff38e4 | 96 | |
adustm | 0:6f035eff38e4 | 97 | uint8_t AUDIO_DISCO_F746NG::IN_Init(uint16_t InputDevice, uint8_t Volume, uint32_t AudioFreq) |
adustm | 0:6f035eff38e4 | 98 | { |
Jerome Coutant
1:7046ce26b7ed
|
99
|
return BSP_AUDIO_IN_Init(InputDevice, Volume, AudioFreq);
|
|
adustm | 0:6f035eff38e4 | 100 | } |
adustm | 0:6f035eff38e4 | 101 | |
Jerome Coutant
1:7046ce26b7ed
|
102
|
uint8_t AUDIO_DISCO_F746NG::IN_OUT_Init(uint16_t InputDevice, uint16_t OutputDevice, uint32_t AudioFreq, uint32_t BitRes, uint32_t ChnlNbr)
|
|
adustm | 0:6f035eff38e4 | 103 | { |
Jerome Coutant
1:7046ce26b7ed
|
104
|
return BSP_AUDIO_IN_OUT_Init(InputDevice, OutputDevice, AudioFreq, BitRes, ChnlNbr);
|
|
adustm | 0:6f035eff38e4 | 105 | } |
adustm | 0:6f035eff38e4 | 106 | |
adustm | 0:6f035eff38e4 | 107 | uint8_t AUDIO_DISCO_F746NG::IN_Record(uint16_t* pbuf, uint32_t size) |
adustm | 0:6f035eff38e4 | 108 | { |
Jerome Coutant
1:7046ce26b7ed
|
109
|
return BSP_AUDIO_IN_Record(pbuf, size);
|
|
adustm | 0:6f035eff38e4 | 110 | } |
adustm | 0:6f035eff38e4 | 111 | |
adustm | 0:6f035eff38e4 | 112 | uint8_t AUDIO_DISCO_F746NG::IN_Stop(uint32_t Option) |
adustm | 0:6f035eff38e4 | 113 | { |
Jerome Coutant
1:7046ce26b7ed
|
114
|
return BSP_AUDIO_IN_Stop(Option);
|
|
adustm | 0:6f035eff38e4 | 115 | } |
adustm | 0:6f035eff38e4 | 116 | |
adustm | 0:6f035eff38e4 | 117 | uint8_t AUDIO_DISCO_F746NG::IN_Pause(void) |
adustm | 0:6f035eff38e4 | 118 | { |
Jerome Coutant
1:7046ce26b7ed
|
119
|
return BSP_AUDIO_IN_Pause();
|
|
adustm | 0:6f035eff38e4 | 120 | } |
adustm | 0:6f035eff38e4 | 121 | |
adustm | 0:6f035eff38e4 | 122 | uint8_t AUDIO_DISCO_F746NG::IN_Resume(void) |
adustm | 0:6f035eff38e4 | 123 | { |
Jerome Coutant
1:7046ce26b7ed
|
124
|
return BSP_AUDIO_IN_Resume();
|
|
adustm | 0:6f035eff38e4 | 125 | } |
adustm | 0:6f035eff38e4 | 126 | |
adustm | 0:6f035eff38e4 | 127 | uint8_t AUDIO_DISCO_F746NG::IN_SetVolume(uint8_t Volume) |
adustm | 0:6f035eff38e4 | 128 | { |
Jerome Coutant
1:7046ce26b7ed
|
129
|
return BSP_AUDIO_IN_SetVolume(Volume);
|
|
adustm | 0:6f035eff38e4 | 130 | } |
adustm | 0:6f035eff38e4 | 131 | |
adustm | 0:6f035eff38e4 | 132 | void AUDIO_DISCO_F746NG::IN_DeInit(void) |
adustm | 0:6f035eff38e4 | 133 | { |
Jerome Coutant
1:7046ce26b7ed
|
134
|
BSP_AUDIO_IN_DeInit();
|
|
adustm | 0:6f035eff38e4 | 135 | } |