Beispiel #1
0
/**
 *  \brief Initialize the app in low power: now PB0 push button has been pressed
 *  once, the application switches in low power mode: Stop LCD controller, stop
 *  LCD backlight, stop QTouch acquisition, switch SAM4L in power scaling PS1
 *  mode. SAM4L is in RUN mode.
 */
void app_init_lowpower(void)
{

	// Stop LCD Controller
	lcdca_disable();

	// Stop QTouch Initialization
	touch_sensors_deinit();

	// Initialize board features
	board_init();

	// Clear LCD backlight
	ioport_set_pin_level(LCD_BL_GPIO, IOPORT_PIN_LEVEL_LOW);

	// Disable the peripheral that we do not use anymore
	sysclk_disable_peripheral_clock(CATB);
	sysclk_disable_peripheral_clock(PDCA);
	sysclk_disable_peripheral_clock(LCDCA);

	// Set MCU Status
	ui_set_mcu_status(POWER_SCALING_PS1, SLEEP_MODE_RUN,
		12000000, CPU_SRC_RC4M);

	// Switch in selected Power Scaling mode
	app_switch_power_scaling(ui_get_power_scaling_mcu_status());

	// Send new MCU status to the board monitor
	ui_bm_send_mcu_status();

}
Beispiel #2
0
/**
 * \brief Clean up LCDCA test.
 *
 * \param test Current test case.
 */
static void run_lcdca_end_test(const struct test_case *test)
{
    UNUSED(test);

    /* Turn off LCD back light */
    ioport_set_pin_level(LCD_BL_GPIO, IOPORT_PIN_LEVEL_LOW);

    /* Disable LCDCA */
    lcdca_disable();
}