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

📄 abb.h

📁 是一个手机功能的模拟程序
💻 H
📖 第 1 页 / 共 2 页
字号:
  #define TSPADC        0x0015
  #define TSPUP         0x0017
  #define TSPDN         0x0018

  // Definition for IOTA Power Management
  #define SLPDLY                0x001F    // delay to set IOTA in sleep mode (unit: 20*T32Khz)
  #define MASK_SLEEP_MODE       0x0000    // set the regulators in low consumption in sleep mode


// DEFINITIONS FOR SYREN
#elif (ANALOG == 3)
  // ABB PAGE
  #define PAGE0	0x0001
  #define PAGE1	0x0002
  #define PAGE2	0x0010

  // ABB REGISTERS
  //=== PAGE 0 =======
  #define PAGEREG     1
  #define APCDEL1     2
  #define BULDATA1_2  3
  #define TOGBR1      4
  #define TOGBR2      5 // modified
  #define VBDCTRL     6
  #define AUXAFC1     7
  #define AUXAFC2     8
  #define AUXAPC      9
  #define APCRAM      10
  #define APCOFF      11 // modified
  #define AUXDAC      12
  #define MADCCTRL    13 // modified
  #define CHGIREG     14 // new
  #define VBATREG     15
  #define VCHGREG     16
  #define ICHGREG     17
  #define VBKPREG     18
  #define ADIN1REG    19
  #define ADIN2REG    20
  #define ADIN3REG    21
  #define ADIN4REG    22
  #define ADIN5REG    23 // new
  #define MADCSTAT    24
  #define CHGVREG     25 // used to be CHGREG
  #define ITMASK      26 // modified
  #define ITSTATREG   27 // modified
  #define BCICTL1     28 // modified
  #define BCICTL2     29 // modified
  #define VRPCDEV     30 // modified
  #define VRPCSTS     31 // modified

  //=== PAGE 1 =======
  #define PAGEREG     1
  #define BULIOFF     2
  #define BULQOFF     3
  #define BULQDAC     4
  #define BULIDAC     5
  #define BBCTRL      6 // modified
  #define VBUCTRL     7
  #define VBCTRL      8 // modified
  #define PWDNRG      9 // modified
  #define VBPOP       10 // modified
  #define VBCTRL2     11 // modified
  #define APCOUT      12
  #define BCICONF     13 // modified
  #define BULGCAL     14
  #define VAUDCTRL    15 // new
  #define VAUSCTRL    16 // new
  #define VAUOCTRL    17 // new
  #define VAUDPLL     18 // new
  #define TAPCTRL     19
  #define TAPREG      20
  #define AFCCTLADD   21
  #define AFCOUT      22
  #define VRPCSIMR    23 // modified
  #define BCIWDOG     24 // used to be ADCLED
  #define NONE8       25
  #define APCDEL2     26
  #define ITSTATREG   27 // modified
  #define NONE9       28
  #define VRPCMSKOFF  29 // modified
  #define VRPCCFG     30 // modified
  #define VRPCMSKSLP  31 // modified
  
  //=== PAGE 2 =======
  #define BBCFG       5  
  #define VRPCABBTST  25 
  #define VRPCAUX     30     
  #define VRPCLDO     31    

/* INSERT HERE OTHER DEVICES REGISTERS */


  // Registers bit definitions
  /*** SYREN internal control bits ***/

  /** For reg. VBCTRL **/      
  #define VULSWITCH 0x008
  #define MICBIAS   0x010
  #define VALOOP    0x020
  #define VCLKMODE  0x040
  #define VSYNC     0x080
  #define VBDFAUXG  0x100
  #define VFBYP     0x200
 
  /** For reg. VBCTRL2 **/      
  #define HSMICSEL  0x001
  #define MICBIASEL 0x004
  #define SPKG      0x008
  #define HSOVMID   0x010
  #define HSDIF     0x020

  /** For reg. VBUCTRL **/      
  #define DXEN      0x200

  /** For reg. VBPOP **/      
  #define HSODIS    0x001
  #define HSOCHG    0x002
  #define HSOAUTO   0x004
  #define EARDIS    0x008
  #define EARCHG    0x010
  #define EARAUTO   0x020
  #define AUXFDIS   0x040
  #define AUXAUTO   0x080
  #define AUXFBYP   0x200

  // ABB device bits definition of register VRPCCFG
  #define PWOND     0x20  // ON Button current state
  #define CHGPRES   0x40

  // ABB device bits definition of register ITSTATREG
  #define REMOT_IT_STS    0x02
  #define PUSHOFF_IT_STS  0x04
  #define CHARGER_IT_STS  0x08
  #define ADCEND_IT_STS   0x20

  // ABB device bits definition of register VRPCSTS
  #define ITWSTS    0x10   // Wake-up IT flag
  #define PWONSTS   0x20   // ON Button push flag
  #define CHGSTS    0x40   // Charger plug flag
  #define RPSTS     0x100  // Remote ON flag

  #define PWR_OFF_KEY_PRESSED      (0)

  // ABB ADC Interrupts
  #define EOC_INTENA  0x03DF
  #define EOC_INTMASK 0x0020

  // ABB ADC CHANNELS (reg. MADCCTRL)
  #define VBATCV    0x0001
  #define VCHGCV    0x0002
  #define ICHGCV    0x0004
  #define VBKPCV    0x0008
  #define ADIN1CV   0x0010
  #define ADIN2CV   0x0020
  #define ADIN3CV   0x0040
  #define ADIN4CV   0x0080
  #define ADIN5CV   0x0100
  #define ALL       0x01FF
  #define NONE      0x0000

  // ABB MODULES
  #define MADC        0x8000
  #define AFC         0x2000
  #define ADAC        0x0800
  #define DCDC        0x0080
  #define ALLOFF      0x0000

  // Definitions of SYREN test modes
  #define TSPTEST1      0x001d
  #define TSPTEST2      0x001e
  #define AFCTEST       0x0010
  #define AFCNORM       0x0000

  #define TSPEN         0x001a
  #define MADCTEST      0x0012
  #define TSPADC        0x0015
  #define TSPUP         0x0017
  #define TSPDN         0x0018

  // Definition for SYREN Power Management
  #define SLPDLY             0x001F    // delay to set SYREN in sleep mode (unit: 20*T32Khz)
  #define MASK_SLEEP_MODE    0x0000    // set the regulators in low consumption in sleep mode

  #define  C_BBCFG           (0x44)<<6  | 0x05   // Syren Like BDLF Filter - DC OFFSET removal OFF

#endif	  // ANALOG == 1,2,3


// Define the level of semaphore protection for all accesses to the ABB
// 0 for no protection
// 1 for protection low 
// 2 for protection medium 
// 3 for protection high 
#if (OP_L1_STANDALONE)
#define ABB_SEMAPHORE_PROTECTION     (0)
#else
#define ABB_SEMAPHORE_PROTECTION     (1)
#endif



// PROTOTYPES
#if (ABB_SEMAPHORE_PROTECTION)   
  void ABB_Sem_Create(void);
#endif
void ABB_Wait_IBIC_Access(void);
void ABB_Write_Register_on_page(SYS_UWORD16 page, SYS_UWORD16 reg_id, SYS_UWORD16 value);
SYS_UWORD16 ABB_Read_Register_on_page(SYS_UWORD16 page, SYS_UWORD16 reg_id);
void ABB_free_13M(void);
void ABB_stop_13M(void);
SYS_UWORD16 ABB_Read_Status(void);
void ABB_Conf_ADC(SYS_UWORD16 Channels, SYS_UWORD16 ItVal);                              
void ABB_Read_ADC(SYS_UWORD16 *Buff);
void ABB_on(SYS_UWORD16 modules, SYS_UWORD8 bRecoveryFlag);
SYS_UWORD32 ABB_sleep(SYS_UWORD8 sleep_performed, SYS_WORD16 afc);
void ABB_wakeup(SYS_UWORD8 sleep_performed, SYS_WORD16 afc);
void ABB_wa_VRPC(SYS_UWORD16 value);
void ABB_Write_Uplink_Data(SYS_UWORD16 *TM_ul_data);
#if (!OP_L1_STANDALONE)
void ABB_Power_Off(void);
#endif

#else    // _WINDOWS

// DEFINITIONS FOR IOTA
  // ABB PAGE
  #define PAGE0	0x0001
  #define PAGE1	0x0002
  #define PAGE2	0x0010

  // ABB REGISTERS
  //=== PAGE 0 =======
  #define PAGEREG      1
  #define APCDEL1      2
  #define BULDATA1_2   3
  #define TOGBR1       4
  #define TOGBR2       5
  #define VBDCTRL      6
  #define AUXAFC1      7
  #define AUXAFC2      8
  #define AUXAPC       9
  #define APCRAM       10
  #define APCOFF       11
  #define AUXDAC       12
  #define MADCCTRL     13
  #define VBATREG      15
  #define VCHGREG      16
  #define ICHGREG      17
  #define VBKPREG      18
  #define ADIN1REG     19
  #define ADIN2REG     20
  #define ADIN3REG     21
  #define ADIN4REG     22
  #define MADCSTAT     24
  #define CHGREG       25
  #define ITMASK       26
  #define ITSTATREG    27
  #define BCICTL1      28
  #define BCICTL2      29
  #define VRPCDEV      30
  #define VRPCSTS      31
								
  //=== PAGE 1 =======		
  #define PAGEREG      1
  #define BULIOFF      2
  #define BULQOFF      3
  #define BULQDAC      4
  #define BULIDAC      5
  #define BBCTRL       6
  #define VBUCTRL      7
  #define VBCTRL1      8
  #define PWDNRG       9
  #define VBPOP        10
  #define VBCTRL2      11
  #define APCOUT       12
  #define BCICONF      13
  #define BULGCAL      14
  #define TAPCTRL      19
  #define TAPREG       20
  #define AFCCTLADD    21
  #define AFCOUT       22
  #define VRPCSIM      23
  #define AUXLED       24
  #define APCDEL2      26
  #define ITSTATREG    27
  #define VRPCMSKABB   29
  #define VRPCCFG      30
  #define VRPCMSK      31

  // ABB device bits definition of register VBUCTRL
  #define DXEN      0x200

  // ABB device bits definition of register VRPCSTS
  #define ONBSTS    0x01  // ON Button push flag
  #define ONRSTS    0x02  // Remote ON flag
  #define ITWSTS    0x04  // Wake-up IT flag
  #define CHGSTS    0x08  // Charger plug flag
  #define ONREFLT   0x10  // ON Button current state
  #define ORMRFLT   0x20  // Remote ON current state
  #define CHGPRES   0x40  // Charger plug current state

  // ABB device bits definition of register ITSTATREG
  #define REMOT_IT_STS    0x02
  #define PUSHOFF_IT_STS  0x04
  #define CHARGER_IT_STS  0x08
  #define ADCEND_IT_STS   0x20


// PROTOTYPES
void ABB_Write_Register_on_page(SYS_UWORD16 page, SYS_UWORD16 reg_id, SYS_UWORD32 value);
SYS_UWORD16 ABB_Read_Register_on_page(SYS_UWORD16 page, SYS_UWORD16 reg_id);
SYS_UWORD16 ABB_Read_Status(void);
void ABB_Conf_ADC(SYS_UWORD16 Channels, SYS_UWORD16 ItVal);                              
void ABB_Read_ADC(SYS_UWORD16 *Buff);

#endif  // _WINDOWS

#endif // __ABB_H__

⌨️ 快捷键说明

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