4D Systems Sound Module Library

Dependents:   STM32F030R8_SOMO-14D

SOMO-14D

The SOMO-14D is a tiny Audio-Sound module that can play back pre-stored audio files such as voice and music from a micro-SD memory card. The module supports 4-bit ADPCM audio files with sample rates from 6Khz up to 32Khz. By using the freely available software tool, any WAVE(.wav) or MP3(.mp3) file can be easily converted to the ADPCM(.ad4) format which can then be can be saved to a micro-SD memory card. The compact 14pin drop-in-module takes up very minimal board space and is ideal for any application that requires embedded audio.

The SERIAL-MODE provides a simple 2-wire interface to any micro-controller via its DATA and CLK lines. Audio operations such as PLAY, PAUSE,STOP and VOLUME control functions are all available to the host micro via simple serial commands.

SOMO-14D Library

The SOMO library handles all basic functions that access the hardware to set the commands that ensure SERIAL-MODE interfacing.

Some of the functions can make control of: - Initialization - Activity - Command

Initialization Function

  • void SOMO14DInit(void (*pfunc)(void));

Activity Function

  • INT8U SOMO14DisBusy(void);

Commanding Functions

  • void SOMO14DSerialOut(INT16U SOMO14Duint16);
  • void SOMO14DPause(void);
  • void SOMO14DStop(void);
  • void SOMO14DSetVol(INT8U *SOMO14DVol);
  • void SOMO14DSetAudio(INT16U SOMO14DAudioFileNo);

For check the function by capability please check the "functions" wiki

Committer:
issaiass
Date:
Sat Mar 14 01:39:34 2015 +0000
Revision:
2:673ecbaff67b
Parent:
0:41f21e0cf86f
Moved the serial out function of the SOMO to declare private

Who changed what in which revision?

UserRevisionLine numberNew contents of line
issaiass 0:41f21e0cf86f 1 /*
issaiass 0:41f21e0cf86f 2 *******************************************************************************
issaiass 0:41f21e0cf86f 3 * CERES CONTROLS
issaiass 0:41f21e0cf86f 4 * PANAMA, REPULIC OF PANAMA
issaiass 0:41f21e0cf86f 5 *
issaiass 0:41f21e0cf86f 6 * File : SOMO14D.h
issaiass 0:41f21e0cf86f 7 * Programmer(s) : Rangel Alvarado
issaiass 0:41f21e0cf86f 8 * Language : ANSI-C
issaiass 0:41f21e0cf86f 9 * Description : SOMO14D is an acronym of SOund MOdule 1 4D SYSTEMS INC.
issaiass 0:41f21e0cf86f 10 * The file mlist all public functions which can be called on
issaiass 0:41f21e0cf86f 11 * your application.
issaiass 0:41f21e0cf86f 12 *
issaiass 0:41f21e0cf86f 13 * Note : Dependancies of mbed libraries...
issaiass 0:41f21e0cf86f 14 * - InterruptIn
issaiass 0:41f21e0cf86f 15 * - DigitalOut
issaiass 0:41f21e0cf86f 16 *
issaiass 0:41f21e0cf86f 17 * ----------------------------------------------------------------------------
issaiass 0:41f21e0cf86f 18 * HISTORY
issaiass 0:41f21e0cf86f 19 * DD MM AA
issaiass 0:41f21e0cf86f 20 * 09 03 15 Created.
issaiass 0:41f21e0cf86f 21 * 09 03 15 Modified.
issaiass 0:41f21e0cf86f 22 * 12 03 15 Import to mbed platform.
issaiass 2:673ecbaff67b 23 * 13 03 15 Moved a function to a private state.
issaiass 0:41f21e0cf86f 24 *******************************************************************************
issaiass 0:41f21e0cf86f 25 */
issaiass 0:41f21e0cf86f 26
issaiass 0:41f21e0cf86f 27
issaiass 0:41f21e0cf86f 28 /*
issaiass 0:41f21e0cf86f 29 *******************************************************************************
issaiass 0:41f21e0cf86f 30 * CONSTANTS AND MACROS
issaiass 0:41f21e0cf86f 31 *******************************************************************************
issaiass 0:41f21e0cf86f 32 */
issaiass 0:41f21e0cf86f 33
issaiass 2:673ecbaff67b 34 #define SOMO_BUSY_PIN PC_0 /* BUSY signal. Active HIGH output. */
issaiass 2:673ecbaff67b 35 #define SOMO_DATA_PIN PC_1 /* Serial DATA input from host MCU */
issaiass 2:673ecbaff67b 36 #define SOMO_CLK_PIN PC_2 /* Serial Clock input from host MCU */
issaiass 2:673ecbaff67b 37 #define SOMO_RESET_PIN PC_3 /* Master Reset. Active LOW trigger. */
issaiass 2:673ecbaff67b 38 #define SOMO_WAIT_BIT 0.01 /* Wait between bits, base = 1 sec. */
issaiass 2:673ecbaff67b 39 #define SOMO_WAIT_IDLE 0.05 /* Wait between idle, base = 1 sec. */
issaiass 0:41f21e0cf86f 40
issaiass 0:41f21e0cf86f 41
issaiass 0:41f21e0cf86f 42 #define SOMO_SONG_CMD_MAX 0x01FF /* 0x0000 = first; 0x01FF = last */
issaiass 0:41f21e0cf86f 43 #define SOMO_VOL_CMD_OFFSET 0xFFF0 /* 0xFFF0 = Vol 0; 0xFFF7 = Vol 7 */
issaiass 0:41f21e0cf86f 44 #define SOMO_PAUSE_CMD_OFFSET 0xFFFE /* Hold or pause/play command */
issaiass 0:41f21e0cf86f 45 #define SOMO_STOP_CMD_OFFSET 0xFFFF /* Stop audio command */
issaiass 0:41f21e0cf86f 46 #define SOMO_VOL_UNF 0xFF /* Volume underflow (app specific) */
issaiass 0:41f21e0cf86f 47 #define SOMO_VOL_MIN 0 /* Volume minimun */
issaiass 0:41f21e0cf86f 48 #define SOMO_VOL_MAX 7 /* Volume maximum */
issaiass 0:41f21e0cf86f 49
issaiass 0:41f21e0cf86f 50
issaiass 0:41f21e0cf86f 51 /*
issaiass 0:41f21e0cf86f 52 *******************************************************************************
issaiass 0:41f21e0cf86f 53 * FUNCTION PROTOTYPES
issaiass 0:41f21e0cf86f 54 *******************************************************************************
issaiass 0:41f21e0cf86f 55 */
issaiass 0:41f21e0cf86f 56
issaiass 0:41f21e0cf86f 57 INT8U SOMO14DisBusy(void); /* Check if SOMO is doing something */
issaiass 0:41f21e0cf86f 58 void SOMO14DInit(void (*pfunc)(void)); /* Initialize the sound module */
issaiass 0:41f21e0cf86f 59 void SOMO14DPause(void); /* Hold the current song */
issaiass 0:41f21e0cf86f 60 void SOMO14DStop(void); /* Stop audio and go to sleep mode */
issaiass 0:41f21e0cf86f 61 void SOMO14DSetVol(INT8U *SOMO14DVol); /* Increase/Decrease the volume */
issaiass 0:41f21e0cf86f 62 void SOMO14DSetAudio(INT16U SOMO14DAudioFileNo); /* Set audio file */