/*
 * Copyright (c) 2022, Shenzhen CVA Innovation CO.,LTD
 * All rights reserved.
 *
 * Shenzhen CVA Innovation CO.,LTD (CVA chip) is supplying this file for use
 * exclusively with CVA's microcontroller products. This file can be freely
 * distributed within development tools that are supporting such microcontroller
 * products.
 *
 * THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES, WHETHER EXPRESS, IMPLIED
 * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
 * CVA SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL,
 * OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
 */

#ifndef _CVM012X_FEATURES_H_
#define _CVM012X_FEATURES_H_

/*! \brief Contains public interface to various functions related
 *         to the features definition of CVM012x series chips
 */

/*******************************************************************************
 * the includes
 ******************************************************************************/

#ifdef __cplusplus
extern "C" {
#endif

/*******************************************************************************
 * the defines
 ******************************************************************************/

#if defined(MCU_CVM0128CVLF) || defined(MCU_CVM0128UVLF) || defined(MCU_CVM0128LVLF)

#ifdef FEATURE_PFLASH_SIZE
#undef FEATURE_PFLASH_SIZE
#endif
#define FEATURE_PFLASH_SIZE (0x38000)

#ifdef FEATURE_RAM_SIZE
#undef FEATURE_RAM_SIZE
#endif
#define FEATURE_RAM_SIZE (0x4000)

#ifdef FEATURE_DFLASH_SIZE
#undef FEATURE_DFLASH_SIZE
#endif
#define FEATURE_DFLASH_SIZE (0x8000)

#ifdef FEATURE_EEPROM_SIZE
#undef FEATURE_EEPROM_SIZE
#endif
#define FEATURE_EEPROM_SIZE (0x800)

#ifdef FEATURE_CAN_FD_INSTANCE_NUM
#undef FEATURE_CAN_FD_INSTANCE_NUM
#endif
#define FEATURE_CAN_FD_INSTANCE_NUM (1)

#ifdef FEATURE_CAN_2_0_INSTANCE_NUM
#undef FEATURE_CAN_2_0_INSTANCE_NUM
#endif
#define FEATURE_CAN_2_0_INSTANCE_NUM (0)

#ifdef FEATURE_CAPSENSOR_CH_NUM
#undef FEATURE_CAPSENSOR_CH_NUM
#endif
#define FEATURE_CAPSENSOR_CH_NUM (30)

#ifdef FEATURE_ADC_SWTRG_ON
#undef FEATURE_ADC_SWTRG_ON
#endif
#define FEATURE_ADC_SWTRG_ON (1)

#ifdef FEATURE_PIN_DRVSTR_ON
#undef FEATURE_PIN_DRVSTR_ON
#endif
#define FEATURE_PIN_DRVSTR_ON (1)

#ifdef FEATURE_PIN_SR_ON
#undef FEATURE_PIN_SR_ON
#endif
#define FEATURE_PIN_SR_ON (1)

#elif defined(MCU_CVM0128CVFM) || defined(MCU_CVM0128UVFM) || defined(MCU_CVM0128LVFM)

#ifdef FEATURE_PFLASH_SIZE
#undef FEATURE_PFLASH_SIZE
#endif
#define FEATURE_PFLASH_SIZE (0x38000)

#ifdef FEATURE_RAM_SIZE
#undef FEATURE_RAM_SIZE
#endif
#define FEATURE_RAM_SIZE (0x4000)

#ifdef FEATURE_DFLASH_SIZE
#undef FEATURE_DFLASH_SIZE
#endif
#define FEATURE_DFLASH_SIZE (0x8000)

#ifdef FEATURE_EEPROM_SIZE
#undef FEATURE_EEPROM_SIZE
#endif
#define FEATURE_EEPROM_SIZE (0x800)

#ifdef FEATURE_CAN_FD_INSTANCE_NUM
#undef FEATURE_CAN_FD_INSTANCE_NUM
#endif
#define FEATURE_CAN_FD_INSTANCE_NUM (1)

#ifdef FEATURE_CAN_2_0_INSTANCE_NUM
#undef FEATURE_CAN_2_0_INSTANCE_NUM
#endif
#define FEATURE_CAN_2_0_INSTANCE_NUM (0)

#ifdef FEATURE_CAPSENSOR_CH_NUM
#undef FEATURE_CAPSENSOR_CH_NUM
#endif
#define FEATURE_CAPSENSOR_CH_NUM (19)

#ifdef FEATURE_ADC_SWTRG_ON
#undef FEATURE_ADC_SWTRG_ON
#endif
#define FEATURE_ADC_SWTRG_ON (1)

#ifdef FEATURE_PIN_DRVSTR_ON
#undef FEATURE_PIN_DRVSTR_ON
#endif
#define FEATURE_PIN_DRVSTR_ON (1)

#ifdef FEATURE_PIN_SR_ON
#undef FEATURE_PIN_SR_ON
#endif
#define FEATURE_PIN_SR_ON (1)

#elif defined(MCU_CVM0126CVFM) || defined(MCU_CVM0126UVFM) || defined(MCU_CVM0126LVFM)

#ifdef FEATURE_PFLASH_SIZE
#undef FEATURE_PFLASH_SIZE
#endif
#define FEATURE_PFLASH_SIZE (0x20000)

#ifdef FEATURE_RAM_SIZE
#undef FEATURE_RAM_SIZE
#endif
#define FEATURE_RAM_SIZE (0x2000)

#ifdef FEATURE_DFLASH_SIZE
#undef FEATURE_DFLASH_SIZE
#endif
#define FEATURE_DFLASH_SIZE (0x8000)

#ifdef FEATURE_EEPROM_SIZE
#undef FEATURE_EEPROM_SIZE
#endif
#define FEATURE_EEPROM_SIZE (0x800)

#ifdef FEATURE_CAN_FD_INSTANCE_NUM
#undef FEATURE_CAN_FD_INSTANCE_NUM
#endif
#define FEATURE_CAN_FD_INSTANCE_NUM (1)

#ifdef FEATURE_CAN_2_0_INSTANCE_NUM
#undef FEATURE_CAN_2_0_INSTANCE_NUM
#endif
#define FEATURE_CAN_2_0_INSTANCE_NUM (0)

#ifdef FEATURE_CAPSENSOR_CH_NUM
#undef FEATURE_CAPSENSOR_CH_NUM
#endif
#define FEATURE_CAPSENSOR_CH_NUM (19)

#ifdef FEATURE_ADC_SWTRG_ON
#undef FEATURE_ADC_SWTRG_ON
#endif
#define FEATURE_ADC_SWTRG_ON (1)

#ifdef FEATURE_PIN_DRVSTR_ON
#undef FEATURE_PIN_DRVSTR_ON
#endif
#define FEATURE_PIN_DRVSTR_ON (1)

#ifdef FEATURE_PIN_SR_ON
#undef FEATURE_PIN_SR_ON
#endif
#define FEATURE_PIN_SR_ON (1)

#elif defined(MCU_CVM0128TVLF) || defined(MCU_CVM0128VVLF)

#ifdef FEATURE_PFLASH_SIZE
#undef FEATURE_PFLASH_SIZE
#endif
#define FEATURE_PFLASH_SIZE (0x38000)

#ifdef FEATURE_RAM_SIZE
#undef FEATURE_RAM_SIZE
#endif
#define FEATURE_RAM_SIZE (0x4000)

#ifdef FEATURE_DFLASH_SIZE
#undef FEATURE_DFLASH_SIZE
#endif
#define FEATURE_DFLASH_SIZE (0x8000)

#ifdef FEATURE_EEPROM_SIZE
#undef FEATURE_EEPROM_SIZE
#endif
#define FEATURE_EEPROM_SIZE (0x800)

#ifdef FEATURE_CAN_FD_INSTANCE_NUM
#undef FEATURE_CAN_FD_INSTANCE_NUM
#endif
#define FEATURE_CAN_FD_INSTANCE_NUM (0)

#ifdef FEATURE_CAN_2_0_INSTANCE_NUM
#undef FEATURE_CAN_2_0_INSTANCE_NUM
#endif
#define FEATURE_CAN_2_0_INSTANCE_NUM (1)

#ifdef FEATURE_CAPSENSOR_CH_NUM
#undef FEATURE_CAPSENSOR_CH_NUM
#endif
#define FEATURE_CAPSENSOR_CH_NUM (30)

#ifdef FEATURE_ADC_SWTRG_ON
#undef FEATURE_ADC_SWTRG_ON
#endif
#define FEATURE_ADC_SWTRG_ON (1)

#ifdef FEATURE_PIN_DRVSTR_ON
#undef FEATURE_PIN_DRVSTR_ON
#endif
#define FEATURE_PIN_DRVSTR_ON (1)

#ifdef FEATURE_PIN_SR_ON
#undef FEATURE_PIN_SR_ON
#endif
#define FEATURE_PIN_SR_ON (1)

#elif defined(MCU_CVM0128TVFM) || defined(MCU_CVM0128VVFM)

#ifdef FEATURE_PFLASH_SIZE
#undef FEATURE_PFLASH_SIZE
#endif
#define FEATURE_PFLASH_SIZE (0x38000)

#ifdef FEATURE_RAM_SIZE
#undef FEATURE_RAM_SIZE
#endif
#define FEATURE_RAM_SIZE (0x4000)

#ifdef FEATURE_DFLASH_SIZE
#undef FEATURE_DFLASH_SIZE
#endif
#define FEATURE_DFLASH_SIZE (0x8000)

#ifdef FEATURE_EEPROM_SIZE
#undef FEATURE_EEPROM_SIZE
#endif
#define FEATURE_EEPROM_SIZE (0x800)

#ifdef FEATURE_CAN_FD_INSTANCE_NUM
#undef FEATURE_CAN_FD_INSTANCE_NUM
#endif
#define FEATURE_CAN_FD_INSTANCE_NUM (0)

#ifdef FEATURE_CAN_2_0_INSTANCE_NUM
#undef FEATURE_CAN_2_0_INSTANCE_NUM
#endif
#define FEATURE_CAN_2_0_INSTANCE_NUM (1)

#ifdef FEATURE_CAPSENSOR_CH_NUM
#undef FEATURE_CAPSENSOR_CH_NUM
#endif
#define FEATURE_CAPSENSOR_CH_NUM (19)

#ifdef FEATURE_ADC_SWTRG_ON
#undef FEATURE_ADC_SWTRG_ON
#endif
#define FEATURE_ADC_SWTRG_ON (1)

#ifdef FEATURE_PIN_DRVSTR_ON
#undef FEATURE_PIN_DRVSTR_ON
#endif
#define FEATURE_PIN_DRVSTR_ON (1)

#ifdef FEATURE_PIN_SR_ON
#undef FEATURE_PIN_SR_ON
#endif
#define FEATURE_PIN_SR_ON (1)

#elif defined(MCU_CVM0126TVFM) || defined(MCU_CVM0126VVFM)

#ifdef FEATURE_PFLASH_SIZE
#undef FEATURE_PFLASH_SIZE
#endif
#define FEATURE_PFLASH_SIZE (0x20000)

#ifdef FEATURE_RAM_SIZE
#undef FEATURE_RAM_SIZE
#endif
#define FEATURE_RAM_SIZE (0x2000)

#ifdef FEATURE_DFLASH_SIZE
#undef FEATURE_DFLASH_SIZE
#endif
#define FEATURE_DFLASH_SIZE (0x8000)

#ifdef FEATURE_EEPROM_SIZE
#undef FEATURE_EEPROM_SIZE
#endif
#define FEATURE_EEPROM_SIZE (0x800)

#ifdef FEATURE_CAN_FD_INSTANCE_NUM
#undef FEATURE_CAN_FD_INSTANCE_NUM
#endif
#define FEATURE_CAN_FD_INSTANCE_NUM (0)

#ifdef FEATURE_CAN_2_0_INSTANCE_NUM
#undef FEATURE_CAN_2_0_INSTANCE_NUM
#endif
#define FEATURE_CAN_2_0_INSTANCE_NUM (1)

#ifdef FEATURE_CAPSENSOR_CH_NUM
#undef FEATURE_CAPSENSOR_CH_NUM
#endif
#define FEATURE_CAPSENSOR_CH_NUM (19)

#ifdef FEATURE_ADC_SWTRG_ON
#undef FEATURE_ADC_SWTRG_ON
#endif
#define FEATURE_ADC_SWTRG_ON (1)

#ifdef FEATURE_PIN_DRVSTR_ON
#undef FEATURE_PIN_DRVSTR_ON
#endif
#define FEATURE_PIN_DRVSTR_ON (1)

#ifdef FEATURE_PIN_SR_ON
#undef FEATURE_PIN_SR_ON
#endif
#define FEATURE_PIN_SR_ON (1)

#elif defined(MCU_CVM0128SVLF) || defined(MCU_CVM0128RVLF)

#ifdef FEATURE_PFLASH_SIZE
#undef FEATURE_PFLASH_SIZE
#endif
#define FEATURE_PFLASH_SIZE (0x38000)

#ifdef FEATURE_RAM_SIZE
#undef FEATURE_RAM_SIZE
#endif
#define FEATURE_RAM_SIZE (0x4000)

#ifdef FEATURE_DFLASH_SIZE
#undef FEATURE_DFLASH_SIZE
#endif
#define FEATURE_DFLASH_SIZE (0x8000)

#ifdef FEATURE_EEPROM_SIZE
#undef FEATURE_EEPROM_SIZE
#endif
#define FEATURE_EEPROM_SIZE (0x800)

#ifdef FEATURE_CAN_FD_INSTANCE_NUM
#undef FEATURE_CAN_FD_INSTANCE_NUM
#endif
#define FEATURE_CAN_FD_INSTANCE_NUM (0)

#ifdef FEATURE_CAN_2_0_INSTANCE_NUM
#undef FEATURE_CAN_2_0_INSTANCE_NUM
#endif
#define FEATURE_CAN_2_0_INSTANCE_NUM (1)

#ifdef FEATURE_CAPSENSOR_CH_NUM
#undef FEATURE_CAPSENSOR_CH_NUM
#endif
#define FEATURE_CAPSENSOR_CH_NUM (30)

#ifdef FEATURE_ADC_SWTRG_ON
#undef FEATURE_ADC_SWTRG_ON
#endif
#define FEATURE_ADC_SWTRG_ON (0)

#ifdef FEATURE_PIN_DRVSTR_ON
#undef FEATURE_PIN_DRVSTR_ON
#endif
#define FEATURE_PIN_DRVSTR_ON (0)

#ifdef FEATURE_PIN_SR_ON
#undef FEATURE_PIN_SR_ON
#endif
#define FEATURE_PIN_SR_ON (0)

#elif defined(MCU_CVM0126SVFM) || defined(MCU_CVM0126RVFM) || defined(MCU_CVM0126QVFM)

#ifdef FEATURE_PFLASH_SIZE
#undef FEATURE_PFLASH_SIZE
#endif
#define FEATURE_PFLASH_SIZE (0x20000)

#ifdef FEATURE_RAM_SIZE
#undef FEATURE_RAM_SIZE
#endif
#define FEATURE_RAM_SIZE (0x2000)

#ifdef FEATURE_DFLASH_SIZE
#undef FEATURE_DFLASH_SIZE
#endif
#define FEATURE_DFLASH_SIZE (0x8000)

#ifdef FEATURE_EEPROM_SIZE
#undef FEATURE_EEPROM_SIZE
#endif
#define FEATURE_EEPROM_SIZE (0x800)

#ifdef FEATURE_CAN_FD_INSTANCE_NUM
#undef FEATURE_CAN_FD_INSTANCE_NUM
#endif
#define FEATURE_CAN_FD_INSTANCE_NUM (0)

#ifdef FEATURE_CAN_2_0_INSTANCE_NUM
#undef FEATURE_CAN_2_0_INSTANCE_NUM
#endif
#define FEATURE_CAN_2_0_INSTANCE_NUM (1)

#ifdef FEATURE_CAPSENSOR_CH_NUM
#undef FEATURE_CAPSENSOR_CH_NUM
#endif
#define FEATURE_CAPSENSOR_CH_NUM (19)

#ifdef FEATURE_ADC_SWTRG_ON
#undef FEATURE_ADC_SWTRG_ON
#endif
#define FEATURE_ADC_SWTRG_ON (0)

#ifdef FEATURE_PIN_DRVSTR_ON
#undef FEATURE_PIN_DRVSTR_ON
#endif
#define FEATURE_PIN_DRVSTR_ON (0)

#ifdef FEATURE_PIN_SR_ON
#undef FEATURE_PIN_SR_ON
#endif
#define FEATURE_PIN_SR_ON (0)

#else
#error "No correct chip defined"
#endif

/*******************************************************************************
 * the typedefs
 ******************************************************************************/

/*******************************************************************************
 * the globals
 ******************************************************************************/

/*******************************************************************************
 * the function prototypes
 ******************************************************************************/

#ifdef __cplusplus
}
#endif /* extern "C" */

#endif /* _CVM012X_FEATURES_H_ */
