Demo entry 2795629

visaHwRegister

   

Submitted by anonymous on Oct 01, 2015 at 10:04
Language: C++. Code size: 2.8 kB.

/* ======================================================================== */
/*                    Start of register declaration                         */
/* ======================================================================== */

/* h00..h01   Versions
 *
 * 16-Bit register
 * BIT-adressierbar
 */
typedef union {
   struct {
      uint16_t FPGA_Vers:12, hwVers:4;
   } ;
   uint16_t word;
} h0001_vers;

/* h02..h03    txed_bytes
 *
 * 16-Bit register
 * byte-adressierbar
 */
typedef union {
   struct {
      uint8_t msb;
      uint8_t lsb;
   } ;
   uint16_t txed;
} h0203_txed;

/* h04     v1
 *
 * 8-Bit register
 * BIT-adressierbar
 */
typedef union {
   struct {
      uint8_t SCOPE_state:3, trig_pres:1, OV_Vpl:1;
      uint8_t OV_Vmi:1, newADC:1, Authoriz:1;
   } ;
   uint8_t byte;
} h04_state;

/* h05   Trig_dist */
typedef uint8_t h05_Trig_dist;

/* h06..h09
 *
 * 32-Bit register
 * BIT-adressierbar
 */
typedef union {
   struct {
      uint32_t act_RAM_addr:16, ADDR_after_trig:16;
   } ;
   uint32_t dword;
} h0609_RAM_Addr;

/* h0a..h0d  trig_ev distance
 *
 * 32-Bit register
 * byte-adressierbar
 */
typedef union {
   struct {
      uint8_t byte1;
      uint8_t byte2;
      uint8_t byte3;
      uint8_t byte4;
   } ;
   uint32_t dist;
} h0a0d_trig_ev;

/* h18..h1f   Bias, DMM
 *
 * 64-Bit register
 * BIT-adressierbar
 */
typedef union {
   struct {
      uint64_t OV_i4:1, OV_u4:1, ADC_Vbias:14;
      uint64_t OV_i5:1, OV_u5:1, ADC_avg:14;
      uint64_t OV_i6:1, OV_u6:1, ADC_gnd:14;
      uint64_t OV_i7:1, OV_u7:1, ADC_sel_gnd:14;
   } ; /*cont;*/
   uint64_t lword;
} h181f_dcm;

// .....  usw  ...... //

/* ======================================================================== */
/*                    End of register declaration                           */
/* ======================================================================== */

/**
 * HW_ro_reg structure mirrors every single BIT of all addressable
 * read only registers! Lets call it the read only-register image
 * structure "HW_ro_img"
 */
typedef struct {
   h0001_vers     h0001;
   h0203_txed     h0203;
   h04_state      h04;
   h05_Trig_dist  h05;
   h0609_RAM_Addr h0609;
   h0a0d_trig_ev  h0a0d;
   h1017_pwr      h1017;
   h181f_dcm      h181f;
   h2023_24bit    h2023;
   h2427_24bit    h2427;
   h2b_logic      h2b;
   h2c2f_scope_ys h2c2f;
} HW_ro_img_t;

/**
 * HW_rw_reg structure mirrors every single BIT of all addressable
 * writeable registers! Lets call it the rw-register image
 * structure "HW_rw_img"
 */
typedef struct {
   h8087_pows     h8047;
   h8a8b_rng      h8a8b;
   hbebf_led      hbebf;
} HW_rw_img_t ;

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).