Ejemplo n.º 1
0
/* Set the EA1788 module red LED to an on or off state */
void led_set(s32_t state)
{
	/* Set inverse GPIO state based on LED drive state */
	if (state)
		GPIO_OutputValue(LED_GPIO_PORT_USED, LED_GPIO_PIN_BIT, DISABLE);
	else
		GPIO_OutputValue(LED_GPIO_PORT_USED, LED_GPIO_PIN_BIT, ENABLE);
}
/*********************************************************************//**
 * @brief       SysTick interrupt handler
 * @param       None
 * @return      None
 ***********************************************************************/
void SysTick_Handler(void)
{
    //Clear System Tick counter flag
    SYSTICK_ClearCounterFlag();

    GPIO_OutputValue(BRD_LED_1_CONNECTED_PORT, BRD_LED_1_CONNECTED_MASK, Cur_State);
    Cur_State = (Cur_State == ENABLE)? DISABLE:ENABLE;
}
Ejemplo n.º 3
0
/*********************************************************************//**
 * @brief       SysTick interrupt handler
 * @param       None
 * @return      None
 ***********************************************************************/
void SysTick_Handler(void)
{
    //Clear System Tick counter flag
    SYSTICK_ClearCounterFlag();

    //toggle GPIO pin
    GPIO_OutputValue(PIO_PORT_USED, PIO_PIN_VALUE, Cur_State);
    Cur_State = (Cur_State == ENABLE) ? DISABLE:ENABLE;
}
Ejemplo n.º 4
0
void Task0(void *Tags)
{
	CLKPWR_ConfigPPWR(CLKPWR_PCONP_PCGPIO, ENABLE);
	GPIO_SetDir(2, 1<<21, GPIO_DIRECTION_OUTPUT);
	GPIO_OutputValue(2,1<<21,0);
	DeBug_SetCallBack(DebugCall);
	while(1)
	{
		Tos_TaskDelay(1000);
		GPIO_OutputValue(2,1<<21,0);
		Tos_TaskDelay(10);
		GPIO_OutputValue(2,1<<21,1);
		Tos_TaskDelay(100);
		GPIO_OutputValue(2,1<<21,0);
		Tos_TaskDelay(10);
		GPIO_OutputValue(2,1<<21,1);
		Tos_TaskDelay(100);
		//DeBug("GUI_ALLOC_GetNumUsedBlocks=%d",GUI_ALLOC_GetNumUsedBlocks(),Infor_Infor);
	}
}
Ejemplo n.º 5
0
void SetLineInput(void)
{
    uint8_t i;
    for(i = 0 ;i < 8;i++)
    {
        GPIO_SetDir ( KeyBoardConfig[i][0], (1<<KeyBoardConfig[i][1]), GPIO_DIRECTION_INPUT );
    }
    for(i = 0 ;i < 4;i++)
    {
        GPIO_SetDir ( KeyBoardConfig[i][0], (1<<KeyBoardConfig[i][1]), GPIO_DIRECTION_OUTPUT );
        GPIO_OutputValue ( KeyBoardConfig[i][0], (1<<KeyBoardConfig[i][1]), 0 );
    }
}
/********************************************************************//**
 * @brief
 * @param
 * @return
 *********************************************************************/
void HAL17XX_USBConnect (uint32_t con)
{
  SIE_WriteCommandData(CMD_SET_DEV_STAT, DAT_WR_BYTE(con ? DEV_CON : 0));
  GPIO_OutputValue(USB_CONNECT_PORT, _BIT(USB_CONNECT_PIN), con ? 0 : DEV_CON);
}