Hardware: Evm6748
Software: CCS4, BIOS 5, PSP 1.30.01.
Application: The application started as the UPP EvmB example combined with a NDK example. UPP channel B was removed from the tci file, and it was removerd from the source code.
Problem description:
See the following code snippett. After calling gioOpen(), gpioReadPin( GPIOPIN(7,1) ) works, but gpioSetPin( GPIOPIN(7,0), value ) does not. The output is monitored by oscilloscope bewteen pins 21 (GPIO7[0]) and pin 29 (DGND).
#define GPIOPIN( bank, pin) ( bank*16 + pin + 1 )
#include <std.h>
#include <pwrm.h>
#include <pwrm6748.h>
#include "ti/pspiom/cslr/soc_C6748.h"
#include "ti/pspiom/cslr/cslr_gpio.h"
#include "ti/pspiom/gpio/Gpio.h"
Gpio_Handle gpio0 = 0x0u;
int testgpio( int value )
{
gpioOpen(Void);
gpioSetPin( GPIOPIN(7,0), value );
return( gpioReadPin( GPIOPIN(7,1) ) );
}
int gpioOpen(Void)
{
Gpio_PinCmdArg pinCmdArg;
Gpio_IntrCmdArg intrCmdArg;
Gpio_Params gpioParams = Gpio_PARAMS; int n; gpioParams.instNum = 0; gpioParams.BankParams[7].inUse = Gpio_InUse_No; gpio0 = Gpio_open(&gpioParams); // Bank 7, Pin 0 as output // Bank 7, Pins 1-15 as input return 0; void gpioClose() gpio0 = 0x0; int gpioSetPin( Uint32 pinspec, int val ) pinCmdArg.pin = pinspec; return( Gpio_setPinVal(gpio0, &pinCmdArg) ); int gpioReadPin( Uint32 pinspec ) pinCmdArg.pin = pinspec; if ( Gpio_getPinVal(gpio0, &pinCmdArg) ) return( (int) pinCmdArg.value );
for ( n = 0; n < 16; n++ ) {
gpioParams.BankParams[7].PinConfInfo[n].inUse = Gpio_InUse_No; // test input
}
PWRM_setDependency(PWRM_RSRC_GPIO);
pinCmdArg.pin = GPIOPIN(7,0);
pinCmdArg.value = Gpio_Direction_Output;
Gpio_setPinDir(gpio0, &pinCmdArg);
for ( n = 1; n < 16; n++ ) {
pinCmdArg.pin = GPIOPIN(7,n);
pinCmdArg.value = Gpio_Direction_Input;
Gpio_setPinDir(gpio0, &pinCmdArg);
}
}
{
if ( gpio0 ) Gpio_close(gpio0);
return;
}
{
Gpio_PinCmdArg pinCmdArg;
pinCmdArg.value = val;
}
{
Gpio_PinCmdArg pinCmdArg;
pinCmdArg.value = 0;
return( -1 );
}