资源简介
STM8S103F3编写的无线充电程序 带AD和PWM功能
代码片段和文件信息
#include “stm8s.h“
#include “PWM.h“
#include “AD.h“
#include “Remote.h“
#include “Urat.h“
#include “BT&REMOTE_CONTROL.h“
#include “A2DP_HFP_CODE.h“
#include “BT_Control.h“
#define A_Board 1
//#define B_Board 1
//#define C_Board 1
//#define TEST_Board 1
u8 Charge_CH1_Buffer[20];
u8 Charge_CH3_Buffer[20];
u8 Charge_CH2_Buffer[20];
void delayxms(uchar x);
void Delay_1ms(uint x);
void Init_Tim4(void);
void charge_test_A_Board(void);
void charge_test_B_Board(void);
void charge_test_C_Board(void);
void charge_test_D_Board(void);
void CH1_Charge_current_test(void);
void CH2_Charge_current_test(void);
void CH3_Charge_current_test(void);
u16 charge_scan_count=0;
u8 charge_scan_able_flag=0;
u8 charge_start_flag=0;
u16 ch2_charge_scan_count;
u8 ch2_charge_scan_able_flag;
u8 ch2_charge_start_flag;
u16 ch3_charge_scan_count;
u8 ch3_charge_scan_able_flag;
u8 ch3_charge_start_flag;
u16 Sum=0;
u16 Sum1=0;
u16 Sum2=0;
u8 Charging_flag;
u8 CH2_Charging_flag;
u8 CH3_Charging_flag;
u8 Freg_Max=0;
u8 Take_out_flag=0x0;
u8 A_CHANLE_B_FLAG;
u8 B_CHANLE_A_FLAG;
void Pick_up_vol(void);
main()
{
clk_init();
GPIO_SET();
Init_Adc();
Init_Urat();
PWM_Set();
//IRInit();
//EXTI_DeInit();
Init_Tim4();
AMP_SDN_HIGH();
//BT_POWER_ON();
//Delay_1ms(100);
//BT_PLAY_HIGH();
//Delay_1ms(8000);
//BT_PLAY_LOW();
//Delay_1ms(1000);
//BT_PLAY_HIGH();
//Delay_1ms(6000);
//BT_PLAY_LOW();
//UART1->DR =0xac;
while (1)
{
u8 i;
Delay_1ms(300);
/*if(Urat_RX_data[0]==0XAA)
{
for(i=0;i<6;i++)
{
UART1->DR=Urat_RX_data[0];
Delay_1ms(5);
Urat_RX_data[0]=0;
}
Recieve_Usart_flag=0X0;
}*/
//Remote_control_BT(IR_RECIVE_DATA);
Pick_up_vol();
BT_Music_Set();
BT_POWER_Match_Set();
Call_On();
//BT_operation();
//BT_POWER_Control();
#ifdef A_Board
charge_test_A_Board();
#endif
#ifdef B_Board
charge_test_B_Board();
#endif
#ifdef C_Board
charge_test_C_Board();
#endif
#ifdef TEST_Board
charge_test_D_Board();
#endif
/*UART1->DR =0x88;
Delay_1ms(5);
UART1->DR =Urat_RX_data[0];
Delay_1ms(5);*/
}
}
void Pick_up_vol(void)
{
if(Light_pin!=0)
{
if(Take_out_flag==0XFF)return;
AMP_SDN_LOW();
BT_vol_decrease_HIGH();
Delay_1ms(3000);
BT_vol_decrease_LOW();
Take_out_flag=0XFF;
}
if(Light_pin==0)
{
if((Power_on_flag==0xff)&&(Take_out_flag==0XFF))
{
AMP_SDN_HIGH();
BT_vol_increase_HIGH();
Delay_1ms(2000);
BT_vol_increase_LOW();
Take_out_flag=0X0;
}
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void charge_test_A_Board(void)
{
u8 temp=0;
u8 itemp2;
////////////
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2013-04-02 12:55 C_Wireless_Charge\
文件 1626 2013-01-21 11:46 C_Wireless_Charge\A2DP_HFP_CODE.h
文件 942 2012-11-19 17:13 C_Wireless_Charge\AD.h
文件 7313 2013-01-21 15:29 C_Wireless_Charge\BT&REMOTE_CONTROL.h
文件 5844 2013-02-04 17:55 C_Wireless_Charge\BT_Control.h
文件 4663 2013-03-22 11:44 C_Wireless_Charge\charge.dep
文件 897 2013-03-22 11:25 C_Wireless_Charge\charge.pdb
文件 15801 2013-01-21 17:54 C_Wireless_Charge\charge.stp
目录 0 2013-04-02 12:55 C_Wireless_Charge\charge_Programmer\
文件 488 2012-12-20 18:11 C_Wireless_Charge\charge_Programmer\charge_STVP.stp
文件 103 2012-12-20 18:11 C_Wireless_Charge\charge_Programmer\charge_STVP_OPTION BYTE.hex
文件 292 2013-01-14 15:06 C_Wireless_Charge\checkres.spy
文件 201 2013-03-22 11:44 C_Wireless_Charge\C_Wireless_Charge.stw
文件 47913 2013-03-22 11:27 C_Wireless_Charge\C_Wireless_Charge.wdb
文件 53302 2013-03-22 11:44 C_Wireless_Charge\C_Wireless_Charge.wed
目录 0 2013-04-02 12:55 C_Wireless_Charge\Debug\
文件 25098 2013-03-22 11:25 C_Wireless_Charge\Debug\charge.elf
文件 2407 2012-10-16 16:57 C_Wireless_Charge\Debug\charge.lkf
文件 41212 2012-12-20 18:24 C_Wireless_Charge\Debug\charge.map
文件 15980 2013-03-22 11:25 C_Wireless_Charge\Debug\charge.s19
文件 113161 2013-03-22 11:25 C_Wireless_Charge\Debug\charge.sm8
文件 189034 2013-03-22 11:25 C_Wireless_Charge\Debug\main.ls
文件 69639 2013-03-22 11:25 C_Wireless_Charge\Debug\main.o
文件 38742 2013-03-22 10:55 C_Wireless_Charge\Debug\stm8s_clk.ls
文件 19447 2013-03-22 10:55 C_Wireless_Charge\Debug\stm8s_clk.o
文件 10053 2013-03-22 10:55 C_Wireless_Charge\Debug\stm8s_exti.ls
文件 4461 2013-03-22 10:55 C_Wireless_Charge\Debug\stm8s_exti.o
文件 10155 2013-03-22 10:55 C_Wireless_Charge\Debug\stm8s_gpio.ls
文件 6835 2013-03-22 10:55 C_Wireless_Charge\Debug\stm8s_gpio.o
文件 6181 2013-03-22 10:55 C_Wireless_Charge\Debug\stm8s_it.ls
文件 6948 2013-03-22 10:55 C_Wireless_Charge\Debug\stm8s_it.o
............此处省略87个文件信息
- 上一篇:基于51单片机的酒精测试仪设计
- 下一篇:arcgis server 10.5许可
相关资源
- STM8S003 红外遥控
- STM8S例程,基于IAR下的STM8S例程
- 基于STM8的HT1621B显示驱动程序
- STM8驱动HT1621B
- STM8L中文参考手册1-4全
- STM8L_MPU6500_DMP_震动唤醒
- arduino主机,stm8从机。I2C测试 。每次
- Lora通讯 stm8
- STM8+FM17750低成本刷卡方案资料硬件设
- STM8_无线315&433_脉宽自适应_通用解码
- STM8S103系列IO模拟串口通信实现真正串
- STM8S中文参考手册
- cosmic STM8破解
- STM8全系列封装
- STM8L051 低功耗运行模式 库函数例程
- STM8L051.串口接收IDLE中断.zip
- 移植在STM8上的实时操作系统uCOS
- 额温枪STM8L方案含原理图和代码.rar
- STM8L 硬件IIC主机
- (D)基于NTC热敏电阻的温度计.zip
- STM8s官方固件库
- STM8+NRF24l01+发送程序
- STM8+NRF24l01+接收程序
- stm8s006超声波硬件设计电路
- stm8的485串口收发程序
- STM8最强固件库
- STM8蜂鸣器音乐演奏
- IAR+for+STM8+ 破解
- IARforSTM83.10IARFORARM8.3注册机.zip
- STM8S105C6 ADC三通道采样-调试可用
评论
共有 条评论