Library to handle the X-NUCLEO-CCA01M1 Sound Terminal Expansion Board.

Dependencies:   ST_I2S X_NUCLEO_COMMON

Dependents:   HelloWorld_CCA01M1 HelloWorld_CCA01M1_mbedOS HelloWorld_CCA01M1_mbedOS Karaoke_CCA01M1_CCA02M1_mbedOS ... more

Fork of X_NUCLEO_CCA01M1 by ST Expansion SW Team

Sound Terminal Library

Library to handle the X-NUCLEO-CCA01M1 Sound Terminal Expansion Board based on the STA350BW Sound Terminal device. A single board allows the output of a standard 2-channel stereo signal, while two boards stacked up realize a 4-channel audio system.


Power supply

The X-NUCLEO-CCA01M1 Sound Terminal Expansion Board has to be powered with at least 5V DC. You can connect the VCC terminal to an external power supplier or directly to the +5V pin of the CN6 Arduino connector.


Platform compatibility

  • This board can be currently used with the Nucleo F4 Family only, please see the ST_I2S library compatibility for further information.
  • The library is compatible both with mbed OS 5.x and mbed classic 2.x (to work with mbed classic, the main application has to import the "events" library, which is not included into the "mbed" library).


I2S Peripheral Usage

This board makes use of an I2S peripheral available on Nucleo boards, and when stacked up two times on the same Nucleo board each expansion board have to be configured to use a different I2S peripheral.

By default it comes with solder bridges configured to use the I2S1 peripheral, as depicted here below:

/media/uploads/Davidroid/solder_bridges_i2s1.png

And can be set to use the I2S2 peripheral by configuring the solder bridges this way:

/media/uploads/Davidroid/solder_bridges_i2s2.png


Committer:
Davidroid
Date:
Wed Jul 12 13:43:07 2017 +0000
Revision:
11:d47a7579b2ac
Parent:
3:c688a4acb4bf
Updating with the new version of the libraries.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
davide.aliprandi@st.com 0:542c79e7e0ef 1 /**
davide.aliprandi@st.com 0:542c79e7e0ef 2 ******************************************************************************
davide.aliprandi@st.com 0:542c79e7e0ef 3 * @file sound_terminal.h
davide.aliprandi@st.com 0:542c79e7e0ef 4 * @author Central Labs
davide.aliprandi@st.com 0:542c79e7e0ef 5 * @version V1.0.0
davide.aliprandi@st.com 0:542c79e7e0ef 6 * @date 18-August-2015
davide.aliprandi@st.com 0:542c79e7e0ef 7 * @brief This file contains all the functions prototypes for the Sound Terminal driver.
davide.aliprandi@st.com 0:542c79e7e0ef 8 ******************************************************************************
davide.aliprandi@st.com 0:542c79e7e0ef 9 * @attention
davide.aliprandi@st.com 0:542c79e7e0ef 10 *
davide.aliprandi@st.com 0:542c79e7e0ef 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
davide.aliprandi@st.com 0:542c79e7e0ef 12 *
davide.aliprandi@st.com 0:542c79e7e0ef 13 * Redistribution and use in source and binary forms, with or without modification,
davide.aliprandi@st.com 0:542c79e7e0ef 14 * are permitted provided that the following conditions are met:
davide.aliprandi@st.com 0:542c79e7e0ef 15 * 1. Redistributions of source code must retain the above copyright notice,
davide.aliprandi@st.com 0:542c79e7e0ef 16 * this list of conditions and the following disclaimer.
davide.aliprandi@st.com 0:542c79e7e0ef 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
davide.aliprandi@st.com 0:542c79e7e0ef 18 * this list of conditions and the following disclaimer in the documentation
davide.aliprandi@st.com 0:542c79e7e0ef 19 * and/or other materials provided with the distribution.
davide.aliprandi@st.com 0:542c79e7e0ef 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
davide.aliprandi@st.com 0:542c79e7e0ef 21 * may be used to endorse or promote products derived from this software
davide.aliprandi@st.com 0:542c79e7e0ef 22 * without specific prior written permission.
davide.aliprandi@st.com 0:542c79e7e0ef 23 *
davide.aliprandi@st.com 0:542c79e7e0ef 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
davide.aliprandi@st.com 0:542c79e7e0ef 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
davide.aliprandi@st.com 0:542c79e7e0ef 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
davide.aliprandi@st.com 0:542c79e7e0ef 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
davide.aliprandi@st.com 0:542c79e7e0ef 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
davide.aliprandi@st.com 0:542c79e7e0ef 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
davide.aliprandi@st.com 0:542c79e7e0ef 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
davide.aliprandi@st.com 0:542c79e7e0ef 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
davide.aliprandi@st.com 0:542c79e7e0ef 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
davide.aliprandi@st.com 0:542c79e7e0ef 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
davide.aliprandi@st.com 0:542c79e7e0ef 34 *
davide.aliprandi@st.com 0:542c79e7e0ef 35 ******************************************************************************
davide.aliprandi@st.com 0:542c79e7e0ef 36 */
davide.aliprandi@st.com 0:542c79e7e0ef 37
davide.aliprandi@st.com 0:542c79e7e0ef 38
davide.aliprandi@st.com 0:542c79e7e0ef 39 /* Define to prevent recursive inclusion -------------------------------------*/
davide.aliprandi@st.com 0:542c79e7e0ef 40
davide.aliprandi@st.com 0:542c79e7e0ef 41 #ifndef __SOUND_TERMINAL_H
davide.aliprandi@st.com 0:542c79e7e0ef 42 #define __SOUND_TERMINAL_H
davide.aliprandi@st.com 0:542c79e7e0ef 43
davide.aliprandi@st.com 0:542c79e7e0ef 44 #ifdef __cplusplus
davide.aliprandi@st.com 0:542c79e7e0ef 45 extern "C" {
davide.aliprandi@st.com 0:542c79e7e0ef 46 #endif
davide.aliprandi@st.com 0:542c79e7e0ef 47
davide.aliprandi@st.com 0:542c79e7e0ef 48
davide.aliprandi@st.com 0:542c79e7e0ef 49 /* Includes ------------------------------------------------------------------*/
davide.aliprandi@st.com 0:542c79e7e0ef 50
davide.aliprandi@st.com 3:c688a4acb4bf 51 #include "component_def.h"
davide.aliprandi@st.com 0:542c79e7e0ef 52 #include <stdint.h>
davide.aliprandi@st.com 0:542c79e7e0ef 53
davide.aliprandi@st.com 0:542c79e7e0ef 54
davide.aliprandi@st.com 0:542c79e7e0ef 55 /** @addtogroup BSP
davide.aliprandi@st.com 0:542c79e7e0ef 56 * @{
davide.aliprandi@st.com 0:542c79e7e0ef 57 */
davide.aliprandi@st.com 0:542c79e7e0ef 58
davide.aliprandi@st.com 0:542c79e7e0ef 59 /** @addtogroup Components
davide.aliprandi@st.com 0:542c79e7e0ef 60 * @{
davide.aliprandi@st.com 0:542c79e7e0ef 61 */
davide.aliprandi@st.com 0:542c79e7e0ef 62
davide.aliprandi@st.com 0:542c79e7e0ef 63 /** @addtogroup SOUND_TERMINAL
davide.aliprandi@st.com 0:542c79e7e0ef 64 * @{
davide.aliprandi@st.com 0:542c79e7e0ef 65 */
davide.aliprandi@st.com 0:542c79e7e0ef 66
davide.aliprandi@st.com 0:542c79e7e0ef 67 /** @defgroup SOUND_TERMINAL_Exported_Types
davide.aliprandi@st.com 0:542c79e7e0ef 68 * @{
davide.aliprandi@st.com 0:542c79e7e0ef 69 */
davide.aliprandi@st.com 0:542c79e7e0ef 70
davide.aliprandi@st.com 0:542c79e7e0ef 71 /**
davide.aliprandi@st.com 0:542c79e7e0ef 72 * @brief SoundTerminal driver structure definition
davide.aliprandi@st.com 0:542c79e7e0ef 73 */
davide.aliprandi@st.com 0:542c79e7e0ef 74 typedef struct
davide.aliprandi@st.com 0:542c79e7e0ef 75 {
davide.aliprandi@st.com 0:542c79e7e0ef 76 /* General */
davide.aliprandi@st.com 3:c688a4acb4bf 77 status_t (*Init)(void *handle, void *init);
davide.aliprandi@st.com 3:c688a4acb4bf 78 status_t (*ReadID)(void *handle, uint8_t *id);
davide.aliprandi@st.com 0:542c79e7e0ef 79 int32_t (*DeInit)(void);
davide.aliprandi@st.com 0:542c79e7e0ef 80
davide.aliprandi@st.com 0:542c79e7e0ef 81 /* Specific */
davide.aliprandi@st.com 0:542c79e7e0ef 82 int32_t (*Play)(uint16_t *pData, uint16_t size);
davide.aliprandi@st.com 0:542c79e7e0ef 83 int32_t (*Pause)(void);
davide.aliprandi@st.com 0:542c79e7e0ef 84 int32_t (*Resume)(void);
davide.aliprandi@st.com 0:542c79e7e0ef 85 int32_t (*Stop)(void);
davide.aliprandi@st.com 0:542c79e7e0ef 86 int32_t (*PowerOn)(void);
davide.aliprandi@st.com 0:542c79e7e0ef 87 int32_t (*PowerOff)(void);
davide.aliprandi@st.com 0:542c79e7e0ef 88 int32_t (*Reset)(void);
davide.aliprandi@st.com 0:542c79e7e0ef 89 int32_t (*SetEq)(uint8_t ram_block, uint8_t filter_number, uint32_t *filter_values);
davide.aliprandi@st.com 0:542c79e7e0ef 90 int32_t (*SetTone)(uint8_t tone_gain);
davide.aliprandi@st.com 0:542c79e7e0ef 91 int32_t (*SetMute)(uint8_t channel, uint8_t state);
davide.aliprandi@st.com 0:542c79e7e0ef 92 int32_t (*SetVolume)(uint8_t channel, uint8_t value);
davide.aliprandi@st.com 0:542c79e7e0ef 93 int32_t (*SetFrequency)(uint32_t audio_freq);
davide.aliprandi@st.com 0:542c79e7e0ef 94 int32_t (*SetDSPOption)(uint8_t option, uint8_t state);
davide.aliprandi@st.com 3:c688a4acb4bf 95 } SOUND_TERMINAL_vt_t;
davide.aliprandi@st.com 0:542c79e7e0ef 96
davide.aliprandi@st.com 0:542c79e7e0ef 97 #ifdef __cplusplus
davide.aliprandi@st.com 0:542c79e7e0ef 98 }
davide.aliprandi@st.com 0:542c79e7e0ef 99 #endif
davide.aliprandi@st.com 0:542c79e7e0ef 100
davide.aliprandi@st.com 0:542c79e7e0ef 101 #endif /* __SOUND_TERMINAL_H */
davide.aliprandi@st.com 0:542c79e7e0ef 102
davide.aliprandi@st.com 0:542c79e7e0ef 103 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/