I'm having issues when using a Fintek F75113 IC to drive physical outputs on a motherboard.
My outputs are connected to registers 0x80 to 0x87.
With the Fintek GPIO tool I can set my register to output state (left column on this screenshot) by writing 0xFF on "Output enable" register, then setting the actual output value (true or false, middle column) on "output data". Works fine.
But I'm having issues doing the same thing in my C++ app using the SDK.
By using this code :
SETINT2UCHARPROC ProcAdd1;
ProcAdd1 = (SETINT2UCHARPROC) GetProcAddress(m_hinstLib, "GPIO_LPC_W");
if (NULL != ProcAdd1)
{
//register as OUTPUTS :
if (! (*ProcAdd1)(0x88, 0b11111111, 1))
{
qDebug() << " fail !";
}
else
{
qDebug() << " ok !";
}
}
else
{
qDebug() << "Fail to get this procedure address";
}
It actually switches the direction of the 8x register as outputs (fine). Confirmed by checking the Fintek app after.
But I didn't manage to understand how to set the actual value (true or false) of the 'output data' (second column of my screenshot).
I tried other functions available on the SDK :
SetLPCGpioControl
SetLPCGpioOutputDataIndividual
Like this :
SETUCHAR2PROC ProcAdd2;
int value = 0x00;
ProcAdd2 = (SETUCHAR2PROC) GetProcAddress(m_hinstLib, "SetLPCGpioControl"); // Fail to get this value SetLPCGpioControl
if (NULL != ProcAdd2)
{
if (! (*ProcAdd2)( 0x88, value)) // set GPIO 10 and GPIO 15 to output mode
{
qDebug() << "Fail to get this value"; //always ends here... :-(
}
else
qDebug() << "SetLPCGpioControl ok !!";
}
else
{
qDebug() << " Fail to get this procedure address ";
}
On every other functions, the call (*ProcAdd2)( 0x88, value) always returns false. I don't get why.
My application run with administrator rights.
Any ideas ?
