grlib_regs.h
263 lines
| 6.7 KiB
| text/x-c
|
CLexer
Alexis Jeandet
|
r1 | /*------------------------------------------------------------------------------ | ||
-- This file is a part of the LFR Offset analysis firmware | ||||
-- Copyright (C) 2016, Plasma Physics Laboratory - CNRS | ||||
-- | ||||
-- This program is free software; you can redistribute it and/or modify | ||||
-- it under the terms of the GNU General Public License as published by | ||||
-- the Free Software Foundation; either version 2 of the License, or | ||||
-- (at your option) any later version. | ||||
-- | ||||
-- This program is distributed in the hope that it will be useful, | ||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
-- GNU General Public License for more details. | ||||
-- | ||||
-- You should have received a copy of the GNU General Public License | ||||
-- along with this program; if not, write to the Free Software | ||||
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||||
-------------------------------------------------------------------------------*/ | ||||
/*-- Author : Alexis Jeandet | ||||
-- Mail : alexis.jeandet@lpp.polytechnique.fr | ||||
----------------------------------------------------------------------------*/ | ||||
Alexis Jeandet
|
r0 | #ifndef GRLIB_REGS_H_INCLUDED | ||
#define GRLIB_REGS_H_INCLUDED | ||||
#define NB_GPTIMER 3 | ||||
#include <stdint.h> | ||||
struct apbuart_regs_str{ | ||||
volatile unsigned int data; | ||||
volatile unsigned int status; | ||||
volatile unsigned int ctrl; | ||||
volatile unsigned int scaler; | ||||
volatile unsigned int fifoDebug; | ||||
}; | ||||
struct grgpio_regs_str{ | ||||
volatile int io_port_data_register; | ||||
int io_port_output_register; | ||||
int io_port_direction_register; | ||||
int interrupt_mak_register; | ||||
int interrupt_polarity_register; | ||||
int interrupt_edge_register; | ||||
int bypass_register; | ||||
int reserved; | ||||
// 0x20-0x3c interrupt map register(s) | ||||
}; | ||||
typedef volatile struct { | ||||
int counter; | ||||
volatile unsigned int reload; | ||||
volatile unsigned int ctrl; | ||||
volatile unsigned int unused; | ||||
} timer_regs_t; | ||||
typedef volatile struct { | ||||
volatile unsigned int scaler_value; | ||||
volatile unsigned int scaler_reload; | ||||
volatile unsigned int conf; | ||||
volatile unsigned int unused0; | ||||
timer_regs_t timer[NB_GPTIMER]; | ||||
} gptimer_regs_t; | ||||
typedef struct | ||||
{ | ||||
uint32_t unused:16; | ||||
uint32_t Fine:16; | ||||
uint32_t Coarse; | ||||
}CUCtime_t; | ||||
struct DualBuffAddr_t | ||||
{ | ||||
volatile uint32_t ADDR0; | ||||
volatile uint32_t ADDR1; | ||||
}; | ||||
struct Potential_t | ||||
{ | ||||
uint32_t UNUSED:16; | ||||
uint32_t Value:16; | ||||
}; | ||||
typedef volatile struct { | ||||
volatile union CONFIG{ | ||||
volatile struct { | ||||
uint32_t UNUSED:29; // 0x00 | ||||
uint32_t run:1; | ||||
uint32_t interuptOnDoneEnable:1; | ||||
uint32_t interuptOnErrorEnable:1; | ||||
}FIELDS; | ||||
uint32_t Value; | ||||
}CONFIG; | ||||
volatile union STATUS{ | ||||
volatile struct { | ||||
uint32_t UNUSED:21; | ||||
uint32_t FIFO_2_Full_err:1; | ||||
uint32_t FIFO_1_Full_err:1; | ||||
uint32_t FIFO_0_Full_err:1; | ||||
uint32_t Buffer_Full_err:1; | ||||
uint32_t Ready_F2_Buffer1:1; | ||||
uint32_t Ready_F2_Buffer0:1; | ||||
uint32_t Ready_F1_Buffer1:1; | ||||
uint32_t Ready_F1_Buffer0:1; | ||||
uint32_t Ready_F0_Buffer1:1; | ||||
uint32_t Ready_F0_Buffer0:1; | ||||
}FIELDS; | ||||
uint32_t Value; | ||||
}STATUS; | ||||
struct DualBuffAddr_t ADDRESS_F0; | ||||
struct DualBuffAddr_t ADDRESS_F1; | ||||
struct DualBuffAddr_t ADDRESS_F2; | ||||
CUCtime_t TIME_F0_0; | ||||
CUCtime_t TIME_F0_1; | ||||
CUCtime_t TIME_F1_0; | ||||
CUCtime_t TIME_F1_1; | ||||
CUCtime_t TIME_F2_0; | ||||
CUCtime_t TIME_F2_1; | ||||
volatile struct { | ||||
uint32_t Unused:6; | ||||
uint32_t length:26; // 0x50, length of a spectral matrix in burst (25*128) / 16 = 200 = 0xc8 | ||||
}length; | ||||
} lfr_sm_regs_t; | ||||
typedef volatile struct { | ||||
volatile union DATASHAPING { | ||||
volatile struct { | ||||
uint32_t UNUSED:26; // 0x00 | ||||
uint32_t R2:1; | ||||
uint32_t R1:1; | ||||
uint32_t R0:1; | ||||
uint32_t SP1:1; | ||||
uint32_t SP0:1; | ||||
uint32_t BW:1; | ||||
}FIELDS; | ||||
uint32_t Value; | ||||
}DATASHAPING; | ||||
volatile union { | ||||
volatile struct { | ||||
uint32_t UNUSED:25; | ||||
uint32_t BURST_EN_F2:1; | ||||
uint32_t BURST_EN_F1:1; | ||||
uint32_t BURST_EN_F0:1; | ||||
uint32_t ACQ_EN_F3:1; | ||||
uint32_t ACQ_EN_F2:1; | ||||
uint32_t ACQ_EN_F1:1; | ||||
uint32_t ACQ_EN_F0:1; | ||||
}FIELDS; | ||||
uint32_t Value; | ||||
}Control; | ||||
volatile struct DualBuffAddr_t ADDRESS_F0; | ||||
volatile struct DualBuffAddr_t ADDRESS_F1; | ||||
volatile struct DualBuffAddr_t ADDRESS_F2; | ||||
volatile struct DualBuffAddr_t ADDRESS_F3; | ||||
uint32_t STATUS; | ||||
uint32_t DeltaSnapshot; | ||||
uint32_t Delta_F0; | ||||
uint32_t UNUSED_Delta_F0_2:25; | ||||
uint32_t Delta_F0_2:7; | ||||
uint32_t Delta_F1; | ||||
uint32_t Delta_F2; | ||||
uint32_t Nb_Data_per_buff; | ||||
uint32_t Nb_snapshot; | ||||
uint32_t StartDate; | ||||
CUCtime_t TIME_F0_0; | ||||
CUCtime_t TIME_F0_1; | ||||
CUCtime_t TIME_F1_0; | ||||
CUCtime_t TIME_F1_1; | ||||
CUCtime_t TIME_F2_0; | ||||
CUCtime_t TIME_F2_1; | ||||
CUCtime_t TIME_F3_0; | ||||
CUCtime_t TIME_F3_1; | ||||
union{ | ||||
struct { | ||||
uint32_t Unused_length:6; | ||||
uint32_t length:26; | ||||
}FIELDS; // 0x50, length of a spectral matrix in burst (25*128) / 16 = 200 = 0xc8 | ||||
uint32_t Value; | ||||
}length; | ||||
struct Potential_t V; | ||||
struct Potential_t E1; | ||||
struct Potential_t E2; | ||||
} lfr_wfp_regs_t; | ||||
typedef struct { | ||||
uint32_t UNUSED:16; | ||||
uint32_t Value:16; | ||||
}lfr_hk_temp_t; | ||||
typedef struct { | ||||
struct { | ||||
uint32_t UNUSED:25; | ||||
uint32_t CAL_EN:1; | ||||
uint32_t Interleaved_EN:1; | ||||
uint32_t Reload_EN:1; | ||||
uint32_t DAC_CFG:4; | ||||
}Control; | ||||
uint32_t UNUSED_PRE:24; | ||||
uint32_t PRE:8; | ||||
uint32_t UNUSED_N:16; | ||||
uint32_t N:16; | ||||
uint32_t UNUSED_ADDR:24; | ||||
uint32_t ADDRESS:8; | ||||
uint32_t UNUSED_DATA_IN:14; | ||||
uint32_t DATA_IN:18; | ||||
}lfr_dac_regs_t; | ||||
typedef volatile struct { | ||||
union { | ||||
struct { | ||||
uint32_t UNUSED:29; | ||||
uint32_t SOFT_RESET:1; | ||||
uint32_t TIME_MANAGMENT_RESET:1; | ||||
uint32_t SWTick:1;}FIELDS; | ||||
uint32_t Value; | ||||
}Control; | ||||
uint32_t UNUSED_TIME_LOAD:1; | ||||
uint32_t TIME_LOAD:31; | ||||
uint32_t Unsynchronized:1; | ||||
uint32_t COARSE_TIME:31; | ||||
uint32_t UNUSED_FINE_TIME:16; | ||||
uint32_t FINE_TIME:16; | ||||
lfr_hk_temp_t TEMP_0; | ||||
lfr_hk_temp_t TEMP_1; | ||||
lfr_hk_temp_t TEMP_2; | ||||
lfr_dac_regs_t DAC; | ||||
}lfr_managment_regs_t; | ||||
typedef volatile struct { | ||||
lfr_sm_regs_t SM; | ||||
lfr_wfp_regs_t WFP; | ||||
struct { | ||||
uint32_t UNUSED:8; | ||||
uint32_t Board:8; | ||||
uint32_t Major:8; | ||||
uint32_t Minor:8; | ||||
}VERSION; | ||||
}lfr_regs_t; | ||||
#endif // GRLIB_REGS_H_INCLUDED | ||||