I've been trying to write a simple program for the PADK Professional Audio Development Kit C6727 DSP that will turn on/off an LED using the HAS pin setup as a GPIO pin according to the state of one of the push buttons, but I can't seem to get it right. Here is what I have:
CSL_UhpiHandle hUhpi = (CSL_UhpiHandle) NULL;
CSL_UhpiObj uhpiObj;
CSL_Status status;
Uint32 response;
int main()
{
CSL_chipInit( NULL );
hUhpi = CSL_uhpiOpen(&uhpiObj,CSL_UHPI,NULL,&status);
GPIO_Reset();
CSL_chipWriteReg (CSL_CHIP_REG_CFGHPI, CSL_UHPI_CFG);
CSL_uhpiHwControl (hUhpi, CSL_UHPI_CMD_SET_GPIO_EN, (void *)((Uint32)0x04));
CSL_uhpiHwControl (hUhpi, CSL_UHPI_CMD_SET_GPIO_DIR2, (void *)((Uint32)0x01));
while(1)
{
GPIO_GetPushButton(1) /* <- gets the pushbutton status */
CSL_uhpiHwSetup (hUhpi, (CSL_UhpiHwSetup *)(GPIO_GetPushButton(1)));
}
}
Can anyone help me figure this out?