I’m having a little difficulty getting the gpio to work correctly.
I was told that the only thing I was to touch the input pins to was ground(logical 0), and if it wasn’t touching ground it would have a logical 1.
I’ve been testing with the AT command: “AT+WIOR=#” but I wasn’t sure what number to put in place of # and testing about didn’t appear to change anything.
I also tried some of the example code listed in the api:
#include "adl_global.h"
const u16 wm_apmCustomStackSize = 1024;
// Global variables & constants
// Subscription data
#define GPIO_COUNT1 2
#define GPIO_COUNT2 1
const adl_ioConfig_t MyGpioConfig1 [ GPIO_COUNT1 ] =
{ { ADL_IO_Q2686_GPIO_4, 0, ADL_IO_OUTPUT, ADL_IO_LOW },
{ ADL_IO_Q2686_GPIO_5, 0, ADL_IO_INPUT } };
const adl_ioConfig_t MyGpioConfig2 [ GPIO_COUNT2 ] =
{ { ADL_IO_Q2686_GPIO_19, 0, ADL_IO_INPUT } };
// Event Handle
s32 MyGpioEventHandle;
// Gpio Handles
s32 MyGpioHandle1, MyGpioHandle2;
// GPIO event handler
void MyGpioEventHandler ( s32 GpioHandle, adl_ioEvent_e Event, u32 Size,
void * Param )
{
TRACE (( 1, "MyGpioEventHandler" ));
// Check event
switch ( Event )
{
case ADL_IO_EVENT_INPUT_CHANGED :
// The subscribed input has changed
TRACE (( 1, "GPIO %d new value: %d",
( ( adl_ioRead_t * ) Param ) [0].eLabel,
( ( adl_ioRead_t * ) Param ) [0].eState ));
break;
}
}
// Somewhere in the application code, used as an event handler
void MyFunction ( void )
{
TRACE (( 1, "MyFunction" ));
// Local variables
s32 ReadValue;
// Subscribe to the GPIO event service
MyGpioEventHandle = adl_ioEventSubscribe ( MyGpioEventHandler );
// Subscribe to the GPIO service (One handle without polling,
// one with a 100ms polling process)
MyGpioHandle1 = adl_ioSubscribe ( GPIO_COUNT1, MyGpioConfig1, ADL_TMR_TYPE_100MS, 1, MyGpioEventHandle );
//MyGpioHandle2 = adl_ioSubscribe ( GPIO_COUNT2, MyGpioConfig2, ADL_TMR_TYPE_100MS, 1, MyGpioEventHandle );
}
void adl_main ( adl_InitType_e InitType )
{
TRACE (( 1, "Embedded Application : Main" ));
MyFunction();
}
I wasn’t sure about the ADL_IO_Q2686_GPIO_4 and ADL_IO_Q2686_GPIO_5 they were originally something else, but I changed them back, because this: http://torg-ru.ru/download/devices/wavecom/fastrak_modem_user_guide.pdf said they were GPIO4 and GPIO5. http://www.secos.ch/fileadmin/wavecom/Fastrack_Supreme/FastrackSupreme_Manual_27_07_07_UserGuide_Rev1.pdf says to use 21 and 25.
I was hoping someone could help me.
Again the model is the Fastrack Supreme 20.
Using Open at ver 4.25
I wanted to confirm the inputs should only be touched to ground and
get some help on reading from the INPUT pin, preferably in the c language.