示例#1
0
AVL63X1_ErrorCode AVL63X1_IBSP_Initialize(void)
{
	HI_S32 res = 0;
	AVL_int32 iI = 0;

#if 0	
	/* 标识信号量状态,所有均可用 */
	for ( iI = 0 ; iI < AVL_MAX_SEMAPHORES; iI++ )
	{
	    AVL_sem_table[iI].free = 1;
	}
	#if  1
	/* GPIO软件复位 */
	HI_UNF_GPIO_Open();
	
	res = HI_UNF_GPIO_SetDirBit( 12, HI_FALSE );/* Gpio1_4 1*8+4=12 */
	res |= HI_UNF_GPIO_WriteBit( 12, HI_TRUE );
	AVL63X1_IBSP_Delay(10);
	res |= HI_UNF_GPIO_WriteBit( 12, HI_FALSE );
	AVL63X1_IBSP_Delay(100);
	res |= HI_UNF_GPIO_WriteBit( 12, HI_TRUE );
	AVL63X1_IBSP_Delay(10);

	HI_UNF_GPIO_Close();
		#endif /* #if 0 */
#endif		
	return(AVL63X1_EC_OK);
}
示例#2
0
int set_gpio_bit(int gpio, int value)
{
	int Ret = 0;

	pthread_mutex_lock(&mutex);
	Ret = HI_UNF_GPIO_SetDirBit(gpio, HI_FALSE);
	Ret = HI_UNF_GPIO_WriteBit(gpio, value);
	pthread_mutex_unlock(&mutex);	

	return Ret;
}