⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lcd_vim808_ext.c

📁 TDK 6521 SOC 芯片 DEMO程序
💻 C
字号:
/***************************************************************************
 * This code and information is provided "as is" without warranty of any   *
 * kind, either expressed or implied, including but not limited to the     *
 * implied warranties of merchantability and/or fitness for a particular   *
 * purpose.                                                                *
 *                                                                         *
 * Copyright (C) 2006 Teridian Semiconductor Corp. All Rights Reserved.    *
 ***************************************************************************/
//**************************************************************************
//  DESCRIPTION: 71M65xx POWER METER - LCD Extended Routines.
// 
//  AUTHOR:  MTF
//
//  History: See end of file.
//**************************************************************************
// File: LCD_EXT.C
//               
#include "options.h"
#if VIM808
#include "lcd.h"

#if MODE_DISPLAY
void LCD_Mode (uint8_t select)
{                                          // Display mode in MSD.
    if (select < 10)
    {
       LCD_Data_Write (iDIGIT8, Digit_Mask[ select ]); 
    }
    else
    {
       LCD_Data_Write (iDIGIT8, Digit_Mask[ select / 10 ]); 
       LCD_Data_Write (iDIGIT7, Digit_Mask[ select % 10 ]); 
    }
}
#endif // MODE_DISPLAY.

#if CE_OFF
void LCD_CE_Off (void)
{
    LCD_Command (LCD_CLEAR);
    LCD_Data_Write (iDIGIT7, ALPHA_C); 
    LCD_Data_Write (iDIGIT6, ALPHA_E); 
    LCD_Data_Write (iDIGIT4, ALPHA_O); 
    LCD_Data_Write (iDIGIT3, ALPHA_F); 
    LCD_Data_Write (iDIGIT2, ALPHA_F); 
}
#endif

void LCD_Hello (void)
{
    LCD_Command (LCD_CLEAR);
    LCD_Data_Write (iDIGIT6, ALPHA_H); 
    LCD_Data_Write (iDIGIT5, ALPHA_E); 
    LCD_Data_Write (iDIGIT4, ALPHA_L); 
    LCD_Data_Write (iDIGIT3, ALPHA_L); 
    LCD_Data_Write (iDIGIT2, ALPHA_O); 
}

#if  OPERATING_TIME
void LCD_Number_Max (uint32_t d, uint8_t p)
{
    LCD_Number (d, 7, p);   // Display upto seven digits.
}
#endif

#if  REAL_TIME_DATE
void LCD_Year (uint8_t yy)
{
    LCD_Data_Write (iDIGIT8, Digit_Mask[ 2 ]);
    LCD_Data_Write (iDIGIT7, Digit_Mask[ yy / 100 ]);
    LCD_Data_Write (iDIGIT6, Digit_Mask[ yy / 10 % 10 ]);
    LCD_Data_Write (iDIGIT5, Digit_Mask[ yy % 10 ]);
}

void LCD_Month (uint8_t mm)
{
    LCD_4COLON ();
    LCD_Data_Write (iDIGIT4, Digit_Mask[ mm / 10 ]);
    LCD_Data_Write (iDIGIT3, Digit_Mask[ mm % 10 ]);
}

void LCD_Date (uint8_t dd)
{
    LCD_2COLON ();
    LCD_Data_Write (iDIGIT2, Digit_Mask[ dd / 10 ]);
    LCD_Data_Write (iDIGIT1, Digit_Mask[ dd % 10 ]);
}

void LCD_Hour (uint8_t hh)
{
    LCD_Data_Write (iDIGIT6, Digit_Mask[ hh / 10 ]);
    LCD_Data_Write (iDIGIT5, Digit_Mask[ hh % 10 ]);
}

void LCD_Min (uint8_t mm)
{
    LCD_4COLON ();
    LCD_Data_Write (iDIGIT4, Digit_Mask[ mm / 10 ]);
    LCD_Data_Write (iDIGIT3, Digit_Mask[ mm % 10 ]);
}

void LCD_Sec (uint8_t ss)
{
    LCD_2COLON ();
    LCD_Data_Write (iDIGIT2, Digit_Mask[ ss / 10 ]);
    LCD_Data_Write (iDIGIT1, Digit_Mask[ ss % 10 ]);
}

void LCD_2COLON (void)
{
#if M6520
    LCD_2DP ();
#else
    LCD_Data_Write (iCOLONS, L_2);  // Colon before 2nd digit.
#endif
}

void LCD_4COLON ()
{
#if M6520
    LCD_4DP ();
#else
    LCD_Data_Write (iCOLONS, L_4);  // Colon before 4th digit.
#endif
}
#endif // REAL_TIME_DATE

#if FREQUENCY || TEMPERATURE
void LCD_1DP (void)
{
    LCD_Data_Write (iDPS, DP_1);    // One (1) decimal places.
}
#endif

#if OPERATING_TIME || (M6520 && REAL_TIME_DATE)
void LCD_2DP (void)
{
    // Two (2) decimal places.
    LCD_Data_Write (iDPS, LCD_Data_Read (iDPS) | DP_2);  
}
#endif

void LCD_3DP (void)
{
    // Three (3) decimal places.
    LCD_Data_Write (iDPS, LCD_Data_Read (iDPS) | DP_3);  
}


#if M6520 && REAL_TIME_DATE
void LCD_4DP (void)
{
    // Four (4) decimal places.
    LCD_Data_Write (iDPS, LCD_Data_Read (iDPS) | DP_4);  
}
#endif

#if AUTOSLEEP
void LCD_AutoSleep (void)
{                                   // Three (3) decimal places.
    LCD_Data_Write (iDPS, DP_3|DP_6|DP_7);  
}
#endif

#if BROWNOUT_BATMODE
void LCD_Brownout (void)
{
    LCD_Data_Write (iDPS, LCD_Data_Read (iDPS) | DP_7);  
}
#endif

#if HEART_BEAT
// Inverts the segment each time it is called.
bool beat;
void LCD_Heart_Beat (void)
{                                   // LCD XFER_BUSY_BEAT.
    beat ^= 1;
    if (beat)
        LCD_Data_Write (iDPS, LCD_Data_Read (iDPS) | DP_7);  
}
#endif

#if WATT_ELEMENT
void LCD_kWH (void)
{
}
#endif

#if VAR_ELEMENT
void LCD_kVArH (void)
{
}
#endif

#if VA_ELEMENT
void LCD_kVAH (void)
{
}
#endif

#if DEMAND
#if WATT_ELEMENT
void LCD_kW (void)
{
}
#endif

#if VAR_ELEMENT
void LCD_kVAr (void)
{
}
#endif

#if VA_ELEMENT
void LCD_kVA (void)
{
}
#endif
#endif // DEMAND.

#if RMS_VALUES
void LCD_Amps (void)
{
}

void LCD_Volts (void)   
{
}
#endif // RMS VALUES.

#if EXTRAS
#if WATT_ELEMENT
void LCD_WH (void)
{
}
#endif

#if VAR_ELEMENT
void LCD_VArH (void)
{
}
#endif

#if VA_ELEMENT
void LCD_VAH (void)
{
}
#endif

#if DEMAND
#if WATT_ELEMENT
void LCD_W (void)
{
}
#endif

#if VAR_ELEMENT
void LCD_VAr (void)
{
}
#endif

#if VA_ELEMENT
void LCD_VA (void)
{
}
#endif
#endif // DEMAND.
#endif // EXTRAs.

/***************************************************************************
 * History                                                                 *
 * $Log: lcd_vim808_ext.c,v $
 * Revision 1.5  2006/09/27 01:02:06  tvander
 * Fixed the missing 4th decimal point on date and time.
 *
 * Revision 1.4  2006/09/15 16:48:53  tvander
 * Fixed heart beat
 *
 * Revision 1.3  2006/09/13 21:37:42  gmikef
 * *** empty log message ***
 *
 * Revision 1.1  2006/09/13 01:38:35  gmikef
 * *** empty log message ***
 *
 * Revision 1.2  2006/09/12 21:29:28  gmikef
 * *** empty log message ***
 *
 * Revision 1.1  2006/09/12 02:45:49  gmikef
 * *** empty log message ***
 *

 *
 * Copyright (C) 2006 Teridian Semiconductor Corp. All Rights Reserved.    *
 * this program is fully protected by the United States copyright          *
 * laws and is the property of Teridian Semiconductor Corporation.         *
 ***************************************************************************/
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -