资源简介
使用STM32F407开发板编写的6288语音模块测试程序,库函数编写
代码片段和文件信息
#include “stm32f4xx.h“
#include “delay.h“
#define GIPOA_IDR ( GPIOA_base + 0X10)
#define GIPOA_ODR ( GPIOA_base + 0X14)
#define GIPOB_IDR ( GPIOB_base + 0X10)
#define GIPOB_ODR ( GPIOB_base + 0X14)
#define GIPOC_IDR ( GPIOC_base + 0X10)
#define GIPOC_ODR ( GPIOC_base + 0X14)
#define GIPOD_IDR ( GPIOD_base + 0X10)
#define GIPOD_ODR ( GPIOD_base + 0X14)
#define BitBound(AddrBitNum) (*(volatile unsigned long*)(((Addr&0xF0000000)+0X2000000+((Addr&0xFFFFF)<<5)+(BitNum<<2))))
#define PAOut(n) BitBound(GIPOA_ODRn)
#define PAIn(n) BitBound(GIPOA_IDRn)
#define PBOut(n) BitBound(GIPOB_ODRn)
#define PBIn(n) BitBound(GIPOB_IDRn)
#define PCOut(n) BitBound(GIPOC_ODRn)
#define PCIn(n) BitBound(GIPOC_IDRn)
#define PDOut(n) BitBound(GIPOD_ODRn)
#define PDIn(n) BitBound(GIPOD_IDRn)
#define PA GPIOA->BSRRL
#define PB GPIOB->BSRRL
#define PC GPIOC->BSRRL
#define PD GPIOD->BSRRL
#define BUSY PBIn(12)
#define init_success 0x4a
#define receive_success 0x41
#define receive__unknow 0x45
#define receive_state_busy 0x4e
#define receive_state_idle 0x4f
#define song_play_cmd 0x01
#define bond_set_cmd 0x31
#define stop_cmd 0x02
#define wait_cmd 0x03
#define recover_cmd 0x04
#define state_refer 0x21
#define power_down 0x88
uint16_t receive;
void Gpio_Config(void);
void USART_Config(void);
void NVIC_CFG(void);
void delay(uint8_t i);
void delay(uint8_t i);
void tend_Sound_data(uint8_t cmduint8_t cmd_parauint8_t *data);
int main(void)
{
uint8_t ilenDATA[]=“[o0][t2]ABCDEFGHIJKLMN[y0]123456789“;
uint16_t receive;
//开系统时钟
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB ENABLE);
RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART3 ENABLE);
delay_init(168);
Gpio_Config();
USART_Config();
//delay_init(168);
while(1)
{
tend_Sound_data(song_play_cmd0x09DATA);
delay_ms(10);
while(BUSY);
}
}
void tend_Sound_data(uint8_t cmduint8_t cmd_parauint8_t *data)
{
uint16_t data_lenyihuo=0idata_ldata_h;
USART_SendData(USART30xfd);
delay_ms(3);
data_len=strlen(data)+3;
data_h=data_len>>8;
data_l=data_len&0xff;
USART_SendData(USART3data_h);
delay_ms(3);
USART_SendData(USART3data_l);
相关资源
- STM32F407双串口
- stm32f407以太网例程
- stm32f407上的两个can发送和接收历程
- STM32F407 USB虚拟串口
- stm32F407ADC电压采集串口输出程序
- 微雪2.9 E-paper.zip
- 基于STM32F407的幅频特性和相频特性测
- STM32F407ZGT6用TB6600驱动器驱动4257步进电
- ADS1220 stm32f407vet6驱动硬件spi2带部分翻
- STM32F407 GPIO LED点亮例程
- STM32f407核心板电路AD原理图和PCB图
- syn6288串口语音芯片
- STM32F407 OV7670摄像头例程
- STM32F407VGT6原理图和PCB库
- STM32F407VET6原理图和PCB库
- STM32F407学习板 开发板 全部例程原理图
- STM32F407VG用软件触发的DAC转换例程
- F407VET6核心板
- 基于STM32F407的数字语音存储回放
- STM32F407_OV7725(DMA)
- STM32 F407的SPI+DMA带文件系统FATFS.zip
- LWIP_MQTT_Succeed.7z
- EC20基于STM32F407 MQTT协议上传数据到
- STM32F407 USB通信程序 USB Device 虚拟串口
- STM32F407用户手册
- STM32F407ZGT6原理图库,PCB封装库
- 正点原子STM32F4原理图
- STM32F407+MPU7250+DMP
- 基于stm32f407+ucos-iii+lwip1.4.1的tcp serve
- 基于SYN6288中文语音合成电路Cadence绘图
评论
共有 条评论