Files
es-praktikum/Milestone5/gip.h
T
2024-12-01 13:07:30 +01:00

135 lines
5.2 KiB
C

//
// gip.h
// Type definitions for AXI, AXIS and AXIL IP
// Prof. Dr.-Ing. W. Gehrke 2020+
//
// Last Update: 01.08.23
#ifndef __GIP_H__
#define __GIP_H__
#include <stdint.h>
typedef struct
{
volatile uint32_t InterruptEnable; // [1] MM2VS INT Enable, [0] VS2MM INT Enable
volatile uint32_t InterruptStatus; // [1] MM2VS INT Status, [0] VS2MM INT Status
volatile uint32_t MM2VS_Control; // [0] 1=run, [1] sync w SOF, [7:4] add. frame buffers, [9] 1=freeze, [15:12] AxCACHE
volatile uint32_t MM2VS_StartAddress; // [31:0] Buffer Start Address
volatile uint32_t MM2VS_HorizontalBytes; // [15:0] Number of Bytes per Line
volatile uint32_t MM2VS_Stride; // [23:0] Stride [Bytes]
volatile uint32_t MM2VS_VerticalLines; // [15:0] Number of Lines
volatile uint32_t MM2VS_InterruptLine; // [15:0] Lineoffset for INT generation (0 = bottom line)
volatile uint32_t MM2VS_FrameNumber; // [15:0] Current Frame Number (read only)
volatile uint32_t MM2VS_LineNumber; // [15:0] Current Line Number (read only)
volatile uint32_t MM2VS_LastFrameAddress; // [31:0] Last used Buffer Start Address (read only)
volatile uint32_t VS2MM_Control; // [0] 1=run, [1] sync w SOF, [7:4] add. frame buffers, [8] no flushing when inactive, [9] 1=freeze, [15:12] AxCACHE
volatile uint32_t VS2MM_StartAddress; // [31:0] Buffer Start Address
volatile uint32_t VS2MM_HorizontalBytes; // [15:0] Number of Bytes per Line
volatile uint32_t VS2MM_Stride; // [23:0] Stride [Bytes]
volatile uint32_t VS2MM_VerticalLines; // [15:0] Number of Lines
volatile uint32_t VS2MM_InterruptLine; // [15:0] Lineoffset for INT generation (0 = bottom line)
volatile uint32_t VS2MM_FrameNumber; // [15:0] Current Frame Number (read only)
volatile uint32_t VS2MM_LineNumber; // [15:0] Current Line Number (read only)
volatile uint32_t VS2MM_LastFrameAddress; // [31:0] Last used Buffer Start Address (read only)
} GIP_AXI_2D_MM2VS;
typedef GIP_AXI_2D_MM2VS *PGIP_AXI_2D_MM2VS;
typedef struct
{
volatile uint32_t Gpo; // GP Outputs
volatile uint32_t Gpi; // GP Inputs (read only)
} GIP_AXIL_GPIO;
typedef GIP_AXIL_GPIO *PGIP_AXIL_GPIO;
typedef struct
{
volatile uint32_t Max; // Counter Max Value
} GIP_AXIL_MODULO_COUNTER;
typedef GIP_AXIL_MODULO_COUNTER *PGIP_AXIL_MODULO_COUNTER;
typedef struct
{
volatile uint32_t Crop_X; // Crop Hor Start
volatile uint32_t Crop_Y; // Crop Ver Start
volatile uint32_t Crop_W; // Crop Width
volatile uint32_t Crop_H; // Crop Height
} GIP_AXIL_CROP_FIXED;
typedef GIP_AXIL_CROP_FIXED *PGIP_AXIL_CROP_FIXED;
typedef struct
{
volatile uint32_t Status_and_Reset; // Write Access: [0] 1=Reset
// Read Access : [0] Reset, [1] RD_empty, [2] WR_full, [3] always 0, [FIFO_AWIDTH+3:4] RD_num , [FIFO_AWIDTH*2+3:FIFO_AWIDTH+4] WR_num
// if FIFO_AWIDTH > 14: only 14 LSBs of RD_num and WR_num are reported
} GIP_AXIS_FIFO;
typedef GIP_AXIS_FIFO *PGIP_AXIS_FIFO;
typedef struct
{
volatile uint32_t Control; // [0] 1=Streaming enable, [1] 1= Output Stream always valid
volatile uint32_t FrameCounter; // (read only)
volatile uint32_t NoiseMeasurement; // (read only)
volatile uint32_t BytesPerLine; // (read only)
volatile uint32_t BytesPerFrame; // (read only)
volatile uint32_t ClockCyclesPerFrame; // (read only)
} GIP_AXIS_FRAME_STATISTICS;
typedef GIP_AXIS_FRAME_STATISTICS *PGIP_AXIS_FRAME_STATISTICS;
typedef struct
{
volatile uint32_t Channel; // [2:0] selected Input Channel
} GIP_AXIS_MUX;
typedef GIP_AXIS_MUX *PGIP_AXIS_MUX;
typedef struct
{
volatile uint32_t weight1; // [7:0] weight stream 1
volatile uint32_t weight2; // [7:0] weight stream 2
volatile uint32_t div; // [7:0] divider = 2^div (div = 0..9)
} GIP_AXIS_MIXER;
typedef GIP_AXIS_MIXER *PGIP_AXIS_MIXER;
typedef struct
{
volatile uint32_t InterruptEnable; // [0] 1=Frame Interrupt Enable
volatile uint32_t InterruptStatus; // [0] Frame Interrupt Status (!! write 0 to clear pending Interrupt !!)
volatile uint32_t Board_IO; // [7:0] LEDs, [15:8] Switches, [23:16] Buttons, [29:24] RGB-LEDs
volatile uint32_t CycleCounter; // [32:0] CycleCounter[31:0] (AXIL_CLK) (read only)
volatile uint32_t MM2VS_FramebaseAddress; // [31:0] Frame Base Address
volatile uint32_t CycleCounterHigh; // [32:0] CycleCounter[63:32] (AXIL_CLK) (read only)
volatile uint32_t HW_Version; // [31:0] HW_Version (same as Generic) (read only)
volatile uint32_t MM2VS_Hor_Bytes; // [15:0] Horizontal Number of Bytes
volatile uint32_t MM2VS_Ver_Lines; // [15:0] Vertical Number of Lines
volatile uint32_t MM2VS_Stride; // [23:0] Stride
volatile uint32_t MM2VS_Control; // [0] 1=run
volatile uint32_t Video_Mode; // [0] 1=Monochrom Mode, 0=RGB Mode (Data[23:16]=Red, Data[15:8]=Green, Data[15:8]=Blue)
} GIP_ZYNQ_BASE;
typedef GIP_ZYNQ_BASE *PGIP_ZYNQ_BASE;
#endif