uni project for eq system
Fork of AUDIO_DISCO_F746NG by
AUDIO_DISCO_F746NG.cpp@2:b82abc6fcaef, 2017-03-29 (annotated)
- Committer:
- valadore
- Date:
- Wed Mar 29 10:07:10 2017 +0000
- Revision:
- 2:b82abc6fcaef
- Parent:
- 0:6f035eff38e4
updating audio bsp for simultaneous in-out;
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 | { |
valadore | 2:b82abc6fcaef | 24 | BSP_AUDIO_IN_OUT_Init(INPUT_DEVICE_INPUT_LINE_1, OUTPUT_DEVICE_HEADPHONE, 70, 48000); |
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 | { |
adustm | 0:6f035eff38e4 | 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 | { |
adustm | 0:6f035eff38e4 | 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 | { |
adustm | 0:6f035eff38e4 | 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 | { |
adustm | 0:6f035eff38e4 | 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 | { |
adustm | 0:6f035eff38e4 | 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 | { |
adustm | 0:6f035eff38e4 | 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 | { |
adustm | 0:6f035eff38e4 | 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 | { |
adustm | 0:6f035eff38e4 | 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 | { |
adustm | 0:6f035eff38e4 | 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 | { |
adustm | 0:6f035eff38e4 | 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 | { |
adustm | 0:6f035eff38e4 | 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 | { |
adustm | 0:6f035eff38e4 | 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 | { |
adustm | 0:6f035eff38e4 | 99 | return BSP_AUDIO_IN_Init(InputDevice, Volume, AudioFreq); |
adustm | 0:6f035eff38e4 | 100 | } |
adustm | 0:6f035eff38e4 | 101 | |
adustm | 0:6f035eff38e4 | 102 | uint8_t AUDIO_DISCO_F746NG::IN_OUT_Init(uint16_t InputDevice, uint16_t OutputDevice, uint8_t Volume, uint32_t AudioFreq) |
adustm | 0:6f035eff38e4 | 103 | { |
adustm | 0:6f035eff38e4 | 104 | return BSP_AUDIO_IN_OUT_Init(InputDevice, OutputDevice, Volume, AudioFreq); |
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 | { |
adustm | 0:6f035eff38e4 | 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 | { |
adustm | 0:6f035eff38e4 | 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 | { |
adustm | 0:6f035eff38e4 | 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 | { |
adustm | 0:6f035eff38e4 | 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 | { |
adustm | 0:6f035eff38e4 | 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 | { |
adustm | 0:6f035eff38e4 | 134 | BSP_AUDIO_IN_DeInit(); |
adustm | 0:6f035eff38e4 | 135 | } |