/* Only call this function from task context */ staticvoid ams_pmu_set_register(u8 reg, u8 value)
{ staticstruct adb_request req;
DECLARE_COMPLETION(req_complete);
/* Only call this function from task context */ static u8 ams_pmu_get_register(u8 reg)
{ staticstruct adb_request req;
DECLARE_COMPLETION(req_complete);
if (req.reply_len > 0) return req.reply[0]; else return 0;
}
/* Enables or disables the specified interrupts */ staticvoid ams_pmu_set_irq(enum ams_irq reg, char enable)
{ if (reg & AMS_IRQ_FREEFALL) {
u8 val = ams_pmu_get_register(AMS_FF_ENABLE); if (enable)
val |= 0x80; else
val &= ~0x80;
ams_pmu_set_register(AMS_FF_ENABLE, val);
}
if (reg & AMS_IRQ_SHOCK) {
u8 val = ams_pmu_get_register(AMS_SHOCK_ENABLE); if (enable)
val |= 0x80; else
val &= ~0x80;
ams_pmu_set_register(AMS_SHOCK_ENABLE, val);
}
if (reg & AMS_IRQ_GLOBAL) {
u8 val = ams_pmu_get_register(AMS_CONTROL); if (enable)
val |= 0x80; else
val &= ~0x80;
ams_pmu_set_register(AMS_CONTROL, val);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.