Ejemplo n.º 1
0
/******************************************************************************
 *
 * Function:		gpioClearFallingEdgeInterrupt
 *
 * Description:		This function clears specified GPIO's falling edge interrupt
 *
 * Parameters:		uiNumber - 	GPIO number to configure
 *
 * Return Value: 	void
 *
 *****************************************************************************/
void gpioClearFallingEdgeInterrupt( uint32_t uiNumber )
{
    CSL_GpioHandle  hGpio;

    // Open the CSL GPIO Module 0
    hGpio = CSL_GPIO_open (0);

    CSL_GPIO_clearFallingEdgeDetect(hGpio, uiNumber); //GPIOREGS->CLR_FAL_TRIG |= (1 << uiNumber);
}
Ejemplo n.º 2
0
/******************************************************************************
 *
 * Function:		gpioInit
 *
 * Description:		Initializes the GPIO peripheral
 *
 * Parameters:		void
 *
 * Return Value: 	void
 *
 *****************************************************************************/
void gpioInit(void)
{
	Int32 pinNum;
	CSL_GpioHandle hGpio;

	// Open the CSL GPIO Module 0
	hGpio = CSL_GPIO_open(0);

	// Disable the GPIO global interrupts
	CSL_GPIO_bankInterruptDisable(hGpio, GPIOBANKNUM);

	// Clear all falling edge trigger and rising edge trigger
	for (pinNum = GPIO_0; pinNum <= GPIO_15; pinNum++)
	{
		CSL_GPIO_clearFallingEdgeDetect(hGpio, pinNum);
		CSL_GPIO_clearRisingEdgeDetect(hGpio, pinNum);
	}
}
BOOL Gpio_Init()
{
	int32_t pinNum;
	//CSL_GpioHandle  hGpio;
	    if( bGpioInitialized == TRUE)
	    	{
	    		return TRUE;
	    	}
	    // Open the CSL GPIO Module 0
	    GpioHandle = CSL_GPIO_open (0);

		// Disable the GPIO global interrupts
		CSL_GPIO_bankInterruptEnable(GpioHandle, GPIOBANKNUM);

		// Clear all falling edge trigger and rising edge trigger
		for (pinNum = GPIO_0; pinNum <= GPIO_15; pinNum++) {
	        CSL_GPIO_clearFallingEdgeDetect(GpioHandle, pinNum);
	        CSL_GPIO_clearRisingEdgeDetect (GpioHandle, pinNum);
	    }

		// Set all GPIO as input
	    //	GPIOREGS->DIR = GPIOREGS->DIR & 0xffffffff;

		// Configure the GPIOs for NAND flash controller communication
		// Configure data bus as output
		//gpioSetDataBusDirection(GPIO_OUT);
	#ifdef EVMBOARD
		// Configure the signal pins direction
		gpioSetDirection(DSP_FPGA_CMD0, GPIO_OUT );
		gpioSetDirection(DSP_FPGA_CMD1, GPIO_OUT );

		gpioSetDirection(DSP_FPGA_STROBE, GPIO_OUT );
		gpioSetDirection(FPGA_DSP_READY, GPIO_IN );
	#endif
    bGpioInitialized = TRUE;

	return TRUE;
}