/**
 * \internal
 * \brief Function to blink a symbol or led.
 * \note Please see conf_oss file in order to configure the signalling.
 *
 */
static uint8_t _blink_symbol(uint8_t icon_com, uint8_t icon_seg, uint8_t status)
{
	if (!status) {
		c42364a_show_icon(icon_com, icon_seg);
		return true;
	} else {
		c42364a_clear_icon(icon_com, icon_seg);
		return false;
	}
}
Exemple #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;
        }
    }

}