📄 main.bak
字号:
// main.c
/*************************************************************************
Program Name : SFP Reference Design Firmware
Hardware : SFP Module Board v1.3/V1.4, Host Board v1.0/v2.0
Parts on board : ADuC7019(rev.H Si)/ADN2870_1/ADN2890_1_2
Revision : 1.70 beta5
Date : Aug 3, 2005
Author : N.Matsuzoe
File(s) : main.c/config.c/monitor.c/diag.c/i2c.c/sff8472_table.c
ldd.c/irq.c/fiq.c/flash.c/common.h
Settings : Core Clock = 42MHz, CD=0, FINT=disable
DDM update rate = 50ms (Timer1@20Hz)
ER compensation update rate = 0.5s
Revision history:
r1.70b5(03Aug05) - added FEEMOD conifig, enabled read/write to flash
r1.70b4(03Aug05) - disabled read/write to Flash
r1.70b3(02Aug05) - added time out in Flash control
r1.70b1(28Jul05) - Support ADuC7019 REV.H silicon
- changed I2C routine
- removed PLA IRQ for a STOP detect
- changed temp sensor TC gain from -2mV/oC to -1.3mV/oC
r1.60(14Feb05) - Added slew rate control(5v/s) on DAC0 at start-up
- Changed I2C routine
- Added I2C stop detection by using Programable Logic Array
- Disabled auto flash update, changed flash update routine
- Changed LOS and RateSel detection. Using P1.4 and P1.5 as GPI
r1.52(23Nov04) - Changed TxPow ADC input channel from ADC3 to ADC15
r1.51(17Nov04) - Changed LOS_INV input to low
r1.50(28Oct04) - Support V1.3 and V1.4 PCB
Changed RxPow ADC input channel from ADC3 to ADC4
Changed TxPow ADC input channel from ADC4/14(Diff.) to ADC3(single-end)
r1.41(12Sep04) - Added software workaround for I2C device address decode error
Byte address from 0x80 thru 0xFF in i2c device address 0xA0
is not supported from this revision
r1.40(09Jul04) - Added write protection for read-only resister
Fixed checksum bug
r1.30(25Jun04) - Added closed-loop ER compensation function
Changed RxPowMonitor, support 2.0Kohm RSSI resistor
Added er#002 workaround
r1.20(14Jun04) - Support ADuC7020 REV.E silicon
Added I2C 2nd address match and I2C TX FIFO Flush
Fixed RxRateSel status bit
r1.17(10Jun04) - Added TxPowMon enable/disable resister
r1.16(03Jun04) - Added Checksum functions
Changed DDM data format, lower 4-bit fixed at zero
r1.15(27May04) - Disabled TxPow monitor
r1.14(26May04) - Changed TxPow monitor
r1.13(25May04) - Changed Timer freq., I2C_read and Temp Mon
r1.12(05May04) - Support ADuC7020 REV.D silicon
Added dummy ADC reads for all monior functions
r1.11(20Apr04) - Fixed temperature monitoring, ER compensation, RxPowMon
r1.10(13Apr04) - Added data save/load function by Flash/EE
r1.00(15Mar04) - Initial release, Support ADuC7020 REV.C silicon
**************************************************************************/
#include <ADuC7020.h>
#include "common.h"
BYTE A0h[256];
BYTE A2h[256];
BYTE i2c_first, i2c_receive, dac_update;
int main(void){
FEEMOD |= 0x108; // enable flash erase/write
InitCPU(); // Initialize CPU configuration
InitFlash(); // Initialize Flash if first start-up(ProgramFlash-to-DataFlash)
InitSFF8472(); // Map SFF8472 table(DataFlash-to-SRAM)
InitLdd(); // Enable DAC for Er/Pav settting
i2c_first = TRUE;
FIQEN = 0x00000200; // enable I2C0SIRQ
IRQEN = 0x00048008; // enable Timer1IRQ, XIRQ0, XIRQ1
while(1){
#if DEBUG == 1
#endif
}
return (0);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -