/********************************************************************* 函数名称: void Buzzer_Init(void) 功 能: 蜂鸣器初始化 说 明: 入口参数: 返 回 值: 设 计: 丛海旭 时 间: 2013-12-4 修 改: 时 间: *********************************************************************/ void Buzzer_Init(void) { GPIO_Config(GPIO1, (1<<0), GPIO_OUT_PP); GPIO_BitWrite(GPIO1, 0, 0); //蜂鸣器关 gb_BuzzerAlwaysOnFlg = false; u8BuzerMode = 0; u32BuzerHoldTime = 0; u32BuzerHoldTime = 0; }
void vParTestToggleLED( unsigned portBASE_TYPE uxLED ) { if( uxLED == partstCOM_TEST_LED ) { /* Remap as described above. */ uxLED = partstRX_CHAR_LED; } /* Adjust the LED value to map to the port pins actually being used, then write the opposite value to the current state to the port pin. */ uxLED += partstFIRST_LED_BIT; GPIO_BitWrite(GPIO1, uxLED, ~GPIO_BitRead( GPIO1, uxLED ) ); }
void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue ) { if( uxLED == partstCOM_TEST_LED ) { /* Remap as described above. */ uxLED = partstRX_CHAR_LED; } /* Adjust the LED value to map to the port pins actually being used, then write the required value to the port. */ uxLED += partstFIRST_LED_BIT; GPIO_BitWrite( GPIO1, uxLED, !xValue ); }
/******************************************************************************* * Function Name : main * Description : Main program * Input : None * Output : None * Return : None *******************************************************************************/ void main(void) { #ifdef DEBUG debug(); #endif // P1.8 as TTL output GPIO_Config( GPIO1, (1<<8), GPIO_OUT_PP ); while(1) { GPIO_BitWrite( GPIO1, 8, !GPIO_BitRead( GPIO1, 8 ) ); delay(); } }