Hi.
1) How do I make an output pin on GP0[14] goes High and Low (bit-wise operation)?
2) How if I want to make all the output pins on GP0 high & low ?
Below code is a snippet for GPIO example program based on PSP 1.20 using on OMAP-L137. I did try to change parameter "12" to "14" assuming it will work for GP0[14]; but it did not.
/* Configure GPIO0_12 (GPIO0_12_PIN) as an output */
gpioRegs->BANK[0].DIR &= ~(CSL_GPIO_DIR_DIR_IN << CSL_GPIO_DIR_DIR12_SHIFT);
/* Configure GPIO0_8 (GPIO0_8_PIN) as an input */
temp = gpioRegs->BANK[0].DIR;
temp = ( (temp & CSL_GPIO_DIR_DIR8_MASK) | (CSL_GPIO_DIR_DIR_IN << CSL_GPIO_DIR_DIR8_SHIFT) );
gpioRegs->BANK[0].DIR |= temp;
while (ledBlinkCount < MAX_BLINK)
{
/* Make the GPIO pin (GPIO0_12_PIN) conected to the LED to low. *
* This turns on the LED - see schematic */
temp = gpioRegs->BANK[0].CLR_DATA;
temp = ( (temp & CSL_GPIO_CLR_DATA_CLR12_MASK) |
(CSL_GPIO_CLR_DATA_CLR_CLR << CSL_GPIO_CLR_DATA_CLR12_SHIFT) );
gpioRegs->BANK[0].CLR_DATA |= temp;
delay(2000);
/* Make the GPIO pin (GPIO0_12_PIN) conected to the LED to high *
* This turns the off the LED - see schematic */
temp = gpioRegs->BANK[0].SET_DATA;
temp = ( (temp & CSL_GPIO_SET_DATA_SET12_MASK) |
(CSL_GPIO_SET_DATA_SET_SET << CSL_GPIO_SET_DATA_SET12_SHIFT) );
gpioRegs->BANK[0].SET_DATA |= temp;
delay(2000);
}