//***************************************************************************** // (C) Automotive Lighting Reutlingen GmbH // Tuebinger Strasse 123, 72762 Reutlingen, Germany // // Automotive Lighting Reutlingen GmbH owns all the rights to this work. // This work shall not be copied, reproduced, used, modified, transferred // or its information shall not be disclosed without the prior written // authorization of Automotive Lighting Reutlingen GmbH. //***************************************************************************** //----------------------------------------------------------------------------- /// \file CddTle94x1_Cfg.h /// /// \brief API for CddTle94x1 /// /// \author ZHAO, Kai ALDE-RT/EES6 /// //----------------------------------------------------------------------------- #ifndef CDD_TLE94X1_CFG_2021_03_08_H_ #define CDD_TLE94X1_CFG_2021_03_08_H_ //============================================================================= // preprocessor definitions //============================================================================= //============================================================================= // includes //============================================================================= //============================================================================= // definitions //============================================================================= //=============================================================== // CAN CONFIGURATION //=============================================================== #define CDD_SBC_CAN_CHANNEL_0_INIT_CFG CDD_TLE94X1_CAN_NORMAL #define CAN_CH0 0u // only CAN0 is used //=============================================================== // SEQUENCE ERROR CONFIGURATION //=============================================================== // The error will be reported if the SPI Cyclic communication // fails multiple 500 times in a row. // // The SPI cyclic is called every 1ms => 500ms SPI timeout //=============================================================== #define CDD_SBC_CFG_MAX_CYCLIC_SEQ_ERRORS 500u #define CDD_SBC_CFG_MAX_READ_ATTEMPTS 10u #define CDD_SBC_CFG_MAX_WRITE_ATTEMPTS 10u #define CDD_SBC_CFG_MAX_SPI_SCHED_QUEUE 20u #define CDDSPI_STATE_RESET 0x00U #define CDDSPI_STATE_SINGLE_OPERATION 0x01U #define CDDSPI_STATE_CYCLIC_OPERATION 0x02U //=============================================================== // WAIT INTERVAL CONFIGURATION //=============================================================== // The number of cycles to wait before reporting errors. // NOTE: The device should enter sleep/stp mode before the timer expires // // 9000 cycles corresponds to 0.01 [ms] //=============================================================== #define CDD_TLE94X1_SLEEP_WAITCNT 9000u //TBD #define CDD_TLE94X1_STOP_WAITCNT 9000u //TBD // Commands #define CDD_TLE94X1_WRITE_CMD 0x80u #define CDD_TLE94X1_READ_CMD 0x00u // Default messages #define CDD_TLE94X1_CLEAR_ALL 0x00u // Masks #define CDD_TLE94X1_STATUS_INFORMATION_FIELD 0x000000FFu #define CDD_TLE94X1_RECEIVED_DATA 0xFFFFu #define CDD_TLE94X1_ADDRESS_FIELD 0x7Fu // Errors #define ERROR_ON 1u #define NO_ERROR 0u #define CDD_TLE94X1_ERROR 0xFFFFu #ifndef ERR_DISABLED #define ERR_DISABLED 255U #endif /*ERR_DISABLED*/ #ifndef ERR_SNA #define ERR_SNA 0U #endif /*ERR_SNA*/ #ifndef ERR_NO #define ERR_NO 2U #endif /*ERR_NO*/ #ifndef ERR_YES #define ERR_YES 1U #endif /*ERR_YES*/ #ifndef NotAvailable #define NotAvailable 253U #endif /*NotAvailable*/ #define OTHER_RESET 255U #define ERROR_ACTIVE 0x5A01 //============================================================================= // types //============================================================================= //============================================================================= // global variable //============================================================================= //============================================================================= // inline functions //============================================================================= //============================================================================= //Intern prototypes //============================================================================= /******************************************************************************/ /* Prototypes */ /******************************************************************************/ #endif // EOF CDD_TLE94X1_CFG_021_03_08_H_