test public
Dependencies: HttpServer_snapshot_mbed-os
mbed-gr-libs/components/AUDIO/AUDIO_GRBoard.h@0:e9fd5575b10e, 2019-10-18 (annotated)
- Committer:
- anhtran
- Date:
- Fri Oct 18 03:09:43 2019 +0000
- Revision:
- 0:e9fd5575b10e
abc
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
anhtran | 0:e9fd5575b10e | 1 | /******************************************************************************* |
anhtran | 0:e9fd5575b10e | 2 | * DISCLAIMER |
anhtran | 0:e9fd5575b10e | 3 | * This software is supplied by Renesas Electronics Corporation and is only |
anhtran | 0:e9fd5575b10e | 4 | * intended for use with Renesas products. No other uses are authorized. This |
anhtran | 0:e9fd5575b10e | 5 | * software is owned by Renesas Electronics Corporation and is protected under |
anhtran | 0:e9fd5575b10e | 6 | * all applicable laws, including copyright laws. |
anhtran | 0:e9fd5575b10e | 7 | * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING |
anhtran | 0:e9fd5575b10e | 8 | * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT |
anhtran | 0:e9fd5575b10e | 9 | * LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE |
anhtran | 0:e9fd5575b10e | 10 | * AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. |
anhtran | 0:e9fd5575b10e | 11 | * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS |
anhtran | 0:e9fd5575b10e | 12 | * ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE |
anhtran | 0:e9fd5575b10e | 13 | * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR |
anhtran | 0:e9fd5575b10e | 14 | * ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE |
anhtran | 0:e9fd5575b10e | 15 | * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. |
anhtran | 0:e9fd5575b10e | 16 | * Renesas reserves the right, without notice, to make changes to this software |
anhtran | 0:e9fd5575b10e | 17 | * and to discontinue the availability of this software. By using this software, |
anhtran | 0:e9fd5575b10e | 18 | * you agree to the additional terms and conditions found by accessing the |
anhtran | 0:e9fd5575b10e | 19 | * following link: |
anhtran | 0:e9fd5575b10e | 20 | * http://www.renesas.com/disclaimer* |
anhtran | 0:e9fd5575b10e | 21 | * Copyright (C) 2017 Renesas Electronics Corporation. All rights reserved. |
anhtran | 0:e9fd5575b10e | 22 | *******************************************************************************/ |
anhtran | 0:e9fd5575b10e | 23 | |
anhtran | 0:e9fd5575b10e | 24 | #ifndef MBED_AUDIO_GRBOARD_H |
anhtran | 0:e9fd5575b10e | 25 | #define MBED_AUDIO_GRBOARD_H |
anhtran | 0:e9fd5575b10e | 26 | |
anhtran | 0:e9fd5575b10e | 27 | #if defined(TARGET_RZ_A1H) |
anhtran | 0:e9fd5575b10e | 28 | |
anhtran | 0:e9fd5575b10e | 29 | #include "mbed.h" |
anhtran | 0:e9fd5575b10e | 30 | #include "TLV320_RBSP.h" |
anhtran | 0:e9fd5575b10e | 31 | |
anhtran | 0:e9fd5575b10e | 32 | /** AUDIO_GRBoard class |
anhtran | 0:e9fd5575b10e | 33 | * |
anhtran | 0:e9fd5575b10e | 34 | */ |
anhtran | 0:e9fd5575b10e | 35 | class AUDIO_GRBoard : public TLV320_RBSP { |
anhtran | 0:e9fd5575b10e | 36 | public: |
anhtran | 0:e9fd5575b10e | 37 | |
anhtran | 0:e9fd5575b10e | 38 | /** Create a audio codec class |
anhtran | 0:e9fd5575b10e | 39 | * |
anhtran | 0:e9fd5575b10e | 40 | * @param int_level Interupt priority (SSIF) |
anhtran | 0:e9fd5575b10e | 41 | * @param max_write_num The upper limit of write buffer (SSIF) |
anhtran | 0:e9fd5575b10e | 42 | * @param max_read_num The upper limit of read buffer (SSIF) |
anhtran | 0:e9fd5575b10e | 43 | */ |
anhtran | 0:e9fd5575b10e | 44 | AUDIO_GRBoard(uint8_t int_level = 0x80, int32_t max_write_num = 16, int32_t max_read_num = 16) : |
anhtran | 0:e9fd5575b10e | 45 | TLV320_RBSP(P10_13, I2C_SDA, I2C_SCL, P4_4, P4_5, P4_7, P4_6, int_level, max_write_num, max_read_num) { |
anhtran | 0:e9fd5575b10e | 46 | TLV320_RBSP::mic(true); |
anhtran | 0:e9fd5575b10e | 47 | TLV320_RBSP::micVolume(true, false); |
anhtran | 0:e9fd5575b10e | 48 | } |
anhtran | 0:e9fd5575b10e | 49 | }; |
anhtran | 0:e9fd5575b10e | 50 | |
anhtran | 0:e9fd5575b10e | 51 | #elif defined(TARGET_GR_LYCHEE) |
anhtran | 0:e9fd5575b10e | 52 | |
anhtran | 0:e9fd5575b10e | 53 | #include "mbed.h" |
anhtran | 0:e9fd5575b10e | 54 | #include "MAX9867_RBSP.h" |
anhtran | 0:e9fd5575b10e | 55 | |
anhtran | 0:e9fd5575b10e | 56 | /** AUDIO_GRBoard class |
anhtran | 0:e9fd5575b10e | 57 | * |
anhtran | 0:e9fd5575b10e | 58 | */ |
anhtran | 0:e9fd5575b10e | 59 | class AUDIO_GRBoard : public MAX9867_RBSP { |
anhtran | 0:e9fd5575b10e | 60 | public: |
anhtran | 0:e9fd5575b10e | 61 | |
anhtran | 0:e9fd5575b10e | 62 | /** Create a audio codec class |
anhtran | 0:e9fd5575b10e | 63 | * |
anhtran | 0:e9fd5575b10e | 64 | * @param int_level Interupt priority (SSIF) |
anhtran | 0:e9fd5575b10e | 65 | * @param max_write_num The upper limit of write buffer (SSIF) |
anhtran | 0:e9fd5575b10e | 66 | * @param max_read_num The upper limit of read buffer (SSIF) |
anhtran | 0:e9fd5575b10e | 67 | */ |
anhtran | 0:e9fd5575b10e | 68 | AUDIO_GRBoard(uint8_t int_level = 0x80, int32_t max_write_num = 16, int32_t max_read_num = 16) : |
anhtran | 0:e9fd5575b10e | 69 | MAX9867_RBSP(P1_7, P1_6, P2_7, P2_9, P2_8, P2_6, int_level, max_write_num, max_read_num) { |
anhtran | 0:e9fd5575b10e | 70 | } |
anhtran | 0:e9fd5575b10e | 71 | }; |
anhtran | 0:e9fd5575b10e | 72 | |
anhtran | 0:e9fd5575b10e | 73 | #elif defined(TARGET_RZ_A2M_EVB) || defined(TARGET_RZ_A2M_EVB_HF) |
anhtran | 0:e9fd5575b10e | 74 | |
anhtran | 0:e9fd5575b10e | 75 | #include "mbed.h" |
anhtran | 0:e9fd5575b10e | 76 | #include "WM8978_RBSP.h" |
anhtran | 0:e9fd5575b10e | 77 | |
anhtran | 0:e9fd5575b10e | 78 | /** AUDIO_GRBoard class |
anhtran | 0:e9fd5575b10e | 79 | * |
anhtran | 0:e9fd5575b10e | 80 | */ |
anhtran | 0:e9fd5575b10e | 81 | class AUDIO_GRBoard : public WM8978_RBSP { |
anhtran | 0:e9fd5575b10e | 82 | public: |
anhtran | 0:e9fd5575b10e | 83 | |
anhtran | 0:e9fd5575b10e | 84 | /** Create a audio codec class |
anhtran | 0:e9fd5575b10e | 85 | * |
anhtran | 0:e9fd5575b10e | 86 | * @param int_level Interupt priority (SSIF) |
anhtran | 0:e9fd5575b10e | 87 | * @param max_write_num The upper limit of write buffer (SSIF) |
anhtran | 0:e9fd5575b10e | 88 | * @param max_read_num The upper limit of read buffer (SSIF) |
anhtran | 0:e9fd5575b10e | 89 | */ |
anhtran | 0:e9fd5575b10e | 90 | AUDIO_GRBoard(uint8_t int_level = 0x80, int32_t max_write_num = 16, int32_t max_read_num = 16) : |
anhtran | 0:e9fd5575b10e | 91 | WM8978_RBSP(P8_6, NC, P8_7, P8_4, P9_6, P9_5, P9_4, P9_3, P6_4, int_level, max_write_num, max_read_num) { |
anhtran | 0:e9fd5575b10e | 92 | } |
anhtran | 0:e9fd5575b10e | 93 | }; |
anhtran | 0:e9fd5575b10e | 94 | |
anhtran | 0:e9fd5575b10e | 95 | #else |
anhtran | 0:e9fd5575b10e | 96 | |
anhtran | 0:e9fd5575b10e | 97 | #include "mbed.h" |
anhtran | 0:e9fd5575b10e | 98 | #include "AUDIO_RBSP.h" |
anhtran | 0:e9fd5575b10e | 99 | |
anhtran | 0:e9fd5575b10e | 100 | class AUDIO_GRBoard : public AUDIO_RBSP { |
anhtran | 0:e9fd5575b10e | 101 | public: |
anhtran | 0:e9fd5575b10e | 102 | AUDIO_GRBoard(uint8_t int_level = 0x80, int32_t max_write_num = 16, int32_t max_read_num = 16){} |
anhtran | 0:e9fd5575b10e | 103 | |
anhtran | 0:e9fd5575b10e | 104 | virtual void power(bool type = true) {} |
anhtran | 0:e9fd5575b10e | 105 | virtual bool format(char length) { return false; } |
anhtran | 0:e9fd5575b10e | 106 | virtual bool frequency(int hz) { return false; } |
anhtran | 0:e9fd5575b10e | 107 | virtual int write(void * const p_data, uint32_t data_size, const rbsp_data_conf_t * const p_data_conf = NULL) { return -1; } |
anhtran | 0:e9fd5575b10e | 108 | virtual int read(void * const p_data, uint32_t data_size, const rbsp_data_conf_t * const p_data_conf = NULL) { return -1; } |
anhtran | 0:e9fd5575b10e | 109 | virtual bool outputVolume(float leftVolumeOut, float rightVolumeOut) { return false; } |
anhtran | 0:e9fd5575b10e | 110 | virtual bool micVolume(float VolumeIn) { return false; } |
anhtran | 0:e9fd5575b10e | 111 | }; |
anhtran | 0:e9fd5575b10e | 112 | |
anhtran | 0:e9fd5575b10e | 113 | #endif |
anhtran | 0:e9fd5575b10e | 114 | |
anhtran | 0:e9fd5575b10e | 115 | #endif |