
//#include "Voice_Play_Buzzer.h"
#include "Include.h"

////////////////////////////�������ú����貹������  /////////////////////
//����������//����// 1����  0�ر�
void Buzzer_Positive_Enable(INT8U ON_OFF)
{
	PIN_30_P = ON_OFF;   // PIN_30_P = ON_OFF;
}

//����������//����// 1����  0�ر�
void Buzzer_Negative_Enable(INT8U ON_OFF)
{								 
        PWM_Channel_Enable(PWM_CH0_PIN29_PP0,ON_OFF);      
}
//����������//����PWMƵ�ʣ�������Ƶ�ʣ���һ������
void Buzzer_Negative_Set_Frequency(INT16U Frequency)
{
        PWM_Channel_Set_Freq (PWM_CH0_PIN29_PP0, Frequency )   ;    
}
//����������//����PWMռ�ձ�//0%�ر�   100%����
//����100�İ���100������
void Buzzer_Negative_Set_Duty(INT8U Duty)
{
	PWM_Channel_Set_Duty(PWM_CH0_PIN29_PP0, Duty )   ;  
}

//������ʼ����ʱ�����һ�θú���
void Buzzer_Play_Start(_SoundAlarm SoundAlarmNew)
{
	Sound_Play_Begin(SoundAlarmNew);
}
//һ�������������������֮������һ�θú���
void Buzzer_Play_Done(_SoundAlarm SoundAlarmNew)
{
	Sound_Play_Once_Done(SoundAlarmNew);
}



//���鳤�� = ��������Դ���� +��2*˫������Դ������


const _BuzzerSyllable BuzzerAttribute[Buzzer_Variety_MAX + Buzzer_Double_Syllable_MAX] =
{

		//Ƶ��//���ʱ��//����ʱ��//����ʱ��      o
		//Frequency//Charge_Time//PlayON_Time//Fade_Time//
		//˫��������      	

             //����������	
		{1800, 50, 0xFFFF, 0},	//����
		{1790, 50, 0, 950},  	  	//1HZ
		{1790, 50, 0, 450}, 	  	//2HZ
		{1790, 50, 0, 200},  	  	//4HZ
		{1790, 50, 0, 350},  	 	//2.5HZ
		{1790, 50, 0, 75},  		//8HZ   
		{2800, 50, 2, 0},   		//tick
		{2350, 50, 2, 0},   //tock	
};

//����������������Ϻ�������Ӧ���� //��Ҫһһ��Ӧ
const _BuzzerAlarmVarietyInfor BuzzerAlarmVarietyInforTable[SoundAlarm_MAX] =
{
		//��Ӧ�������͵�������
	           	       
///1��_sh//////////////////////////////////////////////////////////////////////////////////
/*Sound_Leave_the_vehicle,               	*/		 {Buzzer_Variety_Single_1HZ}, //7
///*Sound_OTA,  	*/		 							{Buzzer_Variety_Single_1HZ}, //7
/*Sound_Skid_of_vehicle,                 	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_DoorOpen_1type,                  	*/		 {Buzzer_Variety_Single_1HZ}, //7
///*Sound_Radar,                           	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_SafetyBelt,	*/		 						{Buzzer_Variety_Single_1HZ}, //7
/*Sound_Close_30,                        	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_Please_wait_relieving_pressure,	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_Please_Fuel_up,                	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_Heavy_overload,                  	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_Overload,                        	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_Little_light,                    	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_Go_to_service_station,           	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_Vehicle_not_shift_gears,       	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_Do_not_operate_shift_gears,    	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_SafetyBelt_EPB,                  	*/		 {Buzzer_Variety_Single_1HZ}, //7
///2��//////////////////////////////////////////////////////////////////////////////////

///2��_sh//////////////////////////////////////////////////////////////////////////////////
/*Sound_start_button,          	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_nokey_sys_fault,       	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_relay_fault,           	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_authentication_failure,	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_undetected_key,        	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_key_not_Car,           	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_Key_close_start,       	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_brake_to_start,        	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_N_gear_start,          	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_N_gear_parking,        	*/		 {Buzzer_Variety_Single_1HZ}, //7

/*Sound_key_low_power,          	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_motor_high,               	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_Fuel_sensor_failure,    	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_engine_water_high,      	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_please_add_fuel,        	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_Please_charge_power,      	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_Electronic_parking_fault, 	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_please_foot_brake,        	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_low_pressure,             	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_gear_fault,               	*/		 {Buzzer_Variety_Single_1HZ}, //7

/*Sound_please_Step_brake,        	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_please_N_gear,            	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_Please_draw_charging,     	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_high_low_temp,            	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_charging_parking_brake,   	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_charge_complete,          	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_charge_fault,             	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_Face_Loss,              	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_fatigue_driving,        	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_fatigue_driving_stopcar,	*/		 {Buzzer_Variety_Single_1HZ}, //7

/*Sound_safe_driving,           	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_Speeding_alarm,           	*/		 {Buzzer_Variety_Single_1HZ}, //7
///*Sound_Front_camera_occlusion, 	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_SOC_low,                  	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_pressure_fault_stopfuel,	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_airbag_fault,           	*/		 {Buzzer_Variety_Single_1HZ}, //7
///*Sound_TPMS_not_study,         	*/		 {Buzzer_Variety_Single_1HZ}, //7
///*Sound_TPMS_sensor_loss,       	*/		 {Buzzer_Variety_Single_1HZ}, //7
///*Sound_TPMS_sensor_fault,      	*/		 {Buzzer_Variety_Single_1HZ}, //7
///*Sound_TPMS_low,               	*/		 {Buzzer_Variety_Single_1HZ}, //7

///*Sound_TPMS_high,             	*/		 {Buzzer_Variety_Single_1HZ}, //7
///*Sound_tire_depresses_quickly,	*/		 {Buzzer_Variety_Single_1HZ}, //7
///*Sound_tire_temp_high,        	*/		 {Buzzer_Variety_Single_1HZ}, //7
///*Sound_TPMS_sensor_low_power, 	*/		 {Buzzer_Variety_Single_1HZ}, //7
#if 1
/*Sound_TPMS_NotLearnt,		*/		 {Buzzer_Variety_Single_1HZ}, //24
/*Sound_TPMS_SenLost,		 	*/		 {Buzzer_Variety_Single_1HZ}, //20 
/*Sound_TPMS_SenFlt,			*/		 {Buzzer_Variety_Single_1HZ}, //21 
/*Sound_TPMS_TirePr_Low,		*/		 {Buzzer_Variety_Single_1HZ}, //22

/*Sound_TPMS_TirePr_High,		*/		 {Buzzer_Variety_Single_1HZ}, //23	     
/*Sound_TPMS_FastLeak,		*/		 {Buzzer_Variety_Single_1HZ}, //24
/*Sound_TPMS_Temp_High,		*/		 {Buzzer_Variety_Single_1HZ}, //23	     
/*Sound_TPMS_BatLow,			*/		 {Buzzer_Variety_Single_1HZ}, //24
#endif
/*Sound_GPF,                   	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_Radar_sys_fault,         	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_shifter_fault,         	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_HighBeam_relay_fault,    	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_RearFog_fault,           	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_FrontFog_fault,				*/		 {Buzzer_Variety_Single_1HZ}, //7

/*Sound_DayRun_fault,	*/		 			{Buzzer_Variety_Single_1HZ}, //7
/*Sound_Position_fault,	*/		 			{Buzzer_Variety_Single_1HZ}, //7
/*Sound_LowBeam_fault,	*/		 			{Buzzer_Variety_Single_1HZ}, //7
/*Sound_reversing_light_fault,    	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_brake_light_fault,        	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_Please_pull_key,          	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_Maintenance_Km,         	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_Maintenance_Tips,         	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_please_Maintenance_engine,	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_Maintenance_engine_Km,    	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_battery_low_power,        	*/		 {Buzzer_Variety_Single_1HZ}, //7

/*Sound_power_takeoff_fault		,	*/	{Buzzer_Variety_Single_1HZ}, //7
/*Sound_power_takeoff_R_gear		,	*/	{Buzzer_Variety_Single_1HZ}, //7
///3��//////////////////////////////////////////////////////////////////////////////////

///3��_sh//////////////////////////////////////////////////////////////////////////////////
///*Sound_Driving_information,	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_Door_Open,     	*/		 		{Buzzer_Variety_Single_1HZ}, //7
/*Sound_Door_Open_Off,     	*/		 		{Buzzer_Variety_Single_1HZ}, //7
///*Sound_DoorOpen_LF,     	*/		 		{Buzzer_Variety_Single_1HZ}, //7
///*Sound_DoorOpen_RF,     	*/		 		{Buzzer_Variety_Single_1HZ}, //7
///*Sound_DoorOpen_LR,     	*/		 		{Buzzer_Variety_Single_1HZ}, //7
///*Sound_DoorOpen_RR,     	*/		 		{Buzzer_Variety_Single_1HZ}, //7
/*Sound_charge_display,     	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_charge_display_Off,     	*/		 {Buzzer_Variety_Single_1HZ}, //7
/*Sound_cooling_liquid_low, 	*/		 {Buzzer_Variety_Single_1HZ}, //7

///////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/*Sound_Reverse_Gear,			*/		 {Buzzer_Variety_Single_1HZ}, //26 
/*Sound_Radar_1HZ 			*/		{Buzzer_Variety_Single_1HZ}, //0	
/*Sound_Radar_2HZ,			*/		{Buzzer_Variety_Single_2HZ}, //1    
/*Sound_Radar_4HZ,			*/		{Buzzer_Variety_Single_4HZ}, //2       
/*Sound_Radar_Loop,			*/		{Buzzer_Variety_Single_Loop},//4
/*Sound_BrakeShoeWear,		*/		 {Buzzer_Variety_Single_1HZ}, //10     
/*Sound_Tick,					*/		 {Buzzer_Variety_Single_Tick},//27
/*Sound_Tock, 				*/		 {Buzzer_Variety_Single_Tock},//28
/*Sound_Outdoor_Temp, 				*/{Buzzer_Variety_Single_1HZ},//28


};
