bool rtc_enable_alarm(bool enable) { if (enable) mc13783_clear(MC13783_INTERRUPT_MASK1, MC13783_TODAM); else mc13783_set(MC13783_INTERRUPT_MASK1, MC13783_TODAM); return false; }
void mc13783_disable_event(enum mc13783_event_ids id) { const struct mc13783_event * const event = &mc13783_events[id]; int set = event->set; uint32_t mask = event->mask; mutex_lock(&mc13783_spi_mutex); pmic_int_enabled[set] &= ~mask; mc13783_set(pmic_intm_regs[set], mask); mutex_unlock(&mc13783_spi_mutex); }
static void lcd_set_power(bool powered) { if (powered) { lcd_powered = false; lcd_write_reg(0x04, 0x00); lcd_enable_interface(false); bitclr32(&GPIO3_DR, (1 << 12)); mc13783_clear(MC13783_REGULATOR_MODE1, MC13783_VCAMEN); } else { mc13783_set(MC13783_REGULATOR_MODE1, MC13783_VCAMEN); bitset32(&GPIO3_DR, (1 << 12)); lcd_enable_interface(true); lcd_write_reg(0x04, 0x01); lcd_powered = true; } }