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

Go to the source code of this file.

Data Structures

struct  ADC2MSCB_TABLE
struct  IADC_TABLE
struct  EEPAGE
struct  user_data_type

Defines

#define ADT7486A_ADDR0   0x49
#define ADT7486A_ADDR1   0x48
#define ADT7486A_ADDR2   0x4B
#define ADT7486A_ADDR3   0x4A
#define ADT7486A_ADDR4   0x48
#define SST_LINE1   1
#define SST_LINE2   2
#define SST_TIME   2
#define BIAS_OUTPUT_ENABLE   ADDR_PCA9539, PCA9539_CONFIG0, PCA9539_ALL_OUTPUT
#define BIAS_DISABLE   ADDR_PCA9539, PCA9539_OUTPUT0, 0xFF
#define BIAS_ENABLE   ADDR_PCA9539, PCA9539_OUTPUT0, 0x00
#define BIAS_READ   ADDR_PCA9539, PCA9539_INPUT0
#define BIAS_WRITE   ADDR_PCA9539, PCA9539_OUTPUT0
#define BACKPLANE_INPUT_ENABLE   ADDR_PCA9539, PCA9539_CONFIG1, PCA9539_ALL_INPUT
#define BACKPLANE_READ   ADDR_PCA9539, PCA9539_INPUT1
#define N_RB_CHANNEL   16
#define EXT_VREF   1.25f
#define CURR_MEASURE   0x04
#define V_A2MTABLE   0
#define I_A2MTABLE   1
#define VOLT_MEASURE   0x04
#define GAIN1   0
#define GAIN4   1
#define GAIN8   2
#define GAIN16   3
#define GAIN32   4
#define GAIN64   5
#define CONVER_FAC2   65536.0f
#define CONVER_FAC1   0xFFFFFFFF
#define Q_PUMP_INIT   1
#define Q_PUMP_OFF   2
#define Q_PUMP_ON   3
#define INT_VREF   2.44f
#define IntGAIN1   0
#define IntGAIN2   1
#define IntGAIN4   2
#define IntGAIN8   3
#define IntGAIN16   4
#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   0x06
#define EEP_RW_LAST_IDX   PAGE_SIZE/4
#define NCHANNEL_BIAS   64
#define NCHANNEL_ASUM   8
#define NCHANNEL_SST   8
#define NCHANNEL_ADT7486A   4
#define IDXEER   1
#define IDXCTL   2
#define IDXQVOLT   6
#define IDXBSWITCH   5
#define IDXASUM   47
#define IDXSST   19
#define IDXBIAS   55
#define IDXEEP_CTL   144
#define IDXASUM_CTL   145
#define SERIALN_LENGTH   (unsigned int) 4
#define SERIALN_ADD   (unsigned int) (0x600)
#define FIRST_BIAS   IDXBIAS
#define LAST_BIAS   FIRST_BIAS + NCHANNEL_BIAS
#define FIRST_ASUM   IDXASUM
#define LAST_ASUM   FIRST_ASUM + NCHANNEL_ASUM
#define ADDR_LTC1669   0x20
#define ADDR_PCA9539   0x74
#define ADDR_LTC2497   0x14
#define ADDR_LTC2495   0x14
#define ON   1
#define DONE   1
#define OFF   0
#define FAILED   0
#define CLEAR   0
#define UCTEMPERATURE_MASK   0x0100
#define BTEMPERATURE_MASK   0x1000
#define FGDTEMPERATURE_MASK   0x0400
#define VOLTAGE_MASK   0x001C
#define CURRENT_MASK   0x0040

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, float coeff, float offset, unsigned char gain)
void switchonoff (unsigned char command)
int eepageAddrConvert (unsigned int index)

Variables

struct ADC2MSCB_TABLE xdata adc2mscb_table [16]
struct IADC_TABLE xdata iadc_table [8]
unsigned char rEER
struct EEPAGE xdata eepage
struct EEPAGE xdata eepage2
unsigned int xdata PageAddr [] = {0x000, 0x200, 0x400, 0x600}
unsigned char xdata ltc1665mirror [64]
unsigned int xdata ltc2600mirror [8]
unsigned char bdata rCTL
sbit CPup = rCTL ^ 0
sbit CAsum = rCTL ^ 2
sbit Ccal = 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 SqPump = rCSR ^ 1
sbit SAsum = rCSR ^ 2
sbit Scal = rCSR ^ 3
sbit SeeS = rCSR ^ 4
sbit SeeR = rCSR ^ 5
sbit SsS = rCSR ^ 6
sbit SmSd = rCSR ^ 7
unsigned int bdata rESR
sbit vQpump = rESR ^ 8
sbit iQpump = rESR ^ 9
sbit vReg1 = rESR ^ 10
sbit vReg2 = rESR ^ 11
sbit vReg3 = rESR ^ 12
sbit iReg1 = rESR ^ 13
sbit iReg2 = rESR ^ 14
sbit iReg3 = rESR ^ 15
sbit uCT = rESR ^ 0
sbit IntssTT = rESR ^ 1
sbit ExtssTT = rESR ^ 2
sbit EEPROM = rESR ^ 3
sbit pcbssTT = rESR ^ 4
sbit RdssT = rESR ^ 5
struct user_data_type xdata user_data
sbit timing = P2 ^ 7
unsigned long xdata smbdebug

Define Documentation

#define ADDR_LTC1669   0x20

Definition at line 236 of file feb64.h.

#define ADDR_LTC2495   0x14

Definition at line 239 of file feb64.h.

#define ADDR_LTC2497   0x14

Definition at line 238 of file feb64.h.

#define ADDR_PCA9539   0x74

Definition at line 237 of file feb64.h.

#define ADT7486A_ADDR0   0x49

Definition at line 17 of file feb64.h.

#define ADT7486A_ADDR1   0x48

Definition at line 18 of file feb64.h.

#define ADT7486A_ADDR2   0x4B

Definition at line 19 of file feb64.h.

#define ADT7486A_ADDR3   0x4A

Definition at line 20 of file feb64.h.

#define ADT7486A_ADDR4   0x48

Definition at line 21 of file feb64.h.

#define BACKPLANE_INPUT_ENABLE   ADDR_PCA9539, PCA9539_CONFIG1, PCA9539_ALL_INPUT

Definition at line 36 of file feb64.h.

#define BACKPLANE_READ   ADDR_PCA9539, PCA9539_INPUT1

Definition at line 37 of file feb64.h.

#define BIAS_DISABLE   ADDR_PCA9539, PCA9539_OUTPUT0, 0xFF

Definition at line 31 of file feb64.h.

#define BIAS_ENABLE   ADDR_PCA9539, PCA9539_OUTPUT0, 0x00

Definition at line 32 of file feb64.h.

#define BIAS_OUTPUT_ENABLE   ADDR_PCA9539, PCA9539_CONFIG0, PCA9539_ALL_OUTPUT

Definition at line 30 of file feb64.h.

#define BIAS_READ   ADDR_PCA9539, PCA9539_INPUT0

Definition at line 33 of file feb64.h.

#define BIAS_WRITE   ADDR_PCA9539, PCA9539_OUTPUT0

Definition at line 34 of file feb64.h.

#define BTEMPERATURE_MASK   0x1000

Definition at line 308 of file feb64.h.

#define CLEAR   0

Definition at line 250 of file feb64.h.

#define CONVER_FAC1   0xFFFFFFFF

Definition at line 76 of file feb64.h.

#define CONVER_FAC2   65536.0f

Definition at line 54 of file feb64.h.

#define CURR_MEASURE   0x04

Definition at line 43 of file feb64.h.

#define CURRENT_MASK   0x0040

Definition at line 311 of file feb64.h.

#define DONE   1

Definition at line 247 of file feb64.h.

#define EEP_CTRL_INVAL_KEY   0x00ff0000

Definition at line 121 of file feb64.h.

#define EEP_CTRL_INVAL_REQ   0xff000000

Definition at line 120 of file feb64.h.

#define EEP_CTRL_KEY   0x3C000000

Definition at line 117 of file feb64.h.

#define EEP_CTRL_OFF_RANGE   0x0000ff00

Definition at line 122 of file feb64.h.

#define EEP_CTRL_READ   0x00110000

Definition at line 118 of file feb64.h.

#define EEP_CTRL_WRITE   0x00220000

Definition at line 119 of file feb64.h.

#define EEP_RW_IDX   0x06

Definition at line 124 of file feb64.h.

#define EEP_RW_LAST_IDX   PAGE_SIZE/4

Definition at line 125 of file feb64.h.

#define EXT_VREF   1.25f

Definition at line 42 of file feb64.h.

#define FAILED   0

Definition at line 249 of file feb64.h.

#define FGDTEMPERATURE_MASK   0x0400

Definition at line 309 of file feb64.h.

#define FIRST_ASUM   IDXASUM

Definition at line 232 of file feb64.h.

#define FIRST_BIAS   IDXBIAS

Definition at line 229 of file feb64.h.

#define GAIN1   0

Definition at line 47 of file feb64.h.

#define GAIN16   3

Definition at line 50 of file feb64.h.

#define GAIN32   4

Definition at line 51 of file feb64.h.

#define GAIN4   1

Definition at line 48 of file feb64.h.

#define GAIN64   5

Definition at line 52 of file feb64.h.

#define GAIN8   2

Definition at line 49 of file feb64.h.

#define I_A2MTABLE   1

Definition at line 45 of file feb64.h.

#define IDXASUM   47

Definition at line 217 of file feb64.h.

#define IDXASUM_CTL   145

Definition at line 221 of file feb64.h.

#define IDXBIAS   55

Definition at line 219 of file feb64.h.

#define IDXBSWITCH   5

Definition at line 216 of file feb64.h.

#define IDXCTL   2

Definition at line 214 of file feb64.h.

#define IDXEEP_CTL   144

Definition at line 220 of file feb64.h.

#define IDXEER   1

Definition at line 213 of file feb64.h.

#define IDXQVOLT   6

Definition at line 215 of file feb64.h.

#define IDXSST   19

Definition at line 218 of file feb64.h.

#define INT_VREF   2.44f

Definition at line 86 of file feb64.h.

#define IntGAIN1   0

Definition at line 87 of file feb64.h.

#define IntGAIN16   4

Definition at line 91 of file feb64.h.

#define IntGAIN2   1

Definition at line 88 of file feb64.h.

#define IntGAIN4   2

Definition at line 89 of file feb64.h.

#define IntGAIN8   3

Definition at line 90 of file feb64.h.

#define LAST_ASUM   FIRST_ASUM + NCHANNEL_ASUM

Definition at line 233 of file feb64.h.

#define LAST_BIAS   FIRST_BIAS + NCHANNEL_BIAS

Definition at line 230 of file feb64.h.

#define N_RB_CHANNEL   16

Definition at line 41 of file feb64.h.

#define NCHANNEL_ADT7486A   4

Definition at line 210 of file feb64.h.

#define NCHANNEL_ASUM   8

Definition at line 208 of file feb64.h.

#define NCHANNEL_BIAS   64

Definition at line 207 of file feb64.h.

#define NCHANNEL_SST   8

Definition at line 209 of file feb64.h.

#define OFF   0

Definition at line 248 of file feb64.h.

#define ON   1

Definition at line 246 of file feb64.h.

#define PAGE_SIZE   sizeof(eepage)

Definition at line 123 of file feb64.h.

#define Q_PUMP_INIT   1

Definition at line 80 of file feb64.h.

#define Q_PUMP_OFF   2

Definition at line 81 of file feb64.h.

#define Q_PUMP_ON   3

Definition at line 82 of file feb64.h.

#define SERIALN_ADD   (unsigned int) (0x600)

Definition at line 224 of file feb64.h.

#define SERIALN_LENGTH   (unsigned int) 4

Definition at line 223 of file feb64.h.

#define SST_LINE1   1

Definition at line 22 of file feb64.h.

#define SST_LINE2   2

Definition at line 23 of file feb64.h.

#define SST_TIME   2

Definition at line 26 of file feb64.h.

#define UCTEMPERATURE_MASK   0x0100

Definition at line 307 of file feb64.h.

#define V_A2MTABLE   0

Definition at line 44 of file feb64.h.

#define VOLT_MEASURE   0x04

Definition at line 46 of file feb64.h.

#define VOLTAGE_MASK   0x001C

Definition at line 310 of file feb64.h.


Function Documentation

int eepageAddrConvert ( unsigned int  index  ) 
float read_voltage ( unsigned char  channel,
unsigned int *  rvalue,
float  coeff,
float  offset,
unsigned char  gain 
)

Definition at line 415 of file feb64.c.

void switchonoff ( unsigned char  command  ) 

Definition at line 441 of file feb64.c.

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

Definition at line 868 of file feb64.c.

void user_init ( unsigned char  init  ) 

Definition at line 606 of file feb64.c.

void user_loop ( void   ) 

Error mask

Definition at line 906 of file feb64.c.

unsigned char user_read ( unsigned char  index  ) 

Definition at line 860 of file feb64.c.

void user_write ( unsigned char  index  ) 

Definition at line 803 of file feb64.c.


Variable Documentation

struct ADC2MSCB_TABLE xdata adc2mscb_table[16]
Initial value:
 {
  {GAIN32, 1, I_A2MTABLE, 1000, 22},    {GAIN32, 3, I_A2MTABLE, 1000, 127}
, {GAIN32, 5, I_A2MTABLE, 1000, 7176},  {GAIN32, 7, I_A2MTABLE, 1000, 1840}
, {GAIN1 , 7, V_A2MTABLE,   101.1, 230}, {GAIN1 , 5, V_A2MTABLE, 101.1, 230}
, {GAIN1 , 3, V_A2MTABLE,   101.1, 230}, {GAIN1 , 1, V_A2MTABLE, 101.1, 230}
, {GAIN32, 0, I_A2MTABLE, 1000, 3178},  {GAIN32, 2, I_A2MTABLE, 1000, 1800}
, {GAIN32, 4, I_A2MTABLE, 1000, 925},   {GAIN32, 6, I_A2MTABLE, 1000, 4895}
, {GAIN1 , 6, V_A2MTABLE,   101.1, 24},  {GAIN1 , 4, V_A2MTABLE, 101.1, 230}
, {GAIN1 , 2, V_A2MTABLE,   101.1, 225}, {GAIN1 , 0, V_A2MTABLE, 101.1, 230}
}

Definition at line 66 of file feb64.h.

sbit CAsum = rCTL ^ 2

Definition at line 256 of file feb64.h.

sbit Ccal = rCTL ^ 3

Definition at line 257 of file feb64.h.

sbit CeeClr = rCTL ^ 6

Definition at line 260 of file feb64.h.

sbit CeeR = rCTL ^ 5

Definition at line 259 of file feb64.h.

sbit CeeS = rCTL ^ 4

Definition at line 258 of file feb64.h.

sbit CmSd = rCTL ^ 7

Definition at line 261 of file feb64.h.

sbit CPup = rCTL ^ 0

Definition at line 254 of file feb64.h.

struct EEPAGE xdata eepage

Definition at line 152 of file feb64.h.

struct EEPAGE xdata eepage2

Definition at line 203 of file feb64.h.

sbit EEPROM = rESR ^ 3

Definition at line 294 of file feb64.h.

sbit ExtssTT = rESR ^ 2

Definition at line 293 of file feb64.h.

struct IADC_TABLE xdata iadc_table[8]
Initial value:
 {
  {IntGAIN2, 50.5,       0.0}, {IntGAIN8, 10000.0/8.0, 0.0}
, {IntGAIN1, 3.980132,     0}, {IntGAIN1, 3.980132, 0}
, {IntGAIN1, 8.5,    -18.751}, {IntGAIN1, 0.1, 0}
, {IntGAIN1, 0.4,          0}, {IntGAIN1, 0.1, 0}
}

Definition at line 101 of file feb64.h.

sbit IntssTT = rESR ^ 1

Definition at line 292 of file feb64.h.

sbit iQpump = rESR ^ 9

Definition at line 282 of file feb64.h.

sbit iReg1 = rESR ^ 13

Definition at line 287 of file feb64.h.

sbit iReg2 = rESR ^ 14

Definition at line 288 of file feb64.h.

sbit iReg3 = rESR ^ 15

Definition at line 289 of file feb64.h.

unsigned char xdata ltc1665mirror[64]

Definition at line 242 of file feb64.h.

unsigned int xdata ltc2600mirror[8]

Definition at line 243 of file feb64.h.

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

Definition at line 227 of file feb64.h.

sbit pcbssTT = rESR ^ 4

Definition at line 296 of file feb64.h.

unsigned char bdata rCSR

Definition at line 265 of file feb64.h.

unsigned char bdata rCTL

Definition at line 253 of file feb64.h.

sbit RdssT = rESR ^ 5

Definition at line 297 of file feb64.h.

unsigned char rEER

Definition at line 115 of file feb64.h.

unsigned int bdata rESR

Definition at line 280 of file feb64.h.

sbit SAsum = rCSR ^ 2

Definition at line 268 of file feb64.h.

sbit Scal = rCSR ^ 3

Definition at line 269 of file feb64.h.

sbit SeeR = rCSR ^ 5

Definition at line 271 of file feb64.h.

sbit SeeS = rCSR ^ 4

Definition at line 270 of file feb64.h.

unsigned long xdata smbdebug

Definition at line 371 of file feb64.h.

sbit SmSd = rCSR ^ 7

Definition at line 273 of file feb64.h.

sbit SPup = rCSR ^ 0

Definition at line 266 of file feb64.h.

sbit SqPump = rCSR ^ 1

Definition at line 267 of file feb64.h.

sbit SsS = rCSR ^ 6

Definition at line 272 of file feb64.h.

sbit timing = P2 ^ 7

Definition at line 370 of file feb64.h.

sbit uCT = rESR ^ 0

Definition at line 291 of file feb64.h.

struct user_data_type xdata user_data

Definition at line 367 of file feb64.h.

sbit vQpump = rESR ^ 8

Definition at line 281 of file feb64.h.

sbit vReg1 = rESR ^ 10

Definition at line 283 of file feb64.h.

sbit vReg2 = rESR ^ 11

Definition at line 284 of file feb64.h.

sbit vReg3 = rESR ^ 12

Definition at line 286 of file feb64.h.


Generated on 1 Feb 2022 for FGDC8051-FEB64 by  doxygen 1.6.1