亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? defaults.c

?? TDK 6521 SOC 芯片 DEMO程序
?? C
?? 第 1 頁 / 共 2 頁
字號:
/***************************************************************************
 * 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) 2005 Teridian Semiconductor Corp. All Rights Reserved.    *
 ***************************************************************************/
//**************************************************************************
//  DESCRIPTION: 71M652x POWER METER - Default values. 
// 
//  AUTHOR:  MTF
//
//  HISTORY: See end of file.
//**************************************************************************
// File:  DEFAULTS.C
//               
#include "options.h"
#include "batmodes.h"
#include "ce.h"
#include "library.h"
#include "cli.h"
#include "io.h"
#include "meter.h"
#if SERIAL0
#include "ser0.h"
#endif
#if SERIAL1
#include "ser1.h"
#endif
#include "flag0.h"
#include "flag1.h"
#include "ser0cli.h"
#include "ser1cli.h"
#include "sercli.h"
#include "serial.h"
#include "lcd.h"
#include "defaults.h"

extern const uint8r_t pre_samps[];
extern uint16x_t samples;
#if CLI
extern enum SERIAL_PORT xdata port;
#endif

/*** Public variables declared within this module ***/
uint8_t xdata select_total, select_phase, select_flow;

#if PULSE_CNT
uint8_t xdata select_pulse;
#endif
#if PULSE_CNT || MAIN_EDGE_COUNT
uint8_t xdata select_interval;
#endif

/*** Private functions declared within this module ***/
// None.

/*** Private variables declared within this module ***/
/*
This function initializes the mode bits as shown below.
All mode bits are in 'reset state' except:
    CE_EN=1;
    DIO_DIR0=11111111;
    DIO_PV=1;
    DIO_PW=1;
    EQU=010;
    LCD_EN=1;
    LCD_FS=11111;
    LCD_NUM=01101;
    SUM_CYCLES=60=111100;
    CHOP=11;
    VREF_CAL=1;
*/

uint8r_t ri_defaults[] =
{ //   0     1     2     3     4     5     6     7
#if M6520
    EQUATION, 0x3C,                     // 2000-2001
#if REAL_TIME_DATE
    0x43,                               // 2002 enable xfer_busy, RTC interrupt.
#else
    0x41,                               // 2002 enable xfer_busy interrupt .
#endif
    0x01, MPU_FREQ, 0x1F, 0x01,         // 2003-6.  MPU_FREQ, (probably 614kHz).

#if BROWNOUT_BATMODE
    0x20,                               // 2007. Enable PLL_OK
#else
    0x00,                               // 2007.
#endif
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,     // 2008-F. DIO Resources, etc.
#if DGM0915_HTN
    0x08, 0x2D,                         // 2020-1.  8 extra segs.
#else
    0x0D, 0x2D,                         // 2020-1. 13 extra segs.
#endif
    0x00,                               // 205A.   LCD BLINK.
    0x00, 0x00, 0x00, 0x00,             // 2060-3. RTM.
    0x44, 0x51,                         // 2080-1. 10ms Pulse_Width, Pulse_Interval.
    0x04, 0x00, 0x00,                   // 20A8-A. CE3, WAKE, TMUX.
    0x00, 0x00, 0x00                    // 20FD-F. TRIMSEL, TRIMX, TRIM.

#elif TRACE11
#if REAL_TIME_DATE
    EQUATION, 0x3C, 0x73, 0x01,                         // 2000-3. Enable XFER_BUSY, etc.
#else
    EQUATION, 0x3C, 0x71, 0x01,                         // 2000-3. Enable XFER_BUSY, etc.
#endif
    MPU_FREQ, 0x12, 0x01, 0x00,                         // 2004-7. MPU_FREQ, longer FIR
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,     // 2008-F. DIO Resources, etc.
    0x8E, 0x25, 0x1F,                                   // 2020-2. LCD Enable, 14 extra segs, etc.
    0x00, 0x00, 0x00, 0x00,                             // 2060-3. RTM.
    0x00, 0x00, 0x00, 0x00, 0x00,                       // Padding, for IO_MERGE
    0x00, 0x00, 0x00                                    // 20FD TRIMSEL

#elif TRACE13
#if REAL_TIME_DATE
    EQUATION, 0x3C, 0x33, 0x01,                         // 2000-3. Enable RTC & XFER_BUSY, etc.
#else
    EQUATION, 0x3C, 0x31, 0x01,                         // 2000-3. Enable XFER_BUSY, etc.
#endif
    MPU_FREQ, 0x02, 0x01, 0x00,                         // 2004-7. MPU_FREQ, short FIR
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,     // 2008-F. DIO Resources, etc.
    0x8E, 0x25, 0x1F,                                   // 2020-2. LCD Enable, 14 extra segs, etc.
    0x00, 0x00, 0x00, 0x00,                             // 2060-3. RTM.
    0x00, 0x00, 0x00, 0x00, 0x00,                       // Padding, for IO_MERGE
    0x00, 0x00, 0x00                                    // 20FD TRIMSEL

#else
#error unknown configuration
#endif 
};

uint8r_t defaults[] =
{
    0x3, 0, 0, 1,           // 0..3 Wh A, Output, RMS display select, aux_mux.
    0, 0,                   // 4,5 Default debug port.
    #if M6520
    // DIO pin directions: outputs, 
    // DIO_4,5 pulled up by EEPROM, DIO_0 is the button, 
    // DIO-8 is battery mode select.
    0xFF, 0xFE, 0xCE,       // 6..8
    0xFF, 0xFF, 0xFF,       // 9..11 DIO pin values: Drive all outputs high.

    #elif TRACE11
    #if SCROLL_METER || (AUTOCAL && !CLI)
    0xFE, 0xFF, 0xCF,       // 6..8 DIO pin directions: outputs, DIO_16 is a button.
    #else // normal
    0xFF, 0xFF, 0xCF,       // 6..8 DIO pin directions: outputs
    #endif
    0xFF, 0xFF, 0xFF,       // 9..11 DIO pin values: Drive all outputs high.

    #elif TRACE13
    #if SCROLL_METER || (AUTOCAL && !CLI)
    0xFF, 0xFF, 0xFB,       // 6..8 DIO pin directions: outputs, DIO_2 is a button.
    #else // normal
    0xFF, 0xFF, 0xFF,       // 6..8 DIO pin directions: outputs
    #endif
    0xFF, 0xFF, 0xFF,       // 9..11 DIO pin values: Drive all outputs high.
    #else

    #error unknown device
    #endif
    BAUD_0, 0x39,           // 12,13 Serial0, bit rate, (seven bit, echo, parity none, odd, stop_bits, xon_xoff).
    BAUD_1, 0x39,           // 14,15 Serial1, bit rate, (seven bit, echo, parity none, odd, stop_bits, xon_xoff). 
    0, 0                    // 16,17 calibration count, checksum
};


struct Parameters_t code r_Parms =
{
    #if M6520 || TRACE11
    513421L,                // )0: 0.08A IThrshld starting current
    0,                      // )1: Config:        Configuration Register.
    906156350L,             // )2: 407.3V VPThresh:  Peak voltage threshold.
    544498635L,             // )3: 50.9A IPThresh:  Peak current threshold.
    0x0000,                 // )4: Y_Cal:  Crystal calibration constants.   
    0x0000,                 // )5: Y_Cal_Deg1.                              
    0x0000,                 // )6: Y_Cal_Deg2.                              
    #if WATT_SUMS
    0x00,                   // )7: PulseWSource;
    0x04,                   // )8: PulseRSource;
    #else
    0x01,                   // )7: PulseWSource;
    0x05,                   // )8: PulseRSource;
    #endif
    6000,                   // )9: Vmax,                                    
    2080,                   // )A: Imax.                                    
    0,                      // )B: ppmc1, -150 is the untrimmed value
    0,                      // )C: ppmc2, -392 is the untrimmed value
    #if WATT_SUMS
    0x00,                   // )D: Pulse3Source; for software pulse outputs
    0x04,                   // )E: Pulse4Source; for software pulse outputs
    #else
    0x01,                   // )D: Pulse3Source; for software pulse outputs
    0x05,                   // )E: Pulse4Source; for software pulse outputs
    #endif
    2,                      // )F: seconds of calibration.
    2400,                   // )10: calibration voltage, LSB = 0.1V (like VMAX).
    300,                    // )11: calibration current, LSB = 0.1A (like IMAX).
    88992958L,              // )12: 40V VThrshld min vlts for mainedge, phase, freq
    50,                     // )13: 10ms pulse width
    #if M6520
    0x3DCC7800,             // )14: temp_nom
    #elif TRACE11
    2025084L,               // )14: temp_nom
    #else
    #error unknown device
    #endif
    2080,                   // )15: IMax2
    513421L,                // )16: 0.08A IThrshld2 starting current
    0x00E54D4C              // )17: 2V battery minimum, Units: ADC>>8
    #elif TRACE13
    433199L,                // )0: 0.08A IThrshld starting current
    0,                      // )1: Config:        Configuration Register.
    764569660L,             // )2: 407.3V VPThresh:  Peak voltage threshold.
    275652520L,             // )3: 50.9A IPThresh:  Peak current threshold.
    0x0000,                 // )4: Y_Cal:  Crystal calibration constants.   
    0x0000,                 // )5: Y_Cal_Deg1.                              
    0x0000,                 // )6: Y_Cal_Deg2.                              
    #if WATT_SUMS
    0x00,                   // )7: PulseWSource;
    0x04,                   // )8: PulseRSource;
    #else
    0x01,                   // )7: PulseWSource;
    0x05,                   // )8: PulseRSource;
    #endif
    6000,                   // )9: Vmax,                                    
    2080,                   // )A: Imax.                                    
    0,                      // )B: ppmc1, -150 is the untrimmed value
    0,                      // )C: ppmc2, -392 is the untrimmed value
    #if WATT_SUMS
    0x00,                   // )D: Pulse3Source; for software pulse outputs
    0x04,                   // )E: Pulse4Source; for software pulse outputs
    #else
    0x01,                   // )D: Pulse3Source; for software pulse outputs
    0x05,                   // )E: Pulse4Source; for software pulse outputs
    #endif
    2,                      // )F: seconds of calibration.
    2400,                   // )10: calibration voltage, LSB = 0.1V (like VMAX).
    300,                    // )11: calibration current, LSB = 0.1A (like IMAX).
    75087832L,              // )12: 40V VThrshld min vlts for mainedge, phase, freq
    50,                     // )13: 10ms pulse width
    #if TRACE13
    847662L,                // )14: temp_nom
    #else
    #error unknown device
    #endif
    2080,                   // )15: IMax2
    433199L,                // )16: 0.08A IThrshld2 starting current
    0x00E54D4C              // )17: 2V battery minimum, Units: ADC>>8
    #else
    #error unknown device
    #endif
};                             

/*** Public variables declared within this module ***/
#if M6520
uint8r_t copyright1[] = { "TSC 71M6521" };
uint8r_t r_demo_version[32] = { "TSC6521.4.3.4,"__DATE__  };
#elif TRACE11 // This is an experimental configuration.
uint8r_t copyright1[] = { "TRACE11" };
uint8r_t r_demo_version[32] = { "TRACE11H.4.3.4,"__DATE__ };
#elif TRACE13 // This is an experimental configuration.
uint8r_t copyright1[] = { "TRACE13" };
uint8r_t r_demo_version[32] = { "TRACE13H.4.3.4,"__DATE__ };
#else
#error unknown device type
#endif

uint8r_t copyright2[] = { " (c) 2006 Teridian Semiconductor Corp. All rights reserved" };

// This is not a fashionable design in some ways.  In particular, initialization is not modularized
// because software design must serve business needs.
// To demonstrate meters and meter chips, it is very convenient to be able to set-up
// a firmware image for a customer, and then e-mail it. Therefore...
// An application engineer must be able to configure the firmware without recompiling it. Therefore...
// TSC has a PC program IOMERGE.EXE that writes changes to the defaults of the firmware. Therefore...
// The firmware default tables must remain stable under maintenance, so IOMERGE works, therefore...
// unlike most object-oriented systems, some object-level initializations
// are centralized here to keep the default tables controlled under maintenance.
void set_defaults (void)
{
    int16_t baud;
    // CE set-up
    samples = pre_samps[ (CE1 & PRE_SAMPS) >> 6 ] * (CE1 & SUM_CYCLES);

    #if M6520 && BROWNOUT_BATMODE
    if (!batmode_is_brownout() )
        memcpy_xr ((uint8x_t *) IO_CE,    &ri_defaults[ IO_CE_IDX ],    IO_CE_SIZE);
    else
    {   // Leave CONFIG0 at reset value (i.e. MPU_DIV = 0).
        memcpy_xr ((uint8x_t *) IO_CE + 0, &ri_defaults[ IO_CE_IDX + 0 ], 4);
        memcpy_xr ((uint8x_t *) IO_CE + 5, &ri_defaults[ IO_CE_IDX + 5 ], IO_CE_SIZE - 5);
    }   
    #elif M6520	|| TRACE10
    memcpy_xr ((uint8x_t *) IO_CE,    &ri_defaults[ IO_CE_IDX ],    IO_CE_SIZE);
    #else
    #error unknown configuration
    #endif // M6520

    #if M6520
    // pulse width set up
    memcpy_xr ((uint8x_t *) IO_PLS,   &ri_defaults[ IO_PLS_IDX ],   IO_PLS_SIZE);
    // CE location (resetup by ce_init(), also WAKE and TMUX defaults
    memcpy_xr ((uint8x_t *) IO_CE3,   &ri_defaults[ IO_CE3_IDX ],   IO_CE3_SIZE);
    #endif // M6520

    // Trim register selection (i.e. just here to set a default for the read index)
    memcpy_xr ((uint8x_t *) IO_TRIM,  &ri_defaults[ IO_TRIM_IDX ],  IO_TRIM_SIZE);

    // RTM set up; really part of CE set-up, because it reads CE registers
    memcpy_xr ((uint8x_t *) IO_RTM,   &ri_defaults[ IO_RTM_IDX ],   IO_RTM_SIZE);
    ce_init ();                         // Initialize Compute Engine.
    // the CE is actually started in the main initialization

    // LCD set up in io\lcd.c LCD_Init(), because brownout needed a complete
    // initialization of LCD, and calling this whole routine was too much.
    #if LCD_ACTIVE
    LCD_Init();
    #endif

    // totals and parameters for meter\meter.c
    memcpy_xr ((uint8x_t *) &Totals.Parms, (uint8r_t *) &r_Parms, sizeof (r_Parms));

    select_total  = defaults[ 0 ] & 0x3F;  // defines LCD output
    select_phase  = (defaults[ 0 ] & 0xC0) >> 6;
    #if RMS_VALUES
    switch(defaults[ 2 ])
    {
    case 1:    select_total = M_IRMS; break;
    case 2:    select_total = M_VRMS; break;
    default:   break;
    }
    #endif

    // CLI (command line interface) set up
    select_flow   = 0;
    
    #if PULSE_CNT
    select_pulse = 0;
    #endif
    #if PULSE_CNT || MAIN_EDGE_COUNT
    select_interval = 0;
    #endif

    // serial set up
    #if CLI
    port = defaults[ 4 ];         // Default debug port.
    #endif

    #if SERIAL0
    baud = defaults[BAUD0_IDX];
    #if M6520
    if (BATTERY_MODE_ENABLE)
        baud = _RATE_300;
    #endif

    #if FLAG0
    ser0_initialize (baud);     // initialize serial interface
    flag0_initialize ();          // initialize flag
    #elif SERIAL0_CLI 
    #if !SERIAL1_CLI
    port = 0; // force it if it's the only one
    #endif
    if (port == 0)
        echo = defaults[ BAUD0_IDX+1 ] & ECHO;
    cli0_init (baud, defaults[ BAUD0_IDX+1 ] & XON_XOFF);
    #else
    ser0_initialize (baud);     // initialize serial interface
    #endif
    #endif

    #if SERIAL1
    baud = defaults[BAUD1_IDX];
    #if M6520
    if (BATTERY_MODE_ENABLE)
        baud = _RATE_300;
    #endif

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
av亚洲精华国产精华精华| 国产精品视频一二三| 自拍偷拍亚洲综合| 久久综合久久综合久久综合| 91精品久久久久久久99蜜桃| 欧美精品国产精品| 欧美日韩一本到| 精品视频在线看| 51精品久久久久久久蜜臀| 7777精品久久久大香线蕉| 91麻豆精品久久久久蜜臀 | 欧美性大战久久| 欧美日韩国产一区二区三区地区| 欧美日韩中字一区| 欧美日韩国产一区| 日韩一区二区三区视频| 欧美成人猛片aaaaaaa| 欧美变态tickling挠脚心| xf在线a精品一区二区视频网站| 久久久久久一级片| 日韩美女久久久| 亚洲大片在线观看| 精品亚洲免费视频| 国产成人精品免费| 91丨九色丨尤物| 欧美日韩一区二区三区高清| 69久久夜色精品国产69蝌蚪网| 91精品国产综合久久久蜜臀图片| 精品少妇一区二区三区日产乱码| 欧美精品一区二区三区高清aⅴ| 国产人久久人人人人爽| 亚洲三级小视频| 午夜激情一区二区| 国产精品一卡二| 色综合久久中文综合久久97| 欧美三区在线观看| 欧美sm极限捆绑bd| 国产精品视频免费| 亚洲第一激情av| 国产一区二区三区高清播放| 99riav久久精品riav| 欧美精品粉嫩高潮一区二区| 久久精品人人做人人爽97 | 99精品欧美一区| 欧美日韩免费在线视频| 久久久国产精品麻豆| 亚洲免费视频成人| 久久精品国产亚洲一区二区三区| 国产成人综合亚洲网站| 欧美又粗又大又爽| 精品av综合导航| 一区二区三区免费在线观看| 美脚の诱脚舐め脚责91| 91浏览器入口在线观看| 日韩欧美一区在线观看| 亚洲天堂免费看| 精品无人区卡一卡二卡三乱码免费卡| 99久久精品国产麻豆演员表| 日韩精品自拍偷拍| 亚洲男人电影天堂| 国产精品夜夜嗨| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆 | 91精彩视频在线| 久久无码av三级| 首页综合国产亚洲丝袜| av一区二区三区在线| 日韩欧美电影一区| 亚洲午夜精品久久久久久久久| 国产成人8x视频一区二区| 91精品欧美综合在线观看最新| 综合电影一区二区三区| 国产精品一二三在| 欧美成人福利视频| 亚洲国产精品久久久久婷婷884 | 色综合久久久久久久久| 久久久久久久久岛国免费| 日韩成人一级大片| 欧美伊人久久久久久久久影院| 国产精品日日摸夜夜摸av| 久久国产精品99精品国产| 欧美三级电影在线看| 亚洲欧美自拍偷拍| 国产成人亚洲综合a∨猫咪| 欧美va亚洲va在线观看蝴蝶网| 不卡视频在线看| 精品久久人人做人人爰| 日韩电影免费在线观看网站| 色哟哟欧美精品| 国产精品福利一区| 成人精品视频一区二区三区尤物| 精品久久久久99| 奇米综合一区二区三区精品视频 | 中文字幕一区二区三区蜜月| 国产一区二区三区免费看 | 日本欧美一区二区| 欧美老女人第四色| 亚洲成a人片综合在线| 色噜噜偷拍精品综合在线| 国产精品黄色在线观看| 国产午夜精品一区二区三区四区| 免费在线观看不卡| 欧美电影在哪看比较好| 亚洲成人综合视频| 欧美天天综合网| 亚洲专区一二三| 欧美日韩在线播| 亚洲丶国产丶欧美一区二区三区| 欧美视频日韩视频| 亚洲国产欧美一区二区三区丁香婷| 日本韩国欧美在线| 一级日本不卡的影视| 91福利在线观看| 亚洲在线视频网站| 欧美日韩国产高清一区二区三区 | 久久久久久久国产精品影院| 国产最新精品精品你懂的| 精品sm在线观看| 国产福利一区在线| 中文字幕av一区 二区| 成人中文字幕在线| 国产精品免费看片| 一本到三区不卡视频| 一区二区三区在线看| 欧美视频你懂的| 美腿丝袜亚洲综合| 久久亚洲私人国产精品va媚药| 国产精品77777竹菊影视小说| 中文字幕av一区二区三区高| 99久久婷婷国产| 亚洲一卡二卡三卡四卡五卡| 欧美精品色综合| 捆绑紧缚一区二区三区视频| 久久久精品人体av艺术| 成人免费高清视频在线观看| 亚洲激情中文1区| 欧美人妖巨大在线| 国产制服丝袜一区| 亚洲欧洲av在线| 51久久夜色精品国产麻豆| 国产一区欧美日韩| 日韩久久一区二区| 欧美日韩成人综合在线一区二区| 久久99深爱久久99精品| 国产精品看片你懂得| 欧美日韩一区二区在线观看 | 欧美一级淫片007| 国产精品123| 一区二区三区不卡视频| 日韩视频一区二区在线观看| 粉嫩欧美一区二区三区高清影视| ...中文天堂在线一区| 91 com成人网| 成人午夜在线免费| 日韩中文欧美在线| 中文字幕精品在线不卡| 欧美天天综合网| 成人免费视频一区二区| 无吗不卡中文字幕| 国产拍揄自揄精品视频麻豆| 欧美性三三影院| 国产乱码精品一区二区三| 亚洲自拍偷拍麻豆| 久久久久国产精品免费免费搜索| 欧美主播一区二区三区| 国产成人精品亚洲午夜麻豆| 亚洲国产成人tv| 欧美精彩视频一区二区三区| 欧美年轻男男videosbes| 成人一区在线观看| 琪琪一区二区三区| 亚洲精品伦理在线| 国产视频亚洲色图| 91精品婷婷国产综合久久性色| 91视视频在线观看入口直接观看www | 一区二区在线电影| 久久久不卡影院| 日韩午夜激情视频| 国产亚洲精品bt天堂精选| 欧美精品亚洲一区二区在线播放| 9久草视频在线视频精品| 精品综合免费视频观看| 亚洲国产aⅴ成人精品无吗| 欧美国产精品专区| 欧美大片一区二区| 欧美性感一区二区三区| 99视频一区二区三区| 国产一区二区在线观看免费| 美女高潮久久久| 石原莉奈在线亚洲二区| 亚洲另类色综合网站| 国产精品久久久久久久久动漫 | 久久亚洲精品国产精品紫薇| 欧美一区二区视频在线观看| 欧美体内she精高潮| 99riav一区二区三区| 9色porny自拍视频一区二区| 国产福利视频一区二区三区| 激情小说欧美图片| 麻豆成人久久精品二区三区红| 日韩经典一区二区|