void _backlight_hw_enable(bool on)
{
#ifdef HAVE_LCD_SLEEP
    if (on)
        /* If the fade-out is interrupted, enabled will be true, but 
           lcd_awake() needs to be called anyways because the LCD 
           may be sleeping.
         */
        lcd_awake();
#endif

    if (on == enabled)
        return;

    if (on)
    {
        GPIO_SET_BITWISE(GPIOB_OUTPUT_VAL, 0x08);
        GPIO_SET_BITWISE(GPIOD_OUTPUT_VAL, 0x80);
        sleep(HZ/100);
        current_dim = 16;
        _backlight_set_brightness(brightness);
    }
    else
    {
        GPIO_CLEAR_BITWISE(GPIOD_OUTPUT_VAL, 0x80);
        GPIO_CLEAR_BITWISE(GPIOB_OUTPUT_VAL, 0x08);
        sleep(HZ/20);
    }
    enabled = on;
}
Пример #2
0
int _backlight_init(void)
{
    _backlight_set_brightness(DEFAULT_BRIGHTNESS_SETTING);
    /* set backlight on by default, since the screen is unreadable without it */
    _backlight_on();
    return true;
}
Пример #3
0
void _backlight_off(void)
{
    _backlight_set_brightness(0);
#ifdef HAVE_LCD_ENABLE
    lcd_enable(false); /* power off visible display */
#endif
}
bool _backlight_init(void)
{
    _backlight_set_brightness(DEFAULT_BRIGHTNESS_SETTING);
    _backlight_on();
    
    return true; /* Backlight always ON after boot. */
}
Пример #5
0
bool _backlight_init(void)
{
    IO_CLK_PWM1C = 0x58D; /* as found in OF */

    _backlight_set_brightness(backlight_brightness);
    return true;
}
Пример #6
0
void _backlight_off(void)
{
    /* there is no real on/off but we can set to 0 brightness */
    _backlight_set_brightness(0);
#ifdef HAVE_LCD_ENABLE
    lcd_enable(false); /* power off visible display */
#endif
}
Пример #7
0
bool _backlight_init(void)
{
    imx233_pinctrl_acquire(0, 10, "backlight_enable");
    imx233_pinctrl_set_function(0, 10, PINCTRL_FUNCTION_GPIO);
    imx233_pinctrl_enable_gpio(0, 10, true);
    imx233_pinctrl_set_gpio(0, 10, true);
    _backlight_set_brightness(DEFAULT_BRIGHTNESS_SETTING);
    return true;
}
Пример #8
0
void system_exception_wait(void)
{
    /* make sure lcd and backlight are on */
    lcd_update();
    _backlight_on();
    _backlight_set_brightness(DEFAULT_BRIGHTNESS_SETTING);
    /* wait until button release (if a button is pressed) */
    while(button_read_device());
    /* then wait until next button press */
    while(!button_read_device());
}
Пример #9
0
void _backlight_on(void)
{
#ifdef HAVE_LCD_ENABLE
    lcd_enable(true); /* power on lcd + visible display */
#endif
#if (CONFIG_BACKLIGHT_FADING != BACKLIGHT_FADING_SW_SETTING) /* in bootloader/sim */
    /* if we set the brightness to the settings value, then fading up
     * is glitchy */
    _backlight_set_brightness(backlight_brightness);
#endif
}
bool _backlight_init(void)
{
    /* Set default LED register value */
    mc13783_write(MC13783_LED_CONTROL0,
                  MC13783_LED_CONTROL0_BITS | MC13783_LEDEN);

#ifdef HAVE_BACKLIGHT_BRIGHTNESS
    /* Our PWM and I-Level is different than retailos (but same apparent
     * brightness), so init to our default. */
    _backlight_set_brightness(DEFAULT_BRIGHTNESS_SETTING);
#else
    /* Use default PWM */
    backlight_pwm_bits = mc13783_read(MC13783_LED_CONTROL2) & MC13783_LEDMDDC;
#endif

    return true;
}
Пример #11
0
void system_exception_wait(void)
{
    /* stop hadrware watchdog, IRQs are stopped */
    imx233_rtc_enable_watchdog(false);
    /* make sure lcd and backlight are on */
    lcd_update();
    _backlight_on();
    _backlight_set_brightness(DEFAULT_BRIGHTNESS_SETTING);
    /* wait until button release (if a button is pressed) */
#ifdef HAVE_BUTTON_DATA
    int data;
    while(button_read_device(&data));
    /* then wait until next button press */
    while(!button_read_device(&data));
#else
    while(button_read_device());
    /* then wait until next button press */
    while(!button_read_device());
#endif
}
Пример #12
0
void __backlight_dim(bool dim_now)
{
    _backlight_set_brightness(dim_now ?
        DEFAULT_BRIGHTNESS_SETTING :
        DEFAULT_DIMNESS_SETTING);
}