
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "cecilie_reg.h"



struct cecilie_pcie_reg_desc_t cecilie_pcie_regs[] = {
	{CEC_REG_CH0_CONTROL, 		"CH0_CONTROL", 		"0 - run, 1 - clear"},
	{CEC_REG_CH1_CONTROL, 		"CH1_CONTROL", 		"0 - run, 1 - clear"},
	{CEC_REG_COMMON_CONTROL, 	"COMMON_CONTROL", 	"0 - sync, 1 - trigger, 2 - clear, 3 - trigger channel, 4 - trigger edge, 18:5 - trigger level"},
	{CEC_REG_CH0_STATUS0, 		"CH0_STATUS0", 		"0 - overflow"},
	{CEC_REG_CH0_STATUS1, 		"CH0_STATUS1", 		"31:0 - word counter lsb"},
	{CEC_REG_CH0_STATUS2, 		"CH0_STATUS2", 		"31:0 - word counter msb"},
	{CEC_REG_CH1_STATUS0, 		"CH1_STATUS0", 		"0 - overflow"},
	{CEC_REG_CH1_STATUS1, 		"CH1_STATUS1", 		"31:0 - word counter lsb"},
	{CEC_REG_CH1_STATUS2, 		"CH1_STATUS2", 		"31:0 - word counter msb"},
	{CEC_REG_COMMON_STATUS, 	"COMMON_STATUS", 	"0 - overflow"},
	{CEC_REG_ID, 			"REG_ID", 		"31:0 - 0xDFC0CEC0"},
};

void registers()
{
	printf("Description of Cecilie PCIE registers:\n");
	for(int i = 0; i < sizeof(cecilie_pcie_regs)/sizeof(*cecilie_pcie_regs); i++){
		printf("%-20s" "0x%08x\t" "%-20s\n", cecilie_pcie_regs[i].name, cecilie_pcie_regs[i].reg_addr, cecilie_pcie_regs[i].description); 
	}
}

