C

Qt Quick Ultralite Automotive Cluster Demo

//============================================================================
// PROJECT = RSCFD Type RSCFDFD_UCIAPRCN
//============================================================================
//                                 C O P Y R I G H T
//============================================================================
// Copyright (c) 2015 by RENESAS Electronics (Europe) GmbH. All rights reserved.
// Arcadiastrasse 10
// D-40472 Duesseldorf
// Germany
//============================================================================
//Purpose: RSCFD Driver Hardware Configuration Sets
//
//Warranty Disclaimer
//
//Because the Product(s) is licensed free of charge, there is no warranty
//of any kind whatsoever and expressly disclaimed and excluded by RENESAS,
//either expressed or implied, including but not limited to those for
//non-infringement of intellectual property, merchantability and/or
//fitness for the particular purpose.
//RENESAS shall not have any obligation to maintain, service or provide bug
//fixes for the supplied Product(s) and/or the Application.
//
//Each User is solely responsible for determining the appropriateness of
//using the Product(s) and assumes all risks associated with its exercise
//of rights under this Agreement, including, but not limited to the risks
//and costs of program errors, compliance with applicable laws, damage to
//or loss of data, programs or equipment, and unavailability or
//interruption of operations.
//
//Limitation of Liability
//
//In no event shall RENESAS be liable to the User for any incidental,
//consequential, indirect, or punitive damage (including but not limited
//to lost profits) regardless of whether such liability is based on breach
//of contract, tort, strict liability, breach of warranties, failure of
//essential purpose or otherwise and even if advised of the possibility of
//such damages. RENESAS shall not be liable for any services or products
//provided by third party vendors, developers or consultants identified or
//referred to the User by RENESAS in connection with the Product(s) and/or the
//Application.
//
//
//
//============================================================================
// Environment: Devices:          All featuring RSCFDFD_UCIAPRCN
//              Assembler:        GHS MULTI
//              C-Compiler:       GHS MULTI
//              Linker:           GHS MULTI
//              Debugger:         GHS MULTI
//============================================================================
#ifndef _RSCFD_S_H
#define _RSCFD_S_H

#include <stddef.h>
#include <ree_types.h>

#define  DRIVER_LOCAL

#ifdef VLIB
#include <config_rscfd.h>

#else
#include <map_rscfd.h>
#endif

/* Default Configuration Macros */

#define EE_RSCFD_A_COMFIFO_OFF { 0, 0, 0, 0, \
                                 EE_RSCFD_FIFODL_8, 0, \
                                 EE_RSCFD_FIFO_DEPTH_0, 0, \
                                 EE_RSCFD_FIFO_INT_ONLEVEL, \
                                 EE_RSCFD_FIFO_ILEVEL_1D8, \
                                 EE_RSCFD_FIFO_MODE_RX, \
                                 EE_RSCFD_FIFO_IT_REFCLK, \
                                 EE_RSCFD_FIFO_IT_REFCLK1, \
                                 0, 0 }                  /* COM FIFO disabled */

#define EE_RSCFD_A_RXFIFO_OFF  { 0, 0, 0, \
                                 EE_RSCFD_FIFODL_8, 0,  \
                                 EE_RSCFD_FIFO_DEPTH_0, 0, \
                                 EE_RSCFD_FIFO_INT_ONLEVEL, \
                                 EE_RSCFD_FIFO_ILEVEL_1D8, 0 } /* RX FIFO disabled */

#define EE_RSCFD_A_TXQ_OFF { 0, 0, EE_RSCFD_TXQ_OFF, 0, 0, 0 }   /* TX Queue OFF */
#define EE_RSCFD_A_THL_OFF { 0, 0, 0, EE_RSCFD_THL_INT_ONLEVEL, \
                             EE_RSCFD_THL_ENTRY_QUEUED, 0 }          /* THL OFF */
#define EE_RSCFD_A_THL_ON  { 1, 0, 0, EE_RSCFD_THL_INT_ONLEVEL, \
                             EE_RSCFD_THL_ENTRY_QUEUED, 0 }           /* THL ON */

#define EE_RSCFD_A_BT_AUTO { 0, 0, 0, 0, 0, 0, 0 }   /* Automatic bit timing */

#define EE_RSCFD_A_FDCFG_DEFAULT  { EE_RSCFD_EOC_ALLTXRX, 0,  \
                                    EE_RSCFD_TDC_MEASOFFSET,  \
                                    EE_RSCFD_TDC_DISABLE,     \
                                    EE_RSCFD_ESI_BYNODE, 0,   \
                                    0, 0,                     \
                                    EE_RSCFD_MULTIGW_DISABLE, \
                                    EE_RSCFD_FDF_FD,          \
                                    EE_RSCFD_BRS_SWITCH,      \
                                    EE_RSCFD_TXBOXMERGE,      \
                                    EE_RSCFD_FDMIXED,         \
                                    EE_RSCFD_RXEDGEFILTER_ON, 0 }

/* Default configurations */

const struct ee_rscfd_cfg_channel EE_RSCFD_A_CHCFG_BASIC = {

  500000,  0.0,                 /* arbitration bitrate 500 kbit/s, default BT */
  2000000, 0.0,                       /* data bitrate 2000 kbit/s, default BT */

  EE_RSCFD_A_BT_AUTO,                     /* automatic arbitration bit timing */
  EE_RSCFD_A_BT_AUTO,                            /* automatic data bit timing */
  {
    EE_RSCFD_OPMODE_KEEP, 0, 0, 0,    /* No implicit change of Operation Mode */
    EE_RSCFD_CINT_OFF, 0,                              /* No Error Interrupts */
    EE_RSCFD_BOM_ISO, 0,     /* Standard Bus Off behaviour & Error Signalling */
    0, EE_RSCFD_TEST_BASIC,                                  /* Test Mode Off */
    0, 0, 0, 0,                             /* Error counters behave normally */
    EE_RSCFD_RESTRICTED_DIS
  },
  {
    EE_RSCFD_OCC_KEEP,                  /* CAN-FD Occurrence Counter settings */
    EE_RSCFD_OCC_KEEP
  },
  EE_RSCFD_A_FDCFG_DEFAULT,                 /* CAN-FD Operation Configuration */

  0xFFFF,                                     /* enable all IRQ of TX Buffers */

  EE_RSCFD_A_TXQ_OFF,                      /* disable queues, lists and FIFOs */
  EE_RSCFD_A_THL_OFF,
  { EE_RSCFD_A_COMFIFO_OFF,
    EE_RSCFD_A_COMFIFO_OFF,
    EE_RSCFD_A_COMFIFO_OFF }
};

const struct ee_rscfd_cfg_global EE_RSCFD_A_GCFG_BASIC = {

  {
    EE_RSCFD_TXPRIO_ID,                      /* TX priority by ID (standard) */
    EE_RSCFD_DLCCHECK_DISABLE,
    EE_RSCFD_DLCREPL_DISABLE,                 /* no DLC check or replacement */
    EE_RSCFD_MIRROR_DISABLE,                               /* no Mirror Mode */
    EE_RSCFD_CLOCK_SYS,                              /* use peripheral clock */
    EE_RSCFD_PLOVF_TRUNCATE,    /* larger messages than buffer are truncated */
    EE_RSCFD_ECCERR_DISABLE,                    /* no ECC errors are flagged */
    EE_RSCFD_TXTS_DISABLE,                   /* transmit timestamps disabled */
    0, EE_RSCFD_CLOCK_TSBIT,
    EE_RSCFD_CHANNEL0,          /* Use 1TQ Bit-Timing clock 0 for Timestamps */
    EE_RSCFD_CLOCK_FIFO_OFF               /* interval timer of FIFO disabled */
  },
  {
    EE_RSCFD_OPMODE_KEEP,
    EE_RSCFD_SLEEP_DISABLE,          /* No implicit change of Operation Mode */
    0, EE_RSCFD_GINT_NONE,                            /* No Error Interrupts */
    0, EE_RSCFD_TIMESTAMP_RESET,                          /* Timestamp reset */
    EE_RSCFD_TIMESTAMP_KEEP, 0       /* Timestamp is not written by software */
  },
  {
        EE_RSCFD_PROTEXCEVENT_EN, 0, /* enable protocol exception event handling */
        EE_RSCFD_TSCAPTURE_SOF, 0      /* timestamp capture performed at SOF bit */
  },
  {
        EE_RSCFD_PROTOCOL_ISO, 0        /* use ISO conformous CRC field protocol */
  },
  {
        EE_RSCFD_MAXRXBUFFERS,        /* use max. amount of classical RX buffers */
        EE_RSCFD_BUFDL_8, 0  /* standard 8-byte size of all classical RX buffers */
  },
  {
          1, 1, 1, 1, 1, 1, 1, 1                    /* every channel has one AFL entry */
  },
  {
    EE_RSCFD_A_RXFIFO_OFF,                           /* disable all RX FIFOs */
    EE_RSCFD_A_RXFIFO_OFF,
    EE_RSCFD_A_RXFIFO_OFF,
    EE_RSCFD_A_RXFIFO_OFF,
    EE_RSCFD_A_RXFIFO_OFF,
    EE_RSCFD_A_RXFIFO_OFF,
    EE_RSCFD_A_RXFIFO_OFF,
    EE_RSCFD_A_RXFIFO_OFF,
  }
};

const struct ee_rscfd_a_afl EE_RSCFD_A_AFL_RXBOX_ANY = {

  {
    0x0000000,               /* Default ID, not relevant because mask is open */
    EE_RSCFD_AFL_RXENTRY,                        /* receive entry type of AFL */
    EE_RSCFD_FRAME_DATA,                      /* RTR data frame configuration */
    EE_RSCFD_ID_STD                           /* standard frame configuration */
  },
  {
    EE_RSCFD_MASK_IDDONTCARE,                     /* mask is open for all IDs */
    0, EE_RSCFD_MASK_DONTCARE,               /* any type of frame is accepted */
    EE_RSCFD_MASK_DONTCARE
  },
  {
    0,
    0,                   /* RX Box Number - to be replaced with actual number */
    EE_RSCFD_SET,                                     /* RX Box is set active */
    0x000,          /* Receive HRH pointer - to be replaced with actual value */
    EE_RSCFD_DLCCHECK_DISABLE          /* to enable DLC check, enter DLC here */
  },
  {
    EE_RSCFD_AFL_RXFIF0_NONE,              /* this AFL entry only receives in */
    EE_RSCFD_AFL_COMFIFO_NONE                      /* classical message boxes */
  }
};

#endif // _RSCFD_S_H