This is some sample C++ code from my TS-7260 + TS-GSM1. Some of the
memory addresses may be different because of differing devices and/or
jumper settings. I hope it is helpful.
Don
devmem=-1;
devmem = open("/dev/mem", O_RDWR|O_SYNC);
if(devmem == -1)
return 0;
int InitializeCellModem(int devmem)
{
volatile unsigned char *pc104base=NULL;
volatile unsigned char *gsmid;
int offset = 0x140;//for JP4=OFF on TS-GSM1
pc104base = (unsigned
char*)mmap(0,getpagesize(),PROT_READ|PROT_WRITE,MAP_SHARED,
devmem,PC104_8BIT_IO);
//check memory map was successful
if (pc104base == MAP_FAILED)
return 0;
//check that the cell modem is present
gsmid = pc104base + offset;
if (*gsmid != 9)
return 0;
//assign global pointer to ON/OFF bit in memory registers for cell phone
OP.gsm_stat = pc104base + offset + 3;
return 1;
}
void TurnCellModemOff(int TimeDelay)
{
*(OP.gsm_stat)=(0x00);
sleep(TimeDelay);
}
void TurnCellModemOn(int TimeDelay)
{
*(OP.gsm_stat)=(0x01);
sleep(TimeDelay);
}
*(OP.gsm_stat)=(0x00);
On 11/22/2011 1:50 AM, wawan_wiratno wrote:
Hi All,
I need to reset power of ts-gsm1 only when communication is hang.
its mean when I cannot initiate AT command will reboot modem only not
the whole board.
according to docs, that register base+3 bit number 0 is the controller
so I use poke8 command to turn on/off
poke8 0x11e00143 0x0 --> modem turn off successfully
but poke8 0x11e00143 0x1 --> will reboot the whole board
note: JP5 ON, IRQ7, JP4 OFF
please help
thanks
Wawan
smime.p7s
Description: S/MIME Cryptographic Signature
|