C-2 Power Management API
MX3-CE Reference Guide E-EQ-MX3CERG-A-ARC
Backup Battery Charge/Discharge
Backup battery charge and discharge are controlled by bits in an FPGA register. Note: turn off the
charge bits when turning on the discharge bits, and vice-versa; this is protected in hardware, but
there’s no reason to risk it.
See Also: ReadFPGA() and WriteFPGA().
#define FPGA_PWR_CNTL2 11
#define BIT_BBDC 0x80
#define BIT_BBC 0x40
void BackupDischarge(int onoff)
{
int val;
ReadFPGA(FPGA_PWR_CNTL2, &val);
if (onoff)
val &= ~BIT_BBC, // charge off
val |= BIT_BBDC; // discharge on
else
val &= ~BIT_BBDC; // discharge off
WriteFPGA(FPGA_PWR_CNTL2, val);
}
void BackupCharge(void)
{
int val;
ReadFPGARegister(FPGA_PWR_CNTL2, &val);
if (onoff)
val |= BIT_BBC, // charge on
val &= ~BIT_BBDC; // discharge off
else
val &= ~BIT_BBC; // charge off
WriteFPGA(FPGA_PWR_CNTL2, val);
}
COM1 Ring Indicator Power
One or more control lines are not connected. This is usually a cable problem, but on a laptop or
other device, it may indicate a bad serial port.
See Also: ReadFPGA() and WriteFPGA().
#define FPGA_PWR_CNTL2 11
#define BIT_COM1RI 0x02
void SetCOM3RI(int onoff)
{
int val;
ReadFPGA(FPGA_PWR_CNTL2, &val);
if (onoff)
val |= BIT_COM1RI; // RI power on
else
val &= ~BIT_COM1RI; // RI power off
WriteFPGA(FPGA_PWR_CNTL2, val);
}