void backlight_hw_off(void) { backlight_hw_brightness(0); #ifdef HAVE_LCD_ENABLE lcd_enable(false); /* power off visible display */ #endif }
void backlight_hw_on(void) { /* configure backlight pin P0.0 as timer PWM output */ PCON0 = ((PCON0 & ~(3 << 0)) | (2 << 0)); backlight_hw_brightness(backlight_brightness); }
void system_exception_wait(void) { backlight_hw_on(); backlight_hw_brightness(DEFAULT_BRIGHTNESS_SETTING); /* wait until button press and release */ while(button_read_device() != 0) {} while(button_read_device() == 0) {} while(button_read_device() != 0) {} while(button_read_device() == 0) {} }
void backlight_hw_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_hw_brightness(backlight_brightness); #endif }
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_hw_on(); backlight_hw_brightness(DEFAULT_BRIGHTNESS_SETTING); /* wait until button release (if a button is pressed) * NOTE at this point, interrupts are off so that rules out touchpad and * ADC, so we are pretty much left with PSWITCH only. If other buttons are * wanted, it is possible to implement a busy polling version of button * reading for GPIO and ADC in button-imx233 but this is not done at the * moment. */ while(imx233_power_read_pswitch() != 0) {} while(imx233_power_read_pswitch() == 0) {} while(imx233_power_read_pswitch() != 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_hw_on(); backlight_hw_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 }
bool backlight_hw_init(void) { short read_value; IO_GIO_BITCLR2 = (1 << 5); /* output low (backlight/lcd on) */ spi_block_transfer(SPI_target_BACKLIGHT, commands[6], 2, 0, 0); spi_block_transfer(SPI_target_BACKLIGHT, commands[8], 2, (char*)&read_value, 2); if( (read_value & 0xFF) < 0xD0 ) { spi_block_transfer(SPI_target_BACKLIGHT, commands[3], 2, 0, 0); spi_block_transfer(SPI_target_BACKLIGHT, commands[4], 2, 0, 0); spi_block_transfer(SPI_target_BACKLIGHT, commands[9], 2, 0, 0); spi_block_transfer(SPI_target_BACKLIGHT, commands[0], 2, 0, 0); } spi_block_transfer(SPI_target_BACKLIGHT, commands[2], 2, 0, 0); backlight_hw_brightness(backlight_brightness); return true; }
bool backlight_hw_init(void) { backlight_hw_on(); backlight_hw_brightness(DEFAULT_BRIGHTNESS_SETTING); return true; }
void __backlight_dim(bool dim_now) { backlight_hw_brightness(dim_now ? DEFAULT_BRIGHTNESS_SETTING : DEFAULT_DIMNESS_SETTING); }