//***************************************************************************** // (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 CddCPSQ5352.h /// /// \brief API for CddCPSQ5352 /// /// \author OTT, Peter ALDE-RT/EES6 //----------------------------------------------------------------------------- #ifndef CDD_CPSQ5352_2021_01_21_H_ #define CDD_CPSQ5352_2021_01_21_H_ //----------------------------------------------------------------------------- // Includes //----------------------------------------------------------------------------- #include //----------------------------------------------------------------------------- // version //----------------------------------------------------------------------------- #define CDDCPSQ5352_VERSION_MAJOR 1 #define CDDCPSQ5352_VERSION_MINOR 3 #define CDDCPSQ5352_VERSION_PATCH 1 //----------------------------------------------------------------------------- // release notes //----------------------------------------------------------------------------- // 1.3.1 Bugfix for pseudo open load errors after repairing open load conditions // 1.3.0 Bugfix for pseudo open load and short to GND errors // 1.2.0 MPU support // 1.1.0 Averaging of analog values // Full implementation of CddCPSQ5352_aboMultiLed // 1.0.0 Add support for VLED_OFF, BUCK_EN // Switch off BUCK_EN depending on LED voltage // Add dummy functions to read back duty cycle and current // Modify function interface // Optimize current calculation // Check if status from driver is valid // Add voltage check for open load // Add check of target PWM for voltage evaluation // 0.0.2 Add function CddCPSQ5352_SpiGetConfig() // 0.0.1 Change schedule table to leave standalone mode at startup // 0.0.0 Initial version based on FLM3 implementation //----------------------------------------------------------------------------- // open issues //----------------------------------------------------------------------------- // Value of EFT parameter AssignedOutput is not used --> not planned // Value of EFT parameter Pmax and Imin are not used --> not planned // Buck driver #0 must be present --> to do // SPI fault handling --> to do // Implement functions for actual current/duty --> to do //----------------------------------------------------------------------------- // Defines //----------------------------------------------------------------------------- #define CDDCPSQ5352_VoltageSna 65535u // used if voltage value is not available #define CDDCPSQ5352_Cfg_MaxNbOfDevices 7 //max number of channel by CPSQ5352 device #define CDDCPSQ5352_Cfg_NbOfDevices 6u //Factor number of channel by CPSQ5352 device #define CDDCPSQ5352_NbOfChannel 2u //Number of channel by CPSQ5352 device #define CDDCPSQ5352_CFG_NO_OF_CHANNELS (CDDCPSQ5352_Cfg_NbOfDevices * CDDCPSQ5352_NbOfChannel) //----------------------------------------------------------------------------- // Start declaration or definitions of functions //----------------------------------------------------------------------------- #define ctadCddLed_START_SEC_CODE #include <../Cfg/CddCPSQ5352_MemMap.h> uint32 CddCPSQ5352_Init(void); void CddCPSQ5352_Cycle20ms(void); void CddCPSQ5352_SetCurrent_mA (const uint32 ulChnIdx, const uint16 unCurrent); void CddCPSQ5352_SetDutyCycle_1_32768 (const uint32 ulChnIdx, const uint16 unDuty); uint16 CddCPSQ5352_GetCurrent_mA (const uint32 ulChnIdx); uint16 CddCPSQ5352_GetDutyCycle_1_32768 (const uint32 ulChnIdx); uint16 CddCPSQ5352_GetInputVoltage_mV (const uint32 ulChnIdx); uint16 CddCPSQ5352_GetLedVoltage_mV (const uint32 ulChnIdx); uint16 CddCPSQ5352_GetLedVoltOnOff_mV (const uint32 ulChnIdx); boolean CddCPSQ5352_IsDriverActive (const uint32 ulChnIdx); boolean CddCPSQ5352_IsShortToGnd (const uint32 ulChnIdx); boolean CddCPSQ5352_IsOpenLoad (const uint32 ulChnIdx); boolean CddCPSQ5352_IsOvercurrent (const uint32 ulChnIdx); boolean CddCPSQ5352_IsThermalShutDown (const uint32 ulChnIdx); boolean CddCPSQ5352_IsThermalWarning (const uint32 ulChnIdx); #define ctadCddLed_STOP_SEC_CODE #include <../Cfg/CddCPSQ5352_MemMap.h> //----------------------------------------------------------------------------- // End declaration or definitions of functions //----------------------------------------------------------------------------- #endif // CDD_CPSQ5352_2021_01_21_H_