/* ** Copyright 2023 Tjitte van der Ploeg, tjitte@tpee.nl ** ** This file is part of the OpenBoost firmware. ** The Open-SEC firmware is free software: you can redistribute ** it and/or modify it under the terms of the GNU General Public License ** as published by the Free Software Foundation, either version 3 of the ** License, or (at your option) any later version. The Open-SEC firmware is ** distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; ** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A ** PARTICULAR PURPOSE. See the GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License along ** with this program. If not, see . */ #ifndef HARDWARE_HW_SECB808B_H_ #define HARDWARE_HW_SECB808B_H_ #ifdef HW_SECB808B #ifndef HW_NAME #define HW_NAME "SEC-B80-8B" #endif //#define HW_TOPOLOGY_BOOST #define HW_HAS_IOUT_SENSOR #define HW_HAS_UART //#define HW_HAS_USB #define HW_HASID #define HSEN #define HW_ADCREF 2900.0f //Filters #define VOLTAGE_IN_FORGETING_FACTOR 0.5f #define VOLTAGE_OUT_FORGETING_FACTOR 0.5f #define CURRENT_IN_FORGETING_FACTOR 0.0f #define CURRENT_PV_FORGETING_FACTOR 0.75f #define TEMP_FORGETING_FACTOR 0.95f //Limits #define HW_LIMIT_HS_VOLTAGE_HARD 85000 #define HW_LIMIT_LS_VOLTAGE_HARD 85000 #define HW_LIMIT_HS_CURRENT_HARD 12000 #define HW_LIMIT_LS_CURRENT_HARD 12000 #define HW_MAX_CURRENT_SETTING 8500.0f #define HW_LIMIT_LS_VOLTAGE_SOFT_MIN 2000.0f #define HW_LIMIT_LS_CURRENT_SOFT_MIN 0.0f #define HW_LIMIT_HS_VOLTAGE_SOFT_MIN 10000.0f #define HW_LIMIT_HS_CURRENT_SOFT_MIN 0.0f #define HW_SWITCHINGFREQUENCY 188 #define HW_ADC_DELAY 1.5f #define HW_DEADTIMERISING 10 #define HW_DEADTIMEFALLING 10 #define HW_L 33e-6f #define HW_CLOW 119e-6f #define HW_CHIGH 224e-6f #define HW_RLINT 5e-3f #define HW_Q 0.8f #ifdef HW_TOPOLOGY_BOOST #define HW_KLIM 0.9f #define HW_KLIM_VOUT 0.4f #elif defined HW_TOPOLOGY_BUCK #define HW_KLIM 0.9f #define HW_KLIM_VOUT 0.4f //#define CURRENT_IN_FORGETING_FACTOR 0.75f #endif #define HW_IOUT_MAXDUTY 0.7f #define HW_CONTROLLERFREQUENCY 20 #define HW_delay 30e-6f #define HW_IOUT_EN_HYST 800 //mA #ifdef SIMULATION #define HW_delay 0.0f #endif #define HW_TIMERINDEX HRTIM_TIMERINDEX_TIMER_B #define HW_HRTIM_ADCTRIGGER HRTIM_ADCTRIGGEREVENT13_TIMERB_CMP3 //Pinout #define LED0_Pin GPIO_PIN_14 #define LED0_GPIO_Port GPIOC #define LED1_Pin GPIO_PIN_15 #define LED1_GPIO_Port GPIOC #define LED2_Pin GPIO_PIN_13 #define LED2_GPIO_Port GPIOC #define LED3_Pin GPIO_PIN_9 #define LED3_GPIO_Port GPIOB #define ID0_Pin GPIO_PIN_4 #define ID0_GPIO_Port GPIOC #define ID1_Pin GPIO_PIN_0 #define ID1_GPIO_Port GPIOB #define ID2_Pin GPIO_PIN_1 #define ID2_GPIO_Port GPIOB #define ID3_Pin GPIO_PIN_2 #define ID3_GPIO_Port GPIOB #define VLS_Pin GPIO_PIN_1 #define VLS_GPIO_Port GPIOA #define IHS__Pin GPIO_PIN_2 #define IHS__GPIO_Port GPIOA #define IHS_A3_Pin GPIO_PIN_3 #define IHS_A3_GPIO_Port GPIOA #define VHS_Pin GPIO_PIN_7 #define VHS_GPIO_Port GPIOA #define ILS__Pin GPIO_PIN_14 #define ILS__GPIO_Port GPIOB #define ILS_B15_Pin GPIO_PIN_15 #define ILS_B15_GPIO_Port GPIOB #define Tamb_Pin GPIO_PIN_8 #define Tamb_GPIO_Port GPIOA #define Tsink_Pin GPIO_PIN_9 #define Tsink_GPIO_Port GPIOA #define P2_PWM_LS_Pin GPIO_PIN_10 #define P2_PWM_LS_GPIO_Port GPIOA #define P2_EN_HS_Pin GPIO_PIN_11 #define P2_EN_HS_GPIO_Port GPIOA #define PHSEN_Pin GPIO_PIN_12 #define PHSEN_GPIO_Port GPIOA #define PEN_Pin GPIO_PIN_15 #define PEN_GPIO_Port GPIOA #define DREN_Pin GPIO_PIN_4 #define DREN_GPIO_Port GPIOB #define VDRVPG_Pin GPIO_PIN_7 #define VDRVPG_GPIO_Port GPIOB #define RST_Pin GPIO_PIN_10 #define RST_GPIO_Port GPIOG #define BOOT0_Pin GPIO_PIN_8 #define BOOT0_GPIO_Port GPIOB #endif #endif /* HARDWARE_HW_OPENBOOST_H_ */