Ejemplo n.º 1
0
/**
 * \brief User Interface - LCD Initialization.
 */
void ui_lcd_init(void)
{
	uint8_t const scrolling_str[] = "SAM4L-EK DEMO";

	/*
	 * LCDCA Controller Initialization and display SAM4L-EK DEMO texts on
	 * segment LCD
	 */

	// Initialize the C42364A LCD glass component.
	c42364a_init();

	// Start autonomous animation.
	c42364a_circular_animation_start(C42364A_CSR_RIGHT, 7, 0x03);
	// Show ARM Icon.
	c42364a_show_icon(C42364A_ICON_ARM);
	// Start scrolling text.
	c42364a_text_scrolling_start(scrolling_str,
			strlen((char const *)scrolling_str));

	while(event_qtouch_sensors_idle_count<UI_IDLE_TIME){}
	event_qtouch_sensors_idle_count = 0;

	// Stop scrolling text.
	c42364a_text_scrolling_stop();

	ui_lcd_refresh_txt();
}
Ejemplo n.º 2
0
/**
 * \brief main function : do init and loop
 */
int main(void)
{
    uint8_t key;
    uint8_t const scrolling_str[] = "C42364A Example  ";
    int32_t value = -12345;

    /* Initialize the SAM system */
    sysclk_init();
    board_init();

    /* Initialize the console uart */
    configure_console();

    /* Output example information */
    printf("-- C42364A Example --\r\n");
    printf("-- %s\n\r", BOARD_NAME);
    printf("-- Compiled: %s %s --\n\r", __DATE__, __TIME__);

    /* Turn on the backlight. */
    ioport_set_pin_level(LCD_BL_GPIO, LCD_BL_ACTIVE_LEVEL);

    /* Initialize the C42364A LCD glass component. */
    c42364a_init();

    printf("Show all the components on the glass.\r\n");
    c42364a_show_all();

    printf("Press any key to continue.\r\n");
    scanf("%c", (char *)&key);

    c42364a_clear_all();

    /* Display menu */
    display_menu();

    while (1) {
        scanf("%c", (char *)&key);

        switch (key) {
        case 'h':
            display_menu();
            break;

        case 'c':
            printf("Clear all the screen.\r\n");
            c42364a_clear_all();
            break;

        case '1':
            printf("Show icons, number and string.\r\n");
            c42364a_show_icon(C42364A_ICON_ARM);
            c42364a_show_numeric_dec(value);
            c42364a_show_text((const uint8_t *)"Welcome");
            c42364a_show_battery(C42364A_BATTERY_TWO);
            break;

        case '2':
            printf("Blink colon icon, show a time.\r\n");
            c42364a_clear_icon(C42364A_ICON_MINUS);
            c42364a_clear_icon(C42364A_ICON_MINUS_SEG1);
            c42364a_clear_icon(C42364A_ICON_MINUS_SEG2);
            c42364a_write_num_packet((const uint8_t *)"1023");
            c42364a_show_icon(C42364A_ICON_AM);
            c42364a_blink_icon_start(C42364A_ICON_COLON);
            break;

        case '3':
            printf("Show the two dots circular animation.\r\n");
            c42364a_circular_animation_start(C42364A_CSR_RIGHT, 7, 0x03);
            break;

        case '4':
            printf("Text scrolling.\r\n");
            c42364a_text_scrolling_start(scrolling_str,
                                         strlen((char const *)scrolling_str));
            break;

        default:
            break;
        }
    }

}