view target-utils/lunadrv/sleep.c @ 995:74024eb17e04

fc-loadtool help: improve language regarding 16 MiB flash chips In FC project history, 16 MiB flash originally meant Pirelli DP-L10. Then we got FCDEV3B with the same flash (our own design), but now we are discovering more Calypso devices that used such large flash, both late Calypso era (Sony Ericsson K2x0) as well as much earlier ones (FIC FLUID devices.txt file with 2004 dates, Leonardo+ rev 5). Hence we need to migrate to more generic or neutral language in associated documentation, without giving elevated status to specific examples that drove our early project history.
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 03 Dec 2023 21:11:12 +0000
parents 57f7db8c4f45
children
line wrap: on
line source

/*
 * This module implements suspend and resume commands for entering
 * and exiting ILI9225G sleep mode.  These commands are expected
 * to work the same on both HaoRan and Formike LCDs, but the
 * current measurement resistor that allows one to see the actual
 * power supply current drawn by the LCD is present only on lunalcd2
 * boards.
 */

#include "types.h"
#include "luna.h"

void
cmd_suspend()
{
	LCD_REG_WR(0x0007, 0);			/* display off */
	wait_ARM_cycles(DELAY_1MS * 50);
	LCD_REG_WR(0x0010, 1);			/* suspend mode */
}

void
cmd_resume()
{
	LCD_REG_WR(0x0010, 0);			/* out of suspend */
	wait_ARM_cycles(DELAY_1MS * 50);
	LCD_REG_WR(0x0007, 0x1017);		/* display on */
}

/*
 * If we wish to run sans-UI firmware on an LCD-equipped board,
 * we would like to put the ILI9225G controller into its lowest
 * power mode, without doing anything else to it.  The following
 * reset-suspend command prototypes this functionality.
 */

void
cmd_reset_suspend()
{
	/* reset pulse */
	CNTL_RST_REG |= EXT_RESET;
	wait_ARM_cycles(DELAY_1MS * 10);
	CNTL_RST_REG &= ~EXT_RESET;
	/* datasheet says it needs 50 ms */
	wait_ARM_cycles(DELAY_1MS * 50);
	/* and straight into suspend mode */
	LCD_REG_WR(0x0010, 1);
}