提交 be0c5479 编写于 作者: X xieyangrun

remove asflib/components

上级 4de4506d
/**
* \file
*
* \brief Management of C42412A LCD Glass component.
*
* Copyright (c) 2015 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* \asf_license_stop
*
*/
/*
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
*/
#include "slcd.h"
#include "c42412a.h"
#include "config_c42412a.h"
#include <string.h>
const uint32_t charactor_map[] = {
0x2e74,0x440,0x23c4,0x25c4,0x5e0,0x25a4,0x27a4,0x444,0x27e4,0x25e4, /*0-9*/
0x7e4,0xa545,0x2224,0xa445,0x23a4,0x3a4,0x2724, /*A-G*/
0x7e0,0xa005,0x2640,0x12b0,0x2220,0x678,0x1668, /*H-N*/
0x2664,0x3e4,0x3664,0x13e4,0x25a4,0x8005, /*O-T*/
0x2660,0xa30,0x1e60,0x1818,0x8018,0x2814 /*U-Z*/
};
const uint32_t num_map[10] = {0x2e74,0x440,0x23c4,0x25c4,0x5e0,0x25a4,0x27a4,0x444,0x27e4,0x25e4};
void c42412a_init(void)
{
struct slcd_config config;
slcd_get_config_defaults(&config);
slcd_init(&config);
slcd_set_frame_counter(SLCD_FRAME_COUNTER_0,false,CONF_C42412A_FC0);
slcd_set_frame_counter(SLCD_FRAME_COUNTER_1,false,CONF_C42412A_FC1);
slcd_set_frame_counter(SLCD_FRAME_COUNTER_2,false,CONF_C42412A_FC2);
slcd_set_contrast(CONF_C42412A_CONTRAST);
slcd_enable();
}
void c42412a_show_all(void)
{
slcd_set_display_memory();
}
void c42412a_clear_all(void)
{
slcd_disable_blink();
slcd_disable_circular_shift();
slcd_clear_display_memory();
}
void c42412a_show_text(const uint8_t *data)
{
Assert(data);
uint32_t len = (uint32_t)strlen((char *) data);
len = (len > C42412A_MAX_CHAR) ? C42412A_MAX_CHAR : len;
slcd_character_map_set(SLCD_AUTOMATED_CHAR_START_FROM_BOTTOM_RIGHT,C42412A_CHAR_MAP_NUM_SEG-1);
for(uint32_t i = 0 ; i < len ; i++) {
if(data[i] >= '0' && data[i] <= '9') {
slcd_character_write_data(0,C42412A_NUM_SEG_INDEX_S+i*C42412A_CHAR_MAP_NUM_SEG,
charactor_map[data[i] - '0'],C42412A_DATA_MASK);
} else if(data[i] >= 'A' && data[i] <= 'Z') {
slcd_character_write_data(0,C42412A_NUM_SEG_INDEX_S+i*C42412A_CHAR_MAP_NUM_SEG,
charactor_map[data[i] - 'A' +10],C42412A_DATA_MASK);
} else if(data[i] >= 'a' && data[i] <= 'z') {
slcd_character_write_data(0,C42412A_NUM_SEG_INDEX_S+i*C42412A_CHAR_MAP_NUM_SEG,
charactor_map[data[i] - 'a' +10],C42412A_DATA_MASK);
} else {
slcd_character_write_data(0,C42412A_NUM_SEG_INDEX_S+i*C42412A_CHAR_MAP_NUM_SEG,
charactor_map[0],C42412A_DATA_MASK);
}
}
}
void c42412a_clear_text(void)
{
slcd_character_map_set(SLCD_AUTOMATED_CHAR_START_FROM_BOTTOM_RIGHT,C42412A_CHAR_MAP_NUM_SEG-1);
for(uint32_t i = 0 ; i < C42412A_MAX_CHAR ; i++) {
slcd_character_write_data(0,C42412A_NUM_SEG_INDEX_S+i*C42412A_CHAR_MAP_NUM_SEG,0,C42412A_DATA_MASK);
}
}
void c42412a_show_icon(uint8_t icon_com, uint8_t icon_seg)
{
slcd_set_pixel(icon_com, icon_seg);
}
void c42412a_clear_icon(uint8_t icon_com, uint8_t icon_seg)
{
slcd_clear_pixel(icon_com, icon_seg);
}
void c42412a_blink_icon_start(uint8_t icon_com, uint8_t icon_seg)
{
if (icon_seg < 2) {
slcd_disable();
struct slcd_blink_config blink_config;
slcd_blink_get_config_defaults(&blink_config);
blink_config.blink_all_seg = false;
blink_config.fc = CONF_C42412A_BLINK_TIMER;
slcd_blink_set_config(&blink_config);
slcd_set_pixel(icon_com, icon_seg);
slcd_set_blink_pixel(icon_com, icon_seg);
slcd_enable_frame_counter(CONF_C42412A_BLINK_TIMER);
slcd_enable_blink();
slcd_enable();
}
}
void c42412a_blink_icon_stop(uint8_t icon_com, uint8_t icon_seg)
{
if (icon_seg < 2) {
slcd_disable_blink();
slcd_disable();
slcd_clear_blink_pixel(icon_com, icon_seg);
slcd_enable_blink();
slcd_enable();
}
}
void c42412a_blink_screen(void)
{
slcd_disable_blink();
slcd_disable();
struct slcd_blink_config blink_config;
slcd_blink_get_config_defaults(&blink_config);
blink_config.blink_all_seg = true;
blink_config.fc = CONF_C42412A_BLINK_TIMER;
slcd_blink_set_config(&blink_config);
slcd_enable_frame_counter(CONF_C42412A_BLINK_TIMER);
slcd_enable_blink();
slcd_enable();
}
void c42412a_blink_disable(void)
{
slcd_disable_frame_counter(CONF_C42412A_BLINK_TIMER);
slcd_disable_blink();
}
void c42412a_set_contrast(uint8_t contrast)
{
slcd_set_contrast(contrast);
}
void c42412a_show_battery(enum c42412a_battery_value val)
{
if (val <= C42412A_BATTERY_THREE )
{
slcd_clear_pixel(C42412A_ICON_BAT_LEVEL_1);
slcd_clear_pixel(C42412A_ICON_BAT_LEVEL_2);
slcd_clear_pixel(C42412A_ICON_BAT_LEVEL_3);
slcd_set_pixel(C42412A_ICON_BAT);
switch (val) {
case C42412A_BATTERY_THREE:
slcd_set_pixel(C42412A_ICON_BAT_LEVEL_3);
case C42412A_BATTERY_TWO:
slcd_set_pixel(C42412A_ICON_BAT_LEVEL_2);
case C42412A_BATTERY_ONE:
slcd_set_pixel(C42412A_ICON_BAT_LEVEL_1);
break;
case C42412A_BATTERY_NONE:
break;
}
}
}
void c42412a_show_wireless(enum c42412a_wireless_value val)
{
slcd_clear_pixel(C42412A_ICON_WLESS_LEVEL_1);
slcd_clear_pixel(C42412A_ICON_WLESS_LEVEL_2);
slcd_clear_pixel(C42412A_ICON_WLESS_LEVEL_3);
slcd_set_pixel(C42412A_ICON_WLESS_LEVEL_0);
switch (val) {
case C42412A_WIRELESS_THREE:
slcd_set_pixel(C42412A_ICON_WLESS_LEVEL_3);
case C42412A_WIRELESS_TWO:
slcd_set_pixel(C42412A_ICON_WLESS_LEVEL_2);
case C42412A_WIRELESS_ONE:
slcd_set_pixel(C42412A_ICON_WLESS_LEVEL_1);
break;
case C42412A_WIRELESS_NONE:
break;
}
}
void c42412a_show_numeric_dec(int32_t value)
{
uint32_t tmp=0;
uint8_t i=0;
Assert(value > -200000);
Assert(value < 200000);
slcd_character_map_set(SLCD_AUTOMATED_CHAR_START_FROM_BOTTOM_RIGHT,C42412A_CHAR_MAP_NUM_SEG-1);
if(value < 0) {
slcd_set_pixel(C42412A_ICON_MINUS);
} else {
slcd_clear_pixel(C42412A_ICON_MINUS);
}
tmp = Abs(value);
if (tmp > 99999) {
slcd_set_pixel(C42412A_ICON_MINUS_SEG1);
slcd_set_pixel(C42412A_ICON_MINUS_SEG2);
tmp -= 100000;
} else {
slcd_clear_pixel(C42412A_ICON_MINUS_SEG1);
slcd_clear_pixel(C42412A_ICON_MINUS_SEG2);
}
while(tmp != 0 && i <= C42412A_MAX_NUM){
slcd_character_write_data(0,C42412A_NUM_SEG_INDEX_E - i*C42412A_CHAR_MAP_NUM_SEG,
num_map[tmp%10],C42412A_DATA_MASK);
tmp /=10;
i++;
}
}
void c42412a_clear_numeric_dec(void)
{
slcd_clear_pixel(C42412A_ICON_MINUS);
slcd_clear_pixel(C42412A_ICON_MINUS_SEG1);
slcd_clear_pixel(C42412A_ICON_MINUS_SEG2);
slcd_character_map_set(SLCD_AUTOMATED_CHAR_START_FROM_BOTTOM_RIGHT,C42412A_CHAR_MAP_NUM_SEG-1);
for(uint32_t i = 0 ; i < C42412A_MAX_CHAR ; i++) {
slcd_character_write_data(0,C42412A_NUM_SEG_INDEX_S+i*C42412A_CHAR_MAP_NUM_SEG,0,C42412A_DATA_MASK);
}
}
void c42412a_circular_animation_start(uint8_t size, uint8_t data)
{
struct slcd_circular_shift_config cfg;
slcd_disable();
slcd_circular_shift_get_config_defaults(&cfg);
cfg.data = data;
cfg.size = size;
cfg.dir = C42412A_CSR_DIR;
cfg.fc = CONF_C42412A_CIRCULAR_ANIMATION_TIMER;
slcd_circular_shift_set_config(&cfg);
slcd_enable_circular_shift();
slcd_enable_frame_counter(CONF_C42412A_CIRCULAR_ANIMATION_TIMER);
slcd_enable();
}
void c42412a_circular_animation_stop(void)
{
slcd_disable_frame_counter(CONF_C42412A_CIRCULAR_ANIMATION_TIMER);
slcd_disable_circular_shift();
}
/**
* \file
*
* \brief Management of C42412A LCD Glass component.
*
* Copyright (c) 2015 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* \asf_license_stop
*
*/
/*
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
*/
#ifndef C42412A_H_INCLUDED
#define C42412A_H_INCLUDED
#include "compiler.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* \defgroup c42412a_display_group Atmel YMCC42412AAAFDCL LCD Glass component
*
* This is a driver for Atmel YMCC42412AAAFDCL LCD component.
* This component is the custom LCD used for SAM4L-Xplained-Pro.
* This driver provides functions for initialization and control of the
* LCD segments.
*
* \section dependencies Dependencies
* This driver depends on the following modules:
* - SLCD driver.
* @{
*/
/**
* \name Value for battery Icon setting
* @{
*/
enum c42412a_battery_value {
C42412A_BATTERY_NONE = 0,
C42412A_BATTERY_ONE,
C42412A_BATTERY_TWO,
C42412A_BATTERY_THREE,
};
/** @} */
/**
* \name Value for wireless Icon setting
* @{
*/
enum c42412a_wireless_value {
C42412A_WIRELESS_NONE = 0,
C42412A_WIRELESS_ONE,
C42412A_WIRELESS_TWO,
C42412A_WIRELESS_THREE,
};
/** @} */
/**
* \name Function Prototypes
* @{
*/
/**
* \brief Initialize the C42412A LCD Glass component.
*
* This function initializes the LCD driver to control the LCD glass.
* It perform LCD module intialization according to the C42412A characteristics.
*
*/
void c42412a_init(void);
/**
* \brief Show text on C42412A LCD glass alphanumeric field.
*
* This function will show text on the alphanumeric field of the LCD glass.
*
* \param data Pointer to the input string(max length is 5)
*/
void c42412a_show_text(const uint8_t *data);
/**
* \brief Clear C42412A LCD glass alphanumeric field.
*
* This function will clear the alphanumeric field of the LCD glass.
*/
void c42412a_clear_text(void);
/**
* \brief Clear a specific icon on the LCD glass.
*
* This function will clear a specific icon.
*
* \param icon_com Pixel coordinate - COMx - of the icon.
* \param icon_seg Pixel coordinate - SEGy - of the icon.
*
* \note Use the icon define in header file.
*/
void c42412a_clear_icon(uint8_t icon_com, uint8_t icon_seg);
/**
* \brief Show a specific icon on the LCD glass.
*
* This function will show a specific icon.
*
* \param icon_com Pixel coordinate - COMx - of the icon.
* \param icon_seg Pixel coordinate - SEGy - of the icon.
*
* \note Use the icon define in header file.
*/
void c42412a_show_icon(uint8_t icon_com, uint8_t icon_seg);
/**
* \brief Blink a specific icon on the LCD glass.
*
* This function will blink a specific icon.
*
* \param icon_com Pixel coordinate - COMx - of the icon.
* \param icon_seg Pixel coordinate - SEGy - of the icon.
*
* \note Use the icon define in header file(with selected segments
* blinking feature).
*/
void c42412a_blink_icon_start(uint8_t icon_com, uint8_t icon_seg);
/**
* \brief Stop blink a specific icon on the LCD glass.
*
* This function will stop blink a specific icon.
*
* \param icon_com Pixel coordinate - COMx - of the icon.
* \param icon_seg Pixel coordinate - SEGy - of the icon.
*
* \note Use the icon define in header file(with selected segments
* blinking feature).
*/
void c42412a_blink_icon_stop(uint8_t icon_com, uint8_t icon_seg);
/**
* \brief Blink the current screen content.
*
* This function will make the current screen blink.
*
*/
void c42412a_blink_screen(void);
/**
* \brief Disable all Blink.
*
* This function will disable all Blink content.
*
*/
void c42412a_blink_disable(void);
/**
* \brief Set the C42412A LCD glass contrast.
*
* This function allows to adjust the contrast of the C42412A LCD glass.
*
* \param contrast Contrast vlaue [0-0xff].
*/
void c42412a_set_contrast(uint8_t contrast);
/**
* \brief Scrolling start.
*
* This function start the text scrolling.
*
* \param data Data string buffer.
* \param length Data string length.
*/
void c42412a_text_scrolling_start(const uint8_t *data, uint32_t length);
/**
* \brief Scrolling stop.
*
* This function stop the text scrolling.
*/
void c42412a_text_scrolling_stop(void);
/**
* \brief Show all content of the LCD glass.
*
* This function sets all pixels and areas of the LCD glass C42412A.
*
*/
void c42412a_show_all(void);
/**
* \brief Clear all content of the LCD glass.
*
* This function clears all pixels and areas of the LCD glass C42412A.
*
*/
void c42412a_clear_all(void);
/**
* \brief Show a decimal numeric value to LCD glass.
*
* This function displays an int32 value to the LCD numeric field of the glass.
*
* \param value The int32_t value to be displayed
*
* \note The value range is [-199999,199999].
*/
void c42412a_show_numeric_dec(int32_t value);
/**
* \brief Clear C42412A LCD glass numeric field and the three
* C42412A_ICON_MINUS*** icons.
*
* This function will clear the numeric field of the LCD glass.
*/
void c42412a_clear_numeric_dec(void);
/**
* \brief Show battery condition by the battery icons on the LCD glass.
*
* This function allows to Show battery condition by the battery icons
* on the LCD glass..
*
* \param val The 0 to 3 value which show the battery condition.
*/
void c42412a_show_battery(enum c42412a_battery_value val);
/**
* \brief Show wireless signal condition by the wireless icons on the LCD glass.
*
* This function allows to Show wireless signal condition by the wireless icons
* on the LCD glass..
*
* \param val The 0 to 3 value which show the wireless signal condition.
*/
void c42412a_show_wireless(enum c42412a_wireless_value val);
/**
* \brief Start autonomous segment animation.
*
* \param val The 0 to 3 value which show the wireless signal condition.
*
* \param size Shift data size.
* \param data Shift data.
*/
void c42412a_circular_animation_start(uint8_t size, uint8_t data);
/**
* \brief Stop autonomous segment animation.
*
*/
void c42412a_circular_animation_stop(void);
/** @} */
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* C42412A_H_INCLUDED */
/**
* Copyright (c) 2012 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* \asf_license_stop
*
* \mainpage
*
* \section intro Introduction
* This documentation has been automatically generated, and documents the source
* code found in the Atmel Software Framework (ASF). <p>
* Use the above menu to navigate in the documentation, or use the links below: <br>
* <ul>
* <li> <a href="globals_func.html">Functions</a>
* <li> <a href="annotated.html">Data structures</a>
* <li> <a href="globals_type.html">Defines</a>
* </ul>
*
* \section main_licence License
* <ul>
* <li>\ref License
* </ul>
* \section contactinfo Contact Information
* For further information, visit <a href="http://www.atmel.com/">Atmel</a>.\n
*
*/
/**
* \file
*
* \brief C42412A LCD Glass component example for SAM.
*
* Copyright (C) 2015 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* \asf_license_stop
*
*/
/**
* \mainpage
* \section intro Introduction
* This is the documentation for the data structures, functions, variables,
* defines, enums, and typedefs for the C42412A LCD Glass component example.
* It also comes bundled with an application-example of usage.
*
* This example demonstrates how to use the C42412A LCD Glass driver.
*
* The supported board list:
* - SAM L22 Xplained Pro
*
* \section compilinfo Compilation Information
* This software is written for GNU GCC and IAR Embedded Workbench
* for Atmel. Other compilers may or may not work.
*
* \section deviceinfo Device Information
* The SEGMENT LCD1 Xplained Pro extension board must be connected to SAM devices.
*
* \section configinfo Configuration Information
* - PC terminal settings:
* - 115200 bps,
* - 8 data bits,
* - no parity bit,
* - 1 stop bit,
* - no flow control.
*
* \section contactinfo Contact Information
* For further information, visit
* <A href="http://www.atmel.com">Atmel</A>.\n
* Support and FAQ: http://www.atmel.com/design-support/
*/
/*
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
*/
#include <asf.h>
#include <string.h>
#include "config_c42412a.h"
struct usart_module usart_instance;
/**
* Configure serial console.
*/
static void configure_console(void)
{
struct usart_config config_usart;
usart_get_config_defaults(&config_usart);
config_usart.baudrate = 38400;
config_usart.mux_setting = EDBG_CDC_SERCOM_MUX_SETTING;
config_usart.pinmux_pad0 = EDBG_CDC_SERCOM_PINMUX_PAD0;
config_usart.pinmux_pad1 = EDBG_CDC_SERCOM_PINMUX_PAD1;
config_usart.pinmux_pad2 = EDBG_CDC_SERCOM_PINMUX_PAD2;
config_usart.pinmux_pad3 = EDBG_CDC_SERCOM_PINMUX_PAD3;
stdio_serial_init(&usart_instance, EDBG_CDC_MODULE, &config_usart);
usart_enable(&usart_instance);
}
static void c42412a_icon_test(void)
{
c42412a_show_icon(C42412A_ICON_COLON);
delay_s(1);
c42412a_show_battery(C42412A_BATTERY_THREE);
delay_s(1);
c42412a_show_battery(C42412A_BATTERY_ONE);
delay_s(1);
c42412a_show_wireless(C42412A_WIRELESS_THREE);
delay_s(1);
c42412a_show_wireless(C42412A_WIRELESS_TWO);
delay_s(1);
c42412a_show_icon(C42412A_ICON_AUDIO_PLAY);
delay_s(1);
c42412a_clear_icon(C42412A_ICON_COLON);
}
static void c42412a_blink_test(void)
{
c42412a_blink_icon_start(C42412A_ICON_USB);
c42412a_blink_icon_start(C42412A_ICON_ATMEL);
delay_s(1);
c42412a_blink_icon_stop(C42412A_ICON_USB);
}
static void c42412a_text_test(void)
{
c42412a_clear_text();
c42412a_show_text((const uint8_t *)"Hi");
delay_s(1);
c42412a_clear_text();
c42412a_show_text((const uint8_t *)"Hello");
delay_s(1);
c42412a_clear_text();
c42412a_show_text((const uint8_t *)"Atmel");
}
static void c42412a_num_dec_test(void)
{
c42412a_clear_numeric_dec();
c42412a_show_numeric_dec(12);
delay_s(1);
c42412a_clear_numeric_dec();
c42412a_show_numeric_dec(345);
delay_s(1);
c42412a_clear_numeric_dec();
c42412a_show_numeric_dec(6789);
delay_s(1);
c42412a_clear_numeric_dec();
c42412a_show_numeric_dec(-98765);
delay_s(1);
c42412a_clear_numeric_dec();
c42412a_show_numeric_dec(-198765);
}
static void c42412a_animation_test(void)
{
c42412a_circular_animation_start(8,0x0f);
}
/**
* \brief main function : do init and loop
*/
int main(void)
{
system_init();
configure_console();
delay_init();
/* Turn on the backlight. */
port_pin_set_output_level(SLCD_BACLKLIGHT,true);
printf("Start SLCD test\r\n");
/* Initialize the C42412A LCD glass component. */
c42412a_init();
c42412a_show_all();
c42412a_set_contrast(0x8);
delay_s(1);
c42412a_clear_all();
c42412a_icon_test();
delay_s(1);
c42412a_blink_test();
delay_s(1);
c42412a_text_test();
delay_s(1);
c42412a_num_dec_test();
delay_s(1);
c42412a_animation_test();
while (1) {
}
}
/**
* \file
*
* \brief SAM L22 Xplained Pro board configuration.
*
* Copyright (c) 2015 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* \asf_license_stop
*
*/
/*
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
*/
#ifndef CONF_BOARD_H_INCLUDED
#define CONF_BOARD_H_INCLUDED
#endif /* CONF_BOARD_H_INCLUDED */
/**
* \file
*
* \brief SAM L22 Clock configuration
*
* Copyright (C) 2015 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* \asf_license_stop
*
*/
/*
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
*/
#include <clock.h>
#ifndef CONF_CLOCKS_H_INCLUDED
# define CONF_CLOCKS_H_INCLUDED
/* System clock bus configuration */
# define CONF_CLOCK_FLASH_WAIT_STATES 0
# define CONF_CLOCK_CPU_DIVIDER SYSTEM_MAIN_CLOCK_DIV_1
# define CONF_CLOCK_BACKUP_DIVIDER SYSTEM_MAIN_CLOCK_DIV_1
/* SYSTEM_CLOCK_SOURCE_OSC16M configuration - Internal 16MHz oscillator */
# define CONF_CLOCK_OSC16M_FREQ_SEL SYSTEM_OSC16M_4M
# define CONF_CLOCK_OSC16M_ON_DEMAND true
# define CONF_CLOCK_OSC16M_RUN_IN_STANDBY false
/* SYSTEM_CLOCK_SOURCE_XOSC configuration - External clock/oscillator */
# define CONF_CLOCK_XOSC_ENABLE false
# define CONF_CLOCK_XOSC_EXTERNAL_CRYSTAL SYSTEM_CLOCK_EXTERNAL_CRYSTAL
# define CONF_CLOCK_XOSC_EXTERNAL_FREQUENCY 12000000UL
# define CONF_CLOCK_XOSC_STARTUP_TIME SYSTEM_XOSC_STARTUP_32768
# define CONF_CLOCK_XOSC_AUTO_GAIN_CONTROL true
# define CONF_CLOCK_XOSC_ON_DEMAND true
# define CONF_CLOCK_XOSC_RUN_IN_STANDBY false
# define CONF_CLOCK_XOSC_CLOCK_FAILURE_DETECT false
# define CONF_CLOCK_XOSC_CLOCK_FAILURE_DIV SYSTEM_CFD_DIV_128
# define CONF_CLOCK_XOSC_CLOCK_FAILURE_EVENT_OUT false
/* SYSTEM_CLOCK_SOURCE_XOSC32K configuration - External 32KHz crystal/clock oscillator */
# define CONF_CLOCK_XOSC32K_ENABLE false
# define CONF_CLOCK_XOSC32K_EXTERNAL_CRYSTAL SYSTEM_CLOCK_EXTERNAL_CRYSTAL
# define CONF_CLOCK_XOSC32K_STARTUP_TIME SYSTEM_XOSC32K_STARTUP_65536
# define CONF_CLOCK_XOSC32K_ENABLE_1KHZ_OUPUT false
# define CONF_CLOCK_XOSC32K_ENABLE_32KHZ_OUTPUT true
# define CONF_CLOCK_XOSC32K_ON_DEMAND true
# define CONF_CLOCK_XOSC32K_RUN_IN_STANDBY false
# define CONF_CLOCK_XOSC32K_CLOCK_FAILURE_DETECT false
# define CONF_CLOCK_XOSC32K_CLOCK_FAILURE_DIV SYSTEM_CFD_DIV_1
# define CONF_CLOCK_XOSC32K_CLOCK_FAILURE_EVENT_OUT false
/* SYSTEM_CLOCK_SOURCE_OSCULP32K configuration - Internal Ultra Low Power 32KHz oscillator */
# define CONF_CLOCK_OSCULP32K_ENABLE_1KHZ_OUTPUT true
# define CONF_CLOCK_OSCULP32K_ENABLE_32KHZ_OUTPUT true
/* SYSTEM_CLOCK_SOURCE_DFLL configuration - Digital Frequency Locked Loop */
# define CONF_CLOCK_DFLL_ENABLE false
# define CONF_CLOCK_DFLL_LOOP_MODE SYSTEM_CLOCK_DFLL_LOOP_MODE_OPEN
# define CONF_CLOCK_DFLL_ON_DEMAND false
# define CONF_CLOCK_DFLL_RUN_IN_STANDBY false
/* DFLL open loop mode configuration */
# define CONF_CLOCK_DFLL_FINE_VALUE (512)
/* DFLL closed loop mode configuration */
# define CONF_CLOCK_DFLL_SOURCE_GCLK_GENERATOR GCLK_GENERATOR_1
# define CONF_CLOCK_DFLL_MULTIPLY_FACTOR (48000000 / 32768)
# define CONF_CLOCK_DFLL_QUICK_LOCK true
# define CONF_CLOCK_DFLL_TRACK_AFTER_FINE_LOCK true
# define CONF_CLOCK_DFLL_KEEP_LOCK_ON_WAKEUP true
# define CONF_CLOCK_DFLL_ENABLE_CHILL_CYCLE true
# define CONF_CLOCK_DFLL_MAX_COARSE_STEP_SIZE (0x1f / 4)
# define CONF_CLOCK_DFLL_MAX_FINE_STEP_SIZE (0xff / 4)
/* SYSTEM_CLOCK_SOURCE_DPLL configuration - Digital Phase-Locked Loop */
# define CONF_CLOCK_DPLL_ENABLE false
# define CONF_CLOCK_DPLL_ON_DEMAND true
# define CONF_CLOCK_DPLL_RUN_IN_STANDBY false
# define CONF_CLOCK_DPLL_LOCK_BYPASS false
# define CONF_CLOCK_DPLL_WAKE_UP_FAST false
# define CONF_CLOCK_DPLL_LOW_POWER_ENABLE false
# define CONF_CLOCK_DPLL_LOCK_TIME SYSTEM_CLOCK_SOURCE_DPLL_LOCK_TIME_DEFAULT
# define CONF_CLOCK_DPLL_REFERENCE_CLOCK SYSTEM_CLOCK_SOURCE_DPLL_REFERENCE_CLOCK_XOSC32K
# define CONF_CLOCK_DPLL_FILTER SYSTEM_CLOCK_SOURCE_DPLL_FILTER_DEFAULT
# define CONF_CLOCK_DPLL_PRESCALER SYSTEM_CLOCK_SOURCE_DPLL_DIV_1
# define CONF_CLOCK_DPLL_REFERENCE_FREQUENCY 32768
# define CONF_CLOCK_DPLL_REFERENCE_DIVIDER 1
# define CONF_CLOCK_DPLL_OUTPUT_FREQUENCY 48000000
/* DPLL GCLK reference configuration */
# define CONF_CLOCK_DPLL_REFERENCE_GCLK_GENERATOR GCLK_GENERATOR_1
/* DPLL GCLK lock timer configuration */
# define CONF_CLOCK_DPLL_LOCK_GCLK_GENERATOR GCLK_GENERATOR_1
/* Set this to true to configure the GCLK when running clocks_init. If set to
* false, none of the GCLK generators will be configured in clocks_init(). */
# define CONF_CLOCK_CONFIGURE_GCLK true
/* Configure GCLK generator 0 (Main Clock) */
# define CONF_CLOCK_GCLK_0_ENABLE true
# define CONF_CLOCK_GCLK_0_RUN_IN_STANDBY false
# define CONF_CLOCK_GCLK_0_CLOCK_SOURCE SYSTEM_CLOCK_SOURCE_OSC16M
# define CONF_CLOCK_GCLK_0_PRESCALER 1
# define CONF_CLOCK_GCLK_0_OUTPUT_ENABLE false
/* Configure GCLK generator 1 */
# define CONF_CLOCK_GCLK_1_ENABLE false
# define CONF_CLOCK_GCLK_1_RUN_IN_STANDBY false
# define CONF_CLOCK_GCLK_1_CLOCK_SOURCE SYSTEM_CLOCK_SOURCE_XOSC32K
# define CONF_CLOCK_GCLK_1_PRESCALER 1
# define CONF_CLOCK_GCLK_1_OUTPUT_ENABLE false
/* Configure GCLK generator 2 */
# define CONF_CLOCK_GCLK_2_ENABLE false
# define CONF_CLOCK_GCLK_2_RUN_IN_STANDBY false
# define CONF_CLOCK_GCLK_2_CLOCK_SOURCE SYSTEM_CLOCK_SOURCE_OSC16M
# define CONF_CLOCK_GCLK_2_PRESCALER 1
# define CONF_CLOCK_GCLK_2_OUTPUT_ENABLE false
/* Configure GCLK generator 3 */
# define CONF_CLOCK_GCLK_3_ENABLE false
# define CONF_CLOCK_GCLK_3_RUN_IN_STANDBY false
# define CONF_CLOCK_GCLK_3_CLOCK_SOURCE SYSTEM_CLOCK_SOURCE_OSC16M
# define CONF_CLOCK_GCLK_3_PRESCALER 1
# define CONF_CLOCK_GCLK_3_OUTPUT_ENABLE false
/* Configure GCLK generator 4 */
# define CONF_CLOCK_GCLK_4_ENABLE false
# define CONF_CLOCK_GCLK_4_RUN_IN_STANDBY false
# define CONF_CLOCK_GCLK_4_CLOCK_SOURCE SYSTEM_CLOCK_SOURCE_OSC16M
# define CONF_CLOCK_GCLK_4_PRESCALER 1
# define CONF_CLOCK_GCLK_4_OUTPUT_ENABLE false
#endif /* CONF_CLOCKS_H_INCLUDED */
/**
* \file
*
* \brief SAM SLCD Driver Configuration Header
*
* Copyright (C) 2015 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* \asf_license_stop
*
*/
/*
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
*/
#ifndef CONF_SLCD_H_INCLUDED
#define CONF_SLCD_H_INCLUDED
/** Select SLCD clock. Use 32.768KHz OSCULP32K or XOSC32K for SLCD clock.
* 0 : From OSCULP32K
* 1 : From XOSC32K
*/
#define CONF_SLCD_CLOCK_SOURCE 0
/** SLCD Duty Setting
* 0:Static duty
* 1:1/2 duty
* 2:1/3 duty
* 3:1/4 duty
*/
#define CONF_SLCD_DUTY 3
/**
* SLCD Bias Setting.
* 0:Static bias
* 1:1/2 bias
* 2:1/3 bias
* 3:1/4 bias
*/
#define CONF_SLCD_BIAS 2
/**
* SLCD Frame Frequency.
* The optimal frame frequency should be in range from 30Hz up to 100Hz
* to avoid flickering and ghosting effect.
* To get the frame frequency, CLK_SLCD_OSC is first divided by a prescaler
* from 16 to 128 then divided by 1 up to 8 as following.
*
* FrameRate = CLK_SLCD_OSC / (PVAL*(CKDIV+1)(DUTY+1))
*
* SLCD Prescaler Value (PVAL).
* 0 : 16 prescaler
* 1 : 32 prescaler
* 2 : 64 prescaler
* 3 : 128 prescaler
*
* SLCD Clock divider (CKDIV)
* 0 : CKDIV is 0
* 1 : CKDIV is 1
* 2 : CKDIV is 2
* 3 : CKDIV is 3
* 4 : CKDIV is 4
* 5 : CKDIV is 5
* 6 : CKDIV is 6
* 7 : CKDIV is 7
*/
#define CONF_SLCD_PVAL 0
#define CONF_SLCD_CKDIV 7
/** Internal/External VLCD selection.
* 0 : Internal VLCD generation
* 1 : External VLCD generation
*/
#define CONF_SLCD_VLCD_SEL 0
/** Reference refresh frequency.
* 0: Bias Reference refresh frequency is 2KHz
* 1: Bias Reference refresh frequency is 1KHz
* 2: Bias Reference refresh frequency is 500Hz
* 3: Bias Reference refresh frequency is 250Hz
* 4: Bias Reference refresh frequency is 125Hz
* 5: Bias Reference refresh frequency is 62.5Hz
*/
#define CONF_SLCD_REF_REFRESH_FREQ 0
/** Power fefresh frequency.
* 0: Charge pump refresh frequency is 2KHz
* 1: Charge pump refresh frequency is 1KHz
* 2: Charge pump refresh frequency is 500Hz
* 3: Charge pump refresh frequency is 250Hz
*/
#define CONF_SLCD_POWER_REFRESH_FREQ 0
/** LCD Working Power Mode.
* 0:LCD power automatically select regualation mode or pump mode.
* 1:LCD power use step-up pump loop only.
* 2:LCD power use step-down drop-out regulation loop only.
*/
#define CONF_SLCD_POWER_MODE 0
/** COM/SEG PIN Selection.
* There are 52 LCD pins, but SLCD can drive up to 48 LCD pins which can be
* individually enabled or disabled according to the LCD glass. The number of LCD pins
* enabled should not be higher than the maximum of COM and SEG lines supported.
* COM and SEG lines are always assigned in ascending order.
* CONF_SLCD_PIN_L_MASK is pin mask [31,0]
* CONF_SLCD_PIN_H_MASK is pin mask [51,32]
*/
#define CONF_SLCD_PIN_L_MASK 0xCFFFC3C0
#define CONF_SLCD_PIN_H_MASK 0x00000FF0
#endif
/**
* \file
*
* \brief C42412A configuration.
*
* Copyright (c) 2015 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* \asf_license_stop
*
*/
/** Configuration of the C42412A LCD glass driver */
/*
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
*/
#ifndef CONF_C42412A_H_INCLUDED
#define CONF_C42412A_H_INCLUDED
#include "slcd.h"
/**
* \name Circular Animation Shift Direction
* @{
*/
#define C42412A_CSR_DIR SLCD_CIRCULAR_SHIFT_RIGHT
/** @} */
/** Init contrast configuration, it's wthin [0-15]. */
#define CONF_C42412A_CONTRAST 0xf
/** Frame count 0 configuration.
Prescaler is not bypassed,the overflow value is (CONF_C42412A_FC0+1).
*/
#define CONF_C42412A_FC0 2
/** Frame count 0 configuration.
Prescaler is not bypassed,the overflow value is (CONF_C42412A_FC0+1).
*/
#define CONF_C42412A_FC1 2
/** Frame count 0 configuration.
Prescaler is not bypassed,the overflow value is (CONF_C42412A_FC0+1).
*/
#define CONF_C42412A_FC2 1
/** Blink timer configuration. */
#define CONF_C42412A_BLINK_TIMER SLCD_FRAME_COUNTER_0
/** Circular animation configuration. */
#define CONF_C42412A_CIRCULAR_ANIMATION_TIMER SLCD_FRAME_COUNTER_0
#define C42412A_NB_OF_COM 4
#define C42412A_NB_OF_SEG 24
#define C42412A_NUM_SEG_INDEX_S 4
#define C42412A_NUM_SEG_INDEX_E 20
#define C42412A_CHAR_MAP_NUM_SEG 4
#define C42412A_DATA_MASK 0xFF4002
#define C42412A_HOUR_SEG_S 16
#define C42412A_MIN_SEG_S 18
#define C42412A_MAX_CHAR 5
#define C42412A_MAX_NUM 5
/**
* \name LCD component C42364A segment map default definitions
* @{
*/
/* Icon with selected segments blinking feature */
#define C42412A_ICON_USB 1, 1
#define C42412A_ICON_COLON 3, 1
#define C42412A_ICON_BAT 0, 0
#define C42412A_ICON_ATMEL 0, 1
/* Icon without selected segments blinking feature */
#define C42412A_ICON_MINUS 0, 17
#define C42412A_ICON_MINUS_SEG1 0, 13
#define C42412A_ICON_MINUS_SEG2 0, 9
#define C42412A_ICON_DOT_1 0, 5
#define C42412A_ICON_DOT_2 3, 6
#define C42412A_ICON_DOT_3 3, 10
#define C42412A_ICON_DOT_4 3, 14
#define C42412A_ICON_DOT_5 3, 18
#define C42412A_ICON_BAT_LEVEL_1 2, 0
#define C42412A_ICON_BAT_LEVEL_2 3, 0
#define C42412A_ICON_BAT_LEVEL_3 1, 0
#define C42412A_ICON_WLESS_LEVEL_0 3, 3
#define C42412A_ICON_WLESS_LEVEL_1 3, 2
#define C42412A_ICON_WLESS_LEVEL_2 2, 3
#define C42412A_ICON_WLESS_LEVEL_3 2, 2
#define C42412A_ICON_AUDIO_PLAY 2, 1
#define C42412A_ICON_AM 0, 2
#define C42412A_ICON_PM 0, 3
#define C42412A_ICON_DEGREE_C 3, 22
#define C42412A_ICON_DEGREE_F 0, 21
#define C42412A_ICON_VOLT 1, 2
#define C42412A_ICON_MILLI_VOLT 1, 3
/* @} */
#endif /* CONF_C42412A_H_INCLUDED */
# List of available make goals:
#
# all Default target, builds the project
# clean Clean up the project
# rebuild Rebuild the project
#
#
# doc Build the documentation
# cleandoc Clean up the documentation
# rebuilddoc Rebuild the documentation
#
# Copyright (c) 2011 Atmel Corporation. All rights reserved.
#
# \asf_license_start
#
# \page License
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3. The name of Atmel may not be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# 4. This software may only be redistributed and used in connection with an
# Atmel microcontroller product.
#
# THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
# EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# \asf_license_stop
#
# Include the common Makefile, which will also include the project specific
# config.mk file.
MAKEFILE_PATH = ../../../../../../../sam0/utils/make/Makefile.sam.in
include $(MAKEFILE_PATH)
/**
* \file
*
* \brief Autogenerated API include file for the Atmel Software Framework (ASF)
*
* Copyright (c) 2012 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* \asf_license_stop
*
*/
#ifndef ASF_H
#define ASF_H
/*
* This file includes all API header files for the selected drivers from ASF.
* Note: There might be duplicate includes required by more than one driver.
*
* The file is automatically generated and will be re-written when
* running the ASF driver selector tool. Any changes will be discarded.
*/
// From module: Common SAM0 compiler driver
#include <compiler.h>
#include <status_codes.h>
// From module: Delay routines
#include <delay.h>
// From module: Generic board support
#include <board.h>
// From module: Interrupt management - SAM implementation
#include <interrupt.h>
// From module: PORT - GPIO Pin Control
#include <port.h>
// From module: Part identification macros
#include <parts.h>
// From module: SERCOM Polled API
#include <sercom.h>
// From module: SERCOM USART - Serial Communications (Polled APIs)
#include <usart.h>
// From module: SLCD - Segment Liquid Crystal Display Controller
#include <slcd.h>
// From module: SYSTEM - Clock Management for SAML22
#include <clock.h>
#include <gclk.h>
// From module: SYSTEM - Core System Driver
#include <system.h>
// From module: SYSTEM - I/O Pin Multiplexer
#include <pinmux.h>
// From module: SYSTEM - Interrupt Driver For SAML22
#include <system_interrupt.h>
// From module: SYSTEM - Power Management for SAM L21
#include <power.h>
// From module: SYSTEM - Reset Management for SAM L21
#include <reset.h>
// From module: Segment LCD
#include <c42412a.h>
// From module: Standard serial I/O (stdio)
#include <stdio_serial.h>
// From module: USART - Serial interface- SAM implementation for devices with only USART
#include <serial.h>
#endif // ASF_H
#
# Copyright (c) 2011 Atmel Corporation. All rights reserved.
#
# \asf_license_start
#
# \page License
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3. The name of Atmel may not be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# 4. This software may only be redistributed and used in connection with an
# Atmel microcontroller product.
#
# THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
# EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# \asf_license_stop
#
# Path to top level ASF directory relative to this project directory.
PRJ_PATH = ../../../../../../..
# Target CPU architecture: cortex-m3, cortex-m4
ARCH = cortex-m0plus
# Target part: none, sam3n4 or sam4l4aa
PART = saml22n18a
# Application target name. Given with suffix .a for library and .elf for a
# standalone application.
TARGET_FLASH = c42412a_example_flash.elf
TARGET_SRAM = c42412a_example_sram.elf
# List of C source files.
CSRCS = \
common/utils/interrupt/interrupt_sam_nvic.c \
common2/components/display/c42412a/c42412a.c \
common2/components/display/c42412a/example/c42412a_example.c \
common2/services/delay/sam0/systick_counter.c \
sam0/boards/saml22_xplained_pro/board_init.c \
sam0/drivers/port/port.c \
sam0/drivers/sercom/sercom.c \
sam0/drivers/sercom/usart/usart.c \
sam0/drivers/slcd/slcd.c \
sam0/drivers/system/clock/clock_saml22/clock.c \
sam0/drivers/system/clock/clock_saml22/gclk.c \
sam0/drivers/system/interrupt/system_interrupt.c \
sam0/drivers/system/pinmux/pinmux.c \
sam0/drivers/system/system.c \
sam0/utils/cmsis/saml22/source/gcc/startup_saml22.c \
sam0/utils/cmsis/saml22/source/system_saml22.c \
sam0/utils/stdio/read.c \
sam0/utils/stdio/write.c \
sam0/utils/syscalls/gcc/syscalls.c
# List of assembler source files.
ASSRCS =
# List of include paths.
INC_PATH = \
common/boards \
common/services/serial \
common/utils \
common2/components/display/c42412a \
common2/components/display/c42412a/example/saml22n18a_saml22_xplained_pro \
common2/services/delay \
common2/services/delay/sam0 \
sam0/boards \
sam0/boards/saml22_xplained_pro \
sam0/drivers/port \
sam0/drivers/sercom \
sam0/drivers/sercom/usart \
sam0/drivers/slcd \
sam0/drivers/system \
sam0/drivers/system/clock \
sam0/drivers/system/clock/clock_saml22 \
sam0/drivers/system/interrupt \
sam0/drivers/system/interrupt/system_interrupt_saml22 \
sam0/drivers/system/pinmux \
sam0/drivers/system/power \
sam0/drivers/system/power/power_sam_l \
sam0/drivers/system/reset \
sam0/drivers/system/reset/reset_sam_l \
sam0/utils \
sam0/utils/cmsis/saml22/include \
sam0/utils/cmsis/saml22/source \
sam0/utils/header_files \
sam0/utils/preprocessor \
sam0/utils/stdio/stdio_serial \
thirdparty/CMSIS/Include \
thirdparty/CMSIS/Lib/GCC \
common2/components/display/c42412a/example/saml22n18a_saml22_xplained_pro/gcc
# Additional search paths for libraries.
LIB_PATH = \
thirdparty/CMSIS/Lib/GCC
# List of libraries to use during linking.
LIBS = \
arm_cortexM0l_math
# Path relative to top level directory pointing to a linker script.
LINKER_SCRIPT_FLASH = sam0/utils/linker_scripts/saml22/gcc/saml22n18a_flash.ld
LINKER_SCRIPT_SRAM = sam0/utils/linker_scripts/saml22/gcc/saml22n18a_sram.ld
# Path relative to top level directory pointing to a linker script.
DEBUG_SCRIPT_FLASH = sam0/boards/saml22_xplained_pro/debug_scripts/gcc/saml22_xplained_pro_flash.gdb
DEBUG_SCRIPT_SRAM = sam0/boards/saml22_xplained_pro/debug_scripts/gcc/saml22_xplained_pro_sram.gdb
# Project type parameter: all, sram or flash
PROJECT_TYPE = flash
# Additional options for debugging. By default the common Makefile.in will
# add -g3.
DBGFLAGS =
# Application optimization used during compilation and linking:
# -O0, -O1, -O2, -O3 or -Os
OPTIMIZATION = -O1
# Extra flags to use when archiving.
ARFLAGS =
# Extra flags to use when assembling.
ASFLAGS =
# Extra flags to use when compiling.
CFLAGS =
# Extra flags to use when preprocessing.
#
# Preprocessor symbol definitions
# To add a definition use the format "-D name[=definition]".
# To cancel a definition use the format "-U name".
#
# The most relevant symbols to define for the preprocessor are:
# BOARD Target board in use, see boards/board.h for a list.
# EXT_BOARD Optional extension board in use, see boards/board.h for a list.
CPPFLAGS = \
-D ARM_MATH_CM0PLUS=true \
-D BOARD=SAML22_XPLAINED_PRO \
-D SYSTICK_MODE \
-D USART_CALLBACK_MODE=false \
-D __SAML22N18A__
# Extra flags to use when linking
LDFLAGS = \
# Pre- and post-build commands
PREBUILD_CMD =
POSTBUILD_CMD =
\ No newline at end of file
<workspace>
<batchBuild></batchBuild>
<project>
<path>$WS_DIR$\c42412a_example_flash.ewp</path>
</project>
</workspace>
<workspace>
<batchBuild></batchBuild>
<project>
<path>$WS_DIR$\c8263a_example_flash.ewp</path>
</project>
</workspace>
<workspace>
<batchBuild></batchBuild>
<project>
<path>$WS_DIR$\ssd1306_example_flash.ewp</path>
</project>
</workspace>
<workspace>
<batchBuild></batchBuild>
<project>
<path>$WS_DIR$\ssd1306_example_flash.ewp</path>
</project>
</workspace>
<workspace>
<batchBuild></batchBuild>
<project>
<path>$WS_DIR$\ssd1306_example_flash.ewp</path>
</project>
</workspace>
<workspace>
<batchBuild></batchBuild>
<project>
<path>$WS_DIR$\ssd1306_example_flash.ewp</path>
</project>
</workspace>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册