📄 fet4xx_rtcwlcd_sb.c
字号:
//*******************************************************************************
//
// Description "FET410_RTCwLCD": This program maintains a real time clock and
// displays the current time on a 3.5 digit static LCD. The colon between the
// minutes and seconds toggles on or off each second to indicate that the clock
// is running. The digits of the display are only rewritten each minute once
// the elapsed seconds roll over from 60 back to 0. The fourth digit is
// automatically blank for hours 1-9. The software is totally interrupt driven.
// It only comes out of low power mode 3 and executes code when a Basic Timer
// interrupt occurs, once each second.
//
//*******************************************************************************
//*******************************************************************************
// Modified Stefan Schauer
// date 11/03/2004
// Changes:
// - SetArrow function
//
// Version 1.0 converted to C
// 11/03/2004
//
//*******************************************************************************
//*******************************************************************************
// THIS PROGRAM IS PROVIDED "AS IS". TI MAKES NO WARRANTIES OR
// REPRESENTATIONS, EITHER EXPRESS, IMPLIED OR STATUTORY,
// INCLUDING ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
// FOR A PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR
// COMPLETENESS OF RESPONSES, RESULTS AND LACK OF NEGLIGENCE.
// TI DISCLAIMS ANY WARRANTY OF TITLE, QUIET ENJOYMENT, QUIET
// POSSESSION, AND NON-INFRINGEMENT OF ANY THIRD PARTY
// INTELLECTUAL PROPERTY RIGHTS WITH REGARD TO THE PROGRAM OR
// YOUR USE OF THE PROGRAM.
//
// IN NO EVENT SHALL TI BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
// CONSEQUENTIAL OR INDIRECT DAMAGES, HOWEVER CAUSED, ON ANY
// THEORY OF LIABILITY AND WHETHER OR NOT TI HAS BEEN ADVISED
// OF THE POSSIBILITY OF SUCH DAMAGES, ARISING IN ANY WAY OUT
// OF THIS AGREEMENT, THE PROGRAM, OR YOUR USE OF THE PROGRAM.
// EXCLUDED DAMAGES INCLUDE, BUT ARE NOT LIMITED TO, COST OF
// REMOVAL OR REINSTALLATION, COMPUTER TIME, LABOR COSTS, LOSS
// OF GOODWILL, LOSS OF PROFITS, LOSS OF SAVINGS, OR LOSS OF
// USE OR INTERRUPTION OF BUSINESS. IN NO EVENT WILL TI'S
// AGGREGATE LIABILITY UNDER THIS AGREEMENT OR ARISING OUT OF
// YOUR USE OF THE PROGRAM EXCEED FIVE HUNDRED DOLLARS
// (U.S.$500).
//
// Unless otherwise stated, the Program written and copyrighted
// by Texas Instruments is distributed as "freeware". You may,
// only under TI's copyright in the Program, use and modify the
// Program without any charge or restriction. You may
// distribute to third parties, provided that you transfer a
// copy of this license to the third party and the third party
// agrees to these terms by its first use of the Program. You
// must reproduce the copyright notice and any other legend of
// ownership on each copy or partial copy, of the Program.
//
// You acknowledge and agree that the Program contains
// copyrighted material, trade secrets and other TI proprietary
// information and is protected by copyright laws,
// international copyright treaties, and trade secret laws, as
// well as other intellectual property laws. To protect TI's
// rights in the Program, you agree not to decompile, reverse
// engineer, disassemble or otherwise translate any object code
// versions of the Program to a human-readable form. You agree
// that in no event will you alter, remove or destroy any
// copyright notice included in the Program. TI reserves all
// rights not specifically granted under this license. Except
// as specifically provided herein, nothing in this agreement
// shall be construed as conferring by implication, estoppel,
// or otherwise, upon you, any license or other right under any
// TI patents, copyrights or trade secrets.
//
// You may not use the Program in non-TI devices.
//*******************************************************************************
#include "parameter.h"
#if PCB == SB_BOARD
#include "device.h"
#define _def_clock
#include "fet4xx_rtclcd.h"
//--------RAM bytes used for variables-------------------------------------------
unsigned char SEC = 0x00;
unsigned char MIN = 0x00;
unsigned char HOUR = 0x12;
unsigned char DAY = 0x01;
unsigned char MONTH = 0x01;
unsigned char YEAR = 0x04;
//-------------------------------------------------------------------------------
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// LCD Definitions
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// LCD_TYPE
// SB LCD
#define a 0x01
#define b 0x02
#define c 0x04
#define d 0x08
#define e 0x40
#define f 0x10
#define g 0x20
#define dp 0x80
#define colon 0x80
//--- character definitions
// decode special Char to be placed at end of the table
const unsigned int CHAR_SPACE = 0;
const unsigned int CHAR_MINUS = g;
//#define CHAR_MINUS LCD_mi
//#define LCD_mi LCD_sp[13]
const unsigned char LCD_sp[] = {
0, //; displays " "
a+b, //; displays "!"
b+f, //; displays """
a+b+c+d+e+f+g, //; displays "#"
a+f+g+c+d, //; displays "$"
a+g+d, //; displays "%"
0, //; displays "&"
a, //; displays "'"
e+f, //; displays "("
b+c, //; displays ")"
0, //; displays "*"
0, //; displays "+"
0, //; displays ","
g, //; displays "-"
colon, //; displays "."
0, //; displays "/"
};
const unsigned char LCD_Tab[] = {
a+b+c+d+e+f, // displays "0" with diagonal slash
b+c, // displays "1"
a+b+d+e+g, // displays "2"
a+b+c+d+g, // displays "3"
b+c+f+g, // displays "4"
a+c+d+f+g, // displays "5"
a+c+d+e+f+g, // displays "6"
a+b+c, // displays "7"
a+b+c+d+e+f+g, // displays "8"
a+b+c+d+f+g, // displays "9"
colon, // displays ":"
colon, // displays ";"
0, // displays "<"
0, // displays "="
0, // displays ">"
0, // displays "?"
0, // displays "@"
a+b+c+e+f+g, // displays "A"
c+d+e+f+g, // displays "B"
a+d+e+f, // displays "C"
b+c+d+e+g, // displays "D"
a+d+e+f+g, // displays "E"
a+e+f+g, // displays "F"
a+c+d+e+f, // displays "G"
b+c+e+f+g, // displays "H"
b+c, // displays "I"
b+c+d, // displays "J"
e+f+b+c, // displays "K"
d+e+f, // displays "L"
a+b+c+e+f, // displays "M"
e+g+c, // displays "N"
c+d+e+g, // displays "O" small
a+b+e+f+g, // displays "P"
a+b+c+d+e+f, // displays "Q"
e+g, // displays "R" small r
a+c+d+f+g, // displays "S"
f+e+d+g, // displays "T"
c+d+e, // displays "U"
c+d+e+f+b, // displays "V" small u
e+f+d+c+b, // displays "W"
0, // displays "X"
f+g+b+c, // displays "Y"
a+b+g+e+d, // displays "Z"
e+f+a+d, // displays "["
0, // displays "\"
a+d+b+c, // displays "]"
a+f+b, // displays "^"
d, // displays "_"
f, // displays "`"
};
//LCD_Tab_Length equ $ - LCD_Tab
//LCD_Tab_End
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -