/home/daqweb/fgddaq/c8051/cmb.h File Reference

Go to the source code of this file.

Data Structures

struct  EEPAGE
struct  user_data_type

Defines

#define VREF   2.455f
#define ADT7486A_address   0x48
#define SST_LINE1   1
#define SST_TIME   (unsigned long) 1
#define TEMP_TIME   (unsigned long) 2
#define ON   1
#define DONE   1
#define SET   1
#define OFF   0
#define FAILED   0
#define CLEAR   0
#define IGAIN1   0
#define IGAIN2   1
#define IGAIN4   2
#define IGAIN8   3
#define IGAIN16   4
#define SERIALN_LENGTH   4
#define SERIALN_ADD   (PageAddr[3])
#define EEP_CTRL_KEY   0x3C000000
#define EEP_CTRL_READ   0x00110000
#define EEP_CTRL_WRITE   0x00220000
#define EEP_CTRL_INVAL_REQ   0xff000000
#define EEP_CTRL_INVAL_KEY   0x00ff0000
#define EEP_CTRL_OFF_RANGE   0x0000ff00
#define PAGE_SIZE   sizeof(eepage)
#define EEP_RW_IDX   0x02
#define IDXEER   1
#define IDXCTL   2
#define IDXEEP_CTL   27
#define UFTEMPERATURE_MASK   (unsigned int) 0x0300
#define BTEMPERATURE_MASK   (unsigned int) 0x0C00
#define VOLTAGE_MASK   (unsigned int) 0x00FE
#define CURRENT_MASK   (unsigned int) 0x0001

Functions

void user_init (unsigned char init)
void user_loop (void)
void user_write (unsigned char index) reentrant
unsigned char user_read (unsigned char index)
unsigned char user_func (unsigned char *data_in, unsigned char *data_out)
float read_voltage (unsigned char channel, unsigned int *rvalue, unsigned char gain)

Variables

unsigned int xdata PageAddr [] = {0x000, 0x200, 0x400, 0x600}
struct EEPAGE xdata eepage
struct EEPAGE xdata eepage2
unsigned char bdata rCTL
sbit CPup = rCTL ^ 0
sbit CXclk = rCTL ^ 1
sbit Ccfg = rCTL ^ 2
sbit Cdeb1 = rCTL ^ 3
sbit CeeS = rCTL ^ 4
sbit CeeR = rCTL ^ 5
sbit CeeClr = rCTL ^ 6
sbit CmSd = rCTL ^ 7
unsigned char bdata rCSR
sbit SPup = rCSR ^ 0
sbit SXclk = rCSR ^ 1
sbit SLinkOn = rCSR ^ 2
sbit Swdog = rCSR ^ 3
sbit SeeS = rCSR ^ 4
sbit SeeR = rCSR ^ 5
sbit SsS = rCSR ^ 6
sbit SmSd = rCSR ^ 7
unsigned int bdata rESR
sbit DI4mon = rESR ^ 8
sbit DV4mon = rESR ^ 9
sbit AV33mon = rESR ^ 10
sbit AV25mon = rESR ^ 11
sbit DV15mon = rESR ^ 12
sbit DV18mon = rESR ^ 13
sbit DV25mon = rESR ^ 14
sbit DV33mon = rESR ^ 15
sbit uCT = rESR ^ 0
sbit FPGAssTT = rESR ^ 1
sbit Vreg1ssTT = rESR ^ 2
sbit Vreg2ssTT = rESR ^ 3
sbit RdssT = rESR ^ 4
sbit EEPROM = rESR ^ 5
sbit AsumLock = rESR ^ 6
sbit V4_OC = rESR ^ 7
float code coeff [8] = {1.901, 2.000 , 1.426, 1.426, 1.0, 1.0, 1.426, 1.426}
float code offset [8] = {0.000, 0.0, 0.0, 0.0 , 0.0, 0.0, 0.0 , 0.0}
struct user_data_type xdata user_data

Define Documentation

#define ADT7486A_address   0x48

Definition at line 19 of file cmb.h.

#define BTEMPERATURE_MASK   (unsigned int) 0x0C00

Definition at line 153 of file cmb.h.

#define CLEAR   0

Definition at line 31 of file cmb.h.

#define CURRENT_MASK   (unsigned int) 0x0001

Definition at line 155 of file cmb.h.

#define DONE   1

Definition at line 27 of file cmb.h.

#define EEP_CTRL_INVAL_KEY   0x00ff0000

Definition at line 52 of file cmb.h.

#define EEP_CTRL_INVAL_REQ   0xff000000

Definition at line 51 of file cmb.h.

#define EEP_CTRL_KEY   0x3C000000

Definition at line 48 of file cmb.h.

#define EEP_CTRL_OFF_RANGE   0x0000ff00

Definition at line 53 of file cmb.h.

#define EEP_CTRL_READ   0x00110000

Definition at line 49 of file cmb.h.

#define EEP_CTRL_WRITE   0x00220000

Definition at line 50 of file cmb.h.

#define EEP_RW_IDX   0x02

Definition at line 55 of file cmb.h.

#define FAILED   0

Definition at line 30 of file cmb.h.

#define IDXCTL   2

Definition at line 99 of file cmb.h.

#define IDXEEP_CTL   27

Definition at line 100 of file cmb.h.

#define IDXEER   1

Definition at line 98 of file cmb.h.

#define IGAIN1   0

Definition at line 34 of file cmb.h.

#define IGAIN16   4

Definition at line 38 of file cmb.h.

#define IGAIN2   1

Definition at line 35 of file cmb.h.

#define IGAIN4   2

Definition at line 36 of file cmb.h.

#define IGAIN8   3

Definition at line 37 of file cmb.h.

#define OFF   0

Definition at line 29 of file cmb.h.

#define ON   1

Definition at line 26 of file cmb.h.

#define PAGE_SIZE   sizeof(eepage)

Definition at line 54 of file cmb.h.

#define SERIALN_ADD   (PageAddr[3])

Definition at line 45 of file cmb.h.

#define SERIALN_LENGTH   4

Definition at line 44 of file cmb.h.

#define SET   1

Definition at line 28 of file cmb.h.

#define SST_LINE1   1

Definition at line 20 of file cmb.h.

#define SST_TIME   (unsigned long) 1

Definition at line 21 of file cmb.h.

#define TEMP_TIME   (unsigned long) 2

Definition at line 22 of file cmb.h.

#define UFTEMPERATURE_MASK   (unsigned int) 0x0300

Definition at line 152 of file cmb.h.

#define VOLTAGE_MASK   (unsigned int) 0x00FE

Definition at line 154 of file cmb.h.

#define VREF   2.455f

Definition at line 16 of file cmb.h.


Function Documentation

float read_voltage ( unsigned char  channel,
unsigned int *  rvalue,
unsigned char  gain 
)

Definition at line 236 of file cmb.c.

unsigned char user_func ( unsigned char *  data_in,
unsigned char *  data_out 
)

Definition at line 406 of file cmb.c.

void user_init ( unsigned char  init  ) 

Definition at line 264 of file cmb.c.

void user_loop ( void   ) 

Definition at line 415 of file cmb.c.

unsigned char user_read ( unsigned char  index  ) 

Definition at line 399 of file cmb.c.

void user_write ( unsigned char  index  ) 

Definition at line 386 of file cmb.c.


Variable Documentation

sbit AsumLock = rESR ^ 6

Definition at line 146 of file cmb.h.

sbit AV25mon = rESR ^ 11

Definition at line 132 of file cmb.h.

sbit AV33mon = rESR ^ 10

Definition at line 131 of file cmb.h.

sbit Ccfg = rCTL ^ 2

Definition at line 106 of file cmb.h.

sbit Cdeb1 = rCTL ^ 3

Definition at line 107 of file cmb.h.

sbit CeeClr = rCTL ^ 6

Definition at line 110 of file cmb.h.

sbit CeeR = rCTL ^ 5

Definition at line 109 of file cmb.h.

sbit CeeS = rCTL ^ 4

Definition at line 108 of file cmb.h.

sbit CmSd = rCTL ^ 7

Definition at line 111 of file cmb.h.

float code coeff[8] = {1.901, 2.000 , 1.426, 1.426, 1.0, 1.0, 1.426, 1.426}

Definition at line 168 of file cmb.h.

sbit CPup = rCTL ^ 0

Definition at line 104 of file cmb.h.

sbit CXclk = rCTL ^ 1

Definition at line 105 of file cmb.h.

sbit DI4mon = rESR ^ 8

Definition at line 129 of file cmb.h.

sbit DV15mon = rESR ^ 12

Definition at line 134 of file cmb.h.

sbit DV18mon = rESR ^ 13

Definition at line 135 of file cmb.h.

sbit DV25mon = rESR ^ 14

Definition at line 136 of file cmb.h.

sbit DV33mon = rESR ^ 15

Definition at line 137 of file cmb.h.

sbit DV4mon = rESR ^ 9

Definition at line 130 of file cmb.h.

struct EEPAGE xdata eepage
Initial value:
 {

 0x00000000

 , 110

 , 123

 , 0.0, 3.0, 3.0, 2.0, 1.2, 1.5, 2.0, 3.0

 , 4.0, 4.5, 3.7, 2.7, 1.7, 2.0, 2.7, 3.7

 , 10., 50.

 , 10. ,50.

 , 0.0, 0.0, 0.0, 0.0
}

Definition at line 72 of file cmb.h.

struct EEPAGE xdata eepage2

Definition at line 95 of file cmb.h.

sbit EEPROM = rESR ^ 5

Definition at line 145 of file cmb.h.

sbit FPGAssTT = rESR ^ 1

Definition at line 140 of file cmb.h.

float code offset[8] = {0.000, 0.0, 0.0, 0.0 , 0.0, 0.0, 0.0 , 0.0}

Definition at line 169 of file cmb.h.

unsigned int xdata PageAddr[] = {0x000, 0x200, 0x400, 0x600}

Definition at line 43 of file cmb.h.

unsigned char bdata rCSR

Definition at line 114 of file cmb.h.

unsigned char bdata rCTL

Definition at line 103 of file cmb.h.

sbit RdssT = rESR ^ 4

Definition at line 144 of file cmb.h.

unsigned int bdata rESR

Definition at line 128 of file cmb.h.

sbit SeeR = rCSR ^ 5

Definition at line 120 of file cmb.h.

sbit SeeS = rCSR ^ 4

Definition at line 119 of file cmb.h.

sbit SLinkOn = rCSR ^ 2

Definition at line 117 of file cmb.h.

sbit SmSd = rCSR ^ 7

Definition at line 122 of file cmb.h.

sbit SPup = rCSR ^ 0

Definition at line 115 of file cmb.h.

sbit SsS = rCSR ^ 6

Definition at line 121 of file cmb.h.

sbit Swdog = rCSR ^ 3

Definition at line 118 of file cmb.h.

sbit SXclk = rCSR ^ 1

Definition at line 116 of file cmb.h.

sbit uCT = rESR ^ 0

Definition at line 139 of file cmb.h.

struct user_data_type xdata user_data

Definition at line 209 of file cmb.h.

sbit V4_OC = rESR ^ 7

Definition at line 147 of file cmb.h.

sbit Vreg1ssTT = rESR ^ 2

Definition at line 141 of file cmb.h.

sbit Vreg2ssTT = rESR ^ 3

Definition at line 142 of file cmb.h.


Generated on 1 Feb 2022 for C8051-CMB by  doxygen 1.6.1