//***************************************************************************** // (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 CddBoost.h /// /// \brief API for CddBoost /// /// \author OTT, Peter ALDE-RT/EES6 //----------------------------------------------------------------------------- #ifndef CDD_BOOST_2021_03_03_H_ #define CDD_BOOST_2021_03_03_H_ //----------------------------------------------------------------------------- // includes //----------------------------------------------------------------------------- #include #include <../Cfg/CddBoost_Cfg.h> //----------------------------------------------------------------------------- // version //----------------------------------------------------------------------------- #define CDDBOOST_VERSION_MAJOR 1 #define CDDBOOST_VERSION_MINOR 0 #define CDDBOOST_VERSION_PATCH 0 //----------------------------------------------------------------------------- // release notes //----------------------------------------------------------------------------- // 1.0.0 MPU support // 0.2.0 Initial version based on FLM3 implementation //----------------------------------------------------------------------------- // types //----------------------------------------------------------------------------- // error status // not supported due to EFT data #define eCddBoost_NoSupport 0 // still in "reset" state #define eCddBoost_Reset 1 // normal operation, no test #define eCddBoost_DiagIdle 2 // normal operation #define eCddBoost_StatusOk 3 // voltage below threshold #define eCddBoost_ErrVoltLo 4 // voltage above threshold #define eCddBoost_ErrVoltHi 5 // thermal shutdown #define eCddBoost_ErrThermShutdn 6 // SPI error #define eCddBoost_ErrSpi 7 // CRC error #define eCddBoost_ErrCrc 8 typedef enum { eCddBoostNoSupport = eCddBoost_NoSupport, // not supported due to EFT data eCddBoostReset = eCddBoost_Reset, // still in "reset" state eCddBoostDiagIdle = eCddBoost_DiagIdle, // normal operation, no test eCddBoostStatusOk = eCddBoost_StatusOk, // normal operation eCddBoostErrVoltLo = eCddBoost_ErrVoltLo, // voltage below threshold eCddBoostErrVoltHi = eCddBoost_ErrVoltHi, // voltage above threshold eCddBoostErrThermShutdn = eCddBoost_ErrThermShutdn, // thermal shutdown eCddBoostErrSpi = eCddBoost_ErrSpi, // SPI error } tCddBoostErrStatus; // full status (all channels) typedef struct { tCddBoostErrStatus aStatus[CDDBOOST_Cfg_NbOfChannels]; uint8 ucCrc; } tCddBoostStatus; // target values typedef struct { uint16 aunBoostVolt_mV[CDDBOOST_Cfg_NbOfChannels]; uint8 ucCrc; } tCddBoostTarget; // parameter typedef struct { uint16 unPara1; uint16 unPara2; }tCddBoostPara; //----------------------------------------------------------------------------- // Start declaration or definitions of functions //----------------------------------------------------------------------------- #define ctadCddBoost_START_SEC_CODE #include <../Cfg/CddBoost_MemMap.h> void CddBoost_Init(void); void CddBoost_SetPara(tCddBoostPara* pPara); void CddBoost_Cycle20ms(void); void CddBoost_SetTarget(tCddBoostTarget* pTarget); void CddBoost_GetStatus(tCddBoostStatus* pStatus); void CddBoost_Shutdown(void); void CddBoost_SpiRx(const uint16 unIx, const uint32 ulData); uint32 CddBoost_SpiTx(const uint16 unIx); void CddBoost_IOInit(void); #define ctadCddBoost_STOP_SEC_CODE #include <../Cfg/CddBoost_MemMap.h> //----------------------------------------------------------------------------- // End declaration or definitions of functions //----------------------------------------------------------------------------- #endif // CDD_BOOST_2021_03_03_H_