77 lines
2.6 KiB
C
77 lines
2.6 KiB
C
/**
|
||
******************************************************************************
|
||
* @file audio.h
|
||
* @author TMC Scan Team
|
||
* @version V1.0.0
|
||
* @date 09/12/2019
|
||
* @brief
|
||
******************************************************************************
|
||
*
|
||
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
|
||
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
|
||
* TIME. AS A RESULT, TMC SHALL NOT BE HELD LIABLE FOR ANY
|
||
* DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
|
||
* FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
|
||
* CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
||
*
|
||
* <h2><center>© COPYRIGHT 2016 TMC</center></h2>
|
||
******************************************************************************
|
||
**/
|
||
|
||
#ifndef __VOICEDATA_H__
|
||
#define __VOICEDATA_H__
|
||
|
||
#include "global.h"
|
||
|
||
/****************************************AUDIO*********************************************************/
|
||
#define VOICE_GPIO_PORT GPIOE
|
||
#define VOICE_GPIO_PIN GPIO_PIN_6
|
||
#define VOICE_GPIO_PIN_NUM 6
|
||
|
||
//Voice File Parameter
|
||
#define VOICE_SIMPLE_RATE_BASE 8000
|
||
#define VOICE_SIMPLE_BIT_BASE 8
|
||
|
||
//PWM output Config
|
||
#define VOICE_PWM_BIT_BASE 9 //change >= VOICE_SIMPLE_BIT : PWM Output bit
|
||
|
||
//Voice File Change
|
||
#define VOICE_SIMPLE_RATE_INC_TIMES 4 //change : SIMPLE RATE MULTIPLE TIMES
|
||
#define VOICE_SIMPLE_BIT_INTERPOLATION 0 //change : VOICE SIMPLE Bit Add
|
||
|
||
//Real Voice output Parameter
|
||
#define VOICE_SIMPLE_RATE (VOICE_SIMPLE_RATE_BASE*VOICE_SIMPLE_RATE_INC_TIMES)
|
||
#define VOICE_SIMPLE_BIT (VOICE_SIMPLE_BIT_BASE+VOICE_SIMPLE_BIT_INTERPOLATION)
|
||
|
||
#define VOICE_FREQUENCY_2000 2000
|
||
#define VOICE_FREQUENCY_2100 2100
|
||
#define VOICE_FREQUENCY_2300 2300
|
||
#define VOICE_FREQUENCY_2600 2600
|
||
#define VOICE_FREQUENCY_3000 3000
|
||
#define VOICE_FREQUENCY_3500 3500
|
||
#define VOICE_DUTY_50 50
|
||
#define VOICE_DUTY_12 12
|
||
#define VOICE_TIME_50 50
|
||
#define VOICE_TIME_100 100
|
||
#define VOICE_TIME_200 200
|
||
|
||
extern const uint8_t BootToneFile[8529];
|
||
extern const uint8_t scanFinishFile[3934];
|
||
//extern const uint8_t weChatPayFile[12800];
|
||
//extern const uint8_t cloudPayFile[11680];
|
||
//extern const uint8_t aliPayFile[11040];
|
||
//extern const uint8_t scanFinishStartPrint[14832];
|
||
extern const uint8_t scanFinishVoiceFile[6948];
|
||
extern const uint8_t scanSuccessFile[8096];
|
||
extern const uint8_t welcomeFile[8080];
|
||
|
||
void AppVoiceInit(void);
|
||
void AppVoicePlay(uint8_t *pVoice, uint32_t voiceSize, uint8_t volume);
|
||
|
||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
void AppPowerOnVoice(void);
|
||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
void AppVoiceSelect(uint8_t voiceType);
|
||
|
||
#endif
|