diff --git a/.gitignore b/.gitignore index 55791c2..8348e86 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,23 @@ +# Ignore list for Atmel studio files +# Hidden folder +.vs/ + +#Build Directories +Debug/ +Release/ + +#Build Results +*.o +*.d +*.eep +*.elf +*.hex +*.map +*.srec + +#User Specific Files +*.atsuo + # Ignore list for Altium temp files History/ __Previews/ @@ -9,3 +29,4 @@ Project Logs for* # Ignore list for Generated output files *.step OUTPUTS/ + diff --git a/docs/MCU_Pinout.pdf b/docs/MCU_Pinout.pdf new file mode 100644 index 0000000..263e5e9 Binary files /dev/null and b/docs/MCU_Pinout.pdf differ diff --git a/docs/MCU_Pinout.xlsx b/docs/MCU_Pinout.xlsx new file mode 100644 index 0000000..0b03bd9 Binary files /dev/null and b/docs/MCU_Pinout.xlsx differ diff --git a/docs/atmega328PB_datasheet.pdf b/docs/atmega328PB_datasheet.pdf new file mode 100644 index 0000000..b7dc5cb Binary files /dev/null and b/docs/atmega328PB_datasheet.pdf differ diff --git a/end plates/End-plate-75mm.PcbDoc b/enclosure/end plates/End-plate-75mm.PcbDoc similarity index 100% rename from end plates/End-plate-75mm.PcbDoc rename to enclosure/end plates/End-plate-75mm.PcbDoc diff --git a/end plates/End-plate-ampseal23-75mm.PcbDoc b/enclosure/end plates/End-plate-ampseal23-75mm.PcbDoc similarity index 100% rename from end plates/End-plate-ampseal23-75mm.PcbDoc rename to enclosure/end plates/End-plate-ampseal23-75mm.PcbDoc diff --git a/firmware/src/hw/analog.c b/firmware/src/hw/analog.c new file mode 100644 index 0000000..8f8a291 --- /dev/null +++ b/firmware/src/hw/analog.c @@ -0,0 +1,45 @@ +/**** Includes ****/ +#include "board/utils/utils.h" +#include "board/ain.h" +#include "analog.h" + +/**** Private definitions ****/ +/**** Private constants ****/ +/**** Private variables ****/ +/**** Private function declarations ****/ +static uint8_t ain_mapping(uint8_t analog_ch, uint8_t* ain_ch); + +/**** Public function definitions ****/ +uint16_t analog_ch_get(uint8_t analog_ch) +{ + uint8_t ain_ch; + // Get channel config + if(ain_mapping(analog_ch, &ain_ch)) return 0; + + // Read input as mV + uint16_t ch_mv = bsp_ain_read(ain_ch); + + // Return result + return ch_mv; +} + +/**** Private function definitions ****/ +static uint8_t ain_mapping(uint8_t analog_ch, uint8_t* ain_ch) +{ + switch(analog_ch) + { + case ANALOG_1: // Pot + *ain_ch = BSP_AIN2; + return 0; + + case ANALOG_2: // Mode + *ain_ch = BSP_AIN1; + return 0; + + default: //Invalid channel + *ain_ch = BSP_AIN5; + return 1; + } + + return 1; +} diff --git a/firmware/src/hw/analog.h b/firmware/src/hw/analog.h new file mode 100644 index 0000000..c09021b --- /dev/null +++ b/firmware/src/hw/analog.h @@ -0,0 +1,20 @@ +#ifndef ANALOG_H_ +#define ANALOG_H_ + +/* +*/ + +/**** Includes ****/ +#include + +/**** Public definitions ****/ +#define ANALOG_1 1 //Potentiometer +#define ANALOG_2 2 //Mode + +/**** Public function declarations ****/ +uint16_t analog_ch_get(uint8_t analog_ch); + +#ifdef TESTING +#endif + +#endif /* ANALOG_H_ */ \ No newline at end of file diff --git a/firmware/src/hw/board/ain.c b/firmware/src/hw/board/ain.c new file mode 100644 index 0000000..a7c6230 --- /dev/null +++ b/firmware/src/hw/board/ain.c @@ -0,0 +1,77 @@ +/**** Includes ****/ +#include "utils/utils.h" +#include "mcu/mcu_hal.h" +#include "ain.h" + +/**** Private definitions ****/ +typedef struct { + uint8_t adc_ch; + uint8_t mul; + uint8_t div; + int16_t offset; +} ainchcfg_t; + +/**** Private constants ****/ +static const uint8_t MV_MUL = BSP_AIN_DEF_MV_MUL; +static const uint8_t MV_DIV = BSP_AIN_DEF_MV_DIV; +static const int16_t MV_OFFSET = BSP_AIN_DEF_MV_OFFSET; + +/**** Private variables ****/ + +/**** Private function declarations ****/ +static uint8_t ain_mapping(uint8_t ain_ch, ainchcfg_t* ain_ch_cfg); + +/**** Public function definitions ****/ +uint16_t bsp_ain_read(uint8_t ch) +{ + ainchcfg_t cfg; + // Get analog input config, and check validity + if(ain_mapping(ch, &cfg)) return 0; + + //Read ADC + uint16_t raw = mcu_adc_read(cfg.adc_ch); + + //Convert to mV + raw = util_convert_muldivoff(raw, cfg.mul, cfg.div, cfg.offset); + + // Return result + return raw; +} + +/**** Private function definitions ****/ +static uint8_t ain_mapping(uint8_t ain_ch, ainchcfg_t* ain_ch_cfg) +{ + // Default 10bit ADC with 5V reference to mV conversion + ain_ch_cfg->mul = MV_MUL; + ain_ch_cfg->div = MV_DIV; + ain_ch_cfg->offset = MV_OFFSET; + + switch(ain_ch) + { + case BSP_AIN1: // Mode + ain_ch_cfg->adc_ch = MCU_ADC5; + return 0; + + case BSP_AIN2: // Pot + ain_ch_cfg->adc_ch = MCU_ADC4; + return 0;; + + case BSP_AIN3: // MCU Temp + ain_ch_cfg->adc_ch = MCU_ADC8; + return 0; + + case BSP_AIN4: // MCU Internal reference + ain_ch_cfg->adc_ch = MCU_ADC14; + return 0; + + case BSP_AIN5: // MCU Ground + ain_ch_cfg->adc_ch = MCU_ADC15; + return 0; + + default: // Invalid channel + ain_ch_cfg->adc_ch = MCU_ADC15; + return 1; + } + + return 1; +} diff --git a/firmware/src/hw/board/ain.h b/firmware/src/hw/board/ain.h new file mode 100644 index 0000000..a973f8c --- /dev/null +++ b/firmware/src/hw/board/ain.h @@ -0,0 +1,26 @@ +#ifndef AIN_H_ +#define AIN_H_ + +/* +AIN1 MODE +AIN2 POT +*/ + +/**** Includes ****/ +#include +#include "config.h" + +/**** Public definitions ****/ +#define BSP_AIN1 1 // Mode +#define BSP_AIN2 2 // Pot +#define BSP_AIN3 3 // MCU Temp +#define BSP_AIN4 4 // MCU Internal reference +#define BSP_AIN5 5 // MCU Ground + +/**** Public function declarations ****/ +uint16_t bsp_ain_read(uint8_t ch); + +#ifdef TESTING +#endif + +#endif /* AIN_H_ */ \ No newline at end of file diff --git a/firmware/src/hw/board/config.h b/firmware/src/hw/board/config.h new file mode 100644 index 0000000..851b087 --- /dev/null +++ b/firmware/src/hw/board/config.h @@ -0,0 +1,32 @@ +#ifndef BSP_CONFIG_H_ +#define BSP_CONFIG_H_ + +/**** Includes ****/ +#include + +/**** Public definitions ****/ +#define BSP_AIN_DEF_MV_MUL 215 +#define BSP_AIN_DEF_MV_DIV 44 +#define BSP_AIN_DEF_MV_OFFSET 0 + +#define BSP_HB_MV_MUL BSP_AIN_DEF_MV_MUL +#define BSP_HB_MV_DIV BSP_AIN_DEF_MV_DIV +#define BSP_HB_MV_OFFSET BSP_AIN_DEF_MV_OFFSET + +#define BSP_HB_UDIV_MUL 20 +#define BSP_HB_UDIV_DIV 1 +#define BSP_HB_UDIV_OFFSET 0 + +#define BSP_HB_ISUP_MUL 235 +#define BSP_HB_ISUP_DIV 6 +#define BSP_HB_ISUP_OFFSET 0 + +#define BSP_HB_IOUT_MUL 215 +#define BSP_HB_IOUT_DIV 22 +#define BSP_HB_IOUT_OFFSET 0 + +/**** Public function declarations ****/ +#ifdef TESTING +#endif + +#endif /* BSP_CONFIG_H_ */ \ No newline at end of file diff --git a/firmware/src/hw/board/din.c b/firmware/src/hw/board/din.c new file mode 100644 index 0000000..3476e11 --- /dev/null +++ b/firmware/src/hw/board/din.c @@ -0,0 +1,83 @@ +/**** Includes ****/ +#include "utils/utils.h" +#include "mcu/mcu_hal.h" +#include "din.h" + +/**** Private definitions ****/ +typedef struct { + uint8_t gpio_ch; + uint8_t invert; +} dinchcfg_t; + +/**** Private constants ****/ +/**** Private variables ****/ +/**** Private function declarations ****/ +static uint8_t din_mapping(uint8_t din_ch, dinchcfg_t* din_ch_cfg); + +/**** Public function definitions ****/ +uint8_t bsp_din_read(uint8_t ch) +{ + dinchcfg_t cfg; + // Get digital input config, and check validity + if(din_mapping(ch, &cfg)) return BSP_DIN_LOW; + + //Read GPIO + uint8_t raw = mcu_gpio_read(cfg.gpio_ch); + + // Check config and invert + if(cfg.invert) raw = util_invert_8b(raw); + + // Return result + return raw; +} + +/**** Private function definitions ***/ +static uint8_t din_mapping(uint8_t din_ch, dinchcfg_t* din_ch_cfg) +{ + // By default ch is not inverted + din_ch_cfg->invert = 0; + + switch(din_ch) + { + case BSP_DIN1: //Mode + din_ch_cfg->gpio_ch = MCU_GPIO0; + return 0; + + case BSP_DIN2: //Pot + din_ch_cfg->gpio_ch = MCU_GPIO1; + return 0; + + case BSP_DIN3: //Down + din_ch_cfg->gpio_ch = MCU_GPIO2; + return 0; + + case BSP_DIN4: //Up + din_ch_cfg->gpio_ch = MCU_GPIO3; + return 0; + + case BSP_DIN5: //Dimm + din_ch_cfg->gpio_ch = MCU_GPIO4; + din_ch_cfg->invert = 1; + return 0; + + case BSP_DIN6: //Brakes + din_ch_cfg->gpio_ch = MCU_GPIO5; + din_ch_cfg->invert = 1; + return 0; + + case BSP_DIN7: //Handbrake + din_ch_cfg->gpio_ch = MCU_GPIO6; + din_ch_cfg->invert = 1; + return 0; + + case BSP_DIN7N: //Handbrake pull + din_ch_cfg->gpio_ch = MCU_GPIO7; + return 0; + + default: //Invalid channel + din_ch_cfg->gpio_ch = 0; + return 1; + } + + return 1; +} diff --git a/firmware/src/hw/board/din.h b/firmware/src/hw/board/din.h new file mode 100644 index 0000000..6a74fe2 --- /dev/null +++ b/firmware/src/hw/board/din.h @@ -0,0 +1,37 @@ +#ifndef DIN_H_ +#define DIN_H_ + +/* +DIN1 MODE +DIN2 POT +DIN3 DOWN +DIN4 UP +DIN5 HV DIM +DIN6 HV BRAKES +DIN7 HV HANDBRAKE +DIN8 HBRAKE PULL +*/ + +/**** Includes ****/ +#include + +/**** Public definitions ****/ +#define BSP_DIN1 1 +#define BSP_DIN2 2 +#define BSP_DIN3 3 +#define BSP_DIN4 4 +#define BSP_DIN5 5 +#define BSP_DIN6 6 +#define BSP_DIN7 7 +#define BSP_DIN7N 8 + +#define BSP_DIN_LOW 0 +#define BSP_DIN_HIGH 1 + +/**** Public function declarations ****/ +uint8_t bsp_din_read(uint8_t ch); + +#ifdef TESTING +#endif + +#endif /* DIN_H_ */ \ No newline at end of file diff --git a/firmware/src/hw/board/dout.c b/firmware/src/hw/board/dout.c new file mode 100644 index 0000000..9a5214c --- /dev/null +++ b/firmware/src/hw/board/dout.c @@ -0,0 +1,58 @@ +/**** Includes ****/ +#include "utils/utils.h" +#include "mcu/mcu_hal.h" +#include "dout.h" + +/**** Private definitions ****/ +/**** Private constants ****/ +/**** Private variables ****/ +/**** Private function declarations ****/ +static uint8_t dout_mapping(uint8_t dout_ch, uint8_t* gpio_ch); + +/**** Public function definitions ****/ +void bsp_dout_write(uint8_t ch, int8_t lvl) +{ + uint8_t gpio_ch; + // Get digital input config, and check validity + if(dout_mapping(ch, &gpio_ch)) return; + + // Write GPIO + mcu_gpio_write(gpio_ch, lvl); +} + +/**** Private function definitions ***/ +static uint8_t dout_mapping(uint8_t dout_ch, uint8_t* gpio_ch) +{ + switch(dout_ch) + { + case BSP_DOUT1: //Mode + *gpio_ch = MCU_GPIO0; + return 0; + + case BSP_DOUT2: //Pot + *gpio_ch = MCU_GPIO1; + return 0; + + case BSP_DOUT3: //Down + *gpio_ch = MCU_GPIO2; + return 0; + + case BSP_DOUT4: //Up + *gpio_ch = MCU_GPIO3; + return 0; + + case BSP_DOUT5: //Handbrake pull + *gpio_ch = MCU_GPIO7; + return 0; + + case BSP_DOUT6: //Speed pull + *gpio_ch = MCU_GPIO8; + return 0; + + default: //Invalid channel + *gpio_ch = 0; + return 1; + } + + return 1; +} diff --git a/firmware/src/hw/board/dout.h b/firmware/src/hw/board/dout.h new file mode 100644 index 0000000..adbbef8 --- /dev/null +++ b/firmware/src/hw/board/dout.h @@ -0,0 +1,34 @@ +#ifndef DOUT_H_ +#define DOUT_H_ + +/* +DOUT1 MODE +DOUT2 POT +DOUT3 DOWN +DOUT4 UP +DOUT5 HBRAKE PULL +DOUT6 SPEED PULL +*/ + +/**** Includes ****/ +#include + +/**** Public definitions ****/ +#define BSP_DOUT1 1 +#define BSP_DOUT2 2 +#define BSP_DOUT3 3 +#define BSP_DOUT4 4 +#define BSP_DOUT5 5 +#define BSP_DOUT6 6 + +#define BSP_DOUT_LOW 0 +#define BSP_DOUT_HIGH 1 +#define BSP_DOUT_HIZ -1 + +/**** Public function declarations ****/ +void bsp_dout_write(uint8_t ch, int8_t lvl); + +#ifdef TESTING +#endif + +#endif /* DOUT_H_ */ \ No newline at end of file diff --git a/firmware/src/hw/board/halfbridge.c b/firmware/src/hw/board/halfbridge.c new file mode 100644 index 0000000..3789d03 --- /dev/null +++ b/firmware/src/hw/board/halfbridge.c @@ -0,0 +1,179 @@ +/**** Includes ****/ +#include "utils/utils.h" +#include "mcu/mcu_hal.h" +#include "halfbridge.h" + +/**** Private definitions ****/ +typedef struct { + uint8_t adc_ch; + uint8_t mul; + uint8_t div; + int16_t offset; +} ainchcfg_t; + +typedef enum { + AIN_OUT_VOLTAGE, + AIN_OUT_CURRENT, + AIN_SUP_VOLTAGE, + AIN_SUP_CURRENT +} hb_ainch_t; + +/**** Private constants ****/ +// Analog channels conversion coefficients +static const uint8_t MV_MUL = BSP_HB_MV_MUL; +static const uint8_t MV_DIV = BSP_HB_MV_DIV; +static const int16_t MV_OFFSET = BSP_HB_MV_OFFSET; + +static const uint8_t UDIV_MUL = BSP_HB_UDIV_MUL; +static const uint8_t UDIV_DIV = BSP_HB_UDIV_DIV; +static const int16_t UDIV_OFFSET = BSP_HB_UDIV_OFFSET; + +static const uint8_t ISUP_MUL = BSP_HB_ISUP_MUL; +static const uint8_t ISUP_DIV = BSP_HB_ISUP_DIV; +static const int16_t ISUP_OFFSET = BSP_HB_ISUP_OFFSET; + +static const uint8_t IOUT_MUL = BSP_HB_IOUT_MUL; +static const uint8_t IOUT_DIV = BSP_HB_IOUT_DIV; +static const int16_t IOUT_OFFSET = BSP_HB_IOUT_OFFSET; + +/**** Private variables ****/ + +/**** Mapping function declarations ****/ +static uint8_t hb_pwm_mapping(uint8_t* pwm_ch); +static uint8_t hb_low_side_mapping(uint8_t* gpio_ch); +static uint8_t hb_ain_mapping(hb_ainch_t ain_ch, ainchcfg_t* ain_ch_cfg); + +/**** Private function declarations ****/ +static uint16_t limit_pwm(uint16_t pwm_in); +static uint16_t read_ain(hb_ainch_t ch); + +/**** Public function definitions ****/ +void bsp_hb_write_low(uint8_t state) +{ + uint8_t gpio_ch; + // Get GPIO channel, and check validity + if(hb_low_side_mapping(&gpio_ch)) return; + + // Set low side on or off + if(state) mcu_gpio_write(gpio_ch, MCU_GPIO_HIGH); + else mcu_gpio_write(gpio_ch, MCU_GPIO_LOW); +} + +void bsp_hb_write_pwm(uint16_t pwm) +{ + uint8_t pwm_ch; + // Get PWM channel, and check validity + if(hb_pwm_mapping(&pwm_ch)) return; + + // Limit PWM, because of charge pump + pwm = limit_pwm(pwm); + + // Set pwm + mcu_pwm_write(pwm_ch, pwm); +} + +void bsp_hb_read_meas(hb_meas_t* measurements) +{ + // Read analog inputs + measurements->out_voltage = read_ain(AIN_OUT_VOLTAGE); + measurements->out_current = read_ain(AIN_OUT_CURRENT); + measurements->sup_voltage = read_ain(AIN_SUP_VOLTAGE); + measurements->sup_current = read_ain(AIN_SUP_CURRENT); + + // Calculate secondary measurements + measurements->out_power = util_sat_mul_kilo(measurements->out_voltage, measurements->out_current); + measurements->sup_power = util_sat_mul_kilo(measurements->sup_voltage, measurements->sup_current); + + measurements->out_impedance = util_sat_div_kilo(measurements->out_voltage, measurements->out_current); + + uint8_t ch; + //Read low side control GPIO level + if(hb_low_side_mapping(&ch)) measurements->low_side_ctrl = 0; + else measurements->low_side_ctrl = mcu_gpio_read(ch); + + //Read PWM duty cycle in 16b format + if(hb_pwm_mapping(&ch)) measurements->pwm = 0; + else measurements->pwm = mcu_pwm_read(ch); +} + +/**** Private function declarations ****/ +static uint16_t read_ain(hb_ainch_t ch) +{ + ainchcfg_t cfg; + // Get analog input config, and check validity + if(hb_ain_mapping(ch, &cfg)) return 0; + + //Read ADC + uint16_t raw = mcu_adc_read(cfg.adc_ch); + + //Convert to target units + raw = util_convert_muldivoff(raw, cfg.mul, cfg.div, cfg.offset); + + // Return result + return raw; +} + +static uint16_t limit_pwm(uint16_t pwm_in) +{ + // Limit to ~95% + if (pwm_in > 0xFC00) return 0xFC00; + else return pwm_in; +} + +/**** Mapping function definitions ****/ +static uint8_t hb_pwm_mapping(uint8_t* pwm_ch) +{ + *pwm_ch = MCU_PWM0; + return 0; +} + +static uint8_t hb_low_side_mapping(uint8_t* gpio_ch) +{ + *gpio_ch = MCU_GPIO15; + return 0; +} + +static uint8_t hb_ain_mapping(hb_ainch_t ain_ch, ainchcfg_t* ain_ch_cfg) +{ + switch(ain_ch) + { + case AIN_OUT_VOLTAGE: + ain_ch_cfg->adc_ch = MCU_ADC1; + ain_ch_cfg->mul = UDIV_MUL; + ain_ch_cfg->div = UDIV_DIV; + ain_ch_cfg->offset = UDIV_OFFSET; + return 0; + + case AIN_OUT_CURRENT: + ain_ch_cfg->adc_ch = MCU_ADC0; + ain_ch_cfg->mul = IOUT_MUL; + ain_ch_cfg->div = IOUT_DIV; + ain_ch_cfg->offset = IOUT_OFFSET; + return 0; + + case AIN_SUP_VOLTAGE: + ain_ch_cfg->adc_ch = MCU_ADC2; + ain_ch_cfg->mul = UDIV_MUL; + ain_ch_cfg->div = UDIV_DIV; + ain_ch_cfg->offset = UDIV_OFFSET; + return 0; + + case AIN_SUP_CURRENT: + ain_ch_cfg->adc_ch = MCU_ADC3; + ain_ch_cfg->mul = ISUP_MUL; + ain_ch_cfg->div = ISUP_DIV; + ain_ch_cfg->offset = ISUP_OFFSET; + return 0; + + default: //Invalid channel + ain_ch_cfg->adc_ch = MCU_ADC15; + // Default 10bit ADC with 5V reference to mV conversion + ain_ch_cfg->mul = MV_MUL; + ain_ch_cfg->div = MV_DIV; + ain_ch_cfg->offset = MV_OFFSET; + return 1; + } + + return 1; +} + diff --git a/firmware/src/hw/board/halfbridge.h b/firmware/src/hw/board/halfbridge.h new file mode 100644 index 0000000..bf5e1a7 --- /dev/null +++ b/firmware/src/hw/board/halfbridge.h @@ -0,0 +1,34 @@ +#ifndef HALFBRIDGE_H_ +#define HALFBRIDGE_H_ + +/* +*/ + +/**** Includes ****/ +#include +#include "config.h" + +/**** Public definitions ****/ +typedef struct { + uint16_t out_voltage; + uint16_t out_current; + uint16_t sup_voltage; + uint16_t sup_current; + uint16_t out_power; + uint16_t sup_power; + uint16_t out_impedance; + uint8_t low_side_ctrl; + uint16_t pwm; +} hb_meas_t; + +/**** Public function declarations ****/ +void bsp_hb_write_low(uint8_t state); +void bsp_hb_write_pwm(uint16_t pwm); + +// Feedback functions +void bsp_hb_read_meas(hb_meas_t* measurements); + +#ifdef TESTING +#endif + +#endif /* HALFBRIDGE_H_ */ diff --git a/firmware/src/hw/board/mcu/mcu_hal.h b/firmware/src/hw/board/mcu/mcu_hal.h new file mode 100644 index 0000000..010fad2 --- /dev/null +++ b/firmware/src/hw/board/mcu/mcu_hal.h @@ -0,0 +1,120 @@ +#ifndef MCU_HAL_H_ +#define MCU_HAL_H_ + +/**** Includes ****/ +#include + +/**** Public definitions ****/ +/* +GPIO0 Down +GPIO1 Up +GPIO2 Mode +GPIO3 Handbrake +GPIO4 Brakes +GPIO5 Dimm +GPIO6 LED0 +GPIO7 LED1 +GPIO8 LED2 +GPIO9 LED3 +GPIO10 LED4 +GPIO11 LED5 +GPIO12 DCCD Enable +GPIO13 Handbrake pull +GPIO14 Speed pull +GPIO15 DCCD PWM +GPIO16 LED PWM + +ADC0 Output current +ADC1 Output voltage +ADC2 Battery current +ADC3 Battery voltage +ADC4 Potentiometer +ADC5 Mode +ADC8 MCU temperature +ADC14 MCU internal reference +ADC15 MCU ground +*/ + +#define MCU_GPIO0 0 //Mode +#define MCU_GPIO1 1 //Pot +#define MCU_GPIO2 2 //Down +#define MCU_GPIO3 3 //Up +#define MCU_GPIO4 4 //Dimm +#define MCU_GPIO5 5 //Brakes +#define MCU_GPIO6 6 //Handbrake +#define MCU_GPIO7 7 //Handbrake pull +#define MCU_GPIO8 8 //Speed pull +#define MCU_GPIO9 9 //LED0 +#define MCU_GPIO10 10 //LED1 +#define MCU_GPIO11 11 //LED2 +#define MCU_GPIO12 12 //LED3 +#define MCU_GPIO13 13 //LED4 +#define MCU_GPIO14 14 //LED5 +#define MCU_GPIO15 15 //DCCD Enable +#define MCU_GPIO16 16 //DCCD PWM +#define MCU_GPIO17 17 //LED PWM + +#define MCU_GPIO_LOW 0 +#define MCU_GPIO_HIGH 1 +#define MCU_GPIO_HIZ -1 + +#define MCU_ADC0 0 //Output current +#define MCU_ADC1 1 //Output voltage +#define MCU_ADC2 2 //Battery voltage +#define MCU_ADC3 3 //Battery current +#define MCU_ADC4 4 //Potentiometer +#define MCU_ADC5 5 //Mode +#define MCU_ADC8 8 //MCU temperature +#define MCU_ADC14 14 //MCU internal reference +#define MCU_ADC15 15 //MCU ground + +#define MCU_PWM0 0 //DCCD +#define MCU_PWM1 1 //LED + +//ADC definitions +typedef enum { + MCU_ADC_DIV2 = 0x01, + MCU_ADC_DIV4 = 0x02, + MCU_ADC_DIV8 = 0x03, + MCU_ADC_DIV16 = 0x04, + MCU_ADC_DIV32 = 0x05, + MCU_ADC_DIV64 = 0x06, + MCU_ADC_DIV128 = 0x07 +} adcClkDiv_t; + +//Timer definitions +typedef enum { + MCU_TIM_DIV1 = 0x01, + MCU_TIM_DIV8 = 0x02, + MCU_TIM_DIV64 = 0x03, + MCU_TIM_DIV256 = 0x04, + MCU_TIM_DIV1024 = 0x05 +} timerClkDiv_t; + +typedef struct { + adcClkDiv_t adc_clk; + timerClkDiv_t pwm_clk; + uint16_t pwm_top; + uint8_t pwm_chb_en; +} startupCfg_t; + +/**** Public function declarations ****/ +void mcu_startup(startupCfg_t* hwCfg); + +uint8_t mcu_gpio_read(uint8_t ch); +void mcu_gpio_write(uint8_t ch, int8_t lvl); + +uint16_t mcu_adc_read(uint8_t ch); + +void mcu_pwm_write(uint8_t ch, uint16_t dc); +uint16_t mcu_pwm_read(uint8_t ch); + +uint8_t mcu_ee_read8b(uint16_t address); +uint16_t mcu_ee_read16b(uint16_t address); +uint32_t mcu_ee_read32b(uint16_t address); + +void mcu_ee_write8b(uint16_t address, uint8_t value); +void mcu_ee_write16b(uint16_t address, uint16_t value); +void mcu_ee_write32b(uint16_t address, uint32_t value); + +#endif /* MCU_HAL_H_ */ diff --git a/firmware/src/hw/board/mcu/mcu_hal_r8.c b/firmware/src/hw/board/mcu/mcu_hal_r8.c new file mode 100644 index 0000000..bd1bcfe --- /dev/null +++ b/firmware/src/hw/board/mcu/mcu_hal_r8.c @@ -0,0 +1,418 @@ +/**** Includes ****/ +#include +#include +#include "mcu_hal.h" + +/**** Private definitions ****/ +/**** Private constants ****/ +/**** Private variables ****/ +/**** Private function declarations ****/ +static uint8_t gpio_read(uint8_t pin_reg, uint8_t mask); +static void pwm_write_ocx(uint8_t ch, uint16_t value); +static uint16_t pwm_read_ocx(uint8_t ch); + +/**** Public function definitions ****/ +void mcu_startup(startupCfg_t* hwCfg) +{ + // Fail-safe GPIO init + PORTB = 0xF8; // Set PORTB pull-ups + DDRB = 0x00; // Set all as inputs + + PORTC = 0x40; // Set PORTC pull-ups + DDRC = 0x00; // Set all as inputs + + PORTD = 0x80; // Set PORTD pull-ups + DDRD = 0x00; // Set all as inputs + + PORTE = 0x0A; // Set PORTE pull-ups + DDRE = 0x00; // Set all as inputs + + // Half-bridge related pins + PORTB &= ~0x03; //Set low + DDRB |= 0x03; //Set as output + + // Common OD PWM pin + if(hwCfg->pwm_chb_en) PORTB &= ~0x04; //Set low + else PORTB |= 0x04; //Set high + DDRB |= 0x04; //Set as output + + // OD control pins + PORTD &= ~0x3F; //Set low (off) + DDRD |= 0x3F; //Set as outputs + + // Handbrake pull-up pin + PORTB |= 0x20; //Set high + DDRB |= 0x20; //Set as output + + // Handbrake and brakes pins + PORTB |= 0xC0; //Set pull-up on + DDRB &= ~0xC0; //Set as inputs + + // Dimm + PORTD |= 0x80; //Set pull-up on + DDRD &= ~0x80; //Set as input + + // Up and Down + PORTE |= 0x0A; //Set pull-up on + DDRE &= ~0x0A; //Set as inputs + + // Internal ADC inputs + PORTC &= ~0x0F; //Pull-up off + DDRC &= ~0x0F; //Set as inputs + + // Potentiometer & Mode + PORTC &= ~0x30; //Pull-up off + DDRC &= ~0x30; //Set as inputs + + //ADC configuration + PRR0 &= ~0x01; //Enable ADC power + DIDR0 |= 0x0F; //Disable digital inputs, ADC0-ADC3 + + ADMUX = 0x40; //Set AVCC reference, Right adjust + ADCSRA = 0x00; //ADC Disabled, Single conversion, no IT + ADCSRA |= (uint8_t)hwCfg->adc_clk; + ADCSRB = 0x00; //no trigger input + + ADCSRA |= 0x80; //Enable ADC + + //DCCD and LED PWM configuration + PRR0 &= ~0x80; //Enable Timer1 power + TCCR1A = 0xC2; //Connect OC1A, inverted mode + if(hwCfg->pwm_chb_en) TCCR1A |= 0x30; //Connect OC1B, inverted mode + TCCR1B = 0x18; //PWM, Phase & Frequency Correct ICR1 top, no clock, WGM:0xE + TCCR1C = 0x00; + TCNT1 = 0x0000; + OCR1A = 0xFFFF; + OCR1B = 0xFFFF; + ICR1 = hwCfg->pwm_top; + TIMSK1 = 0x00; //No interrupts + TIFR1 = 0x00; //Clear all flags + + uint8_t tim1_prescaler = (uint8_t)hwCfg->pwm_clk; + TCCR1B |= tim1_prescaler; //Enable timer +} + +// ADC Interface functions +uint16_t mcu_adc_read(uint8_t ch) +{ + //check if ADC is enabled + if(!(ADCSRA&0x80)) return 0xFFFF; + + //Safe guard mux + if(ch > 15) return 0xFFFF; + // Not available channels + if((ch > 8) && (ch<14)) return 0xFFFF; + + ADMUX &= ~0x0F; + ADMUX |= ch; + ADCSRA |= 0x40; + while(ADCSRA&0x40); //wait to finish + return ADC; +} + +// PWM Timer Interface functions +void mcu_pwm_write(uint8_t ch, uint16_t dc) +{ + dc = 0xFFFF - dc; + + // Calculate value as % of TOP + uint32_t top = (uint32_t)ICR1; + uint32_t temp = (uint32_t)dc * top; + temp = temp/0x0000FFFF; + + //Limit temp + if(temp>0x0000FFFF) temp = 0x0000FFFF; + uint16_t ocrx = (uint16_t)temp; + + // Write register + pwm_write_ocx(ch, ocrx); +} + +uint16_t mcu_pwm_read(uint8_t ch) +{ + uint16_t ocrx = pwm_read_ocx(ch); + + // Check easy answers + if(ocrx == 0) return 0; + if(ocrx >= ICR1) return 0xFFFF; + + // Calculate + uint32_t top = (uint32_t)ICR1; + uint32_t temp = (uint32_t)ocrx * 0xFFFF; + temp = temp/top; + + //Limit temp + if(temp>0x0000FFFF) return 0xFFFF; + return (uint16_t)temp; +} + +uint8_t mcu_gpio_read(uint8_t ch) +{ + switch(ch) + { + case MCU_GPIO0: // Mode DIN1 + return gpio_read(PINC,0x20); + + case MCU_GPIO1: // Pot DIN2 + return gpio_read(PINC,0x10); + + case MCU_GPIO2: // Down DIN3 + return gpio_read(PINE,0x02); + + case MCU_GPIO3: // Up DIN4 + return gpio_read(PINE,0x08); + + case MCU_GPIO4: // Dimm DIN5 + return gpio_read(PIND,0x80); + + case MCU_GPIO5: // Brakes DIN6 + return gpio_read(PINB,0x80); + + case MCU_GPIO6: // Handbrake DIN7 + return gpio_read(PINB,0x40); + + case MCU_GPIO7: // Handbrake pull DIN8 + return gpio_read(PINB,0x20); + + case MCU_GPIO8: // Speed-pull + return gpio_read(PIND,0x40); + + case MCU_GPIO9: // LED 0 + return gpio_read(PIND,0x01); + + case MCU_GPIO10: // LED 1 + return gpio_read(PIND,0x02); + + case MCU_GPIO11: // LED 2 + return gpio_read(PIND,0x04); + + case MCU_GPIO12: // LED 3 + return gpio_read(PIND,0x08); + + case MCU_GPIO13: // LED 4 + return gpio_read(PIND,0x10); + + case MCU_GPIO14: // LED 5 + return gpio_read(PIND,0x20); + + case MCU_GPIO15: // DCCD Enable + return gpio_read(PINB,0x01); + + case MCU_GPIO16: // DCCD PWM + return gpio_read(PINB,0x02); + + case MCU_GPIO17: // LED PWM + return gpio_read(PINB,0x04); + + default: + return 0; + } +} + +void mcu_gpio_write(uint8_t ch, int8_t lvl) +{ + switch(ch) + { + case MCU_GPIO0: // Mode DIN1 + if(lvl>0) + { + PORTC |= 0x20; + DDRC |= 0x20; + } + else if(lvl<0) + { + DDRC &= ~0x20; + PORTC &= ~0x20; + } + else + { + PORTC &= ~0x20; + DDRC |= 0x20; + } + return; + + case MCU_GPIO1: // Pot DIN2 + if(lvl>0) + { + PORTC |= 0x10; + DDRC |= 0x10; + } + else if(lvl<0) + { + DDRC &= ~0x10; + PORTC &= ~0x10; + } + else + { + PORTC &= ~0x10; + DDRC |= 0x10; + } + return; + + case MCU_GPIO2: // Down DIN3 + if(lvl>0) + { + PORTE |= 0x02; + DDRE |= 0x02; + } + else if(lvl<0) + { + DDRE &= ~0x02; + PORTE &= ~0x02; + } + else + { + PORTE &= ~0x02; + DDRE |= 0x02; + } + return; + + case MCU_GPIO3: // Up DIN4 + if(lvl>0) + { + PORTE |= 0x08; + DDRE |= 0x08; + } + else if(lvl<0) + { + DDRE &= ~0x08; + PORTE &= ~0x08; + } + else + { + PORTE &= ~0x08; + DDRE |= 0x08; + } + return; + + case MCU_GPIO7: // Handbrake pull DIN + if(lvl>0) + { + PORTB |= 0x20; + DDRB |= 0x20; + } + else if(lvl<0) + { + DDRB &= ~0x20; + PORTB &= ~0x20; + } + else + { + PORTB &= ~0x20; + DDRB |= 0x20; + } + return; + + case MCU_GPIO8: // Speed-pull + if(lvl>0) PORTD |= 0x40; + else PORTD &= ~0x40; + return; + + case MCU_GPIO9: // LED 0 + if(lvl>0) PORTD |= 0x01; + else PORTD &= ~0x01; + return; + + case MCU_GPIO10: // LED 1 + if(lvl>0) PORTD |= 0x02; + else PORTD &= ~0x02; + return; + + case MCU_GPIO11: // LED 2 + if(lvl>0) PORTD |= 0x04; + else PORTD &= ~0x04; + return; + + case MCU_GPIO12: // LED 3 + if(lvl>0) PORTD |= 0x08; + else PORTD &= ~0x08; + return; + + case MCU_GPIO13: // LED 4 + if(lvl>0) PORTD |= 0x10; + else PORTD &= ~0x10; + return; + + case MCU_GPIO14: // LED 5 + if(lvl>0) PORTD |= 0x20; + else PORTD &= ~0x20; + return; + + case MCU_GPIO15: // DCCD Enable + if(lvl>0) PORTB |= 0x01; + else PORTB &= ~0x01; + return; + + default: + return; + } +} + +uint8_t mcu_ee_read8b(uint16_t address) +{ + return eeprom_read_byte((uint8_t*)address); +} + +uint16_t mcu_ee_read16b(uint16_t address) +{ + return eeprom_read_word((uint16_t*)address); +} + +uint32_t mcu_ee_read32b(uint16_t address) +{ + return eeprom_read_dword((uint32_t*)address); +} + +void mcu_ee_write8b(uint16_t address, uint8_t value) +{ + eeprom_write_byte((uint8_t*)address, value); +} + +void mcu_ee_write16b(uint16_t address, uint16_t value) +{ + eeprom_write_word((uint16_t*)address, value); +} + +void mcu_ee_write32b(uint16_t address, uint32_t value) +{ + eeprom_write_dword((uint32_t*)address, value); +} + +/**** Private function definitions ****/ +static uint8_t gpio_read(uint8_t pin_reg, uint8_t mask) +{ + if(pin_reg&mask) return MCU_GPIO_HIGH; + else return MCU_GPIO_LOW; +} + +static void pwm_write_ocx(uint8_t ch, uint16_t value) +{ + switch(ch) + { + case MCU_PWM0: + OCR1A = value; + return; + + case MCU_PWM1: + OCR1B = value; + return; + + default: + return; + } +} + +static uint16_t pwm_read_ocx(uint8_t ch) +{ + switch(ch) + { + case MCU_PWM0: + return OCR1A; + + case MCU_PWM1: + return OCR1B ; + + default: + return 0x0000; + } +} \ No newline at end of file diff --git a/firmware/src/hw/board/odout.c b/firmware/src/hw/board/odout.c new file mode 100644 index 0000000..f5fda12 --- /dev/null +++ b/firmware/src/hw/board/odout.c @@ -0,0 +1,80 @@ +/**** Includes ****/ +#include "utils/utils.h" +#include "mcu/mcu_hal.h" +#include "odout.h" + +/**** Private definitions ****/ +/**** Private constants ****/ +/**** Private variables ****/ +/**** Private function declarations ****/ +static uint8_t odout_pwm_mapping(uint8_t* pwm_ch); +static uint8_t odout_mapping(uint8_t od_ch, uint8_t* gpio_ch); + + +/**** Public function definitions ****/ +void bsp_odout_write(uint8_t ch, int8_t lvl) +{ + uint8_t gpio_ch; + // Get GPIO channel config, and check validity + if(odout_mapping(ch, &gpio_ch)) return; + + // Set output level + if(lvl==0) mcu_gpio_write(gpio_ch, 1); // Output active + else mcu_gpio_write(gpio_ch, 0); // Output off +} + +void bsp_odout_write_common(uint8_t percent) +{ + uint8_t pwm_ch; + // Get PWM channel config, and check validity + if(odout_pwm_mapping(&pwm_ch)) return; + + // Convert percent to 16b duty cycle + uint16_t dc = util_percent_to_16b(percent); + + // Set PWM + mcu_pwm_write(pwm_ch, dc); +} + +/**** Private function definitions ****/ +static uint8_t odout_pwm_mapping(uint8_t* pwm_ch) +{ + *pwm_ch = MCU_PWM1; + return 0; +} + +static uint8_t odout_mapping(uint8_t od_ch, uint8_t* gpio_ch) +{ + switch(od_ch) + { + case BSP_OD1: // LED0 + *gpio_ch = MCU_GPIO9; + return 0; + + case BSP_OD2: // LED1 + *gpio_ch = MCU_GPIO10; + return 0; + + case BSP_OD3: // LED2 + *gpio_ch = MCU_GPIO11; + return 0; + + case BSP_OD4: // LED3 + *gpio_ch = MCU_GPIO12; + return 0; + + case BSP_OD5: // LED4 + *gpio_ch = MCU_GPIO13; + return 0; + + case BSP_OD6: // LED5 + *gpio_ch = MCU_GPIO14; + return 0; + + default: //Invalid channel + *gpio_ch = 0; + return 1; + } + + return 1; +} diff --git a/firmware/src/hw/board/odout.h b/firmware/src/hw/board/odout.h new file mode 100644 index 0000000..0d7ad5e --- /dev/null +++ b/firmware/src/hw/board/odout.h @@ -0,0 +1,37 @@ +#ifndef ODOUT_H_ +#define ODOUT_H_ + +/* +OD1 LED 0 +OD2 LED 1 +OD3 LED 2 +OD4 LED 3 +OD5 LED 4 +OD6 LED 5 + +COMMON LED PWM +*/ + +/**** Includes ****/ +#include + +/**** Public definitions ****/ +#define BSP_OD1 1 +#define BSP_OD2 2 +#define BSP_OD3 3 +#define BSP_OD4 4 +#define BSP_OD5 5 +#define BSP_OD6 6 + +#define BSP_ODOUT_LOW 0 +#define BSP_ODOUT_HIGH 1 +#define BSP_ODOUT_HIZ -1 + +/**** Public function declarations ****/ +void bsp_odout_write(uint8_t ch, int8_t lvl); +void bsp_odout_write_common(uint8_t percent); + +#ifdef TESTING +#endif + +#endif /* ODOUT_H_ */ \ No newline at end of file diff --git a/firmware/src/hw/board/setup.c b/firmware/src/hw/board/setup.c new file mode 100644 index 0000000..5f13cc4 --- /dev/null +++ b/firmware/src/hw/board/setup.c @@ -0,0 +1,23 @@ +/**** Includes ****/ +#include "utils/utils.h" +#include "mcu/mcu_hal.h" +#include "setup.h" + +/**** Private definitions ****/ +/**** Private constants ****/ +/**** Private variables ****/ +/**** Private function declarations ****/ +/**** Public function definitions ****/ + +/**** Private function definitions ****/ +void bsp_startup(void) +{ + startupCfg_t mcu_cfg; + + mcu_cfg.adc_clk = MCU_ADC_DIV2; + mcu_cfg.pwm_clk = MCU_TIM_DIV1; + mcu_cfg.pwm_top = 511; + mcu_cfg.pwm_chb_en = 1; + + mcu_startup(&mcu_cfg); +} \ No newline at end of file diff --git a/firmware/src/hw/board/setup.h b/firmware/src/hw/board/setup.h new file mode 100644 index 0000000..c9e5bf8 --- /dev/null +++ b/firmware/src/hw/board/setup.h @@ -0,0 +1,14 @@ +#ifndef BSP_SETUP_H_ +#define BSP_SETUP_H_ + +/**** Includes ****/ +#include + +/**** Public definitions ****/ +/**** Public function declarations ****/ +void bsp_startup(void); + +#ifdef TESTING +#endif + +#endif /* BSP_SETUP_H_ */ \ No newline at end of file diff --git a/firmware/src/hw/board/utils/faults.c b/firmware/src/hw/board/utils/faults.c new file mode 100644 index 0000000..02a04e5 --- /dev/null +++ b/firmware/src/hw/board/utils/faults.c @@ -0,0 +1,67 @@ +/**** Includes ****/ +#include "faults.h" +#include "utils.h" + +/**** Private definitions ****/ +/**** Private constants ****/ +/**** Private variables ****/ +/**** Mapping function declarations ****/ +/**** Private function declarations ****/ +/**** Public function definitions ****/ +#ifdef TESTING +#endif + +uint8_t fault_process(fault_t* fault, uint8_t w_trig, uint8_t f_trig, fault_cfg_t* cfg) +{ + // Override warning trigger in case of fault trigger + if(f_trig) w_trig = 1; + + // Increase warning time, if reoccurring + if((w_trig)&&(fault->severity != FAULT_LVL_OK)) fault->w_time = util_sat_add_16b(fault->w_time, 1); + else fault->w_time = 0; + + // Check if waring can be considered fault + if((cfg->wtof > 0)&&(fault->w_time > cfg->wtof)) f_trig = 1; + + // Increase fault time, if reoccurring + if((f_trig)&&(fault->severity != FAULT_LVL_OK)) fault->f_time = util_sat_add_16b(fault->f_time, 1); + else fault->f_time = 0; + + // Modify fault trigger + if((cfg->delay)&&(fault->f_time < cfg->delay)) f_trig = 0; + + // Process fault level + if(f_trig) + { + fault->severity = FAULT_LVL_FAULT; + return 1; + } + else + { + if(w_trig) fault->severity = FAULT_LVL_WARNING; + else fault->severity = FAULT_LVL_OK; + } + + return 0; +} + +uint8_t fault_is_active(fault_t* fault) +{ + if(fault->severity == FAULT_LVL_FAULT) return 1; + else return 0; +} + +uint8_t fault_is_warning(fault_t* fault) +{ + if(fault->severity != FAULT_LVL_OK) return 1; + else return 0; +} + +void fault_reset(fault_t* fault) +{ + fault->severity = FAULT_LVL_OK; + fault->w_time = 0; + fault->f_time = 0; +} + +/**** Private function definitions ****/ diff --git a/firmware/src/hw/board/utils/faults.h b/firmware/src/hw/board/utils/faults.h new file mode 100644 index 0000000..2a89077 --- /dev/null +++ b/firmware/src/hw/board/utils/faults.h @@ -0,0 +1,37 @@ +#ifndef FAULTS_H_ +#define FAULTS_H_ + +/* +*/ + +/**** Includes ****/ +#include + +/**** Public definitions ****/ +typedef enum { + FAULT_LVL_OK, + FAULT_LVL_WARNING, + FAULT_LVL_FAULT +} fault_lvl_t; + +typedef struct { + fault_lvl_t severity; + uint16_t w_time; + uint16_t f_time; +} fault_t; + +typedef struct { + uint16_t delay; + uint16_t wtof; +} fault_cfg_t; + +/**** Public function declarations ****/ +uint8_t fault_process(fault_t* fault, uint8_t w_trig, uint8_t f_trig, fault_cfg_t* cfg); +uint8_t fault_is_active(fault_t* fault); +uint8_t fault_is_warning(fault_t* fault); +void fault_reset(fault_t* fault); + +#ifdef TESTING +#endif + +#endif /* FAULTS_H_ */ \ No newline at end of file diff --git a/firmware/src/hw/board/utils/fuses.c b/firmware/src/hw/board/utils/fuses.c new file mode 100644 index 0000000..997f586 --- /dev/null +++ b/firmware/src/hw/board/utils/fuses.c @@ -0,0 +1,81 @@ +/**** Includes ****/ +#include "fuses.h" +#include "utils.h" + +/**** Private definitions ****/ +/**** Private constants ****/ +/**** Private variables ****/ +/**** Mapping function declarations ****/ +/**** Private function declarations ****/ +/**** Public function definitions ****/ +#ifdef TESTING +#endif + +void fuse_reset(fuse_t* fuse) +{ + fuse->state = FUSE_OFF; + fuse->timer = 0; + fuse->count = 0; +} + +uint8_t fuse_process(fuse_t* fuse, uint8_t fault, fuse_cfg_t* cfg) +{ + // Active fault condition + if(fault) + { + // Note fuse time count + if((fuse->state == FUSE_OFF)||(fuse->state == FUSE_RETRY)) fuse->count++; + + // Go to fused state in any case + fuse->state = FUSE_ACTIVE; + fuse->timer = 0; + return 1; + }; + + // No active fault condition + if(fuse->state==FUSE_ACTIVE) + { + // Go to cooldown + fuse->state = FUSE_COOLDOWN; + fuse->timer = cfg->cooldown_time; + }; + + // Wait for timeout + if(fuse->timer) + { + fuse->timer--; + if(fuse->state == FUSE_RETRY) return 0; + else return 1; + }; + + // Timeout end, transition logic + switch(fuse->state) + { + case FUSE_COOLDOWN: + // Cooldown end + if(cfg->retry_time) + { + fuse->state = FUSE_RETRY; + fuse->timer = cfg->retry_time; + } + else + { + fuse->state = FUSE_OFF; + fuse->timer = 0; + } + break; + + case FUSE_RETRY: + // Go back to normal + fuse->state = FUSE_OFF; + break; + + default: + // Nothing to do + break; + } + + return 0; +} + +/**** Private function definitions ****/ diff --git a/firmware/src/hw/board/utils/fuses.h b/firmware/src/hw/board/utils/fuses.h new file mode 100644 index 0000000..49f3ce8 --- /dev/null +++ b/firmware/src/hw/board/utils/fuses.h @@ -0,0 +1,36 @@ +#ifndef FUSES_H_ +#define FUSES_H_ + +/* +*/ + +/**** Includes ****/ +#include + +/**** Public definitions ****/ +typedef enum { + FUSE_OFF, + FUSE_ACTIVE, + FUSE_COOLDOWN, + FUSE_RETRY +} fuse_state_t; + +typedef struct { + fuse_state_t state; + uint8_t count; + uint16_t timer; +} fuse_t; + +typedef struct { + uint16_t cooldown_time; + uint16_t retry_time; +} fuse_cfg_t; + +/**** Public function declarations ****/ +void fuse_reset(fuse_t* fuse); +uint8_t fuse_process(fuse_t* fuse, uint8_t fault, fuse_cfg_t* cfg); + +#ifdef TESTING +#endif + +#endif /* FUSES_H_ */ \ No newline at end of file diff --git a/firmware/src/hw/board/utils/utils.c b/firmware/src/hw/board/utils/utils.c new file mode 100644 index 0000000..e1f673d --- /dev/null +++ b/firmware/src/hw/board/utils/utils.c @@ -0,0 +1,272 @@ +/**** Includes ****/ +#include "utils.h" + +/**** Private definitions ****/ +/**** Private constants ****/ +/**** Private variables ****/ +/**** Private function declarations ****/ +#ifndef TESTING +static uint8_t find_interval_end_index(uint16_t val, uint16_t* axis_values, uint8_t len_axis); +static uint16_t interpolate_u16b(uint16_t x, uint16_t x0, uint16_t x1, uint16_t y0, uint16_t y1); +static uint16_t index2d_to_index1d(uint8_t ix, uint8_t iy, uint8_t len_x); +#endif + +/**** Public function definitions ****/ +uint8_t util_invert_8b(uint8_t x) +{ + if(x!=0) return 0; + else return 1; +} + +uint8_t util_sat_add_8b(uint8_t x, uint8_t y) +{ + uint8_t z = x + y; + // Check for overflow + if((z < x)||(z < y)) return 0xFF; + else return z; +} + +uint8_t util_sat_subtract_8b(uint8_t x, uint8_t y) +{ + uint8_t z = x - y; + // Check for underflow + if(z > x) return 0; + else return z; +} + +uint16_t util_sat_add_16b(uint16_t x, uint16_t y) +{ + uint16_t z = x + y; + // Check for overflow + if((z < x)||(z < y)) return 0xFFFF; + else return z; +} + +uint16_t util_sat_subtract_16b(uint16_t x, uint16_t y) +{ + uint16_t z = x - y; + // Check for underflow + if(z > x) return 0; + else return z; +} + +uint16_t util_limit_u32b_to_u16b(uint32_t in) +{ + if(in == 0) return 0; + else if(in >= 0x0000FFFF) return 0xFFFF; + else return (uint16_t)in; +} + +uint16_t util_limit_s32b_to_u16b(int32_t in) +{ + if(in <= 0) return 0; + else if(in >= 0x0000FFFF) return 0xFFFF; + else return (uint16_t)in; +} + +uint16_t util_convert_muldivoff(uint16_t raw, uint8_t mul, uint8_t div, int16_t offset) +{ + int32_t temp = (int32_t)raw; + + temp = temp * mul; + if(div>1) temp /= div; + temp += offset; + + return util_limit_s32b_to_u16b(temp); +} + +uint16_t util_sat_mul_kilo(uint16_t xk, uint16_t yk) +{ + uint32_t temp = (uint32_t)xk * (uint32_t)yk; + temp /= 1000; + + return util_limit_u32b_to_u16b(temp); +} + +uint16_t util_sat_div_kilo(uint16_t top, uint16_t bot) +{ + //Sanity check bot + if(bot==0) return 0xFFFF; //aka infinity + + uint32_t temp = (uint32_t)top * 1000; + temp /= (uint32_t)bot; + + return util_limit_u32b_to_u16b(temp); +} + +uint16_t util_sat_ratio_16b(uint16_t top, uint16_t bot) +{ + //Sanity check bot + if(bot==0) return 0xFFFF; //aka infinity + + //Easy option + if(top>=bot) return 0xFFFF; + + uint32_t temp = (uint32_t)top * 0x0000FFFF; + temp /= (uint32_t)bot; + + return util_limit_u32b_to_u16b(temp); +} + +uint16_t util_percent_to_16b(uint8_t percent) +{ + uint32_t temp = (uint32_t)percent * 0x0000FFFF; + temp /= 100; + + // Limit to 16 bits + uint16_t pwm = util_limit_u32b_to_u16b(temp); + + return pwm; +} + +uint16_t util_interpolate_1d_u16b(uint16_t x, uint16_t* x_axis, uint16_t* y_values, uint8_t len_axis) +{ + // validate axis length + if(len_axis==0) return 0; // Empty data set + if(len_axis==1) return y_values[0]; // Only one data point + + uint16_t y; + + uint8_t i = find_interval_end_index(x, x_axis, len_axis); + if(i==0) + { + //Less then start + y = y_values[0]; + } + else if(i==len_axis) + { + //More than end + y = y_values[len_axis-1]; + } + else + { + // Do interpolate + y = interpolate_u16b(x, x_axis[i-1], x_axis[i], y_values[i-1], y_values[i]); + } + + return y; +} + +uint16_t util_interpolate_2d_u16b(uint16_t x, uint16_t y, uint16_t* x_axis, uint8_t len_x_axis, uint16_t* y_axis, uint8_t len_y_axis, uint16_t* z_values) +{ + // validate axis length + if((len_x_axis==0)&&(len_y_axis==0)) return 0; // Empty data set + if((len_x_axis==1)&&(len_y_axis==1)) return z_values[0]; // Only one data point + + uint8_t ix = find_interval_end_index(x, x_axis, len_x_axis); + uint8_t iy = find_interval_end_index(y, y_axis, len_y_axis); + + // Check corners - easy answers + if((ix==0)&&(iy==0)) + { + return z_values[0]; //[0][0] [Y][X] + } + else if((ix==len_x_axis)&&(iy==0)) + { + return z_values[len_x_axis-1]; //[0][end] + } + else if((ix==0)&&(iy==len_y_axis)) + { + uint16_t i = index2d_to_index1d(0, len_y_axis-1, len_x_axis); + return z_values[i]; //[end][0] + } + else if((ix==len_x_axis)&&(iy==len_y_axis)) + { + uint16_t i = index2d_to_index1d(len_x_axis-1, len_y_axis-1, len_x_axis); + return z_values[i]; //[end][end] + }; + + // Check boundaries - 1D interpolation + if(ix==0) + { + // On ix=0 line + uint16_t i = 0; + uint16_t z0 = z_values[i]; + i = index2d_to_index1d(0, len_y_axis-1, len_x_axis); + uint16_t z1 = z_values[i]; + return interpolate_u16b(y, y_axis[0], y_axis[len_y_axis-1], z0, z1); + } + else if(ix==len_x_axis) + { + // On ix=END line + uint16_t i = len_x_axis-1; + uint16_t z0 = z_values[i]; + i = index2d_to_index1d(len_x_axis-1, len_y_axis-1, len_x_axis); + uint16_t z1 = z_values[i]; + return interpolate_u16b(y, y_axis[0], y_axis[len_y_axis-1], z0, z1); + } + else if(iy==0) + { + // On iy=0 line + uint16_t i = 0; + uint16_t z0 = z_values[i]; + i = len_x_axis-1; + uint16_t z1 = z_values[i]; + return interpolate_u16b(x, x_axis[0], x_axis[len_x_axis-1], z0, z1); + } + else if(iy==len_y_axis) + { + // On iy=END line + uint16_t i = index2d_to_index1d(0, len_y_axis-1, len_x_axis); + uint16_t z0 = z_values[i]; + i = index2d_to_index1d(len_x_axis-1, len_y_axis-1, len_x_axis); + uint16_t z1 = z_values[i]; + return interpolate_u16b(x, x_axis[0], x_axis[len_x_axis-1], z0, z1); + } + + // Do interpolation + // Get axis values + uint16_t x0 = x_axis[ix-1]; + uint16_t x1 = x_axis[ix]; + uint16_t y0 = y_axis[iy-1]; + uint16_t y1 = y_axis[iy]; + + // Do y0 line calculation + // Get z values at x0 and x1 points on y0 line + uint16_t i = index2d_to_index1d(ix-1, iy-1, len_x_axis); + uint16_t z0 = z_values[i]; + uint16_t z1 = z_values[i+1]; + // Interpolate z value on y0 line + uint16_t zy0 = interpolate_u16b(x, x0, x1, z0, z1); + + // Do y1 line calculation + // Get z values at x0 and x1 points on y1 line + i = index2d_to_index1d(ix-1, iy, len_x_axis); + z0 = z_values[i]; + z1 = z_values[i+1]; + // Interpolate z value on y0 line + uint16_t zy1 = interpolate_u16b(x, x0, x1, z0, z1); + + // Do calculation in y axis on xz line + return interpolate_u16b(y, y0, y1, zy0, zy1); +} + +/**** Private function definitions ****/ +static uint16_t interpolate_u16b(uint16_t x, uint16_t x0, uint16_t x1, uint16_t y0, uint16_t y1) +{ + int32_t dy = (int32_t)y1 - (int32_t)y0; + int32_t dx = (int32_t)x1 - (int32_t)x0; + int32_t d = (int32_t)x - (int32_t)x0; + + int32_t y = dy * d; + y /= dx; + y += y0; + + return util_limit_s32b_to_u16b(y); +} + +static uint8_t find_interval_end_index(uint16_t val, uint16_t* axis_values, uint8_t len_axis) +{ + for(uint8_t i=0; i + +/**** Public definitions ****/ + +/**** Public function declarations ****/ +uint8_t util_invert_8b(uint8_t x); + +uint16_t util_limit_u32b_to_u16b(uint32_t in); +uint16_t util_limit_s32b_to_u16b(int32_t in); + +uint16_t util_convert_muldivoff(uint16_t raw, uint8_t mul, uint8_t div, int16_t offset); +uint16_t util_sat_mul_kilo(uint16_t xk, uint16_t yk); +uint16_t util_sat_div_kilo(uint16_t top, uint16_t bot); +uint16_t util_sat_ratio_16b(uint16_t top, uint16_t bot); +uint16_t util_percent_to_16b(uint8_t percent); + +uint8_t util_sat_add_8b(uint8_t x, uint8_t y); +uint8_t util_sat_subtract_8b(uint8_t x, uint8_t y); + +uint16_t util_sat_add_16b(uint16_t x, uint16_t y); +uint16_t util_sat_subtract_16b(uint16_t x, uint16_t y); + +uint16_t util_interpolate_1d_u16b(uint16_t x, uint16_t* x_axis, uint16_t* y_values, uint8_t len_axis); +uint16_t util_interpolate_2d_u16b(uint16_t x, uint16_t y, uint16_t* x_axis, uint8_t len_x_axis, uint16_t* y_axis, uint8_t len_y_axis, uint16_t* z_values); + +#ifdef TESTING +// Access to private functions for unit testing +static uint8_t find_interval_end_index(uint16_t val, uint16_t* axis_values, uint8_t len_axis); +static uint16_t interpolate_u16b(uint16_t x, uint16_t x0, uint16_t x1, uint16_t y0, uint16_t y1); +static uint16_t index2d_to_index1d(uint8_t ix, uint8_t iy, uint8_t len_x); +#endif + +#endif /* UTILS_H_ */ \ No newline at end of file diff --git a/firmware/src/hw/buttons.c b/firmware/src/hw/buttons.c new file mode 100644 index 0000000..b8c60d5 --- /dev/null +++ b/firmware/src/hw/buttons.c @@ -0,0 +1,173 @@ +/**** Includes ****/ +#include "board/utils/utils.h" +#include "board/din.h" +#include "board/dout.h" +#include "buttons.h" + +/**** Private definitions ****/ +/**** Private constants ****/ +static const uint8_t DEF_DBNC_LIM = HW_BTN_DEF_DBNC_LIM; +static const uint16_t DEF_REPEAT_TIME = HW_BTN_DEF_REPEAT_TIME; + +/**** Private variables ****/ +/**** Private function declarations ****/ +static uint8_t buttons_mapping(uint8_t btn_ch, uint8_t* din_ch, btn_cfg_t* cfg); +static uint8_t buttons_pull_mapping(uint8_t btn_ch, uint8_t* dout_ch); + +/**** Public function definitions ****/ +void btn_reset(btn_t* btn) +{ + btn->state = BTN_INACTIVE; + btn->new_state = 0; + btn->state_time = 0; + btn->transition_cntr = 0; + btn->dbnc_active = 1; +} + +uint8_t btn_ch_process(uint8_t btn_ch, btn_t* btn) +{ + // Get channel config + uint8_t din_ch; + btn_cfg_t cfg; + if(buttons_mapping(btn_ch, &din_ch, &cfg)) return BTN_INACTIVE; + + // Read din level + uint8_t lvl = bsp_din_read(din_ch); + + // Process button logic + uint8_t btn_act = btn_process(lvl, btn, &cfg); + return btn_act; +} + +uint8_t btn_process(uint8_t lvl, btn_t* btn, btn_cfg_t* cfg) +{ + // Increase state time + btn->state_time = util_sat_add_16b(btn->state_time, 1); + + // Check repeated new flag + if((cfg->repeat_time)&&(btn->state_time < 0xFFFF)) + { + if((btn->state_time)%(cfg->repeat_time) == 0) btn->new_state = 1; + }; + + // Calculate saved level from state and active level cfg + uint8_t prev_lvl = 0; + if(((btn->dbnc_active)&&(btn->state))||((!btn->dbnc_active)&&(!btn->state))) prev_lvl = util_invert_8b(cfg->act_lvl); + else prev_lvl = cfg->act_lvl; + + // Check if level changed + uint8_t lvl_chnaged = 0; + if(lvl!=prev_lvl) lvl_chnaged = 1; + + //Process debounce logic + if(lvl_chnaged) + { + // Changed debounce state + if(!btn->dbnc_active) btn->dbnc_active = 1; // Start debounce + else btn->dbnc_active = 0; // Stop debounce + // Reset debounce counter + btn->transition_cntr = 0; + } + else + { + // Continue debounce + if(btn->dbnc_active) btn->transition_cntr += 1; + } + + // Check for debounce end + if((btn->dbnc_active)&&(btn->transition_cntr >= cfg->dbnc_lim)) + { + // Reset debounce + btn->dbnc_active = 0; //End debounce + btn->transition_cntr = 0; + // Set new state + if(lvl==cfg->act_lvl) btn->state = BTN_ACTIVE; + else btn->state = BTN_INACTIVE; + btn->state_time = 0; //Reset timer + btn->new_state = 1; //Set new flag + }; + + return btn->state; +} + +void btn_ch_set_pull(uint8_t btn_ch, int8_t lvl) +{ + // Get channel config + uint8_t dout_ch; + if(buttons_pull_mapping(btn_ch, &dout_ch)) return; + + // Set button pull + bsp_dout_write(dout_ch, lvl); +} + +/**** Private function definitions ****/ +static uint8_t buttons_mapping(uint8_t btn_ch, uint8_t* din_ch, btn_cfg_t* cfg) +{ + // Default, most common config + cfg->act_lvl = BSP_DIN_LOW; + cfg->dbnc_lim = DEF_DBNC_LIM; + cfg->repeat_time = DEF_REPEAT_TIME; + + switch(btn_ch) + { + case BTN_1: // Mode + *din_ch = BSP_DIN1; + return 0; + + case BTN_2: // Down + *din_ch = BSP_DIN3; + return 0; + + case BTN_3: // Up + *din_ch = BSP_DIN4; + return 0; + + case BTN_4: // Dimm + *din_ch = BSP_DIN5; + cfg->act_lvl = BSP_DIN_HIGH; + cfg->repeat_time = 0; + return 0; + + case BTN_5: // Brakes + *din_ch = BSP_DIN6; + cfg->act_lvl = BSP_DIN_HIGH; + cfg->repeat_time = 0; + return 0; + + case BTN_6: // Handbrake + *din_ch = BSP_DIN7; + cfg->repeat_time = 0; + return 0; + + case BTN_6N: // Handbrake inverted + *din_ch = BSP_DIN7N; + cfg->repeat_time = 0; + return 0; + + default: //Invalid channel + *din_ch = 0; + return 1; + } + + return 1; +} + +static uint8_t buttons_pull_mapping(uint8_t btn_ch, uint8_t* dout_ch) +{ + switch(btn_ch) + { + case BTN_6: // Handbrake + *dout_ch = BSP_DOUT5; + return 0; + + case BTN_6N: // Handbrake inverted + *dout_ch = BSP_DOUT5; + return 0; + + default: //Invalid channel + *dout_ch = 0; + return 1; + } + + return 1; +} diff --git a/firmware/src/hw/buttons.h b/firmware/src/hw/buttons.h new file mode 100644 index 0000000..323406e --- /dev/null +++ b/firmware/src/hw/buttons.h @@ -0,0 +1,54 @@ +#ifndef BUTTONS_H_ +#define BUTTONS_H_ + +/* +*/ + +/**** Includes ****/ +#include +#include "config.h" + +/**** Public definitions ****/ +typedef struct { + uint8_t act_lvl; + uint8_t dbnc_lim; + uint16_t repeat_time; +} btn_cfg_t; + +typedef struct { + uint8_t state; + uint8_t new_state; + uint16_t state_time; + uint8_t transition_cntr; + uint8_t dbnc_active; +} btn_t; + +#define BTN_1 1 //DIN1 Mode +#define BTN_2 2 //DIN3 Down +#define BTN_3 3 //DIN4 Up +#define BTN_4 4 //DIN5 Dimm +#define BTN_5 5 //DIN6 Brakes +#define BTN_6 6 //DIN7 Handbrake +#define BTN_6N 7 //DIN7N Direct handbrake + +#define BTN_INACTIVE 0 +#define BTN_ACTIVE 1 + +#define BTN_PULL_LOW 0 +#define BTN_PULL_HIGH 1 +#define BTN_PULL_NONE -1 + +/**** Public function declarations ****/ +void btn_reset(btn_t* btn); + +// Using internal map +uint8_t btn_ch_process(uint8_t btn_ch, btn_t* btn); +void btn_ch_set_pull(uint8_t btn_ch, int8_t lvl); + +// Manual process +uint8_t btn_process(uint8_t lvl, btn_t* btn, btn_cfg_t* cfg); + +#ifdef TESTING +#endif + +#endif /* BUTTONS_H_ */ \ No newline at end of file diff --git a/firmware/src/hw/config.h b/firmware/src/hw/config.h new file mode 100644 index 0000000..ac63781 --- /dev/null +++ b/firmware/src/hw/config.h @@ -0,0 +1,45 @@ +#ifndef HW_CONFIG_H_ +#define HW_CONFIG_H_ + +/**** Includes ****/ +#include + +/**** Public definitions ****/ +#define HW_BTN_DEF_DBNC_LIM 10 +#define HW_BTN_DEF_REPEAT_TIME 1000 + +#define HW_HB_SUPPLY_VOLT_MIN_W 10000 +#define HW_HB_SUPPLY_VOLT_MIN_F 8000 + +#define HW_HB_SUPPLY_VOLT_MAX_W 16000 +#define HW_HB_SUPPLY_VOLT_MAX_F 19500 + +#define HW_HB_SUPPLY_CURRENT_MAX_W 6000 +#define HW_HB_SUPPLY_CURRENT_MAX_F 8000 + +#define HW_HB_SUPPLY_POWER_MAX_W 30000 +#define HW_HB_SUPPLY_POWER_MAX_F 45000 + +#define HW_HB_OUT_CURRENT_MAX_W 6000 +#define HW_HB_OUT_CURRENT_MAX_F 8000 + +#define HW_HB_OUT_VOLTAGE_MAX_W 8000 +#define HW_HB_OUT_VOLTAGE_MAX_F 10000 + +#define HW_HB_OUT_POWER_MAX_W 30000 +#define HW_HB_OUT_POWER_MAX_F 40000 + +#define HW_HB_OUT_RESISTANCE_MIN_W 750 +#define HW_HB_OUT_RESISTANCE_MIN_F 500 + +#define HW_HB_OUT_RESISTANCE_MAX_W 5000 +#define HW_HB_OUT_RESISTANCE_MAX_F 10000 + +#define HW_HB_FAULT_DELAY 500 +#define HW_HB_WTOF_DELAY 0 + +/**** Public function declarations ****/ +#ifdef TESTING +#endif + +#endif /* HW_CONFIG_H_ */ diff --git a/firmware/src/hw/hb_control.c b/firmware/src/hw/hb_control.c new file mode 100644 index 0000000..3ab05d6 --- /dev/null +++ b/firmware/src/hw/hb_control.c @@ -0,0 +1,399 @@ +/**** Includes ****/ +#include "board/utils/utils.h" +#include "board/halfbridge.h" +#include "hb_control.h" + +/**** Private definitions ****/ +/**** Private constants ****/ +// Fault condition thresholds +static const uint16_t SUPPLY_VOLT_MIN_W = HW_HB_SUPPLY_VOLT_MIN_W; +static const uint16_t SUPPLY_VOLT_MIN_F = HW_HB_SUPPLY_VOLT_MIN_F; + +static const uint16_t SUPPLY_VOLT_MAX_W = HW_HB_SUPPLY_VOLT_MAX_W; +static const uint16_t SUPPLY_VOLT_MAX_F = HW_HB_SUPPLY_VOLT_MAX_F; + +static const uint16_t SUPPLY_CURRENT_MAX_W = HW_HB_SUPPLY_CURRENT_MAX_W; +static const uint16_t SUPPLY_CURRENT_MAX_F = HW_HB_SUPPLY_CURRENT_MAX_F; + +static const uint16_t SUPPLY_POWER_MAX_W = HW_HB_SUPPLY_POWER_MAX_W; +static const uint16_t SUPPLY_POWER_MAX_F = HW_HB_SUPPLY_POWER_MAX_F; + +static const uint16_t OUT_CURRENT_MAX_W = HW_HB_OUT_CURRENT_MAX_W; +static const uint16_t OUT_CURRENT_MAX_F = HW_HB_OUT_CURRENT_MAX_F; + +static const uint16_t OUT_VOLTAGE_MAX_W = HW_HB_OUT_VOLTAGE_MAX_W; +static const uint16_t OUT_VOLTAGE_MAX_F = HW_HB_OUT_VOLTAGE_MAX_F; + +static const uint16_t OUT_POWER_MAX_W = HW_HB_OUT_POWER_MAX_W; +static const uint16_t OUT_POWER_MAX_F = HW_HB_OUT_POWER_MAX_F; + +static const uint16_t OUT_RESISTANCE_MIN_W = HW_HB_OUT_RESISTANCE_MIN_W; +static const uint16_t OUT_RESISTANCE_MIN_F = HW_HB_OUT_RESISTANCE_MIN_F; + +static const uint16_t OUT_RESISTANCE_MAX_W = HW_HB_OUT_RESISTANCE_MAX_W; +static const uint16_t OUT_RESISTANCE_MAX_F = HW_HB_OUT_RESISTANCE_MAX_F; + +static const uint16_t FAULT_DELAY = HW_HB_FAULT_DELAY; +static const uint16_t WTOF_DELAY = HW_HB_WTOF_DELAY; + +/**** Private variables ****/ + +/**** Private function declarations ****/ +// Protection functions +static void faults_chs_reset(hb_fault_chs_t* ch_list); +static void faults_init(hb_faults_t* faults, hb_fault_chs_t* en_list); +static void faults_logic(hb_meas_t* measurements, hb_faults_t* faults); + +static uint8_t faults_check(hb_faults_t* faults, hb_fault_chs_t* en_list, hb_fault_chs_t* fb_list, fault_lvl_t check); +static uint8_t warnings_feedback(hb_faults_t* faults, hb_fault_chs_t* en_list, hb_fault_chs_t* fb_list); +static uint8_t faults_feedback(hb_faults_t* faults, hb_fault_chs_t* en_list, hb_fault_chs_t* fb_list); +static uint8_t faults_is_any(hb_fault_chs_t* fb_list); + +static uint8_t is_outside(uint16_t meas, uint16_t min, uint16_t max); + +static uint8_t fuse_subprocess(hb_feedback_t* hb_fb, hb_control_t* hb_ctrl); +static void target_to_control(int16_t target, uint16_t ref_voltage, uint16_t* pwm_out, uint8_t* low_out, hb_fault_chs_t* fault_ch_en); + +/**** Public function definitions ****/ +void hb_init(hb_feedback_t* hb_fb, hb_control_t* hb_ctrl) +{ + // Initialize control + hb_ctrl->enabled = 0; + + // Initialize protection structures + faults_init(&hb_ctrl->out_faults, &hb_ctrl->out_faults_en); + + fuse_reset(&hb_ctrl->out_fuse); + hb_ctrl->out_fuse_cfg.cooldown_time = 1000; + hb_ctrl->out_fuse_cfg.retry_time = 1000; + + // Initialize feedback structure + bsp_hb_read_meas(&hb_fb->analog); + faults_chs_reset(&hb_fb->faults); + faults_chs_reset(&hb_fb->warnings); + + hb_fb->enabled = 0; + hb_fb->warning_act = 0; + hb_fb->fault_act = 0; + hb_fb->fused = 0; + + bsp_hb_write_pwm(0); + bsp_hb_write_low(0); +} + +void hb_enable(hb_control_t* hb_ctrl) +{ + bsp_hb_write_pwm(0); + bsp_hb_write_low(1); + hb_ctrl->enabled = 1; +} + +void hb_disable(hb_control_t* hb_ctrl) +{ + hb_ctrl->enabled = 0; + bsp_hb_write_pwm(0); + bsp_hb_write_low(0); +} + + +void hb_process(int16_t target, hb_feedback_t* hb_fb, hb_control_t* hb_ctrl) +{ + uint16_t out_pwm = 0; + uint8_t low_on = 0; + + // Read feedback + bsp_hb_read_meas(&hb_fb->analog); + + // Process fuse + uint8_t fuse_act = fuse_subprocess(hb_fb, hb_ctrl); + + // Act on fuse state + if((fuse_act)||(!hb_ctrl->enabled)) + { + // Turn off output + bsp_hb_write_pwm(0); + bsp_hb_write_low(0); + return; + }; + + // Process new target + target_to_control(target, hb_fb->analog.sup_voltage, &out_pwm, &low_on, &hb_ctrl->out_faults_en); + + // Apply new controls + bsp_hb_write_low(low_on); + bsp_hb_write_pwm(out_pwm); +} + +/**** Private function definitions ****/ +static void target_to_control(int16_t target, uint16_t ref_voltage, uint16_t* pwm_out, uint8_t* low_out, hb_fault_chs_t* fault_ch_en) +{ + if(target < 0) + { + // Fast decay + *pwm_out = 0; + *low_out = 0; + // Set appropriate fault channels + fault_ch_en->out_short = 0; + fault_ch_en->out_ovp = 0; + } + else if(target == 0) + { + // Slow decay + *pwm_out = 0; + *low_out = 1; + // Set appropriate fault channels + fault_ch_en->out_short = 0; + fault_ch_en->out_ovp = 1; + } + else + { + // Calculate target PWM + *pwm_out = util_sat_ratio_16b((uint16_t)target, ref_voltage); + *low_out = 1; + fault_ch_en->out_short = 1; + fault_ch_en->out_ovp = 1; + } +} + +static uint8_t fuse_subprocess(hb_feedback_t* hb_fb, hb_control_t* hb_ctrl) +{ + // Process faults + faults_logic(&hb_fb->analog, &hb_ctrl->out_faults); + + // Check if any enabled fault is active + uint8_t warn_act = warnings_feedback(&hb_ctrl->out_faults, &hb_ctrl->out_faults_en, &hb_fb->warnings); + uint8_t fault_act = faults_feedback(&hb_ctrl->out_faults, &hb_ctrl->out_faults_en, &hb_fb->faults); + + // Process fuse state + uint8_t fuse_act = fuse_process(&hb_ctrl->out_fuse, fault_act, &hb_ctrl->out_fuse_cfg); + + // Copy feedback data + hb_fb->enabled = hb_ctrl->enabled; + hb_fb->warning_act = warn_act; + hb_fb->fault_act = fault_act; + hb_fb->fused = fuse_act; + + return fuse_act; +} + +// Fault logic functions +static void faults_chs_reset(hb_fault_chs_t* ch_list) +{ + // Zero all channels + ch_list->sup_uvp = 0; + ch_list->sup_ovp = 0; + ch_list->sup_ocp = 0; + ch_list->sup_opp = 0; + ch_list->out_ovp = 0; + ch_list->out_ocp = 0; + ch_list->out_opp = 0; + ch_list->out_short = 0; + ch_list->out_open = 0; +} + +static void faults_init(hb_faults_t* faults, hb_fault_chs_t* en_list) +{ + // Init state + fault_reset(&faults->sup_uvp); + fault_reset(&faults->sup_ovp); + fault_reset(&faults->sup_ocp); + fault_reset(&faults->sup_opp); + fault_reset(&faults->out_ovp); + fault_reset(&faults->out_ocp); + fault_reset(&faults->out_opp); + fault_reset(&faults->out_short); + fault_reset(&faults->out_open); + + // Init enabled channels + faults_chs_reset(en_list); + en_list->sup_ocp = 1; + en_list->out_ocp = 1; + en_list->out_short = 1; +} + +static void faults_logic(hb_meas_t* measurements, hb_faults_t* faults) +{ + uint8_t w_trig = 0; + uint8_t f_trig = 0; + + fault_cfg_t fault_cfg; + fault_cfg.delay = FAULT_DELAY; + fault_cfg.wtof = WTOF_DELAY; + + // Check supply voltage + w_trig = is_outside(measurements->sup_voltage, SUPPLY_VOLT_MIN_W, 0); + f_trig = is_outside(measurements->sup_voltage, SUPPLY_VOLT_MIN_F, 0); + fault_process(&faults->sup_uvp, w_trig, f_trig, &fault_cfg); + + w_trig = is_outside(measurements->sup_voltage, 0, SUPPLY_VOLT_MAX_W); + f_trig = is_outside(measurements->sup_voltage, 0, SUPPLY_VOLT_MAX_F); + fault_process(&faults->sup_ovp, w_trig, f_trig, &fault_cfg); + + // Check supply current + w_trig = is_outside(measurements->sup_current, 0, SUPPLY_CURRENT_MAX_W); + f_trig = is_outside(measurements->sup_current, 0, SUPPLY_CURRENT_MAX_F); + fault_process(&faults->sup_ocp, w_trig, f_trig, &fault_cfg); + + // Check supply power + w_trig = is_outside(measurements->sup_power, 0, SUPPLY_POWER_MAX_W); + f_trig = is_outside(measurements->sup_power, 0, SUPPLY_POWER_MAX_F); + fault_process(&faults->sup_opp, w_trig, f_trig, &fault_cfg); + + // Check output voltage + w_trig = is_outside(measurements->out_voltage, 0, OUT_VOLTAGE_MAX_W); + f_trig = is_outside(measurements->out_voltage, 0, OUT_VOLTAGE_MAX_F); + fault_process(&faults->out_ovp, w_trig, f_trig, &fault_cfg); + + // Check output current + w_trig = is_outside(measurements->out_current, 0, OUT_CURRENT_MAX_W); + f_trig = is_outside(measurements->out_current, 0, OUT_CURRENT_MAX_F); + fault_process(&faults->out_ocp, w_trig, f_trig, &fault_cfg); + + // Check output power + w_trig = is_outside(measurements->out_power, 0, OUT_POWER_MAX_W); + f_trig = is_outside(measurements->out_power, 0, OUT_POWER_MAX_F); + fault_process(&faults->out_opp, w_trig, f_trig, &fault_cfg); + + // Check output resistance + w_trig = is_outside(measurements->out_impedance, OUT_RESISTANCE_MIN_W, 0); + f_trig = is_outside(measurements->out_impedance, OUT_RESISTANCE_MIN_F, 0); + fault_process(&faults->out_short, w_trig, f_trig, &fault_cfg); + + w_trig = is_outside(measurements->out_impedance, 0, OUT_RESISTANCE_MAX_W); + f_trig = is_outside(measurements->out_impedance, 0, OUT_RESISTANCE_MAX_F); + fault_process(&faults->out_open, w_trig, f_trig, &fault_cfg); +} + +static uint8_t warnings_feedback(hb_faults_t* faults, hb_fault_chs_t* en_list, hb_fault_chs_t* fb_list) +{ + return faults_check(faults, en_list, fb_list, FAULT_LVL_WARNING); +} + +static uint8_t faults_feedback(hb_faults_t* faults, hb_fault_chs_t* en_list, hb_fault_chs_t* fb_list) +{ + return faults_check(faults, en_list, fb_list, FAULT_LVL_FAULT); +} + +// Utilities +static uint8_t is_outside(uint16_t meas, uint16_t min, uint16_t max) +{ + if((meas < min)||((max!=0)&&(meas > max))) return 1; + else return 0; +} + +static uint8_t faults_check(hb_faults_t* faults, hb_fault_chs_t* en_list, hb_fault_chs_t* fb_list, fault_lvl_t check) +{ + if((en_list->sup_uvp)&&(faults->sup_uvp.severity == check)) fb_list->sup_uvp = 1; + if((en_list->sup_ovp)&&(faults->sup_ovp.severity == check)) fb_list->sup_ovp = 1; + if((en_list->sup_ocp)&&(faults->sup_ocp.severity == check)) fb_list->sup_ocp = 1; + if((en_list->sup_opp)&&(faults->sup_opp.severity == check)) fb_list->sup_opp = 1; + if((en_list->out_ovp)&&(faults->out_ovp.severity == check)) fb_list->out_ovp = 1; + if((en_list->out_ocp)&&(faults->out_ocp.severity == check)) fb_list->out_ocp = 1; + if((en_list->out_opp)&&(faults->out_opp.severity == check)) fb_list->out_opp = 1; + if((en_list->out_short)&&(faults->out_short.severity == check)) fb_list->out_short = 1; + if((en_list->out_open)&&(faults->out_open.severity == check)) fb_list->out_open = 1; + + return faults_is_any(fb_list); +} + +static uint8_t faults_is_any(hb_fault_chs_t* fb_list) +{ + if(fb_list->sup_uvp) return 1; + if(fb_list->sup_ovp) return 1; + if(fb_list->sup_ocp) return 1; + if(fb_list->sup_opp) return 1; + if(fb_list->out_ovp) return 1; + if(fb_list->out_ocp) return 1; + if(fb_list->out_opp) return 1; + if(fb_list->out_short) return 1; + if(fb_list->out_open) return 1; + + return 0; +} + +#ifdef TESTING +uint8_t hb_is_equal_fb_struct(hb_feedback_t* f1, hb_feedback_t* f2) +{ + if(f1->analog.out_voltage != f2->analog.out_voltage ) return 0; + if(f1->analog.out_current != f2->analog.out_current ) return 0; + if(f1->analog.sup_voltage != f2->analog.sup_voltage ) return 0; + if(f1->analog.sup_current != f2->analog.sup_current ) return 0; + if(f1->analog.out_power != f2->analog.out_power ) return 0; + if(f1->analog.sup_power != f2->analog.sup_power ) return 0; + if(f1->analog.out_impedance != f2->analog.out_impedance ) return 0; + if(f1->analog.low_side_ctrl != f2->analog.low_side_ctrl ) return 0; + if(f1->analog.pwm != f2->analog.pwm ) return 0; + if(f1->enabled != f2->enabled ) return 0; + if(f1->warning_act != f2->warning_act ) return 0; + if(f1->fault_act != f2->fault_act ) return 0; + if(f1->fused != f2->fused ) return 0; + if(f1->warnings.sup_uvp != f2->warnings.sup_uvp ) return 0; + if(f1->warnings.sup_ovp != f2->warnings.sup_ovp ) return 0; + if(f1->warnings.sup_ocp != f2->warnings.sup_ocp ) return 0; + if(f1->warnings.sup_opp != f2->warnings.sup_opp ) return 0; + if(f1->warnings.out_ovp != f2->warnings.out_ovp ) return 0; + if(f1->warnings.out_ocp != f2->warnings.out_ocp ) return 0; + if(f1->warnings.out_opp != f2->warnings.out_opp ) return 0; + if(f1->warnings.out_short != f2->warnings.out_short ) return 0; + if(f1->warnings.out_open != f2->warnings.out_open ) return 0; + if(f1->faults.sup_uvp != f2->faults.sup_uvp ) return 0; + if(f1->faults.sup_ovp != f2->faults.sup_ovp ) return 0; + if(f1->faults.sup_ocp != f2->faults.sup_ocp ) return 0; + if(f1->faults.sup_opp != f2->faults.sup_opp ) return 0; + if(f1->faults.out_ovp != f2->faults.out_ovp ) return 0; + if(f1->faults.out_ocp != f2->faults.out_ocp ) return 0; + if(f1->faults.out_opp != f2->faults.out_opp ) return 0; + if(f1->faults.out_short != f2->faults.out_short ) return 0; + if(f1->faults.out_open != f2->faults.out_open ) return 0; + + return 1; +} + +uint8_t hb_is_equal_ctrl_struct(hb_control_t* c1, hb_control_t* c2) +{ + if(c1->enabled != c2->enabled ) return 0; + if(c1->out_faults.sup_uvp.severity != c2->out_faults.sup_uvp.severity ) return 0; + if(c1->out_faults.sup_uvp.w_time != c2->out_faults.sup_uvp.w_time ) return 0; + if(c1->out_faults.sup_uvp.f_time != c2->out_faults.sup_uvp.f_time ) return 0; + if(c1->out_faults.sup_ovp.severity != c2->out_faults.sup_ovp.severity ) return 0; + if(c1->out_faults.sup_ovp.w_time != c2->out_faults.sup_ovp.w_time ) return 0; + if(c1->out_faults.sup_ovp.f_time != c2->out_faults.sup_ovp.f_time ) return 0; + if(c1->out_faults.sup_ocp.severity != c2->out_faults.sup_ocp.severity ) return 0; + if(c1->out_faults.sup_ocp.w_time != c2->out_faults.sup_ocp.w_time ) return 0; + if(c1->out_faults.sup_ocp.f_time != c2->out_faults.sup_ocp.f_time ) return 0; + if(c1->out_faults.sup_opp.severity != c2->out_faults.sup_opp.severity ) return 0; + if(c1->out_faults.sup_opp.w_time != c2->out_faults.sup_opp.w_time ) return 0; + if(c1->out_faults.sup_opp.f_time != c2->out_faults.sup_opp.f_time ) return 0; + if(c1->out_faults.out_ovp.severity != c2->out_faults.out_ovp.severity ) return 0; + if(c1->out_faults.out_ovp.w_time != c2->out_faults.out_ovp.w_time ) return 0; + if(c1->out_faults.out_ovp.f_time != c2->out_faults.out_ovp.f_time ) return 0; + if(c1->out_faults.out_ocp.severity != c2->out_faults.out_ocp.severity ) return 0; + if(c1->out_faults.out_ocp.w_time != c2->out_faults.out_ocp.w_time ) return 0; + if(c1->out_faults.out_ocp.f_time != c2->out_faults.out_ocp.f_time ) return 0; + if(c1->out_faults.out_opp.severity != c2->out_faults.out_opp.severity ) return 0; + if(c1->out_faults.out_opp.w_time != c2->out_faults.out_opp.w_time ) return 0; + if(c1->out_faults.out_opp.f_time != c2->out_faults.out_opp.f_time ) return 0; + if(c1->out_faults.out_short.severity != c2->out_faults.out_short.severity ) return 0; + if(c1->out_faults.out_short.w_time != c2->out_faults.out_short.w_time ) return 0; + if(c1->out_faults.out_short.f_time != c2->out_faults.out_short.f_time ) return 0; + if(c1->out_faults.out_open.severity != c2->out_faults.out_open.severity ) return 0; + if(c1->out_faults.out_open.w_time != c2->out_faults.out_open.w_time ) return 0; + if(c1->out_faults.out_open.f_time != c2->out_faults.out_open.f_time ) return 0; + if(c1->out_faults_en.sup_uvp != c2->out_faults_en.sup_uvp ) return 0; + if(c1->out_faults_en.sup_ovp != c2->out_faults_en.sup_ovp ) return 0; + if(c1->out_faults_en.sup_ocp != c2->out_faults_en.sup_ocp ) return 0; + if(c1->out_faults_en.sup_opp != c2->out_faults_en.sup_opp ) return 0; + if(c1->out_faults_en.out_ovp != c2->out_faults_en.out_ovp ) return 0; + if(c1->out_faults_en.out_ocp != c2->out_faults_en.out_ocp ) return 0; + if(c1->out_faults_en.out_opp != c2->out_faults_en.out_opp ) return 0; + if(c1->out_faults_en.out_short != c2->out_faults_en.out_short ) return 0; + if(c1->out_faults_en.out_open != c2->out_faults_en.out_open ) return 0; + if(c1->out_fuse.state != c2->out_fuse.state ) return 0; + if(c1->out_fuse.count != c2->out_fuse.count ) return 0; + if(c1->out_fuse.timer != c2->out_fuse.timer ) return 0; + if(c1->out_fuse_cfg.cooldown_time != c2->out_fuse_cfg.cooldown_time ) return 0; + if(c1->out_fuse_cfg.retry_time != c2->out_fuse_cfg.retry_time ) return 0; + + return 1; +} +#endif diff --git a/firmware/src/hw/hb_control.h b/firmware/src/hw/hb_control.h new file mode 100644 index 0000000..aae6afe --- /dev/null +++ b/firmware/src/hw/hb_control.h @@ -0,0 +1,67 @@ +#ifndef HB_CONTROL_H_ +#define HB_CONTROL_H_ + +/**** Includes ****/ +#include +#include "board/utils/faults.h" +#include "board/utils/fuses.h" +#include "board/halfbridge.h" +#include "config.h" + +/**** Public definitions ****/ +typedef struct { + fault_t sup_uvp; + fault_t sup_ovp; + fault_t sup_ocp; + fault_t sup_opp; + fault_t out_ovp; + fault_t out_ocp; + fault_t out_opp; + fault_t out_short; + fault_t out_open; +} hb_faults_t; + +typedef struct { + uint8_t sup_uvp; + uint8_t sup_ovp; + uint8_t sup_ocp; + uint8_t sup_opp; + uint8_t out_ovp; + uint8_t out_ocp; + uint8_t out_opp; + uint8_t out_short; + uint8_t out_open; +} hb_fault_chs_t; + +typedef struct { + hb_meas_t analog; + uint8_t enabled; + uint8_t warning_act; + uint8_t fault_act; + uint8_t fused; + hb_fault_chs_t warnings; + hb_fault_chs_t faults; +} hb_feedback_t; + +typedef struct { + uint8_t enabled; + hb_faults_t out_faults; + hb_fault_chs_t out_faults_en; + fuse_t out_fuse; + fuse_cfg_t out_fuse_cfg; +} hb_control_t; + +/**** Public function declarations ****/ +void hb_init(hb_feedback_t* hb_fb, hb_control_t* hb_ctrl); + +void hb_enable(hb_control_t* hb_ctrl); +void hb_disable(hb_control_t* hb_ctrl); + +void hb_process(int16_t target, hb_feedback_t* hb_fb, hb_control_t* hb_ctrl); + +#ifdef TESTING +uint8_t hb_is_equal_fb_struct(hb_feedback_t* f1, hb_feedback_t* f2); +uint8_t hb_is_equal_ctrl_struct(hb_control_t* c1, hb_control_t* c2); +#endif + +#endif /* HB_CONTROL_H_ */ \ No newline at end of file diff --git a/firmware/src/hw/led_display.c b/firmware/src/hw/led_display.c new file mode 100644 index 0000000..d3ebc89 --- /dev/null +++ b/firmware/src/hw/led_display.c @@ -0,0 +1,38 @@ +/**** Includes ****/ +#include "board/odout.h" +#include "led_display.h" + +/**** Private definitions ****/ +/**** Private constants ****/ +/**** Private variables ****/ +/**** Private function declarations ****/ + +/**** Public function definitions ****/ +void led_dsp_set_image(uint8_t image) +{ + if(image&0x01) bsp_odout_write(BSP_OD1, BSP_ODOUT_LOW); + else bsp_odout_write(BSP_OD1, BSP_ODOUT_HIZ); + + if(image&0x02) bsp_odout_write(BSP_OD2, BSP_ODOUT_LOW); + else bsp_odout_write(BSP_OD2, BSP_ODOUT_HIZ); + + if(image&0x04) bsp_odout_write(BSP_OD3, BSP_ODOUT_LOW); + else bsp_odout_write(BSP_OD3, BSP_ODOUT_HIZ); + + if(image&0x08) bsp_odout_write(BSP_OD4, BSP_ODOUT_LOW); + else bsp_odout_write(BSP_OD4, BSP_ODOUT_HIZ); + + if(image&0x10) bsp_odout_write(BSP_OD5, BSP_ODOUT_LOW); + else bsp_odout_write(BSP_OD5, BSP_ODOUT_HIZ); + + if(image&0x20) bsp_odout_write(BSP_OD6, BSP_ODOUT_LOW); + else bsp_odout_write(BSP_OD6, BSP_ODOUT_HIZ); +} + +void led_dsp_backligth_set(uint8_t percent) +{ + bsp_odout_write_common(percent); +} + +/**** Private function definitions ****/ + diff --git a/firmware/src/hw/led_display.h b/firmware/src/hw/led_display.h new file mode 100644 index 0000000..ac61a08 --- /dev/null +++ b/firmware/src/hw/led_display.h @@ -0,0 +1,19 @@ +#ifndef LED_DISPLAY_H_ +#define LED_DISPLAY_H_ + +/* +*/ + +/**** Includes ****/ +#include + +/**** Public definitions ****/ + +/**** Public function declarations ****/ +void led_dsp_set_image(uint8_t image); +void led_dsp_backligth_set(uint8_t percent); + +#ifdef TESTING +#endif + +#endif /* LED_DISPLAY_H_ */ diff --git a/firmware/src/hw/startup.c b/firmware/src/hw/startup.c new file mode 100644 index 0000000..7d37254 --- /dev/null +++ b/firmware/src/hw/startup.c @@ -0,0 +1,16 @@ +/**** Includes ****/ +#include "board/utils/utils.h" +#include "board/setup.h" +#include "startup.h" + +/**** Private definitions ****/ +/**** Private constants ****/ +/**** Private variables ****/ +/**** Private function declarations ****/ +/**** Public function definitions ****/ +void hw_startup(void) +{ + bsp_startup(); +} + +/**** Private function definitions ****/ diff --git a/firmware/src/hw/startup.h b/firmware/src/hw/startup.h new file mode 100644 index 0000000..8d8b511 --- /dev/null +++ b/firmware/src/hw/startup.h @@ -0,0 +1,14 @@ +#ifndef HW_STARTUP_H_ +#define HW_STARTUP_H_ + +/**** Includes ****/ +#include + +/**** Public definitions ****/ +/**** Public function declarations ****/ +void hw_startup(void); + +#ifdef TESTING +#endif + +#endif /* HW_STARTUP_H_ */ \ No newline at end of file diff --git a/firmware/src/logic/coil.c b/firmware/src/logic/coil.c new file mode 100644 index 0000000..7b32da2 --- /dev/null +++ b/firmware/src/logic/coil.c @@ -0,0 +1,41 @@ +/**** Includes ****/ +#include "coil.h" + +/**** Private definitions ****/ +/**** Private constants ****/ +static const int16_t TARGET_HANDBRAKE = COIL_TARGET_HANDBRAKE; +static const int16_t LOCK_VOLTAGE = COIL_LOCK_VOLTAGE; + +/**** Private variables ****/ +/**** Private function declarations ****/ + +/**** Public function definitions ****/ +int16_t coil_target(uint8_t force, uint8_t hbrake_act) +{ + if(hbrake_act) + { + return TARGET_HANDBRAKE; + } + else if(force==0) + { + return 0; + } + else if(force >= 100) + { + return LOCK_VOLTAGE; + } + else + { + // Calculate target + uint32_t t = (uint32_t)force * LOCK_VOLTAGE; + t /= 100; + if(t > LOCK_VOLTAGE) return LOCK_VOLTAGE; + else if(t < 0) return 0; + else return (int16_t)t; + } + + return 0; +} + +/**** Private function definitions ****/ + diff --git a/firmware/src/logic/coil.h b/firmware/src/logic/coil.h new file mode 100644 index 0000000..6a14495 --- /dev/null +++ b/firmware/src/logic/coil.h @@ -0,0 +1,17 @@ +#ifndef COIL_H_ +#define COIL_H_ + +/**** Includes ****/ +#include + +/**** Public definitions ****/ +#define COIL_TARGET_HANDBRAKE -1 +#define COIL_LOCK_VOLTAGE 6500 + +/**** Public function declarations ****/ +int16_t coil_target(uint8_t force, uint8_t hbrake_act); + +#ifdef TESTING +#endif + +#endif /* COIL_H_ */ \ No newline at end of file diff --git a/firmware/src/logic/display.c b/firmware/src/logic/display.c new file mode 100644 index 0000000..d46e8e8 --- /dev/null +++ b/firmware/src/logic/display.c @@ -0,0 +1,108 @@ +/**** Includes ****/ +#include "display.h" + +/**** Private definitions ****/ +/**** Private constants ****/ +static const uint8_t BACKLIGHT_DIMM = DSP_BACKLIGHT_DIMM_PERCENT; +static const uint8_t BACKLIGHT_BRIGTH = DSP_BACKLIGHT_BRIGTH_PERCENT; + +/**** Private variables ****/ +/**** Private function declarations ****/ +static uint8_t img_gen_dot10(uint8_t percent); +static uint8_t img_gen_dot20(uint8_t percent); +static uint8_t img_gen_bar(uint8_t percent); + +/**** Public function definitions ****/ +void dsp_init_ctrl(dsp_ctrl_t* ctrl) +{ + ctrl->img_lock = 0; + ctrl->act_img = 0x00; +} + +void dsp_set_lock(dsp_ctrl_t* ctrl) +{ + ctrl->img_lock = 1; +} + +void dsp_reset_lock(dsp_ctrl_t* ctrl) +{ + ctrl->img_lock = 0; +} + +uint8_t dsp_img_percent(uint8_t value, dsp_style_t style, dsp_ctrl_t* ctrl) +{ + if(ctrl->img_lock) return ctrl->act_img; + + switch(style) + { + case LED_DSP_BAR: + ctrl->act_img = img_gen_bar(value); + break; + + case LED_DSP_DOT10: + ctrl->act_img = img_gen_dot10(value); + break; + + default: + ctrl->act_img = img_gen_dot20(value); + break; + } + + return ctrl->act_img; +} + +uint8_t dsp_img_raw(uint8_t image, dsp_ctrl_t* ctrl) +{ + if(ctrl->img_lock) return ctrl->act_img; + + ctrl->act_img = image & 0x3F; + + return ctrl->act_img; +} + +uint8_t dsp_get_act_img(dsp_ctrl_t* ctrl) +{ + return ctrl->act_img; +} + +uint8_t dsp_backlight(uint8_t dimm_act) +{ + if(dimm_act) return BACKLIGHT_DIMM; + else return BACKLIGHT_BRIGTH; +} + +/**** Private function definitions ****/ +static uint8_t img_gen_dot10(uint8_t percent) +{ + if(percent<6) return 0x01; + else if(percent<16) return 0x03; + else if(percent<26) return 0x02; + else if(percent<36) return 0x06; + else if(percent<46) return 0x04; + else if(percent<56) return 0x0C; + else if(percent<66) return 0x08; + else if(percent<76) return 0x18; + else if(percent<86) return 0x10; + else if(percent<96) return 0x30; + else return 0x20; +} + +static uint8_t img_gen_dot20(uint8_t percent) +{ + if(percent<11) return 0x01; + else if(percent<31) return 0x02; + else if(percent<51) return 0x04; + else if(percent<71) return 0x08; + else if(percent<91) return 0x10; + else return 0x20; +} + +static uint8_t img_gen_bar(uint8_t percent) +{ + if(percent<11) return 0x01; + else if(percent<31) return 0x03; + else if(percent<51) return 0x07; + else if(percent<71) return 0x0F; + else if(percent<91) return 0x1F; + else return 0x3F; +} diff --git a/firmware/src/logic/display.h b/firmware/src/logic/display.h new file mode 100644 index 0000000..588bd79 --- /dev/null +++ b/firmware/src/logic/display.h @@ -0,0 +1,37 @@ +#ifndef LOGIC_DISPLAY_H_ +#define LOGIC_DISPLAY_H_ + +/**** Includes ****/ +#include + +/**** Public definitions ****/ +#define DSP_BACKLIGHT_DIMM_PERCENT 50 +#define DSP_BACKLIGHT_BRIGTH_PERCENT 100 + +typedef enum { + LED_DSP_DOT20, + LED_DSP_DOT10, + LED_DSP_BAR +} dsp_style_t; + +typedef struct { + uint8_t img_lock; + uint8_t act_img; +} dsp_ctrl_t; + +/**** Public function declarations ****/ +void dsp_init_ctrl(dsp_ctrl_t* ctrl); + +void dsp_set_lock(dsp_ctrl_t* ctrl); +void dsp_reset_lock(dsp_ctrl_t* ctrl); + +uint8_t dsp_img_percent(uint8_t value, dsp_style_t style, dsp_ctrl_t* ctrl); +uint8_t dsp_img_raw(uint8_t image, dsp_ctrl_t* ctrl); +uint8_t dsp_get_act_img(dsp_ctrl_t* ctrl); + +uint8_t dsp_backlight(uint8_t dimm_act); + +#ifdef TESTING +#endif + +#endif /* LOGIC_DISPLAY_H_ */ diff --git a/firmware/src/logic/force.c b/firmware/src/logic/force.c new file mode 100644 index 0000000..adee492 --- /dev/null +++ b/firmware/src/logic/force.c @@ -0,0 +1,63 @@ +/**** Includes ****/ +#include "force.h" + +/**** Private definitions ****/ +/**** Private constants ****/ +static const uint16_t MAX_HBRAKE_HOLD_TIME = FORCE_MAX_HBRAKE_HOLD_TIME; + +/**** Private variables ****/ +/**** Private function declarations ****/ + +/**** Public function definitions ****/ +#ifdef TESTING +#endif + +uint8_t force_next(uint8_t handbrake, uint8_t brakes, fbrake_mode_t bmode, uint8_t user_force, uint16_t hbarke_act_time) +{ + // Do force logic + if((handbrake)&&(hbarke_act_time < MAX_HBRAKE_HOLD_TIME)) + { + return 0; + } + else if(brakes) + { + switch(bmode) + { + case FORCE_BMODE_KEEP: + return user_force; + break; + + case FORCE_BMODE_LOCK: + return 100; + break; + + default: //FORCE_BMODE_OPEN + return 0; + break; + } + } + else + { + return user_force; + } + + return 0; +} + +fbrake_mode_t force_cycle_bmode(fbrake_mode_t bmode) +{ + switch(bmode) + { + case FORCE_BMODE_OPEN: + return FORCE_BMODE_KEEP; + + case FORCE_BMODE_KEEP: + return FORCE_BMODE_LOCK; + + default: + return FORCE_BMODE_OPEN; + } +} + +/**** Private function definitions ****/ + diff --git a/firmware/src/logic/force.h b/firmware/src/logic/force.h new file mode 100644 index 0000000..4655b45 --- /dev/null +++ b/firmware/src/logic/force.h @@ -0,0 +1,23 @@ +#ifndef FORCE_H_ +#define FORCE_H_ + +/**** Includes ****/ +#include + +/**** Public definitions ****/ +#define FORCE_MAX_HBRAKE_HOLD_TIME 1000 + +typedef enum { + FORCE_BMODE_OPEN, + FORCE_BMODE_KEEP, + FORCE_BMODE_LOCK +} fbrake_mode_t; + +/**** Public function declarations ****/ +uint8_t force_next(uint8_t handbrake, uint8_t brakes, fbrake_mode_t bmode, uint8_t user_force, uint16_t hbarke_act_time); +fbrake_mode_t force_cycle_bmode(fbrake_mode_t bmode); + +#ifdef TESTING +#endif + +#endif /* FORCE_H_ */ \ No newline at end of file diff --git a/firmware/src/logic/pot.c b/firmware/src/logic/pot.c new file mode 100644 index 0000000..932639c --- /dev/null +++ b/firmware/src/logic/pot.c @@ -0,0 +1,42 @@ +/**** Includes ****/ +#include "pot.h" + +/**** Private definitions ****/ +/**** Private constants ****/ +/**** Private variables ****/ +/**** Private function declarations ****/ +/**** Public function definitions ****/ +#ifdef TESTING +#endif + +uint8_t pot_mv_to_percent(uint16_t value, pot_cfg_t* cfg) +{ + // Setup limits + uint16_t bottom = 0; + uint16_t top = cfg->reference; + + // Adjust for top and bottom deadband + if(bottom < cfg->deadband) bottom = cfg->deadband; + if(top > cfg->deadband) top -= cfg->deadband; + + // Calculate percent + if(value <= bottom) return 0; + else if(value >= top) return 100; + else + { + // Adjust values for offset + if(bottom) + { + value = value - bottom; + top = top - bottom; + }; + + uint32_t y = (uint32_t)value * 100; + y = y/(uint32_t)top; + + return (uint16_t)y; + } +} + +/**** Private function definitions ****/ + diff --git a/firmware/src/logic/pot.h b/firmware/src/logic/pot.h new file mode 100644 index 0000000..d77c46b --- /dev/null +++ b/firmware/src/logic/pot.h @@ -0,0 +1,19 @@ +#ifndef POTENTIOMETER_H_ +#define POTENTIOMETER_H_ + +/**** Includes ****/ +#include + +/**** Public definitions ****/ +typedef struct { + uint16_t reference; + uint16_t deadband; +} pot_cfg_t; + +/**** Public function declarations ****/ +uint8_t pot_mv_to_percent(uint16_t value, pot_cfg_t* cfg); + +#ifdef TESTING +#endif + +#endif /* POTENTIOMETER_H_ */ \ No newline at end of file diff --git a/firmware/src/logic/user_force.c b/firmware/src/logic/user_force.c new file mode 100644 index 0000000..5f856cd --- /dev/null +++ b/firmware/src/logic/user_force.c @@ -0,0 +1,52 @@ +/**** Includes ****/ +#include "user_force.h" + +/**** Private definitions ****/ +/**** Private constants ****/ +static const uint8_t MAX_PERCENT = USER_FORCE_MAX_PERCENT; +static const uint8_t MIN_PERCENT = USER_FORCE_MIN_PERCENT; + +/**** Private variables ****/ +/**** Private function declarations ****/ +/**** Public function definitions ****/ +#ifdef TESTING +#endif + +uint8_t user_force_btn(uint8_t prev_force, uint8_t up_act, uint8_t down_act, uint8_t delta) +{ + uint8_t new_froce = prev_force; + + if(up_act) + { + new_froce = prev_force + delta; + // Limit overflow and top value + if(new_froce < prev_force) new_froce = 100; + else if(new_froce < MIN_PERCENT) new_froce = MIN_PERCENT; + }; + + if(down_act) + { + new_froce = prev_force - delta; + // Limit overflow and top value + if(new_froce > prev_force) new_froce = 0; + else if(new_froce > MAX_PERCENT) new_froce = MAX_PERCENT; + }; + + // Do deadband + if(new_froce < MIN_PERCENT) new_froce = 0; + else if(new_froce > MAX_PERCENT) new_froce = 100; + + return new_froce; +} + +uint8_t user_force_pot(uint8_t prev_force, uint8_t pot, uint8_t hyst) +{ + uint8_t new_froce = pot; + + if(new_froce < MIN_PERCENT) new_froce = 0; + else if(new_froce > MAX_PERCENT) new_froce = 100; + + return new_froce; +} + +/**** Private function definitions ****/ diff --git a/firmware/src/logic/user_force.h b/firmware/src/logic/user_force.h new file mode 100644 index 0000000..a7b5aa4 --- /dev/null +++ b/firmware/src/logic/user_force.h @@ -0,0 +1,18 @@ +#ifndef USER_FORCE_H_ +#define USER_FORCE_H_ + +/**** Includes ****/ +#include + +/**** Public definitions ****/ +#define USER_FORCE_MAX_PERCENT 90 +#define USER_FORCE_MIN_PERCENT 10 + +/**** Public function declarations ****/ +uint8_t user_force_btn(uint8_t prev_force, uint8_t up_act, uint8_t down_act, uint8_t delta); +uint8_t user_force_pot(uint8_t prev_force, uint8_t pot, uint8_t hyst); + +#ifdef TESTING +#endif + +#endif /* USER_FORCE_H_ */ \ No newline at end of file diff --git a/firmware/src/main.c b/firmware/src/main.c new file mode 100644 index 0000000..b1d9d5b --- /dev/null +++ b/firmware/src/main.c @@ -0,0 +1,127 @@ +/**** Includes ****/ +#include + +// Hardware IO +#include "hw/startup.h" +#include "hw/analog.h" +#include "hw/buttons.h" +#include "hw/hb_control.h" +#include "hw/led_display.h" + +// Logic blocks +#include "logic/coil.h" +#include "logic/display.h" +#include "logic/force.h" +#include "logic/pot.h" +#include "logic/user_force.h" + +/**** Private definitions ****/ +/**** Private constants ****/ +/**** Private variables ****/ +static volatile uint8_t user_force = 0; +static volatile uint8_t user_force_step = 10; + +static volatile fbrake_mode_t bmode = FORCE_BMODE_OPEN; + +static volatile uint8_t next_force = 0; +static volatile int16_t next_target = 0; + +static volatile hb_feedback_t hb_feedback; +static volatile hb_control_t hb_ctrl; + +static volatile uint8_t backlight = 0; +static volatile dsp_ctrl_t dsp_logic_ctrl; + +/**** Private function declarations ****/ + +/**** Public function definitions ****/ +int main(void) +{ + hw_startup(); + + // Create objects for all buttons + btn_t btn_mode; + btn_t btn_down; + btn_t btn_up; + btn_t btn_dimm; + btn_t btn_brakes; + btn_t btn_handbrake; + btn_t btn_handbrake_dir; + + // Set button pulls + //btn_ch_set_pull(BTN_1, BTN_PULL_HIGH); + //btn_ch_set_pull(BTN_2, BTN_PULL_HIGH); + //btn_ch_set_pull(BTN_3, BTN_PULL_HIGH); + btn_ch_set_pull(BTN_6, BTN_PULL_HIGH); + + // Create object for half-bridge control + + // Initialize half-bridge + hb_init(&hb_feedback, &hb_ctrl); + hb_enable(&hb_ctrl); + + // Init display backlight + dsp_init_ctrl(&dsp_logic_ctrl); + backlight = dsp_backlight(1); + led_dsp_backligth_set(backlight); + + while(1) + { + // Read buttons + btn_ch_process(BTN_1, &btn_mode); + btn_ch_process(BTN_2, &btn_down); + btn_ch_process(BTN_3, &btn_up); + btn_ch_process(BTN_4, &btn_dimm); + btn_ch_process(BTN_5, &btn_brakes); + btn_ch_process(BTN_6, &btn_handbrake); + btn_ch_process(BTN_6N, &btn_handbrake_dir); + + // Process user force changes + if((btn_up.new_state)||(btn_down.new_state)) + { + uint8_t up_act = btn_up.new_state & btn_up.state; + uint8_t down_act = btn_down.new_state & btn_down.state; + + user_force = user_force_btn(user_force, up_act, down_act, user_force_step); + btn_up.new_state = 0; + btn_down.new_state = 0; + }; + + // Process brake mode changes + if(btn_mode.new_state) + { + if(btn_mode.state) bmode = force_cycle_bmode(bmode); + btn_mode.new_state = 0; + }; + + // Calculate next force + next_force = force_next(btn_handbrake.state, btn_brakes.state, bmode, user_force, btn_handbrake.state_time); + + // Calculate next coil target + next_target = coil_target(next_force, btn_handbrake.state); + + // Read Half-bridge status and apply next target + hb_process(next_target, &hb_feedback, &hb_ctrl); + + // Generate image of current force + uint8_t img = 0x00; + + if(hb_feedback.fused) img = 0xAA; + else img = dsp_img_percent(next_force, LED_DSP_DOT10); + + // Apply image + led_dsp_set_image(img); + + // Process display backlight + if(btn_dimm.new_state) + { + backlight = dsp_backlight(btn_dimm.state); + led_dsp_backligth_set(backlight); + btn_dimm.new_state = 0; + }; + } + + return 0; +} + +/**** Private function definitions ****/ diff --git a/firmware/src/uDCCD_Controller.atsln b/firmware/src/uDCCD_Controller.atsln new file mode 100644 index 0000000..c9942df --- /dev/null +++ b/firmware/src/uDCCD_Controller.atsln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Atmel Studio Solution File, Format Version 11.00 +VisualStudioVersion = 14.0.23107.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "uDCCD_Controller", "uDCCD_Controller.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|AVR = Debug|AVR + Release|AVR = Release|AVR + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR + {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR + {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR + {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/firmware/src/uDCCD_Controller.componentinfo.xml b/firmware/src/uDCCD_Controller.componentinfo.xml new file mode 100644 index 0000000..49393d5 --- /dev/null +++ b/firmware/src/uDCCD_Controller.componentinfo.xml @@ -0,0 +1,86 @@ + + + + + + + Device + Startup + + + Atmel + 1.7.0 + C:/Program Files (x86)\Atmel\Studio\7.0\Packs + + + + + C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.7.374\include\ + + include + C + + + include/ + + + + + C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.7.374\include\avr\iom328pb.h + + header + C + TU9y07FA4IWGxznrvGv9rQ== + + include/avr/iom328pb.h + + + + + C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.7.374\templates\main.c + template + source + C Exe + YLr2MkKo6ZooP7MhARWYNA== + + templates/main.c + Main file (.c) + + + + C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.7.374\templates\main.cpp + template + source + C Exe + mkKaE95TOoATsuBGv6jmxg== + + templates/main.cpp + Main file (.cpp) + + + + C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.7.374\gcc\dev\atmega328pb + + libraryPrefix + GCC + + + gcc/dev/atmega328pb + + + + + ATmega_DFP + C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.7.374/Atmel.ATmega_DFP.pdsc + 1.7.374 + true + ATmega328PB + + + + Resolved + Fixed + true + + + \ No newline at end of file diff --git a/firmware/src/uDCCD_Controller.cproj b/firmware/src/uDCCD_Controller.cproj new file mode 100644 index 0000000..fd9019a --- /dev/null +++ b/firmware/src/uDCCD_Controller.cproj @@ -0,0 +1,276 @@ + + + + 2.0 + 7.0 + com.Atmel.AVRGCC8.C + dce6c7e3-ee26-4d79-826b-08594b9ad897 + ATmega328PB + none + Executable + C + $(MSBuildProjectName) + .elf + $(MSBuildProjectDirectory)\$(Configuration) + uDCCD_Controller + uDCCD_Controller + uDCCD_Controller + Native + true + false + true + true + 0x20000000 + + true + exception_table + 2 + 0 + 1 + + + + + + + + + + + + + + com.atmel.avrdbg.tool.atmelice + J42700001490 + 0x1E9516 + + + + 125000 + + debugWIRE + + com.atmel.avrdbg.tool.atmelice + J42700001490 + Atmel-ICE + + debugWIRE + 125000 + + + + + -mmcu=atmega328pb -B "%24(PackRepoDir)\atmel\ATmega_DFP\1.7.374\gcc\dev\atmega328pb" + True + True + True + True + False + True + True + + + NDEBUG + + + + + %24(PackRepoDir)\atmel\ATmega_DFP\1.7.374\include\ + + + Optimize for size (-Os) + True + True + True + + + libm + + + + + %24(PackRepoDir)\atmel\ATmega_DFP\1.7.374\include\ + + + + + + + + + -mmcu=atmega328pb -B "%24(PackRepoDir)\atmel\ATmega_DFP\1.7.374\gcc\dev\atmega328pb" + True + True + True + True + False + True + True + + + DEBUG + + + + + %24(PackRepoDir)\atmel\ATmega_DFP\1.7.374\include\ + + + True + True + Default (-g2) + True + + + libm + + + + + %24(PackRepoDir)\atmel\ATmega_DFP\1.7.374\include\ + + + Default (-Wa,-g) + + + + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + + + + + + + + + \ No newline at end of file diff --git a/firmware/tests/Units_Tests.workspace b/firmware/tests/Units_Tests.workspace new file mode 100644 index 0000000..35d25d9 --- /dev/null +++ b/firmware/tests/Units_Tests.workspace @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/firmware/tests/Units_Tests.workspace.layout b/firmware/tests/Units_Tests.workspace.layout new file mode 100644 index 0000000..3fa6504 --- /dev/null +++ b/firmware/tests/Units_Tests.workspace.layout @@ -0,0 +1,6 @@ + + + + + + diff --git a/firmware/tests/bsp_main.c b/firmware/tests/bsp_main.c new file mode 100644 index 0000000..fe5a2b9 --- /dev/null +++ b/firmware/tests/bsp_main.c @@ -0,0 +1,147 @@ +#include +#include + +#include "ut_utils/ut_utils.h" +#include "ut_utils/ut_fault.h" +#include "ut_utils/ut_fuses.h" + +#include "ut_board/ut_ain.h" +#include "ut_board/ut_din.h" +#include "ut_board/ut_dout.h" +#include "ut_board/ut_halfbridge.h" +#include "ut_board/ut_odout.h" +#include "ut_board/ut_setup.h" + +int main() +{ + int tr; + int pass = 1; + + /* UTILITIES TESTS */ + printf("******************************************************\n"); + + tr = ut_util_invert_8b_test(); + if(!tr) pass = 0; + + tr = ut_util_sat_add_8b_test(); + if(!tr) pass = 0; + + tr = ut_util_sat_subtract_8b_test(); + if(!tr) pass = 0; + + tr = ut_util_sat_util_sat_add_16b_test(); + if(!tr) pass = 0; + + tr = ut_util_sat_subtract_16b_test(); + if(!tr) pass = 0; + + tr = ut_util_limit_u32b_to_u16b_test(); + if(!tr) pass = 0; + + tr = ut_util_limit_s32b_to_u16b_test(); + if(!tr) pass = 0; + + tr = ut_util_convert_muldivoff_test(); + if(!tr) pass = 0; + + tr = ut_util_sat_mul_kilo_test(); + if(!tr) pass = 0; + + tr = ut_util_sat_div_kilo_test(); + if(!tr) pass = 0; + + tr = ut_util_sat_ratio_16b_test(); + if(!tr) pass = 0; + + tr = ut_util_percent_to_16b_test(); + if(!tr) pass = 0; + + /* FAULT TESTS */ + printf("******************************************************\n"); + + tr = ut_fault_process_test(); + if(!tr) pass = 0; + + tr = ut_fault_is_active_test(); + if(!tr) pass = 0; + + tr = ut_fault_is_warning_test(); + if(!tr) pass = 0; + + tr = ut_fault_reset_test(); + if(!tr) pass = 0; + + /* FUSE TESTS */ + printf("******************************************************\n"); + + tr = ut_fuse_reset_test(); + if(!tr) pass = 0; + + /* AIN TESTS */ + printf("******************************************************\n"); + + tr = ut_bsp_ain_read_test(); + if(!tr) pass = 0; + + /* DIN TESTS */ + printf("******************************************************\n"); + + tr = ut_bsp_din_read_test(); + if(!tr) pass = 0; + + /* DOUT TESTS */ + printf("******************************************************\n"); + + tr = ut_bsp_dout_write_test(); + if(!tr) pass = 0; + + /* HALFBRIDGE TESTS */ + printf("******************************************************\n"); + + tr = ut_bsp_hb_write_low_test(); + if(!tr) pass = 0; + + tr = ut_bsp_hb_write_pwm_test(); + if(!tr) pass = 0; + + tr = ut_bsp_hb_read_meas_test(); + if(!tr) pass = 0; + + /* ODOUT TESTS */ + printf("******************************************************\n"); + + tr = ut_bsp_odout_write_test(); + if(!tr) pass = 0; + + tr = ut_bsp_odout_write_common_test(); + if(!tr) pass = 0; + + /* SETUP TESTS */ + printf("******************************************************\n"); + + tr = ut_bsp_startup_test(); + if(!tr) pass = 0; + + /* FINAL RESULT */ + printf("******************************************************\n"); + + tr = ut_util_interpolate_1d_u16b_test(); + if(!tr) pass = 0; + + tr = ut_util_interpolate_2d_u16b_test(); + if(!tr) pass = 0; + + + if(pass) + { + printf("ALL PASS\n\n"); + return 1; + } + else + { + printf("SOME FAIL\n\n"); + return 0; + } + + return 0; +} diff --git a/firmware/tests/hw_main.c b/firmware/tests/hw_main.c new file mode 100644 index 0000000..442e284 --- /dev/null +++ b/firmware/tests/hw_main.c @@ -0,0 +1,102 @@ +#include +#include + +#include "ut_hw/ut_analog.h" +#include "ut_hw/ut_buttons.h" +#include "ut_hw/ut_hb_control.h" +#include "ut_hw/ut_led_display.h" +#include "ut_hw/ut_startup.h" + +int main() +{ + int tr; + int pass = 1; + int t_cnt = 0; + int f_cnt = 0; + + /* ANALOG TESTS */ + printf("******************************************************\n"); + + tr = ut_analog_ch_get_test(); + t_cnt++; + if(!tr){ pass = 0; f_cnt++;}; + + /* BUTTON TESTS */ + printf("******************************************************\n"); + + tr = ut_btn_reset_test(); + t_cnt++; + if(!tr){ pass = 0; f_cnt++;}; + + tr = ut_btn_process_test(); + t_cnt++; + if(!tr){ pass = 0; f_cnt++;}; + + tr = ut_btn_ch_process_test(); + t_cnt++; + if(!tr){ pass = 0; f_cnt++;}; + + tr = ut_btn_ch_set_pull_test(); + t_cnt++; + if(!tr){ pass = 0; f_cnt++;}; + + /* HALFBRIDGE CONTROL TESTS */ + printf("******************************************************\n"); + + tr = ut_hb_is_equal_fb_struct_test(); + t_cnt++; + if(!tr){ pass = 0; f_cnt++;}; + + tr = ut_hb_is_equal_ctrl_struct_test(); + t_cnt++; + if(!tr){ pass = 0; f_cnt++;}; + + tr = ut_hb_init_test(); + t_cnt++; + if(!tr){ pass = 0; f_cnt++;}; + + tr = ut_hb_enable_test(); + t_cnt++; + if(!tr){ pass = 0; f_cnt++;}; + + tr = ut_hb_disable_test(); + t_cnt++; + if(!tr){ pass = 0; f_cnt++;}; + + tr = ut_hb_process_test(); + t_cnt++; + if(!tr){ pass = 0; f_cnt++;}; + + /* DISPLAY TESTS */ + printf("******************************************************\n"); + + tr = ut_led_dsp_set_image_test(); + t_cnt++; + if(!tr){ pass = 0; f_cnt++;}; + + tr = ut_led_dsp_backligth_set_test(); + t_cnt++; + if(!tr){ pass = 0; f_cnt++;}; + + /* STARTUP TESTS */ + printf("******************************************************\n"); + + tr = ut_hw_startup_test(); + t_cnt++; + if(!tr){ pass = 0; f_cnt++;}; + + printf("******************************************************\n"); + printf("\n%d TESTS DONE\n", t_cnt); + if(pass) + { + printf("ALL PASS\n\n"); + return 1; + } + else + { + printf("%d FAILED\n\n", f_cnt); + return 0; + } + + return 0; +} diff --git a/firmware/tests/logic_main.c b/firmware/tests/logic_main.c new file mode 100644 index 0000000..66d6d11 --- /dev/null +++ b/firmware/tests/logic_main.c @@ -0,0 +1,98 @@ +#include +#include + +#include "ut_logic/ut_coil.h" +#include "ut_logic/ut_display.h" +#include "ut_logic/ut_force.h" +#include "ut_logic/ut_pot.h" +#include "ut_logic/ut_user_force.h" + +int main() +{ + int tr; + int pass = 1; + int t_cnt = 0; + int f_cnt = 0; + + /* COIL TESTS */ + printf("******************************************************\n"); + + tr = ut_coil_target_test(); + t_cnt++; + if(!tr){ pass = 0; f_cnt++;}; + + /* DISPLAY TESTS */ + printf("******************************************************\n"); + + tr = ut_dsp_init_ctrl_test(); + t_cnt++; + if(!tr){ pass = 0; f_cnt++;}; + + tr = ut_dsp_set_lock_test(); + t_cnt++; + if(!tr){ pass = 0; f_cnt++;}; + + tr = ut_dsp_reset_lock_test(); + t_cnt++; + if(!tr){ pass = 0; f_cnt++;}; + + tr = ut_dsp_img_percent_test(); + t_cnt++; + if(!tr){ pass = 0; f_cnt++;}; + + tr = ut_dsp_img_raw_test(); + t_cnt++; + if(!tr){ pass = 0; f_cnt++;}; + + tr = ut_dsp_get_act_img_test(); + t_cnt++; + if(!tr){ pass = 0; f_cnt++;}; + + tr = ut_dsp_backlight_test(); + t_cnt++; + if(!tr){ pass = 0; f_cnt++;}; + + /* FORCE TESTS */ + printf("******************************************************\n"); + + tr = ut_force_cycle_bmode_test(); + t_cnt++; + if(!tr){ pass = 0; f_cnt++;}; + + tr = ut_force_next_test(); + t_cnt++; + if(!tr){ pass = 0; f_cnt++;}; + + /* POT TESTS */ + printf("******************************************************\n"); + + tr = ut_pot_mv_to_percent_test(); + t_cnt++; + if(!tr){ pass = 0; f_cnt++;}; + + /* USER FORCE TESTS */ + printf("******************************************************\n"); + + tr = ut_user_force_btn_test(); + t_cnt++; + if(!tr){ pass = 0; f_cnt++;}; + + tr = ut_user_force_pot_test(); + t_cnt++; + if(!tr){ pass = 0; f_cnt++;}; + + printf("******************************************************\n"); + printf("\n%d TESTS DONE\n", t_cnt); + if(pass) + { + printf("ALL PASS\n\n"); + return 1; + } + else + { + printf("%d FAILED\n\n", f_cnt); + return 0; + } + + return 0; +} diff --git a/firmware/tests/mock_board/mock_board_ain.c b/firmware/tests/mock_board/mock_board_ain.c new file mode 100644 index 0000000..e7ca8f2 --- /dev/null +++ b/firmware/tests/mock_board/mock_board_ain.c @@ -0,0 +1,32 @@ +#include "mock_board_ain.h" + +#define AIN_CH_CNT 5 +static uint8_t ain_ch = 0; +static uint16_t ain_data[AIN_CH_CNT+1]; + +uint16_t bsp_ain_read(uint8_t ch) +{ + if(ch > AIN_CH_CNT) return 0; + ain_ch = ch; + return ain_data[ch]; +} + +uint8_t mock_board_ain_read_ch(void) +{ + return ain_ch; +} + +void mock_board_ain_write_ch(uint8_t ch) +{ + ain_ch = ch; +} + +uint16_t mock_board_ain_read_data(uint8_t ch) +{ + return ain_data[ch]; +} + +void mock_board_ain_write_data(uint8_t ch, uint16_t value) +{ + ain_data[ch] = value; +} diff --git a/firmware/tests/mock_board/mock_board_ain.h b/firmware/tests/mock_board/mock_board_ain.h new file mode 100644 index 0000000..7807d3b --- /dev/null +++ b/firmware/tests/mock_board/mock_board_ain.h @@ -0,0 +1,14 @@ +#ifndef MOCK_BOARD_AIN_ +#define MOCK_BOARD_AIN_ + +#include +#include + +#include "..\..\src\hw\board\ain.h" + +uint8_t mock_board_ain_read_ch(void); +void mock_board_ain_write_ch(uint8_t ch); +uint16_t mock_board_ain_read_data(uint8_t ch); +void mock_board_ain_write_data(uint8_t ch, uint16_t value); + +#endif /* MOCK_BOARD_AIN_ */ diff --git a/firmware/tests/mock_board/mock_board_din.c b/firmware/tests/mock_board/mock_board_din.c new file mode 100644 index 0000000..018d90f --- /dev/null +++ b/firmware/tests/mock_board/mock_board_din.c @@ -0,0 +1,32 @@ +#include "mock_board_din.h" + +#define DIN_CH_CNT 9 +static uint8_t din_ch = 0; +static uint8_t din_data[DIN_CH_CNT]; + +uint8_t bsp_din_read(uint8_t ch) +{ + if(ch >= DIN_CH_CNT) return BSP_DIN_LOW; + din_ch = ch; + return din_data[ch]; +} + +uint8_t mock_board_din_read_ch(void) +{ + return din_ch; +} + +void mock_board_din_write_ch(uint8_t ch) +{ + din_ch = ch; +} + +uint8_t mock_board_din_read_data(uint8_t ch) +{ + return din_data[ch]; +} + +void mock_board_din_write_data(uint8_t ch, uint8_t value) +{ + din_data[ch] = value; +} diff --git a/firmware/tests/mock_board/mock_board_din.h b/firmware/tests/mock_board/mock_board_din.h new file mode 100644 index 0000000..d117d60 --- /dev/null +++ b/firmware/tests/mock_board/mock_board_din.h @@ -0,0 +1,14 @@ +#ifndef MOCK_BOARD_DIN_ +#define MOCK_BOARD_DIN_ + +#include +#include + +#include "..\..\src\hw\board\din.h" + +uint8_t mock_board_din_read_ch(void); +void mock_board_din_write_ch(uint8_t ch); +uint8_t mock_board_din_read_data(uint8_t ch); +void mock_board_din_write_data(uint8_t ch, uint8_t value); + +#endif /* MOCK_BOARD_DIN_ */ diff --git a/firmware/tests/mock_board/mock_board_dout.c b/firmware/tests/mock_board/mock_board_dout.c new file mode 100644 index 0000000..3dba81b --- /dev/null +++ b/firmware/tests/mock_board/mock_board_dout.c @@ -0,0 +1,31 @@ +#include "mock_board_dout.h" + +#define DOUT_CH_CNT 7 +static uint8_t dout_ch = 0; +static int8_t dout_data[DOUT_CH_CNT]; + +void bsp_dout_write(uint8_t ch, int8_t lvl) +{ + if(ch < DOUT_CH_CNT) dout_data[ch] = lvl; + dout_ch = ch; +} + +uint8_t mock_board_dout_read_ch(void) +{ + return dout_ch; +} + +void mock_board_dout_write_ch(uint8_t ch) +{ + dout_ch = ch; +} + +int8_t mock_board_dout_read_data(uint8_t ch) +{ + return dout_data[ch]; +} + +void mock_board_dout_write_data(uint8_t ch, int8_t lvl) +{ + dout_data[ch] = lvl; +} diff --git a/firmware/tests/mock_board/mock_board_dout.h b/firmware/tests/mock_board/mock_board_dout.h new file mode 100644 index 0000000..8a9e058 --- /dev/null +++ b/firmware/tests/mock_board/mock_board_dout.h @@ -0,0 +1,14 @@ +#ifndef MOCK_BOARD_DOUT_ +#define MOCK_BOARD_DOUT_ + +#include +#include + +#include "..\..\src\hw\board\dout.h" + +uint8_t mock_board_dout_read_ch(void); +void mock_board_dout_write_ch(uint8_t ch); +int8_t mock_board_dout_read_data(uint8_t ch); +void mock_board_dout_write_data(uint8_t ch, int8_t lvl); + +#endif /* MOCK_BOARD_DOUT_ */ diff --git a/firmware/tests/mock_board/mock_board_halfbridge.c b/firmware/tests/mock_board/mock_board_halfbridge.c new file mode 100644 index 0000000..93e323f --- /dev/null +++ b/firmware/tests/mock_board/mock_board_halfbridge.c @@ -0,0 +1,76 @@ +#include "mock_board_halfbridge.h" + +#define DOUT_CH_CNT 6 +static uint8_t low_ctrl = 0; +static uint16_t pwm_ctrl = 0; +static hb_meas_t feedback; + +void bsp_hb_write_low(uint8_t state) +{ + low_ctrl = state; +} + +void bsp_hb_write_pwm(uint16_t pwm) +{ + pwm_ctrl = pwm; +} + +void bsp_hb_read_meas(hb_meas_t* measurements) +{ + measurements->out_voltage = feedback.out_voltage; + measurements->out_current = feedback.out_current; + measurements->sup_voltage = feedback.sup_voltage; + measurements->sup_current = feedback.sup_current; + measurements->out_power = feedback.out_power; + measurements->sup_power = feedback.sup_power; + measurements->out_impedance = feedback.out_impedance; + measurements->low_side_ctrl = feedback.low_side_ctrl; + measurements->pwm = feedback.pwm; +} + + +uint8_t mock_board_halfbridge_read_low(void) +{ + return low_ctrl; +} + +void mock_board_halfbridge_write_low(uint8_t state) +{ + low_ctrl = state; +} + +uint16_t mock_board_halfbridge_read_pwm(void) +{ + return pwm_ctrl; +} + +void mock_board_halfbridge_write_pwm(uint16_t pwm) +{ + pwm_ctrl = pwm; +} + +void mock_board_halfbridge_read_feedback(hb_meas_t* measurements) +{ + measurements->out_voltage = feedback.out_voltage; + measurements->out_current = feedback.out_current; + measurements->sup_voltage = feedback.sup_voltage; + measurements->sup_current = feedback.sup_current; + measurements->out_power = feedback.out_power; + measurements->sup_power = feedback.sup_power; + measurements->out_impedance = feedback.out_impedance; + measurements->low_side_ctrl = feedback.low_side_ctrl; + measurements->pwm = feedback.pwm; +} + +void mock_board_halfbridge_write_feedback(hb_meas_t* new_fb) +{ + feedback.out_voltage = new_fb->out_voltage; + feedback.out_current = new_fb->out_current; + feedback.sup_voltage = new_fb->sup_voltage; + feedback.sup_current = new_fb->sup_current; + feedback.out_power = new_fb->out_power; + feedback.sup_power = new_fb->sup_power; + feedback.out_impedance = new_fb->out_impedance; + feedback.low_side_ctrl = new_fb->low_side_ctrl; + feedback.pwm = new_fb->pwm; +} diff --git a/firmware/tests/mock_board/mock_board_halfbridge.h b/firmware/tests/mock_board/mock_board_halfbridge.h new file mode 100644 index 0000000..6949928 --- /dev/null +++ b/firmware/tests/mock_board/mock_board_halfbridge.h @@ -0,0 +1,18 @@ +#ifndef MOCK_BOARD_HALFBRIDGE_ +#define MOCK_BOARD_HALFBRIDGE_ + +#include +#include + +#include "..\..\src\hw\board\halfbridge.h" + +uint8_t mock_board_halfbridge_read_low(void); +void mock_board_halfbridge_write_low(uint8_t state); + +uint16_t mock_board_halfbridge_read_pwm(void); +void mock_board_halfbridge_write_pwm(uint16_t pwm); + +void mock_board_halfbridge_read_feedback(hb_meas_t* measurements); +void mock_board_halfbridge_write_feedback(hb_meas_t* new_fb); + +#endif /* MOCK_BOARD_HALFBRIDGE_ */ diff --git a/firmware/tests/mock_board/mock_board_odout.c b/firmware/tests/mock_board/mock_board_odout.c new file mode 100644 index 0000000..33bc914 --- /dev/null +++ b/firmware/tests/mock_board/mock_board_odout.c @@ -0,0 +1,47 @@ +#include "mock_board_odout.h" + +#define ODOUT_CH_CNT 7 +static uint8_t odout_ch = 0; +static int8_t odout_data[ODOUT_CH_CNT]; +static uint8_t common_pwm = 0; + +void bsp_odout_write(uint8_t ch, int8_t lvl) +{ + if(ch < ODOUT_CH_CNT) odout_data[ch] = lvl; + odout_ch = ch; +} + +void bsp_odout_write_common(uint8_t percent) +{ + common_pwm = percent; +} + +uint8_t mock_board_odout_read_ch(void) +{ + return odout_ch; +} + +void mock_board_odout_write_ch(uint8_t ch) +{ + odout_ch = ch; +} + +int8_t mock_board_odout_read_data(uint8_t ch) +{ + return odout_data[ch]; +} + +void mock_board_odout_write_data(uint8_t ch, int8_t lvl) +{ + odout_data[ch] = lvl; +} + +uint8_t mock_board_odout_read_pwm(void) +{ + return common_pwm; +} + +void mock_board_odout_write_pwm(uint8_t percent) +{ + common_pwm = percent; +} diff --git a/firmware/tests/mock_board/mock_board_odout.h b/firmware/tests/mock_board/mock_board_odout.h new file mode 100644 index 0000000..fed625e --- /dev/null +++ b/firmware/tests/mock_board/mock_board_odout.h @@ -0,0 +1,16 @@ +#ifndef MOCK_BOARD_ODOUT_ +#define MOCK_BOARD_ODOUT_ + +#include +#include + +#include "..\..\src\hw\board\odout.h" + +uint8_t mock_board_odout_read_ch(void); +void mock_board_odout_write_ch(uint8_t ch); +int8_t mock_board_odout_read_data(uint8_t ch); +void mock_board_odout_write_data(uint8_t ch, int8_t lvl); +uint8_t mock_board_odout_read_pwm(void); +void mock_board_odout_write_pwm(uint8_t percent); + +#endif /* MOCK_BOARD_ODOUT_ */ diff --git a/firmware/tests/mock_board/mock_board_setup.c b/firmware/tests/mock_board/mock_board_setup.c new file mode 100644 index 0000000..96c3f7e --- /dev/null +++ b/firmware/tests/mock_board/mock_board_setup.c @@ -0,0 +1,18 @@ +#include "mock_board_setup.h" + +static uint8_t setup_called = 0; + +void bsp_startup(void) +{ + setup_called = 1; +} + +uint8_t mock_board_setup_read_called(void) +{ + return setup_called; +} + +void mock_board_setup_reset_called(void) +{ + setup_called = 0; +} diff --git a/firmware/tests/mock_board/mock_board_setup.h b/firmware/tests/mock_board/mock_board_setup.h new file mode 100644 index 0000000..a339808 --- /dev/null +++ b/firmware/tests/mock_board/mock_board_setup.h @@ -0,0 +1,12 @@ +#ifndef MOCK_BOARD_SETUP_ +#define MOCK_BOARD_SETUP_ + +#include +#include + +#include "..\..\src\hw\board\setup.h" + +uint8_t mock_board_setup_read_called(void); +void mock_board_setup_reset_called(void); + +#endif /* MOCK_BOARD_SETUP_ */ diff --git a/firmware/tests/mock_mcu/mock_mcu_hal_r8.c b/firmware/tests/mock_mcu/mock_mcu_hal_r8.c new file mode 100644 index 0000000..7038ce5 --- /dev/null +++ b/firmware/tests/mock_mcu/mock_mcu_hal_r8.c @@ -0,0 +1,178 @@ +#include "..\..\src\hw\board\mcu\mcu_hal.h" +#include "mock_mcu_hal_r8.h" + +// Startup-Configuration functions +static startupCfg_t saved_hwCfg; + +void mcu_startup(startupCfg_t* hwCfg) +{ + saved_hwCfg.adc_clk = hwCfg->adc_clk; + saved_hwCfg.pwm_clk = hwCfg->pwm_clk; + saved_hwCfg.pwm_top = hwCfg->pwm_top; + saved_hwCfg.pwm_chb_en = hwCfg->pwm_chb_en; +} + +void mock_mcu_startup_read_cfg(startupCfg_t* cfg_out) +{ + cfg_out->adc_clk = saved_hwCfg.adc_clk; + cfg_out->pwm_clk = saved_hwCfg.pwm_clk; + cfg_out->pwm_top = saved_hwCfg.pwm_top; + cfg_out->pwm_chb_en = saved_hwCfg.pwm_chb_en; +} + +void mock_mcu_startup_write_cfg(startupCfg_t* cfg_in) +{ + saved_hwCfg.adc_clk = cfg_in->adc_clk; + saved_hwCfg.pwm_clk = cfg_in->pwm_clk; + saved_hwCfg.pwm_top = cfg_in->pwm_top; + saved_hwCfg.pwm_chb_en = cfg_in->pwm_chb_en; +} + +// ADC Interface functions +#define ADC_CH_CNT 16 +static uint8_t adc_ch = 0; +static uint16_t adc_raw[ADC_CH_CNT]; + +uint16_t mcu_adc_read(uint8_t ch) +{ + adc_ch = ch; + + //Safe guard mux + if(ch > (ADC_CH_CNT-1)) return 0xFFFF; + // Not available channels + if((ch > 8) && (ch<14)) return 0xFFFF; + + return adc_raw[ch]; +} + +uint8_t mock_mcu_adc_read_ch(void) +{ + return adc_ch; +} + +void mock_mcu_adc_set_ch(uint8_t new_ch) +{ + adc_ch = new_ch; +} + +uint16_t mock_mcu_adc_read_raw(uint8_t ch) +{ + return adc_raw[ch]; +} + +void mock_mcu_adc_set_raw(uint16_t new_adc_out, uint8_t ch) +{ + adc_raw[ch] = new_adc_out; +} + +// PWM Timer Interface functions +#define PWM_CH_CNT 2 +static uint8_t pwm_ch = 0; +static uint16_t pwm_raw[PWM_CH_CNT]; + +void mcu_pwm_write(uint8_t ch, uint16_t dc) +{ + pwm_ch = ch; + if(ch < PWM_CH_CNT) pwm_raw[ch] = dc; +} + +uint16_t mcu_pwm_read(uint8_t ch) +{ + pwm_ch = ch; + if(ch < PWM_CH_CNT) return pwm_raw[ch]; + else return 0; +} + +uint8_t mock_mcu_pwm_read_ch(void) +{ + return pwm_ch; +} + +void mock_mcu_pwm_set_ch(uint8_t new_ch) +{ + pwm_ch = new_ch; +} + +uint16_t mock_mcu_pwm_read_raw(uint8_t ch) +{ + return pwm_raw[ch]; +} + +void mock_mcu_pwm_set_raw(uint16_t new_pwm, uint8_t ch) +{ + pwm_raw[ch] = new_pwm; +} + +// GPIO Functions +#define GPIO_CH_CNT 18 +static uint8_t gpio_ch = 0; +static uint8_t gpio_input_lvl[GPIO_CH_CNT]; +static int8_t gpio_output_lvl[GPIO_CH_CNT]; + +uint8_t mcu_gpio_read(uint8_t ch) +{ + gpio_ch = ch; + if(ch < GPIO_CH_CNT) return gpio_input_lvl[ch]; + else return 0; +} + +void mcu_gpio_write(uint8_t ch, int8_t lvl) +{ + gpio_ch = ch; + if(ch < GPIO_CH_CNT) gpio_output_lvl[ch] = lvl; +} + +uint8_t mock_mcu_gpio_read_ch(void) +{ + return gpio_ch; +} + +void mock_mcu_gpio_set_ch(uint8_t new_ch) +{ + gpio_ch = new_ch; +} + +int8_t mock_mcu_gpio_read_output_lvl(uint8_t ch) +{ + return gpio_output_lvl[ch]; +} + +void mock_mcu_gpio_set_output_lvl(int8_t new_output_lvl, uint8_t ch) +{ + gpio_output_lvl[ch] = new_output_lvl; +} + +void mock_mcu_gpio_set_input_lvl(uint8_t new_in_lvl, uint8_t ch) +{ + gpio_input_lvl[ch] = new_in_lvl; +} + +// EEPROM functions +uint8_t mcu_ee_read8b(uint16_t address) +{ + return 0x00; +} + +uint16_t mcu_ee_read16b(uint16_t address) +{ + return 0x0000; +} + +uint32_t mcu_ee_read32b(uint16_t address) +{ + return 0x00000000; +} + +void mcu_ee_write8b(uint16_t address, uint8_t value) +{ + +} + +void mcu_ee_write16b(uint16_t address, uint16_t value) +{ +} + +void mcu_ee_write32b(uint16_t address, uint32_t value) +{ + +} diff --git a/firmware/tests/mock_mcu/mock_mcu_hal_r8.h b/firmware/tests/mock_mcu/mock_mcu_hal_r8.h new file mode 100644 index 0000000..1303302 --- /dev/null +++ b/firmware/tests/mock_mcu/mock_mcu_hal_r8.h @@ -0,0 +1,28 @@ +#ifndef MOCK_MCU_HAL_R8_ +#define MOCK_MCU_HAL_R8_ + +#include +#include + +#include "../../src/hw/board/mcu/mcu_hal.h" + +void mock_mcu_startup_read_cfg(startupCfg_t* cfg_out); +void mock_mcu_startup_write_cfg(startupCfg_t* cfg_in); + +uint8_t mock_mcu_adc_read_ch(void); +void mock_mcu_adc_set_ch(uint8_t ch); +uint16_t mock_mcu_adc_read_raw(uint8_t ch); +void mock_mcu_adc_set_raw(uint16_t new_adc_out, uint8_t ch); + +uint8_t mock_mcu_pwm_read_ch(void); +void mock_mcu_pwm_set_ch(uint8_t new_ch); +uint16_t mock_mcu_pwm_read_raw(uint8_t ch); +void mock_mcu_pwm_set_raw(uint16_t new_pwm, uint8_t ch); + +uint8_t mock_mcu_gpio_read_ch(void); +void mock_mcu_gpio_set_ch(uint8_t new_ch); +int8_t mock_mcu_gpio_read_output_lvl(uint8_t ch); +void mock_mcu_gpio_set_output_lvl(int8_t new_output_lvl, uint8_t ch); +void mock_mcu_gpio_set_input_lvl(uint8_t new_in_lvl, uint8_t ch); + +#endif /* MOCK_MCU_HAL_R8_ */ diff --git a/firmware/tests/uDCCD_Unit_Tests_BSP.cbp b/firmware/tests/uDCCD_Unit_Tests_BSP.cbp new file mode 100644 index 0000000..563b6aa --- /dev/null +++ b/firmware/tests/uDCCD_Unit_Tests_BSP.cbp @@ -0,0 +1,106 @@ + + + + + + diff --git a/firmware/tests/uDCCD_Unit_Tests_BSP.depend b/firmware/tests/uDCCD_Unit_Tests_BSP.depend new file mode 100644 index 0000000..5bd0319 --- /dev/null +++ b/firmware/tests/uDCCD_Unit_Tests_BSP.depend @@ -0,0 +1,348 @@ +# depslib dependency file v1.0 +1698696655 source:f:\microrally\udccd_controller\src\hw\board\ain.c + "utils/utils.h" + "mcu/mcu_hal.h" + "ain.h" + +1699031869 f:\microrally\udccd_controller\src\hw\board\utils\utils.h + + +1698776270 f:\microrally\udccd_controller\src\hw\board\mcu\mcu_hal.h + + +1699031869 f:\microrally\udccd_controller\src\hw\board\ain.h + + +1698336545 source:f:\microrally\udccd_controller\src\hw\board\din.c + "utils/utils.h" + "mcu/mcu_hal.h" + "din.h" + +1699031869 f:\microrally\udccd_controller\src\hw\board\din.h + + +1698740890 source:f:\microrally\udccd_controller\src\hw\board\dout.c + "utils/utils.h" + "mcu/mcu_hal.h" + "dout.h" + +1699031869 f:\microrally\udccd_controller\src\hw\board\dout.h + + +1698575529 source:f:\microrally\udccd_controller\src\hw\board\halfbridge.c + "utils/utils.h" + "mcu/mcu_hal.h" + "halfbridge.h" + +1699031869 f:\microrally\udccd_controller\src\hw\board\halfbridge.h + + +1697628825 source:f:\microrally\udccd_controller\src\hw\board\odout.c + "utils/utils.h" + "mcu/mcu_hal.h" + "odout.h" + +1699197585 f:\microrally\udccd_controller\src\hw\board\odout.h + + +1698336545 source:f:\microrally\udccd_controller\src\hw\board\setup.c + "utils/utils.h" + "mcu/mcu_hal.h" + "setup.h" + +1699031869 f:\microrally\udccd_controller\src\hw\board\setup.h + + +1699031869 source:f:\microrally\udccd_controller\src\hw\board\utils\faults.c + "faults.h" + "utils.h" + +1699031869 f:\microrally\udccd_controller\src\hw\board\utils\faults.h + + +1699031869 source:f:\microrally\udccd_controller\src\hw\board\utils\fuses.c + "fuses.h" + "utils.h" + +1699031869 f:\microrally\udccd_controller\src\hw\board\utils\fuses.h + + +1699031869 source:f:\microrally\udccd_controller\src\hw\board\utils\utils.c + "utils.h" + +1699205020 source:f:\microrally\udccd_controller\tests\bsp_main.c + + + "ut_utils/ut_utils.h" + "ut_utils/ut_fault.h" + "ut_utils/ut_fuses.h" + "ut_board/ut_ain.h" + "ut_board/ut_din.h" + "ut_board/ut_dout.h" + "ut_board/ut_halfbridge.h" + "ut_board/ut_odout.h" + "ut_board/ut_setup.h" + +1699204674 f:\microrally\udccd_controller\tests\ut_utils\ut_utils.h + + + +1698870535 f:\microrally\udccd_controller\tests\ut_utils\ut_fault.h + + + +1698959419 f:\microrally\udccd_controller\tests\ut_utils\ut_fuses.h + + + +1699031869 f:\microrally\udccd_controller\tests\ut_board\ut_ain.h + + + +1699041803 f:\microrally\udccd_controller\tests\ut_board\ut_din.h + + + +1699042443 f:\microrally\udccd_controller\tests\ut_board\ut_dout.h + + + +1699051096 f:\microrally\udccd_controller\tests\ut_board\ut_halfbridge.h + + + +1699200555 source:f:\microrally\udccd_controller\tests\mock_mcu\mock_mcu_hal_r8.c + "..\..\src\hw\board\mcu\mcu_hal.h" + "mock_mcu_hal_r8.h" + +1699200561 f:\microrally\udccd_controller\tests\mock_mcu\mock_mcu_hal_r8.h + + + "../../src/hw/board/mcu/mcu_hal.h" + +1699196285 source:f:\microrally\udccd_controller\tests\ut_board\ut_ain.c + "ut_ain.h" + "..\mock_mcu\mock_mcu_hal_r8.h" + "..\..\src\hw\board\ain.h" + +1699196304 source:f:\microrally\udccd_controller\tests\ut_board\ut_din.c + "ut_din.h" + "..\mock_mcu\mock_mcu_hal_r8.h" + "..\..\src\hw\board\din.h" + +1699196320 source:f:\microrally\udccd_controller\tests\ut_board\ut_dout.c + "ut_dout.h" + "..\mock_mcu\mock_mcu_hal_r8.h" + "..\..\src\hw\board\dout.h" + +1699196359 source:f:\microrally\udccd_controller\tests\ut_board\ut_halfbridge.c + "ut_dout.h" + "..\mock_mcu\mock_mcu_hal_r8.h" + "..\..\src\hw\board\halfbridge.h" + +1699196427 source:f:\microrally\udccd_controller\tests\ut_utils\ut_fault.c + "ut_fault.h" + "..\..\src\hw\board\utils\faults.h" + +1699196445 source:f:\microrally\udccd_controller\tests\ut_utils\ut_fuses.c + "ut_fuses.h" + "..\..\src\hw\board\utils\fuses.h" + +1699203820 source:f:\microrally\udccd_controller\tests\ut_utils\ut_utils.c + "ut_utils.h" + "..\..\src\hw\board\utils\utils.h" + +1699200030 f:\microrally\udccd_controller\tests\ut_board\ut_odout.h + + + +1699200020 source:f:\microrally\udccd_controller\tests\ut_board\ut_odout.c + "ut_odout.h" + "..\mock_mcu\mock_mcu_hal_r8.h" + "..\..\src\hw\board\odout.h" + +1699201018 f:\microrally\udccd_controller\tests\ut_board\ut_setup.h + + + +1699201095 source:f:\microrally\udccd_controller\tests\ut_board\ut_setup.c + "ut_odout.h" + "..\mock_mcu\mock_mcu_hal_r8.h" + "..\..\src\hw\board\setup.h" + +1699018375 source:d:\microrally\udccd_controller\src\hw\board\ain.c + "utils/utils.h" + "mcu/mcu_hal.h" + "ain.h" + +1699007962 d:\microrally\udccd_controller\src\hw\board\utils\utils.h + + +1699017409 d:\microrally\udccd_controller\src\hw\board\mcu\mcu_hal.h + + +1699535273 d:\microrally\udccd_controller\src\hw\board\ain.h + + "config.h" + +1698333216 source:d:\microrally\udccd_controller\src\hw\board\din.c + "utils/utils.h" + "mcu/mcu_hal.h" + "din.h" + +1699535289 d:\microrally\udccd_controller\src\hw\board\din.h + + +1698673847 source:d:\microrally\udccd_controller\src\hw\board\dout.c + "utils/utils.h" + "mcu/mcu_hal.h" + "dout.h" + +1699535296 d:\microrally\udccd_controller\src\hw\board\dout.h + + +1698656931 source:d:\microrally\udccd_controller\src\hw\board\halfbridge.c + "utils/utils.h" + "mcu/mcu_hal.h" + "halfbridge.h" + +1699535318 d:\microrally\udccd_controller\src\hw\board\halfbridge.h + + "config.h" + +1697618884 source:d:\microrally\udccd_controller\src\hw\board\odout.c + "utils/utils.h" + "mcu/mcu_hal.h" + "odout.h" + +1699257917 d:\microrally\udccd_controller\src\hw\board\odout.h + + +1698328348 source:d:\microrally\udccd_controller\src\hw\board\setup.c + "utils/utils.h" + "mcu/mcu_hal.h" + "setup.h" + +1699017683 d:\microrally\udccd_controller\src\hw\board\setup.h + + +1699007034 source:d:\microrally\udccd_controller\src\hw\board\utils\faults.c + "faults.h" + "utils.h" + +1699007033 d:\microrally\udccd_controller\src\hw\board\utils\faults.h + + +1699007093 source:d:\microrally\udccd_controller\src\hw\board\utils\fuses.c + "fuses.h" + "utils.h" + +1699007094 d:\microrally\udccd_controller\src\hw\board\utils\fuses.h + + +1699264217 source:d:\microrally\udccd_controller\src\hw\board\utils\utils.c + "utils.h" + +1699257917 source:d:\microrally\udccd_controller\tests\bsp_main.c + + + "ut_utils/ut_utils.h" + "ut_utils/ut_fault.h" + "ut_utils/ut_fuses.h" + "ut_board/ut_ain.h" + "ut_board/ut_din.h" + "ut_board/ut_dout.h" + "ut_board/ut_halfbridge.h" + "ut_board/ut_odout.h" + "ut_board/ut_setup.h" + +1699257917 d:\microrally\udccd_controller\tests\ut_utils\ut_utils.h + + + +1698921312 d:\microrally\udccd_controller\tests\ut_utils\ut_fault.h + + + +1699004735 d:\microrally\udccd_controller\tests\ut_utils\ut_fuses.h + + + +1699018575 d:\microrally\udccd_controller\tests\ut_board\ut_ain.h + + + +1699257917 d:\microrally\udccd_controller\tests\ut_board\ut_din.h + + + +1699257917 d:\microrally\udccd_controller\tests\ut_board\ut_dout.h + + + +1699257917 d:\microrally\udccd_controller\tests\ut_board\ut_halfbridge.h + + + +1699257917 d:\microrally\udccd_controller\tests\ut_board\ut_odout.h + + + +1699257917 d:\microrally\udccd_controller\tests\ut_board\ut_setup.h + + + +1699257917 source:d:\microrally\udccd_controller\tests\mock_mcu\mock_mcu_hal_r8.c + "..\..\src\hw\board\mcu\mcu_hal.h" + "mock_mcu_hal_r8.h" + +1699257917 d:\microrally\udccd_controller\tests\mock_mcu\mock_mcu_hal_r8.h + + + "../../src/hw/board/mcu/mcu_hal.h" + +1699257917 source:d:\microrally\udccd_controller\tests\ut_board\ut_ain.c + "ut_ain.h" + "..\mock_mcu\mock_mcu_hal_r8.h" + "..\..\src\hw\board\ain.h" + +1699257917 source:d:\microrally\udccd_controller\tests\ut_board\ut_din.c + "ut_din.h" + "..\mock_mcu\mock_mcu_hal_r8.h" + "..\..\src\hw\board\din.h" + +1699257917 source:d:\microrally\udccd_controller\tests\ut_board\ut_dout.c + "ut_dout.h" + "..\mock_mcu\mock_mcu_hal_r8.h" + "..\..\src\hw\board\dout.h" + +1699257917 source:d:\microrally\udccd_controller\tests\ut_board\ut_halfbridge.c + "ut_dout.h" + "..\mock_mcu\mock_mcu_hal_r8.h" + "..\..\src\hw\board\halfbridge.h" + +1699257917 source:d:\microrally\udccd_controller\tests\ut_board\ut_odout.c + "ut_odout.h" + "..\mock_mcu\mock_mcu_hal_r8.h" + "..\..\src\hw\board\odout.h" + +1699257917 source:d:\microrally\udccd_controller\tests\ut_board\ut_setup.c + "ut_odout.h" + "..\mock_mcu\mock_mcu_hal_r8.h" + "..\..\src\hw\board\setup.h" + +1699257917 source:d:\microrally\udccd_controller\tests\ut_utils\ut_fault.c + "ut_fault.h" + "..\..\src\hw\board\utils\faults.h" + +1699257917 source:d:\microrally\udccd_controller\tests\ut_utils\ut_fuses.c + "ut_fuses.h" + "..\..\src\hw\board\utils\fuses.h" + +1699264250 source:d:\microrally\udccd_controller\tests\ut_utils\ut_utils.c + "ut_utils.h" + "..\..\src\hw\board\utils\utils.h" + +1699535389 d:\microrally\udccd_controller\src\hw\board\config.h + + diff --git a/firmware/tests/uDCCD_Unit_Tests_BSP.layout b/firmware/tests/uDCCD_Unit_Tests_BSP.layout new file mode 100644 index 0000000..566a1dd --- /dev/null +++ b/firmware/tests/uDCCD_Unit_Tests_BSP.layout @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/firmware/tests/uDCCD_Unit_Tests_HW.cbp b/firmware/tests/uDCCD_Unit_Tests_HW.cbp new file mode 100644 index 0000000..808a48b --- /dev/null +++ b/firmware/tests/uDCCD_Unit_Tests_HW.cbp @@ -0,0 +1,105 @@ + + + + + + diff --git a/firmware/tests/uDCCD_Unit_Tests_HW.depend b/firmware/tests/uDCCD_Unit_Tests_HW.depend new file mode 100644 index 0000000..4507af5 --- /dev/null +++ b/firmware/tests/uDCCD_Unit_Tests_HW.depend @@ -0,0 +1,378 @@ +# depslib dependency file v1.0 +1699007034 source:d:\microrally\udccd_controller\src\hw\board\utils\faults.c + "faults.h" + "utils.h" + +1699007033 d:\microrally\udccd_controller\src\hw\board\utils\faults.h + + +1699007962 d:\microrally\udccd_controller\src\hw\board\utils\utils.h + + +1699007093 source:d:\microrally\udccd_controller\src\hw\board\utils\fuses.c + "fuses.h" + "utils.h" + +1699007094 d:\microrally\udccd_controller\src\hw\board\utils\fuses.h + + +1699264217 source:d:\microrally\udccd_controller\src\hw\board\utils\utils.c + "utils.h" + +1698741271 source:d:\microrally\udccd_controller\src\hw\analog.c + "board/utils/utils.h" + "board/ain.h" + "analog.h" + +1699535273 d:\microrally\udccd_controller\src\hw\board\ain.h + + "config.h" + +1699017683 d:\microrally\udccd_controller\src\hw\analog.h + + +1699283768 source:d:\microrally\udccd_controller\tests\mock_board\mock_board_dout.c + "mock_board_dout.h" + +1699535296 d:\microrally\udccd_controller\src\hw\board\dout.h + + +1699272290 d:\microrally\udccd_controller\tests\mock_board\mock_board_dout.h + + + "..\..\src\hw\board\dout.h" + +1699283776 source:d:\microrally\udccd_controller\tests\mock_board\mock_board_odout.c + "mock_board_odout.h" + +1699257917 d:\microrally\udccd_controller\src\hw\board\odout.h + + +1699272272 d:\microrally\udccd_controller\tests\mock_board\mock_board_odout.h + + + "..\..\src\hw\board\odout.h" + +1699272265 source:d:\microrally\udccd_controller\tests\mock_board\mock_board_setup.c + "mock_board_setup.h" + +1699017683 d:\microrally\udccd_controller\src\hw\board\setup.h + + +1699272264 d:\microrally\udccd_controller\tests\mock_board\mock_board_setup.h + + + "..\..\src\hw\board\setup.h" + +1699516357 source:d:\microrally\udccd_controller\tests\hw_main.c + + + "ut_hw/ut_analog.h" + "ut_hw/ut_buttons.h" + "ut_hw/ut_hb_control.h" + "ut_hw/ut_led_display.h" + "ut_hw/ut_startup.h" + +1699271694 d:\microrally\udccd_controller\tests\ut_hw\ut_analog.h + + + +1699272372 source:d:\microrally\udccd_controller\tests\mock_board\mock_board_ain.c + "mock_board_ain.h" + +1699272245 d:\microrally\udccd_controller\tests\mock_board\mock_board_ain.h + + + "..\..\src\hw\board\ain.h" + +1699283758 source:d:\microrally\udccd_controller\tests\mock_board\mock_board_din.c + "mock_board_din.h" + +1699535289 d:\microrally\udccd_controller\src\hw\board\din.h + + +1699272297 d:\microrally\udccd_controller\tests\mock_board\mock_board_din.h + + + "..\..\src\hw\board\din.h" + +1699535318 d:\microrally\udccd_controller\src\hw\board\halfbridge.h + + "config.h" + +1699272285 source:d:\microrally\udccd_controller\tests\mock_board\mock_board_halfbridge.c + "mock_board_halfbridge.h" + +1699287859 d:\microrally\udccd_controller\tests\mock_board\mock_board_halfbridge.h + + + "..\..\src\hw\board\halfbridge.h" + +1699276363 source:d:\microrally\udccd_controller\tests\ut_hw\ut_analog.c + "ut_analog.h" + "..\mock_board\mock_board_ain.h" + "..\..\src\hw\analog.h" + +1699284536 source:d:\microrally\udccd_controller\tests\ut_hw\ut_buttons.c + "ut_buttons.h" + "..\mock_board\mock_board_din.h" + "..\mock_board\mock_board_dout.h" + "..\..\src\hw\buttons.h" + +1699284495 d:\microrally\udccd_controller\tests\ut_hw\ut_buttons.h + + + +1699535453 d:\microrally\udccd_controller\src\hw\buttons.h + + "config.h" + +1699516357 source:d:\microrally\udccd_controller\src\hw\buttons.c + "board/utils/utils.h" + "board/din.h" + "board/dout.h" + "buttons.h" + +1699373886 source:d:\microrally\udccd_controller\src\hw\hb_control.c + "board/utils/utils.h" + "board/halfbridge.h" + "hb_control.h" + +1699351840 d:\microrally\udccd_controller\src\hw\hb_control.h + + "board/utils/faults.h" + "board/utils/fuses.h" + "board/halfbridge.h" + +1699286008 source:d:\microrally\udccd_controller\src\hw\led_display.c + "board/odout.h" + "led_display.h" + +1699017683 d:\microrally\udccd_controller\src\hw\led_display.h + + +1698328349 source:d:\microrally\udccd_controller\src\hw\startup.c + "board/utils/utils.h" + "board/setup.h" + "startup.h" + +1699017682 d:\microrally\udccd_controller\src\hw\startup.h + + +1699285771 d:\microrally\udccd_controller\tests\ut_hw\ut_startup.h + + + +1699285777 source:d:\microrally\udccd_controller\tests\ut_hw\ut_startup.c + "ut_startup.h" + "..\mock_board\mock_board_setup.h" + "..\..\src\hw\startup.h" + +1699286754 source:d:\microrally\udccd_controller\tests\ut_hw\ut_led_display.c + "ut_led_display.h" + "..\mock_board\mock_board_odout.h" + "..\..\src\hw\led_display.h" + +1699286570 d:\microrally\udccd_controller\tests\ut_hw\ut_led_display.h + + + +1699375169 source:d:\microrally\udccd_controller\tests\ut_hw\ut_hb_control.c + "ut_hb_control.h" + "..\mock_board\mock_board_halfbridge.h" + "..\..\src\hw\hb_control.h" + +1699371510 d:\microrally\udccd_controller\tests\ut_hw\ut_hb_control.h + + + +1699031869 source:f:\microrally\udccd_controller\src\hw\board\utils\faults.c + "faults.h" + "utils.h" + +1699031869 f:\microrally\udccd_controller\src\hw\board\utils\faults.h + + +1699031869 f:\microrally\udccd_controller\src\hw\board\utils\utils.h + + +1699031869 source:f:\microrally\udccd_controller\src\hw\board\utils\fuses.c + "fuses.h" + "utils.h" + +1699031869 f:\microrally\udccd_controller\src\hw\board\utils\fuses.h + + +1698697335 source:f:\microrally\udccd_controller\src\hw\analog.c + "board/utils/utils.h" + "board/ain.h" + "analog.h" + +1699476816 f:\microrally\udccd_controller\src\hw\board\ain.h + + +1699031869 f:\microrally\udccd_controller\src\hw\analog.h + + +1699298687 source:f:\microrally\udccd_controller\src\hw\board\utils\utils.c + "utils.h" + +1699298687 source:f:\microrally\udccd_controller\src\hw\buttons.c + "board/utils/utils.h" + "board/din.h" + "board/dout.h" + "buttons.h" + +1699031869 f:\microrally\udccd_controller\src\hw\board\din.h + + +1699031869 f:\microrally\udccd_controller\src\hw\board\dout.h + + +1699477045 f:\microrally\udccd_controller\src\hw\buttons.h + + +1699298687 source:f:\microrally\udccd_controller\src\hw\led_display.c + "board/odout.h" + "led_display.h" + +1699197585 f:\microrally\udccd_controller\src\hw\board\odout.h + + +1699031869 f:\microrally\udccd_controller\src\hw\led_display.h + + +1698336545 source:f:\microrally\udccd_controller\src\hw\startup.c + "board/utils/utils.h" + "board/setup.h" + "startup.h" + +1699031869 f:\microrally\udccd_controller\src\hw\board\setup.h + + +1699031869 f:\microrally\udccd_controller\src\hw\startup.h + + +1699474639 source:f:\microrally\udccd_controller\tests\hw_main.c + + + "ut_hw/ut_analog.h" + "ut_hw/ut_buttons.h" + "ut_hw/ut_hb_control.h" + "ut_hw/ut_led_display.h" + "ut_hw/ut_startup.h" + +1699298688 f:\microrally\udccd_controller\tests\ut_hw\ut_analog.h + + + +1699298688 f:\microrally\udccd_controller\tests\ut_hw\ut_buttons.h + + + +1699298688 f:\microrally\udccd_controller\tests\ut_hw\ut_startup.h + + + +1699298687 source:f:\microrally\udccd_controller\tests\mock_board\mock_board_ain.c + "mock_board_ain.h" + +1699298687 f:\microrally\udccd_controller\tests\mock_board\mock_board_ain.h + + + "..\..\src\hw\board\ain.h" + +1699298687 source:f:\microrally\udccd_controller\tests\mock_board\mock_board_din.c + "mock_board_din.h" + +1699298687 f:\microrally\udccd_controller\tests\mock_board\mock_board_din.h + + + "..\..\src\hw\board\din.h" + +1699298687 source:f:\microrally\udccd_controller\tests\mock_board\mock_board_dout.c + "mock_board_dout.h" + +1699298687 f:\microrally\udccd_controller\tests\mock_board\mock_board_dout.h + + + "..\..\src\hw\board\dout.h" + +1699298687 source:f:\microrally\udccd_controller\tests\mock_board\mock_board_halfbridge.c + "mock_board_halfbridge.h" + +1699298687 f:\microrally\udccd_controller\tests\mock_board\mock_board_halfbridge.h + + + "..\..\src\hw\board\halfbridge.h" + +1699476970 f:\microrally\udccd_controller\src\hw\board\halfbridge.h + + +1699298687 source:f:\microrally\udccd_controller\tests\mock_board\mock_board_odout.c + "mock_board_odout.h" + +1699298687 f:\microrally\udccd_controller\tests\mock_board\mock_board_odout.h + + + "..\..\src\hw\board\odout.h" + +1699298687 source:f:\microrally\udccd_controller\tests\mock_board\mock_board_setup.c + "mock_board_setup.h" + +1699298688 f:\microrally\udccd_controller\tests\mock_board\mock_board_setup.h + + + "..\..\src\hw\board\setup.h" + +1699298688 source:f:\microrally\udccd_controller\tests\ut_hw\ut_analog.c + "ut_analog.h" + "..\mock_board\mock_board_ain.h" + "..\..\src\hw\analog.h" + +1699298688 source:f:\microrally\udccd_controller\tests\ut_hw\ut_buttons.c + "ut_buttons.h" + "..\mock_board\mock_board_din.h" + "..\mock_board\mock_board_dout.h" + "..\..\src\hw\buttons.h" + +1699298688 source:f:\microrally\udccd_controller\tests\ut_hw\ut_led_display.c + "ut_led_display.h" + "..\mock_board\mock_board_odout.h" + "..\..\src\hw\led_display.h" + +1699298688 f:\microrally\udccd_controller\tests\ut_hw\ut_led_display.h + + + +1699298688 source:f:\microrally\udccd_controller\tests\ut_hw\ut_startup.c + "ut_startup.h" + "..\mock_board\mock_board_setup.h" + "..\..\src\hw\startup.h" + +1699391649 source:f:\microrally\udccd_controller\src\hw\hb_control.c + "board/utils/utils.h" + "board/halfbridge.h" + "hb_control.h" + +1699382733 f:\microrally\udccd_controller\src\hw\hb_control.h + + "board/utils/faults.h" + "board/utils/fuses.h" + "board/halfbridge.h" + +1699393539 source:f:\microrally\udccd_controller\tests\ut_hw\ut_hb_control.c + "ut_hb_control.h" + "..\mock_board\mock_board_halfbridge.h" + "..\..\src\hw\hb_control.h" + +1699382733 f:\microrally\udccd_controller\tests\ut_hw\ut_hb_control.h + + + +1699535389 d:\microrally\udccd_controller\src\hw\board\config.h + + +1699535687 d:\microrally\udccd_controller\src\hw\config.h + + diff --git a/firmware/tests/uDCCD_Unit_Tests_HW.layout b/firmware/tests/uDCCD_Unit_Tests_HW.layout new file mode 100644 index 0000000..22a15ce --- /dev/null +++ b/firmware/tests/uDCCD_Unit_Tests_HW.layout @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/firmware/tests/uDCCD_Unit_Tests_Logic.cbp b/firmware/tests/uDCCD_Unit_Tests_Logic.cbp new file mode 100644 index 0000000..cf04a15 --- /dev/null +++ b/firmware/tests/uDCCD_Unit_Tests_Logic.cbp @@ -0,0 +1,71 @@ + + + + + + diff --git a/firmware/tests/uDCCD_Unit_Tests_Logic.depend b/firmware/tests/uDCCD_Unit_Tests_Logic.depend new file mode 100644 index 0000000..b36d4bb --- /dev/null +++ b/firmware/tests/uDCCD_Unit_Tests_Logic.depend @@ -0,0 +1,80 @@ +# depslib dependency file v1.0 +1699474847 source:f:\microrally\udccd_controller\src\logic\coil.c + "coil.h" + +1699474848 f:\microrally\udccd_controller\src\logic\coil.h + + +1699472530 source:f:\microrally\udccd_controller\src\logic\display.c + "display.h" + +1699472535 f:\microrally\udccd_controller\src\logic\display.h + + +1699474995 source:f:\microrally\udccd_controller\src\logic\force.c + "force.h" + +1699474996 f:\microrally\udccd_controller\src\logic\force.h + + +1699031869 source:f:\microrally\udccd_controller\src\logic\pot.c + "pot.h" + +1699475345 f:\microrally\udccd_controller\src\logic\pot.h + + +1699475089 source:f:\microrally\udccd_controller\src\logic\user_force.c + "user_force.h" + +1699475337 f:\microrally\udccd_controller\src\logic\user_force.h + + +1699474661 source:f:\microrally\udccd_controller\tests\logic_main.c + + + "ut_logic/ut_coil.h" + "ut_logic/ut_display.h" + "ut_logic/ut_force.h" + "ut_logic/ut_pot.h" + "ut_logic/ut_user_force.h" + +1698869680 f:\microrally\udccd_controller\tests\ut_logic\ut_coil.h + + + +1699473947 f:\microrally\udccd_controller\tests\ut_logic\ut_display.h + + + +1698869680 f:\microrally\udccd_controller\tests\ut_logic\ut_force.h + + + +1698869680 f:\microrally\udccd_controller\tests\ut_logic\ut_pot.h + + + +1698869680 f:\microrally\udccd_controller\tests\ut_logic\ut_user_force.h + + + +1699474942 source:f:\microrally\udccd_controller\tests\ut_logic\ut_coil.c + "ut_coil.h" + "..\..\src\logic\coil.h" + +1699474733 source:f:\microrally\udccd_controller\tests\ut_logic\ut_display.c + "ut_display.h" + "..\..\src\logic\display.h" + +1699475023 source:f:\microrally\udccd_controller\tests\ut_logic\ut_force.c + "ut_force.h" + "..\..\src\logic\force.h" + +1699195810 source:f:\microrally\udccd_controller\tests\ut_logic\ut_pot.c + "ut_pot.h" + "..\..\src\logic\pot.h" + +1699195775 source:f:\microrally\udccd_controller\tests\ut_logic\ut_user_force.c + "ut_user_force.h" + "..\..\src\logic\user_force.h" + diff --git a/firmware/tests/uDCCD_Unit_Tests_Logic.layout b/firmware/tests/uDCCD_Unit_Tests_Logic.layout new file mode 100644 index 0000000..3b6ecd4 --- /dev/null +++ b/firmware/tests/uDCCD_Unit_Tests_Logic.layout @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/firmware/tests/ut_board/ut_ain.c b/firmware/tests/ut_board/ut_ain.c new file mode 100644 index 0000000..3568ea3 --- /dev/null +++ b/firmware/tests/ut_board/ut_ain.c @@ -0,0 +1,96 @@ +#include "ut_ain.h" + +#include "..\mock_mcu\mock_mcu_hal_r8.h" +#include "..\..\src\hw\board\ain.h" + +static const uint8_t NOT_ACCESED_ADC_CH = 255; + +static int ut_bsp_ain_read(uint8_t ain_ch, uint16_t adc_raw, uint16_t exp_out, uint8_t exp_adc_ch) +{ + printf(" Input: Ain-Ch:%d Adc-Raw:%d \n", ain_ch, adc_raw); + + mock_mcu_adc_set_ch(NOT_ACCESED_ADC_CH); + mock_mcu_adc_set_raw(adc_raw, exp_adc_ch); + + uint16_t out = bsp_ain_read(ain_ch); + + uint8_t adc_ch = mock_mcu_adc_read_ch(); + + printf(" Output: AIN:%d Adc-Ch:%d \n", out, adc_ch); + printf("Expected: AIN:%d Adc-Ch:%d \n", exp_out, exp_adc_ch); + + if((out==exp_out)&&(adc_ch==exp_adc_ch)) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_bsp_ain_read_test(void) +{ + printf("******************************************************\n"); + printf("uint16_t bsp_ain_read(uint8_t ch)\n"); + + int test_res; + int pass = 1; + + uint8_t ain_ch; + uint16_t adc_raw; + uint16_t exp_out; + uint8_t exp_adc_ch; + + // Normal 1 + ain_ch = BSP_AIN1; + adc_raw = 88; + exp_out = 430; + exp_adc_ch = MCU_ADC5; + test_res = ut_bsp_ain_read(ain_ch, adc_raw, exp_out, exp_adc_ch); + if(!test_res) pass = 0; + + // Normal 2 + ain_ch = BSP_AIN2; + adc_raw = 88; + exp_out = 430; + exp_adc_ch = MCU_ADC4; + test_res = ut_bsp_ain_read(ain_ch, adc_raw, exp_out, exp_adc_ch); + if(!test_res) pass = 0; + + // Normal 3 + ain_ch = BSP_AIN3; + adc_raw = 500; + exp_out = 2443; + exp_adc_ch = MCU_ADC8; + test_res = ut_bsp_ain_read(ain_ch, adc_raw, exp_out, exp_adc_ch); + if(!test_res) pass = 0; + + // Norma 4 + ain_ch = BSP_AIN4; + adc_raw = 1023; + exp_out = 4998; + exp_adc_ch = MCU_ADC14; + test_res = ut_bsp_ain_read(ain_ch, adc_raw, exp_out, exp_adc_ch); + if(!test_res) pass = 0; + + // Normal 5 + ain_ch = BSP_AIN5; + adc_raw = 1; + exp_out = 4; + exp_adc_ch = MCU_ADC15; + test_res = ut_bsp_ain_read(ain_ch, adc_raw, exp_out, exp_adc_ch); + if(!test_res) pass = 0; + + // Not existing ADC channel + ain_ch = 0; + adc_raw = 500; + exp_out = 0; + exp_adc_ch = NOT_ACCESED_ADC_CH; + test_res = ut_bsp_ain_read(ain_ch, adc_raw, exp_out, exp_adc_ch); + if(!test_res) pass = 0; + + return pass; +} diff --git a/firmware/tests/ut_board/ut_ain.h b/firmware/tests/ut_board/ut_ain.h new file mode 100644 index 0000000..6ff046e --- /dev/null +++ b/firmware/tests/ut_board/ut_ain.h @@ -0,0 +1,9 @@ +#ifndef UT_BOARD_AIN_H_ +#define UT_BOARD_AIN_H_ + +#include +#include + +int ut_bsp_ain_read_test(void); + +#endif /* UT_BOARD_AIN_H_ */ diff --git a/firmware/tests/ut_board/ut_din.c b/firmware/tests/ut_board/ut_din.c new file mode 100644 index 0000000..d55551b --- /dev/null +++ b/firmware/tests/ut_board/ut_din.c @@ -0,0 +1,191 @@ +#include "ut_din.h" + +#include "..\mock_mcu\mock_mcu_hal_r8.h" +#include "..\..\src\hw\board\din.h" + +static const uint8_t NOT_ACCESED_GPIO_CH = 255; + +static int ut_bsp_din_read(uint8_t din_ch, uint8_t gpio_lvl, uint8_t exp_out, uint8_t exp_gpio_ch) +{ + printf(" Input: Din-Ch:%d GPIO-lvl:%d \n", din_ch, gpio_lvl); + + mock_mcu_gpio_set_ch(NOT_ACCESED_GPIO_CH); + mock_mcu_gpio_set_input_lvl(gpio_lvl, exp_gpio_ch); + + uint8_t out = bsp_din_read(din_ch); + + uint8_t gpio_ch = mock_mcu_gpio_read_ch(); + + printf(" Output: DIN:%d GPIO-Ch:%d \n", out, gpio_ch); + printf("Expected: DIN:%d GPIO-Ch:%d \n", exp_out, exp_gpio_ch); + + if((out==exp_out)&&(gpio_ch==exp_gpio_ch)) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_bsp_din_read_test(void) +{ + printf("******************************************************\n"); + printf("uint8_t bsp_din_read(uint8_t ch)\n"); + + int test_res; + int pass = 1; + + uint8_t din_ch; + uint8_t gpio_lvl; + uint8_t exp_out; + uint8_t exp_gpio_ch; + + // DIN 1 + din_ch = BSP_DIN1; + gpio_lvl = MCU_GPIO_LOW; + exp_out = 0; + exp_gpio_ch = MCU_GPIO0; + test_res = ut_bsp_din_read(din_ch, gpio_lvl, exp_out, exp_gpio_ch); + if(!test_res) pass = 0; + + din_ch = BSP_DIN1; + gpio_lvl = MCU_GPIO_HIGH; + exp_out = 1; + exp_gpio_ch = MCU_GPIO0; + test_res = ut_bsp_din_read(din_ch, gpio_lvl, exp_out, exp_gpio_ch); + if(!test_res) pass = 0; + + // DIN 2 + din_ch = BSP_DIN2; + gpio_lvl = MCU_GPIO_LOW; + exp_out = 0; + exp_gpio_ch = MCU_GPIO1; + test_res = ut_bsp_din_read(din_ch, gpio_lvl, exp_out, exp_gpio_ch); + if(!test_res) pass = 0; + + din_ch = BSP_DIN2; + gpio_lvl = MCU_GPIO_HIGH; + exp_out = 1; + exp_gpio_ch = MCU_GPIO1; + test_res = ut_bsp_din_read(din_ch, gpio_lvl, exp_out, exp_gpio_ch); + if(!test_res) pass = 0; + + // DIN 3 + din_ch = BSP_DIN3; + gpio_lvl = MCU_GPIO_LOW; + exp_out = 0; + exp_gpio_ch = MCU_GPIO2; + test_res = ut_bsp_din_read(din_ch, gpio_lvl, exp_out, exp_gpio_ch); + if(!test_res) pass = 0; + + din_ch = BSP_DIN3; + gpio_lvl = MCU_GPIO_HIGH; + exp_out = 1; + exp_gpio_ch = MCU_GPIO2; + test_res = ut_bsp_din_read(din_ch, gpio_lvl, exp_out, exp_gpio_ch); + if(!test_res) pass = 0; + + // DIN 4 + din_ch = BSP_DIN4; + gpio_lvl = MCU_GPIO_LOW; + exp_out = 0; + exp_gpio_ch = MCU_GPIO3; + test_res = ut_bsp_din_read(din_ch, gpio_lvl, exp_out, exp_gpio_ch); + if(!test_res) pass = 0; + + din_ch = BSP_DIN4; + gpio_lvl = MCU_GPIO_HIGH; + exp_out = 1; + exp_gpio_ch = MCU_GPIO3; + test_res = ut_bsp_din_read(din_ch, gpio_lvl, exp_out, exp_gpio_ch); + if(!test_res) pass = 0; + + // DIN 5 + din_ch = BSP_DIN5; + gpio_lvl = MCU_GPIO_LOW; + exp_out = 1; + exp_gpio_ch = MCU_GPIO4; + test_res = ut_bsp_din_read(din_ch, gpio_lvl, exp_out, exp_gpio_ch); + if(!test_res) pass = 0; + + din_ch = BSP_DIN5; + gpio_lvl = MCU_GPIO_HIGH; + exp_out = 0; + exp_gpio_ch = MCU_GPIO4; + test_res = ut_bsp_din_read(din_ch, gpio_lvl, exp_out, exp_gpio_ch); + if(!test_res) pass = 0; + + // DIN 6 + din_ch = BSP_DIN6; + gpio_lvl = MCU_GPIO_LOW; + exp_out = 1; + exp_gpio_ch = MCU_GPIO5; + test_res = ut_bsp_din_read(din_ch, gpio_lvl, exp_out, exp_gpio_ch); + if(!test_res) pass = 0; + + din_ch = BSP_DIN6; + gpio_lvl = MCU_GPIO_HIGH; + exp_out = 0; + exp_gpio_ch = MCU_GPIO5; + test_res = ut_bsp_din_read(din_ch, gpio_lvl, exp_out, exp_gpio_ch); + if(!test_res) pass = 0; + + // DIN 7 + din_ch = BSP_DIN7; + gpio_lvl = MCU_GPIO_LOW; + exp_out = 1; + exp_gpio_ch = MCU_GPIO6; + test_res = ut_bsp_din_read(din_ch, gpio_lvl, exp_out, exp_gpio_ch); + if(!test_res) pass = 0; + + din_ch = BSP_DIN7; + gpio_lvl = MCU_GPIO_HIGH; + exp_out = 0; + exp_gpio_ch = MCU_GPIO6; + test_res = ut_bsp_din_read(din_ch, gpio_lvl, exp_out, exp_gpio_ch); + if(!test_res) pass = 0; + + // DIN 7N + din_ch = BSP_DIN7N; + gpio_lvl = MCU_GPIO_LOW; + exp_out = 0; + exp_gpio_ch = MCU_GPIO7; + test_res = ut_bsp_din_read(din_ch, gpio_lvl, exp_out, exp_gpio_ch); + if(!test_res) pass = 0; + + din_ch = BSP_DIN7N; + gpio_lvl = MCU_GPIO_HIGH; + exp_out = 1; + exp_gpio_ch = MCU_GPIO7; + test_res = ut_bsp_din_read(din_ch, gpio_lvl, exp_out, exp_gpio_ch); + if(!test_res) pass = 0; + + // Wrong channel + din_ch = 0; + gpio_lvl = MCU_GPIO_LOW; + exp_out = 0; + exp_gpio_ch = NOT_ACCESED_GPIO_CH; + test_res = ut_bsp_din_read(din_ch, gpio_lvl, exp_out, exp_gpio_ch); + if(!test_res) pass = 0; + + // DSP OUTPUT DEFINITIONS + din_ch = BSP_DIN1; + gpio_lvl = MCU_GPIO_LOW; + exp_out = BSP_DIN_LOW; + exp_gpio_ch = MCU_GPIO0; + test_res = ut_bsp_din_read(din_ch, gpio_lvl, exp_out, exp_gpio_ch); + if(!test_res) pass = 0; + + din_ch = BSP_DIN1; + gpio_lvl = MCU_GPIO_HIGH; + exp_out = BSP_DIN_HIGH; + exp_gpio_ch = MCU_GPIO0; + test_res = ut_bsp_din_read(din_ch, gpio_lvl, exp_out, exp_gpio_ch); + if(!test_res) pass = 0; + + return pass; +} diff --git a/firmware/tests/ut_board/ut_din.h b/firmware/tests/ut_board/ut_din.h new file mode 100644 index 0000000..970513c --- /dev/null +++ b/firmware/tests/ut_board/ut_din.h @@ -0,0 +1,9 @@ +#ifndef UT_BOARD_DIN_H_ +#define UT_BOARD_DIN_H_ + +#include +#include + +int ut_bsp_din_read_test(void); + +#endif /* UT_BOARD_DIN_H_ */ diff --git a/firmware/tests/ut_board/ut_dout.c b/firmware/tests/ut_board/ut_dout.c new file mode 100644 index 0000000..294336f --- /dev/null +++ b/firmware/tests/ut_board/ut_dout.c @@ -0,0 +1,142 @@ +#include "ut_dout.h" + +#include "..\mock_mcu\mock_mcu_hal_r8.h" +#include "..\..\src\hw\board\dout.h" + +static const uint8_t NOT_ACCESED_GPIO_CH = 255; +static const uint8_t NOT_ACCESED_GPIO_LVL = MCU_GPIO_HIZ; + +static int ut_bsp_dout_write(uint8_t dout_ch, int8_t dout_lvl, int8_t exp_gpio_lvl, uint8_t exp_gpio_ch) +{ + printf(" Input: Dout-Ch:%d Dout-lvl:%d \n", dout_ch, dout_lvl); + + mock_mcu_gpio_set_ch(NOT_ACCESED_GPIO_CH); + mock_mcu_gpio_set_output_lvl(NOT_ACCESED_GPIO_LVL, exp_gpio_ch); + + bsp_dout_write(dout_ch, dout_lvl); + + uint8_t gpio_ch = mock_mcu_gpio_read_ch(); + int8_t gpio_lvl = mock_mcu_gpio_read_output_lvl(gpio_ch); + + printf(" Output: GPIO-lvl:%d GPIO-Ch:%d \n", gpio_lvl, gpio_ch); + printf("Expected: GPIO-lvl:%d GPIO-Ch:%d \n", exp_gpio_lvl, exp_gpio_ch); + + if((gpio_lvl==exp_gpio_lvl)&&(gpio_ch==exp_gpio_ch)) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_bsp_dout_write_test(void) +{ + printf("******************************************************\n"); + printf("void bsp_dout_write(uint8_t ch, int8_t lvl)\n"); + + int test_res; + int pass = 1; + + uint8_t dout_ch; + uint8_t dout_lvl; + int8_t exp_gpio_lvl; + uint8_t exp_gpio_ch; + + // DOUT 1 + dout_ch = BSP_DOUT1; + dout_lvl = 0; + exp_gpio_lvl = MCU_GPIO_LOW; + exp_gpio_ch = MCU_GPIO0; + test_res = ut_bsp_dout_write(dout_ch, dout_lvl, exp_gpio_lvl, exp_gpio_ch); + if(!test_res) pass = 0; + + dout_ch = BSP_DOUT1; + dout_lvl = 1; + exp_gpio_lvl = MCU_GPIO_HIGH; + exp_gpio_ch = MCU_GPIO0; + test_res = ut_bsp_dout_write(dout_ch, dout_lvl, exp_gpio_lvl, exp_gpio_ch); + if(!test_res) pass = 0; + + dout_ch = BSP_DOUT1; + dout_lvl = -1; + exp_gpio_lvl = MCU_GPIO_HIZ; + exp_gpio_ch = MCU_GPIO0; + test_res = ut_bsp_dout_write(dout_ch, dout_lvl, exp_gpio_lvl, exp_gpio_ch); + if(!test_res) pass = 0; + + // Defines test + dout_ch = BSP_DOUT1; + dout_lvl = BSP_DOUT_LOW; + exp_gpio_lvl = MCU_GPIO_LOW; + exp_gpio_ch = MCU_GPIO0; + test_res = ut_bsp_dout_write(dout_ch, dout_lvl, exp_gpio_lvl, exp_gpio_ch); + if(!test_res) pass = 0; + + dout_ch = BSP_DOUT1; + dout_lvl = BSP_DOUT_HIGH; + exp_gpio_lvl = MCU_GPIO_HIGH; + exp_gpio_ch = MCU_GPIO0; + test_res = ut_bsp_dout_write(dout_ch, dout_lvl, exp_gpio_lvl, exp_gpio_ch); + if(!test_res) pass = 0; + + dout_ch = BSP_DOUT1; + dout_lvl = BSP_DOUT_HIZ; + exp_gpio_lvl = MCU_GPIO_HIZ; + exp_gpio_ch = MCU_GPIO0; + test_res = ut_bsp_dout_write(dout_ch, dout_lvl, exp_gpio_lvl, exp_gpio_ch); + if(!test_res) pass = 0; + + // DOUT 2 + dout_ch = BSP_DOUT2; + dout_lvl = BSP_DOUT_LOW; + exp_gpio_lvl = MCU_GPIO_LOW; + exp_gpio_ch = MCU_GPIO1; + test_res = ut_bsp_dout_write(dout_ch, dout_lvl, exp_gpio_lvl, exp_gpio_ch); + if(!test_res) pass = 0; + + // DOUT 3 + dout_ch = BSP_DOUT3; + dout_lvl = BSP_DOUT_HIGH; + exp_gpio_lvl = MCU_GPIO_HIGH; + exp_gpio_ch = MCU_GPIO2; + test_res = ut_bsp_dout_write(dout_ch, dout_lvl, exp_gpio_lvl, exp_gpio_ch); + if(!test_res) pass = 0; + + // DOUT 4 + dout_ch = BSP_DOUT4; + dout_lvl = BSP_DOUT_LOW; + exp_gpio_lvl = MCU_GPIO_LOW; + exp_gpio_ch = MCU_GPIO3; + test_res = ut_bsp_dout_write(dout_ch, dout_lvl, exp_gpio_lvl, exp_gpio_ch); + if(!test_res) pass = 0; + + // DOUT 5 + dout_ch = BSP_DOUT5; + dout_lvl = BSP_DOUT_HIGH; + exp_gpio_lvl = MCU_GPIO_HIGH; + exp_gpio_ch = MCU_GPIO7; + test_res = ut_bsp_dout_write(dout_ch, dout_lvl, exp_gpio_lvl, exp_gpio_ch); + if(!test_res) pass = 0; + + // DOUT 6 + dout_ch = BSP_DOUT6; + dout_lvl = BSP_DOUT_LOW; + exp_gpio_lvl = MCU_GPIO_LOW; + exp_gpio_ch = MCU_GPIO8; + test_res = ut_bsp_dout_write(dout_ch, dout_lvl, exp_gpio_lvl, exp_gpio_ch); + if(!test_res) pass = 0; + + // Wrong channel + dout_ch = 0; + dout_lvl = BSP_DOUT_HIGH; + exp_gpio_lvl = NOT_ACCESED_GPIO_LVL; + exp_gpio_ch = NOT_ACCESED_GPIO_CH; + test_res = ut_bsp_dout_write(dout_ch, dout_lvl, exp_gpio_lvl, exp_gpio_ch); + if(!test_res) pass = 0; + + return pass; +} diff --git a/firmware/tests/ut_board/ut_dout.h b/firmware/tests/ut_board/ut_dout.h new file mode 100644 index 0000000..7b6108f --- /dev/null +++ b/firmware/tests/ut_board/ut_dout.h @@ -0,0 +1,9 @@ +#ifndef UT_BOARD_DOUT_H_ +#define UT_BOARD_DOUT_H_ + +#include +#include + +int ut_bsp_dout_write_test(void); + +#endif /* UT_BOARD_DOUT_H_ */ diff --git a/firmware/tests/ut_board/ut_halfbridge.c b/firmware/tests/ut_board/ut_halfbridge.c new file mode 100644 index 0000000..4116b76 --- /dev/null +++ b/firmware/tests/ut_board/ut_halfbridge.c @@ -0,0 +1,273 @@ +#include "ut_dout.h" + +#include "..\mock_mcu\mock_mcu_hal_r8.h" +#include "..\..\src\hw\board\halfbridge.h" + +static const uint8_t NOT_ACCESED_GPIO_CH = 255; +static const uint8_t NOT_ACCESED_GPIO_LVL = MCU_GPIO_HIZ; + +static int ut_bsp_hb_write_low(uint8_t state, int8_t exp_gpio_lvl, uint8_t exp_gpio_ch) +{ + printf(" Input: State:%d \n", state); + + mock_mcu_gpio_set_ch(NOT_ACCESED_GPIO_CH); + mock_mcu_gpio_set_output_lvl(NOT_ACCESED_GPIO_LVL, exp_gpio_ch); + + bsp_hb_write_low(state); + + uint8_t gpio_ch = mock_mcu_gpio_read_ch(); + int8_t gpio_lvl = mock_mcu_gpio_read_output_lvl(gpio_ch); + + printf(" Output: GPIO-lvl:%d GPIO-Ch:%d \n", gpio_lvl, gpio_ch); + printf("Expected: GPIO-lvl:%d GPIO-Ch:%d \n", exp_gpio_lvl, exp_gpio_ch); + + if((gpio_lvl==exp_gpio_lvl)&&(gpio_ch==exp_gpio_ch)) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_bsp_hb_write_low_test(void) +{ + printf("******************************************************\n"); + printf("void bsp_hb_write_low(uint8_t state) \n"); + + int test_res; + int pass = 1; + + uint8_t state; + int8_t exp_gpio_lvl; + uint8_t exp_gpio_ch; + + // Low + state = 0; + exp_gpio_lvl = MCU_GPIO_LOW; + exp_gpio_ch = MCU_GPIO15; + test_res = ut_bsp_hb_write_low(state, exp_gpio_lvl, exp_gpio_ch); + if(!test_res) pass = 0; + + // High + state = 1; + exp_gpio_lvl = MCU_GPIO_HIGH; + exp_gpio_ch = MCU_GPIO15; + test_res = ut_bsp_hb_write_low(state, exp_gpio_lvl, exp_gpio_ch); + if(!test_res) pass = 0; + + // High + state = 255; + exp_gpio_lvl = MCU_GPIO_HIGH; + exp_gpio_ch = MCU_GPIO15; + test_res = ut_bsp_hb_write_low(state, exp_gpio_lvl, exp_gpio_ch); + if(!test_res) pass = 0; + + return pass; +} + +static const uint8_t NOT_ACCESED_PWM_CH = 255; +static const uint8_t NOT_ACCESED_PWM_VAL = 0xFFFF; + +static int ut_bsp_hb_write_pwm(uint16_t pwm, uint16_t exp_pwm, uint8_t exp_pwm_ch) +{ + printf(" Input: PWM:%d \n", pwm); + + mock_mcu_pwm_set_ch(NOT_ACCESED_PWM_CH); + mock_mcu_pwm_set_raw(NOT_ACCESED_PWM_VAL, exp_pwm_ch); + + bsp_hb_write_pwm(pwm); + + uint8_t pwm_ch = mock_mcu_pwm_read_ch(); + uint16_t pwm_value = mock_mcu_pwm_read_raw(pwm_ch); + + printf(" Output: PWM:%d PWM-Ch:%d \n", pwm_value, pwm_ch); + printf("Expected: PWM:%d PWM-Ch:%d \n", exp_pwm, exp_pwm_ch); + + if((pwm_value==exp_pwm)&&(pwm_ch==exp_pwm_ch)) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_bsp_hb_write_pwm_test(void) +{ + printf("******************************************************\n"); + printf("void bsp_hb_write_pwm(uint16_t pwm) \n"); + + int test_res; + int pass = 1; + + uint16_t pwm; + uint16_t exp_pwm; + uint8_t exp_pwm_ch; + + // 0 + pwm = 0; + exp_pwm = 0; + exp_pwm_ch = MCU_PWM0; + test_res = ut_bsp_hb_write_pwm(pwm, exp_pwm, exp_pwm_ch); + if(!test_res) pass = 0; + + // 100 + pwm = 100; + exp_pwm = 100; + exp_pwm_ch = MCU_PWM0; + test_res = ut_bsp_hb_write_pwm(pwm, exp_pwm, exp_pwm_ch); + if(!test_res) pass = 0; + + // 95% + pwm = 0xFC00; + exp_pwm = 0xFC00; + exp_pwm_ch = MCU_PWM0; + test_res = ut_bsp_hb_write_pwm(pwm, exp_pwm, exp_pwm_ch); + if(!test_res) pass = 0; + + // MAX + pwm = 0xFFFF; + exp_pwm = 0xFC00; + exp_pwm_ch = MCU_PWM0; + test_res = ut_bsp_hb_write_pwm(pwm, exp_pwm, exp_pwm_ch); + if(!test_res) pass = 0; + + return pass; +} + +static const uint8_t NOT_ACCESED_ADC_CH = 255; +static const uint8_t NOT_ACCESED_ADC_VAL = 0xFFFF; + +static int ut_bsp_hb_read_meas(uint16_t adc_sup_u, uint16_t adc_sup_i, uint16_t adc_out_u, uint16_t adc_out_i, uint8_t low_side_lvl, uint16_t act_pwm, hb_meas_t* exp_meas) +{ + printf(" Input: Out-U:%d Out-I:%d Sup-U:%d Sup-I:%d Low-Lvl:%d PWM:%d \n", adc_out_u, adc_out_i, adc_sup_u, adc_sup_i, low_side_lvl, act_pwm); + + mock_mcu_adc_set_ch(NOT_ACCESED_ADC_CH); + mock_mcu_adc_set_raw(adc_sup_u, MCU_ADC2); + mock_mcu_adc_set_raw(adc_sup_i, MCU_ADC3); + mock_mcu_adc_set_raw(adc_out_u, MCU_ADC1); + mock_mcu_adc_set_raw(adc_out_i, MCU_ADC0); + + mock_mcu_gpio_set_ch(NOT_ACCESED_GPIO_CH); + mock_mcu_gpio_set_input_lvl(low_side_lvl, MCU_GPIO15); + + mock_mcu_pwm_set_ch(NOT_ACCESED_PWM_CH); + mock_mcu_pwm_set_raw(act_pwm, MCU_PWM0); + + hb_meas_t out; + + bsp_hb_read_meas(&out); + + uint8_t adc_ch = mock_mcu_adc_read_ch(); + uint8_t gpio_ch = mock_mcu_gpio_read_ch(); + uint8_t pwm_ch = mock_mcu_pwm_read_ch(); + + int equal = 1; + + if(out.out_voltage != exp_meas->out_voltage) equal = 0; + if(out.out_current != exp_meas->out_current) equal = 0; + if(out.sup_voltage != exp_meas->sup_voltage) equal = 0; + if(out.sup_current != exp_meas->sup_current) equal = 0; + if(out.out_power != exp_meas->out_power) equal = 0; + if(out.sup_power != exp_meas->sup_power) equal = 0; + if(out.out_impedance != exp_meas->out_impedance) equal = 0; + if(out.low_side_ctrl != exp_meas->low_side_ctrl) equal = 0; + if(out.pwm != exp_meas->pwm) equal = 0; + + printf(" Output: Out-U:%d Out-I:%d Bat-U:%d Bat-I:%d Out-P:%d Bat-P:%d Out-Z:%d Low:%d PWM:%d \n", out.out_voltage, out.out_current, out.sup_voltage, out.sup_current, out.out_power, out.sup_power, out.out_impedance, out.low_side_ctrl, out.pwm); + printf("Expected: Out-U:%d Out-I:%d Bat-U:%d Bat-I:%d Out-P:%d Bat-P:%d Out-Z:%d Low:%d PWM:%d \n", exp_meas->out_voltage, exp_meas->out_current, exp_meas->sup_voltage, exp_meas->sup_current, exp_meas->out_power, exp_meas->sup_power, exp_meas->out_impedance, exp_meas->low_side_ctrl, exp_meas->pwm); + + if((equal)&&(gpio_ch==MCU_GPIO15)&&(pwm_ch==MCU_PWM0)&&(adc_ch!=NOT_ACCESED_ADC_CH)) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_bsp_hb_read_meas_test(void) +{ + printf("******************************************************\n"); + printf("void bsp_hb_read_meas(hb_meas_t* measurements) \n"); + + int test_res; + int pass = 1; + + uint16_t adc_sup_u; + uint16_t adc_sup_i; + uint16_t adc_out_u; + uint16_t adc_out_i; + uint8_t low_side_lvl; + uint16_t act_pwm; + hb_meas_t exp_meas; + + // 0 + adc_sup_u = 0; + adc_sup_i = 0; + adc_out_u = 0; + adc_out_i = 0; + low_side_lvl = MCU_GPIO_LOW; + act_pwm = 0x0000; + exp_meas.out_voltage = 0; + exp_meas.out_current = 0; + exp_meas.sup_voltage = 0; + exp_meas.sup_current = 0; + exp_meas.out_power = 0; + exp_meas.sup_power = 0; + exp_meas.out_impedance = 0xFFFF; + exp_meas.low_side_ctrl = 0; + exp_meas.pwm = 0; + test_res = ut_bsp_hb_read_meas(adc_sup_u, adc_sup_i, adc_out_u, adc_out_i, low_side_lvl, act_pwm, &exp_meas); + if(!test_res) pass = 0; + + // Limits + adc_sup_u = 1023; + adc_sup_i = 1023; + adc_out_u = 1023; + adc_out_i = 1023; + low_side_lvl = MCU_GPIO_HIGH; + act_pwm = 457; + exp_meas.out_voltage = 20460; + exp_meas.out_current = 9997; + exp_meas.sup_voltage = 20460; + exp_meas.sup_current = 40067; + exp_meas.out_power = 0xFFFF; + exp_meas.sup_power = 0xFFFF; + exp_meas.out_impedance = 2046; + exp_meas.low_side_ctrl = 1; + exp_meas.pwm = 457; + test_res = ut_bsp_hb_read_meas(adc_sup_u, adc_sup_i, adc_out_u, adc_out_i, low_side_lvl, act_pwm, &exp_meas); + if(!test_res) pass = 0; + + // Normal + adc_sup_u = 600; + adc_sup_i = 51; + adc_out_u = 300; + adc_out_i = 409; + low_side_lvl = MCU_GPIO_HIGH; + act_pwm = 0xAAAA; + exp_meas.out_voltage = 6000; + exp_meas.out_current = 3997; + exp_meas.sup_voltage = 12000; + exp_meas.sup_current = 1997; + exp_meas.out_power = 23982; + exp_meas.sup_power = 23964; + exp_meas.out_impedance = 1501; + exp_meas.low_side_ctrl = 1; + exp_meas.pwm = 0xAAAA; + test_res = ut_bsp_hb_read_meas(adc_sup_u, adc_sup_i, adc_out_u, adc_out_i, low_side_lvl, act_pwm, &exp_meas); + if(!test_res) pass = 0; + + return pass; +} diff --git a/firmware/tests/ut_board/ut_halfbridge.h b/firmware/tests/ut_board/ut_halfbridge.h new file mode 100644 index 0000000..632697e --- /dev/null +++ b/firmware/tests/ut_board/ut_halfbridge.h @@ -0,0 +1,11 @@ +#ifndef UT_BOARD_HALFBRIDGE_H_ +#define UT_BOARD_HALFBRIDGE_H_ + +#include +#include + +int ut_bsp_hb_write_low_test(void); +int ut_bsp_hb_write_pwm_test(void); +int ut_bsp_hb_read_meas_test(void); + +#endif /* UT_BOARD_HALFBRIDGE_H_ */ diff --git a/firmware/tests/ut_board/ut_odout.c b/firmware/tests/ut_board/ut_odout.c new file mode 100644 index 0000000..9379742 --- /dev/null +++ b/firmware/tests/ut_board/ut_odout.c @@ -0,0 +1,212 @@ +#include "ut_odout.h" + +#include "..\mock_mcu\mock_mcu_hal_r8.h" +#include "..\..\src\hw\board\odout.h" + +static const uint8_t NOT_ACCESED_GPIO_CH = 255; +static const uint8_t NOT_ACCESED_GPIO_LVL = MCU_GPIO_HIZ; + +static int ut_bsp_odout_write(uint8_t odout_ch, int8_t odout_lvl, int8_t exp_gpio_lvl, uint8_t exp_gpio_ch) +{ + printf(" Input: ODout-Ch:%d ODout-lvl:%d \n", odout_ch, odout_lvl); + + mock_mcu_gpio_set_ch(NOT_ACCESED_GPIO_CH); + mock_mcu_gpio_set_output_lvl(NOT_ACCESED_GPIO_LVL, exp_gpio_ch); + + bsp_odout_write(odout_ch, odout_lvl); + + uint8_t gpio_ch = mock_mcu_gpio_read_ch(); + int8_t gpio_lvl = mock_mcu_gpio_read_output_lvl(gpio_ch); + + printf(" Output: GPIO-lvl:%d GPIO-Ch:%d \n", gpio_lvl, gpio_ch); + printf("Expected: GPIO-lvl:%d GPIO-Ch:%d \n", exp_gpio_lvl, exp_gpio_ch); + + if((gpio_lvl==exp_gpio_lvl)&&(gpio_ch==exp_gpio_ch)) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_bsp_odout_write_test(void) +{ + printf("******************************************************\n"); + printf("void bsp_odout_write(uint8_t ch, int8_t lvl) \n"); + + int test_res; + int pass = 1; + + uint8_t odout_ch; + uint8_t odout_lvl; + int8_t exp_gpio_lvl; + uint8_t exp_gpio_ch; + + // Control level - LOW + odout_ch = BSP_OD1; + odout_lvl = 0; + exp_gpio_lvl = MCU_GPIO_HIGH; + exp_gpio_ch = MCU_GPIO9; + test_res = ut_bsp_odout_write(odout_ch, odout_lvl, exp_gpio_lvl, exp_gpio_ch); + if(!test_res) pass = 0; + + // Control level - HIGH + odout_ch = BSP_OD1; + odout_lvl = 1; + exp_gpio_lvl = MCU_GPIO_LOW; + exp_gpio_ch = MCU_GPIO9; + test_res = ut_bsp_odout_write(odout_ch, odout_lvl, exp_gpio_lvl, exp_gpio_ch); + if(!test_res) pass = 0; + + // Control level - HIZ + odout_ch = BSP_OD1; + odout_lvl = -1; + exp_gpio_lvl = MCU_GPIO_LOW; + exp_gpio_ch = MCU_GPIO9; + test_res = ut_bsp_odout_write(odout_ch, odout_lvl, exp_gpio_lvl, exp_gpio_ch); + if(!test_res) pass = 0; + + // Control level DEFINE - LOW + odout_ch = BSP_OD1; + odout_lvl = BSP_ODOUT_LOW; + exp_gpio_lvl = MCU_GPIO_HIGH; + exp_gpio_ch = MCU_GPIO9; + test_res = ut_bsp_odout_write(odout_ch, odout_lvl, exp_gpio_lvl, exp_gpio_ch); + if(!test_res) pass = 0; + + // Control level DEFINE - HIGH + odout_ch = BSP_OD1; + odout_lvl = BSP_ODOUT_HIGH; + exp_gpio_lvl = MCU_GPIO_LOW; + exp_gpio_ch = MCU_GPIO9; + test_res = ut_bsp_odout_write(odout_ch, odout_lvl, exp_gpio_lvl, exp_gpio_ch); + if(!test_res) pass = 0; + + // Control level DEFINE - HIZ + odout_ch = BSP_OD1; + odout_lvl = BSP_ODOUT_HIZ; + exp_gpio_lvl = MCU_GPIO_LOW; + exp_gpio_ch = MCU_GPIO9; + test_res = ut_bsp_odout_write(odout_ch, odout_lvl, exp_gpio_lvl, exp_gpio_ch); + if(!test_res) pass = 0; + + // ODOUT 2 + odout_ch = BSP_OD2; + odout_lvl = 0; + exp_gpio_lvl = MCU_GPIO_HIGH; + exp_gpio_ch = MCU_GPIO10; + test_res = ut_bsp_odout_write(odout_ch, odout_lvl, exp_gpio_lvl, exp_gpio_ch); + if(!test_res) pass = 0; + + // ODOUT 3 + odout_ch = BSP_OD3; + odout_lvl = 0; + exp_gpio_lvl = MCU_GPIO_HIGH; + exp_gpio_ch = MCU_GPIO11; + test_res = ut_bsp_odout_write(odout_ch, odout_lvl, exp_gpio_lvl, exp_gpio_ch); + if(!test_res) pass = 0; + + // ODOUT 4 + odout_ch = BSP_OD4; + odout_lvl = 0; + exp_gpio_lvl = MCU_GPIO_HIGH; + exp_gpio_ch = MCU_GPIO12; + test_res = ut_bsp_odout_write(odout_ch, odout_lvl, exp_gpio_lvl, exp_gpio_ch); + if(!test_res) pass = 0; + + // ODOUT 5 + odout_ch = BSP_OD5; + odout_lvl = 0; + exp_gpio_lvl = MCU_GPIO_HIGH; + exp_gpio_ch = MCU_GPIO13; + test_res = ut_bsp_odout_write(odout_ch, odout_lvl, exp_gpio_lvl, exp_gpio_ch); + if(!test_res) pass = 0; + + // ODOUT 6 + odout_ch = BSP_OD6; + odout_lvl = 0; + exp_gpio_lvl = MCU_GPIO_HIGH; + exp_gpio_ch = MCU_GPIO14; + test_res = ut_bsp_odout_write(odout_ch, odout_lvl, exp_gpio_lvl, exp_gpio_ch); + if(!test_res) pass = 0; + + // Wrong chanell + odout_ch = 0; + odout_lvl = 0; + exp_gpio_lvl = NOT_ACCESED_GPIO_LVL; + exp_gpio_ch = NOT_ACCESED_GPIO_CH; + test_res = ut_bsp_odout_write(odout_ch, odout_lvl, exp_gpio_lvl, exp_gpio_ch); + if(!test_res) pass = 0; + + return pass; +} + +static const uint8_t NOT_ACCESED_PWM_CH = 255; +static const uint8_t NOT_ACCESED_PWM_VAL = 0xFFFF; + +static int ut_bsp_odout_write_common(uint8_t percent, uint16_t exp_pwm, uint8_t exp_pwm_ch) +{ + printf(" Input: Percent:%d \n", percent); + + mock_mcu_pwm_set_ch(NOT_ACCESED_PWM_CH); + mock_mcu_pwm_set_raw(NOT_ACCESED_PWM_VAL, exp_pwm_ch); + + bsp_odout_write_common(percent); + + uint8_t pwm_ch = mock_mcu_pwm_read_ch(); + uint16_t pwm_value = mock_mcu_pwm_read_raw(pwm_ch); + + printf(" Output: PWM:%d PWM-Ch:%d \n", pwm_value, pwm_ch); + printf("Expected: PWM:%d PWM-Ch:%d \n", exp_pwm, exp_pwm_ch); + + if((pwm_value==exp_pwm)&&(pwm_ch==exp_pwm_ch)) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_bsp_odout_write_common_test(void) +{ + printf("******************************************************\n"); + printf("void bsp_odout_write_common(uint8_t percent) \n"); + + int test_res; + int pass = 1; + + uint8_t percent; + uint16_t exp_pwm; + uint8_t exp_pwm_ch; + + // Zero + percent = 0; + exp_pwm = 0x0000; + exp_pwm_ch = MCU_PWM1; + test_res = ut_bsp_odout_write_common(percent, exp_pwm, exp_pwm_ch); + if(!test_res) pass = 0; + + // 100 + percent = 100; + exp_pwm = 0xFFFF; + exp_pwm_ch = MCU_PWM1; + test_res = ut_bsp_odout_write_common(percent, exp_pwm, exp_pwm_ch); + if(!test_res) pass = 0; + + // 50 + percent = 50; + exp_pwm = 0x7FFF; + exp_pwm_ch = MCU_PWM1; + test_res = ut_bsp_odout_write_common(percent, exp_pwm, exp_pwm_ch); + if(!test_res) pass = 0; + + return pass; +} diff --git a/firmware/tests/ut_board/ut_odout.h b/firmware/tests/ut_board/ut_odout.h new file mode 100644 index 0000000..4905b2f --- /dev/null +++ b/firmware/tests/ut_board/ut_odout.h @@ -0,0 +1,10 @@ +#ifndef UT_BOARD_ODOUT_H_ +#define UT_BOARD_ODOUT_H_ + +#include +#include + +int ut_bsp_odout_write_test(void); +int ut_bsp_odout_write_common_test(void); + +#endif /* UT_BOARD_ODOUT_H_ */ diff --git a/firmware/tests/ut_board/ut_setup.c b/firmware/tests/ut_board/ut_setup.c new file mode 100644 index 0000000..f15aa37 --- /dev/null +++ b/firmware/tests/ut_board/ut_setup.c @@ -0,0 +1,62 @@ +#include "ut_odout.h" + +#include "..\mock_mcu\mock_mcu_hal_r8.h" +#include "..\..\src\hw\board\setup.h" + +static adcClkDiv_t not_accesed_adc_clk = MCU_ADC_DIV128; +static timerClkDiv_t not_accesed_pwm_clk = MCU_TIM_DIV1024; +static uint16_t not_accesed_pwm_top = 0; +static uint8_t not_accesed_pwm_chb_en = 255; + +static int ut_bsp_startup(startupCfg_t* exp_cfg) +{ + printf(" Input: \n"); + + startupCfg_t not_accesd_cfg; + not_accesd_cfg.adc_clk = not_accesed_adc_clk; + not_accesd_cfg.pwm_clk = not_accesed_pwm_clk; + not_accesd_cfg.pwm_top = not_accesed_pwm_top; + not_accesd_cfg.pwm_chb_en = not_accesed_pwm_chb_en; + mock_mcu_startup_write_cfg(¬_accesd_cfg); + + bsp_startup(); + + startupCfg_t cfg; + mock_mcu_startup_read_cfg(&cfg); + + printf(" Output: ADC-CLK:%d PWN-CLK:%d PWM-TOP:%d PWM-CHB-EN:%d \n", cfg.adc_clk, cfg.pwm_clk, cfg.pwm_top, cfg.pwm_chb_en); + printf("Expected: ADC-CLK:%d PWN-CLK:%d PWM-TOP:%d PWM-CHB-EN:%d \n", exp_cfg->adc_clk, exp_cfg->pwm_clk, exp_cfg->pwm_top, exp_cfg->pwm_chb_en); + + if((cfg.adc_clk==exp_cfg->adc_clk)&&(cfg.pwm_clk==exp_cfg->pwm_clk)&&(cfg.pwm_top==exp_cfg->pwm_top)&&(cfg.pwm_chb_en==exp_cfg->pwm_chb_en)) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_bsp_startup_test(void) +{ + printf("******************************************************\n"); + printf("void bsp_startup(void) \n"); + + int test_res; + int pass = 1; + + startupCfg_t exp_cfg; + + // Control level - LOW + exp_cfg.adc_clk = MCU_ADC_DIV2; + exp_cfg.pwm_clk = MCU_TIM_DIV1; + exp_cfg.pwm_top = 511; + exp_cfg.pwm_chb_en = 1; + test_res = ut_bsp_startup(&exp_cfg); + if(!test_res) pass = 0; + + return pass; +} + diff --git a/firmware/tests/ut_board/ut_setup.h b/firmware/tests/ut_board/ut_setup.h new file mode 100644 index 0000000..0957e3b --- /dev/null +++ b/firmware/tests/ut_board/ut_setup.h @@ -0,0 +1,9 @@ +#ifndef UT_BOARD_SETUP_H_ +#define UT_BOARD_SETUP_H_ + +#include +#include + +int ut_bsp_startup_test(void); + +#endif /* UT_BOARD_SETUP_H_ */ diff --git a/firmware/tests/ut_hw/ut_analog.c b/firmware/tests/ut_hw/ut_analog.c new file mode 100644 index 0000000..2ae20ac --- /dev/null +++ b/firmware/tests/ut_hw/ut_analog.c @@ -0,0 +1,73 @@ +#include "ut_analog.h" + +#include "..\mock_board\mock_board_ain.h" + +#include "..\..\src\hw\analog.h" + +static const uint8_t NOT_ACCESED_AIN_CH = 255; + +static int ut_analog_ch_get(uint8_t analog_ch, uint16_t ain_value, uint16_t exp_out, uint8_t exp_ain_ch) +{ + printf(" Input: Analog-Ch:%d AIN-Value:%d \n", analog_ch, ain_value); + + mock_board_ain_write_ch(NOT_ACCESED_AIN_CH); + mock_board_ain_write_data(exp_ain_ch, ain_value); + + uint16_t out = analog_ch_get(analog_ch); + + uint8_t ain_ch = mock_board_ain_read_ch(); + + printf(" Output: ANALOG:%d AIN-Ch:%d \n", out, ain_ch); + printf("Expected: ANALOG:%d AIN-Ch:%d \n", exp_out, exp_ain_ch); + + if((out==exp_out)&&(ain_ch==exp_ain_ch)) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_analog_ch_get_test(void) +{ + printf("******************************************************\n"); + printf("uint16_t analog_ch_get(uint8_t analog_ch) \n"); + + int test_res; + int pass = 1; + + uint8_t analog_ch; + uint16_t ain_value; + uint16_t exp_out; + uint8_t exp_ain_ch; + + // Normal 1 + analog_ch = ANALOG_1; + ain_value = 2500; + exp_out = 2500; + exp_ain_ch = BSP_AIN2; + test_res = ut_analog_ch_get(analog_ch, ain_value, exp_out, exp_ain_ch); + if(!test_res) pass = 0; + + // Normal 2 + analog_ch = ANALOG_2; + ain_value = 3000; + exp_out = 3000; + exp_ain_ch = BSP_AIN1; + test_res = ut_analog_ch_get(analog_ch, ain_value, exp_out, exp_ain_ch); + if(!test_res) pass = 0; + + // Wrong channel + analog_ch = 0; + ain_value = 1200; + exp_out = 0; + exp_ain_ch = NOT_ACCESED_AIN_CH; + test_res = ut_analog_ch_get(analog_ch, ain_value, exp_out, exp_ain_ch); + if(!test_res) pass = 0; + + return pass; +} diff --git a/firmware/tests/ut_hw/ut_analog.h b/firmware/tests/ut_hw/ut_analog.h new file mode 100644 index 0000000..fc3d064 --- /dev/null +++ b/firmware/tests/ut_hw/ut_analog.h @@ -0,0 +1,9 @@ +#ifndef UT_HW_ANALOG_H_ +#define UT_HW_ANALOG_H_ + +#include +#include + +int ut_analog_ch_get_test(void); + +#endif /* UT_HW_ANALOG_H_ */ diff --git a/firmware/tests/ut_hw/ut_buttons.c b/firmware/tests/ut_hw/ut_buttons.c new file mode 100644 index 0000000..7cebd6b --- /dev/null +++ b/firmware/tests/ut_hw/ut_buttons.c @@ -0,0 +1,854 @@ +#include "ut_buttons.h" + +#include "..\mock_board\mock_board_din.h" +#include "..\mock_board\mock_board_dout.h" + +#include "..\..\src\hw\buttons.h" + +static const uint8_t NOT_ACCESED_DIN_CH = 255; +static const uint8_t NOT_ACCESED_DIN_LVL = BSP_DIN_LOW; + +static const uint8_t NOT_ACCESED_DOUT_CH = 255; +static const int8_t NOT_ACCESED_DOUT_LVL = BSP_DOUT_HIZ; + +static int ut_btn_reset(btn_t* btn, btn_t* exp_btn) +{ + printf(" Input: State:%d New-State:%d State-time:%d Transition-cntr:%d Debounce-act:%d \n", btn->state, btn->new_state, btn->state_time, btn->transition_cntr, btn->dbnc_active); + + btn_reset(btn); + + printf(" Output: State:%d New-State:%d State-time:%d Transition-cntr:%d Debounce-act:%d \n", btn->state, btn->new_state, btn->state_time, btn->transition_cntr, btn->dbnc_active); + printf("Expected: State:%d New-State:%d State-time:%d Transition-cntr:%d Debounce-act:%d \n", exp_btn->state, exp_btn->new_state, exp_btn->state_time, exp_btn->transition_cntr, exp_btn->dbnc_active); + + int equal = 1; + if(btn->state != exp_btn->state) equal = 0; + if(btn->new_state != exp_btn->new_state) equal = 0; + if(btn->state_time != exp_btn->state_time) equal = 0; + if(btn->transition_cntr != exp_btn->transition_cntr) equal = 0; + if(btn->dbnc_active != exp_btn->dbnc_active) equal = 0; + + if(equal) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_btn_reset_test(void) +{ + printf("******************************************************\n"); + printf("void btn_reset(btn_t* btn) \n"); + + int test_res; + int pass = 1; + + btn_t btn; + btn_t exp_btn; + + // Normal 1 + btn.state = 0; + btn.new_state = 0; + btn.state_time = 0; + btn.transition_cntr = 0; + btn.dbnc_active = 0; + exp_btn.state = 0; + exp_btn.new_state = 0; + exp_btn.state_time = 0; + exp_btn.transition_cntr = 0; + exp_btn.dbnc_active = 1; + test_res = ut_btn_reset(&btn, &exp_btn); + if(!test_res) pass = 0; + + // Normal 1 + btn.state = 1; + btn.new_state = 1; + btn.state_time = 1000; + btn.transition_cntr = 20; + btn.dbnc_active = 0; + exp_btn.state = BTN_INACTIVE; + exp_btn.new_state = 0; + exp_btn.state_time = 0; + exp_btn.transition_cntr = 0; + exp_btn.dbnc_active = 1; + test_res = ut_btn_reset(&btn, &exp_btn); + if(!test_res) pass = 0; + + return pass; +} + +static int ut_btn_process(uint8_t lvl, btn_t* btn, btn_cfg_t* cfg, uint8_t exp_out, btn_t* exp_btn, btn_cfg_t* exp_cfg) +{ + printf(" Input: Level:%d \n", lvl); + printf(" Input: State:%d New-State:%d State-time:%d Transition-cntr:%d Debounce-act:%d \n", btn->state, btn->new_state, btn->state_time, btn->transition_cntr, btn->dbnc_active); + printf(" Input: Act-Lvl:%d Debounce-lim:%d Repeat-Time:%d \n", cfg->act_lvl, cfg->dbnc_lim, cfg->repeat_time); + + uint8_t out = btn_process(lvl, btn, cfg); + + printf(" Output: %d \n", out); + printf(" Output: State:%d New-State:%d State-time:%d Transition-cntr:%d Debounce-act:%d \n", btn->state, btn->new_state, btn->state_time, btn->transition_cntr, btn->dbnc_active); + printf(" Output: Act-Lvl:%d Debounce-lim:%d Repeat-Time:%d \n", cfg->act_lvl, cfg->dbnc_lim, cfg->repeat_time); + + printf("Expected: %d \n", exp_out); + printf("Expected: State:%d New-State:%d State-time:%d Transition-cntr:%d Debounce-act:%d \n", exp_btn->state, exp_btn->new_state, exp_btn->state_time, exp_btn->transition_cntr, exp_btn->dbnc_active); + printf("Expected: Act-Lvl:%d Debounce-lim:%d Repeat-Time:%d \n", exp_cfg->act_lvl, exp_cfg->dbnc_lim, exp_cfg->repeat_time); + + int equal = 1; + if(btn->state != exp_btn->state) equal = 0; + if(btn->new_state != exp_btn->new_state) equal = 0; + if(btn->state_time != exp_btn->state_time) equal = 0; + if(btn->transition_cntr != exp_btn->transition_cntr) equal = 0; + if(btn->dbnc_active != exp_btn->dbnc_active) equal = 0; + if(cfg->act_lvl != exp_cfg->act_lvl) equal = 0; + if(cfg->dbnc_lim != exp_cfg->dbnc_lim) equal = 0; + if(cfg->repeat_time != exp_cfg->repeat_time) equal = 0; + + if((out==exp_out)&&(equal)) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_btn_process_test(void) +{ + printf("******************************************************\n"); + printf("uint8_t btn_process(uint8_t lvl, btn_t* btn, btn_cfg_t* cfg) \n"); + + int test_res; + int pass = 1; + + uint8_t lvl; + btn_t btn; + btn_cfg_t cfg; + uint8_t exp_out; + btn_t exp_btn; + btn_cfg_t exp_cfg; + + // No changes + lvl = 0; + btn.state = 0; + btn.new_state = 0; + btn.state_time = 0; + btn.transition_cntr = 0; + btn.dbnc_active = 0; + cfg.act_lvl = 1; + cfg.dbnc_lim = 0; + cfg.repeat_time = 0; + + exp_out = 0; + exp_btn.state = 0; + exp_btn.new_state = 0; + exp_btn.state_time = 1; + exp_btn.transition_cntr = 0; + exp_btn.dbnc_active = 0; + exp_cfg.act_lvl = cfg.act_lvl; + exp_cfg.dbnc_lim = cfg.dbnc_lim; + exp_cfg.repeat_time = cfg.repeat_time; + + test_res = ut_btn_process(lvl, &btn, &cfg, exp_out, &exp_btn, &exp_cfg); + if(!test_res) pass = 0; + + // State time increase + lvl = 1; + btn.state = 0; + btn.new_state = 0; + btn.state_time = 12345; + btn.transition_cntr = 0; + btn.dbnc_active = 0; + cfg.act_lvl = 0; + cfg.dbnc_lim = 0; + cfg.repeat_time = 0; + + exp_out = 0; + exp_btn.state = 0; + exp_btn.new_state = 0; + exp_btn.state_time = 12346; + exp_btn.transition_cntr = 0; + exp_btn.dbnc_active = 0; + exp_cfg.act_lvl = cfg.act_lvl; + exp_cfg.dbnc_lim = cfg.dbnc_lim; + exp_cfg.repeat_time = cfg.repeat_time; + + test_res = ut_btn_process(lvl, &btn, &cfg, exp_out, &exp_btn, &exp_cfg); + if(!test_res) pass = 0; + + // Activation, first time, act high + lvl = 1; + btn.state = 0; + btn.new_state = 0; + btn.state_time = 38455; + btn.transition_cntr = 0; + btn.dbnc_active = 0; + cfg.act_lvl = 1; + cfg.dbnc_lim = 0; + cfg.repeat_time = 0; + + exp_out = 1; + exp_btn.state = 1; + exp_btn.new_state = 1; + exp_btn.state_time = 0; + exp_btn.transition_cntr = 0; + exp_btn.dbnc_active = 0; + exp_cfg.act_lvl = cfg.act_lvl; + exp_cfg.dbnc_lim = cfg.dbnc_lim; + exp_cfg.repeat_time = cfg.repeat_time; + + test_res = ut_btn_process(lvl, &btn, &cfg, exp_out, &exp_btn, &exp_cfg); + if(!test_res) pass = 0; + + // Activation, first time, act low + lvl = 0; + btn.state = 0; + btn.new_state = 0; + btn.state_time = 38455; + btn.transition_cntr = 0; + btn.dbnc_active = 0; + cfg.act_lvl = 0; + cfg.dbnc_lim = 0; + cfg.repeat_time = 0; + + exp_out = 1; + exp_btn.state = 1; + exp_btn.new_state = 1; + exp_btn.state_time = 0; + exp_btn.transition_cntr = 0; + exp_btn.dbnc_active = 0; + exp_cfg.act_lvl = cfg.act_lvl; + exp_cfg.dbnc_lim = cfg.dbnc_lim; + exp_cfg.repeat_time = cfg.repeat_time; + + test_res = ut_btn_process(lvl, &btn, &cfg, exp_out, &exp_btn, &exp_cfg); + if(!test_res) pass = 0; + + // Active second time, not cleared new flag + lvl = 1; + btn.state = 1; + btn.new_state = 1; + btn.state_time = 0; + btn.transition_cntr = 0; + btn.dbnc_active = 0; + cfg.act_lvl = 1; + cfg.dbnc_lim = 0; + cfg.repeat_time = 0; + + exp_out = 1; + exp_btn.state = 1; + exp_btn.new_state = 1; + exp_btn.state_time = 1; + exp_btn.transition_cntr = 0; + exp_btn.dbnc_active = 0; + exp_cfg.act_lvl = cfg.act_lvl; + exp_cfg.dbnc_lim = cfg.dbnc_lim; + exp_cfg.repeat_time = cfg.repeat_time; + + test_res = ut_btn_process(lvl, &btn, &cfg, exp_out, &exp_btn, &exp_cfg); + if(!test_res) pass = 0; + + // Active second time, cleared new flag + lvl = 1; + btn.state = 1; + btn.new_state = 0; + btn.state_time = 0; + btn.transition_cntr = 0; + btn.dbnc_active = 0; + cfg.act_lvl = 1; + cfg.dbnc_lim = 0; + cfg.repeat_time = 0; + + exp_out = 1; + exp_btn.state = 1; + exp_btn.new_state = 0; + exp_btn.state_time = 1; + exp_btn.transition_cntr = 0; + exp_btn.dbnc_active = 0; + exp_cfg.act_lvl = cfg.act_lvl; + exp_cfg.dbnc_lim = cfg.dbnc_lim; + exp_cfg.repeat_time = cfg.repeat_time; + + test_res = ut_btn_process(lvl, &btn, &cfg, exp_out, &exp_btn, &exp_cfg); + if(!test_res) pass = 0; + + // Deactive, act high + lvl = 0; + btn.state = 1; + btn.new_state = 0; + btn.state_time = 60584; + btn.transition_cntr = 0; + btn.dbnc_active = 0; + cfg.act_lvl = 1; + cfg.dbnc_lim = 0; + cfg.repeat_time = 0; + + exp_out = 0; + exp_btn.state = 0; + exp_btn.new_state = 1; + exp_btn.state_time = 0; + exp_btn.transition_cntr = 0; + exp_btn.dbnc_active = 0; + exp_cfg.act_lvl = cfg.act_lvl; + exp_cfg.dbnc_lim = cfg.dbnc_lim; + exp_cfg.repeat_time = cfg.repeat_time; + + test_res = ut_btn_process(lvl, &btn, &cfg, exp_out, &exp_btn, &exp_cfg); + if(!test_res) pass = 0; + + // Deactive, act low + lvl = 1; + btn.state = 1; + btn.new_state = 0; + btn.state_time = 558; + btn.transition_cntr = 0; + btn.dbnc_active = 0; + cfg.act_lvl = 0; + cfg.dbnc_lim = 0; + cfg.repeat_time = 0; + + exp_out = 0; + exp_btn.state = 0; + exp_btn.new_state = 1; + exp_btn.state_time = 0; + exp_btn.transition_cntr = 0; + exp_btn.dbnc_active = 0; + exp_cfg.act_lvl = cfg.act_lvl; + exp_cfg.dbnc_lim = cfg.dbnc_lim; + exp_cfg.repeat_time = cfg.repeat_time; + + test_res = ut_btn_process(lvl, &btn, &cfg, exp_out, &exp_btn, &exp_cfg); + if(!test_res) pass = 0; + + // Debounce, first + lvl = 1; + btn.state = 0; + btn.new_state = 0; + btn.state_time = 24789; + btn.transition_cntr = 0; + btn.dbnc_active = 0; + cfg.act_lvl = 1; + cfg.dbnc_lim = 10; + cfg.repeat_time = 0; + + exp_out = 0; + exp_btn.state = 0; + exp_btn.new_state = 0; + exp_btn.state_time = 24790; + exp_btn.transition_cntr = 0; + exp_btn.dbnc_active = 1; + exp_cfg.act_lvl = cfg.act_lvl; + exp_cfg.dbnc_lim = cfg.dbnc_lim; + exp_cfg.repeat_time = cfg.repeat_time; + + test_res = ut_btn_process(lvl, &btn, &cfg, exp_out, &exp_btn, &exp_cfg); + if(!test_res) pass = 0; + + // Debounce at end + lvl = 1; + btn.state = 0; + btn.new_state = 0; + btn.state_time = 142; + btn.transition_cntr = 9; + btn.dbnc_active = 1; + cfg.act_lvl = 1; + cfg.dbnc_lim = 10; + cfg.repeat_time = 0; + + exp_out = 1; + exp_btn.state = 1; + exp_btn.new_state = 1; + exp_btn.state_time = 0; + exp_btn.transition_cntr = 0; + exp_btn.dbnc_active = 0; + exp_cfg.act_lvl = cfg.act_lvl; + exp_cfg.dbnc_lim = cfg.dbnc_lim; + exp_cfg.repeat_time = cfg.repeat_time; + + test_res = ut_btn_process(lvl, &btn, &cfg, exp_out, &exp_btn, &exp_cfg); + if(!test_res) pass = 0; + + // Debounce fail, act high, fail to active state + lvl = 0; + btn.state = 0; + btn.new_state = 0; + btn.state_time = 142; + btn.transition_cntr = 5; + btn.dbnc_active = 1; + cfg.act_lvl = 1; + cfg.dbnc_lim = 10; + cfg.repeat_time = 0; + + exp_out = 0; + exp_btn.state = 0; + exp_btn.new_state = 0; + exp_btn.state_time = 143; + exp_btn.transition_cntr = 0; + exp_btn.dbnc_active = 0; + exp_cfg.act_lvl = cfg.act_lvl; + exp_cfg.dbnc_lim = cfg.dbnc_lim; + exp_cfg.repeat_time = cfg.repeat_time; + + test_res = ut_btn_process(lvl, &btn, &cfg, exp_out, &exp_btn, &exp_cfg); + if(!test_res) pass = 0; + + // Debounce fail, act low, fail to active state + lvl = 1; + btn.state = 0; + btn.new_state = 0; + btn.state_time = 257; + btn.transition_cntr = 4; + btn.dbnc_active = 1; + cfg.act_lvl = 0; + cfg.dbnc_lim = 10; + cfg.repeat_time = 0; + + exp_out = 0; + exp_btn.state = 0; + exp_btn.new_state = 0; + exp_btn.state_time = 258; + exp_btn.transition_cntr = 0; + exp_btn.dbnc_active = 0; + exp_cfg.act_lvl = cfg.act_lvl; + exp_cfg.dbnc_lim = cfg.dbnc_lim; + exp_cfg.repeat_time = cfg.repeat_time; + + test_res = ut_btn_process(lvl, &btn, &cfg, exp_out, &exp_btn, &exp_cfg); + if(!test_res) pass = 0; + + // Before New state repeat + lvl = 1; + btn.state = 1; + btn.new_state = 0; + btn.state_time = 4998; + btn.transition_cntr = 0; + btn.dbnc_active = 0; + cfg.act_lvl = 1; + cfg.dbnc_lim = 10; + cfg.repeat_time = 5000; + + exp_out = 1; + exp_btn.state = 1; + exp_btn.new_state = 0; + exp_btn.state_time = 4999; + exp_btn.transition_cntr = 0; + exp_btn.dbnc_active = 0; + exp_cfg.act_lvl = cfg.act_lvl; + exp_cfg.dbnc_lim = cfg.dbnc_lim; + exp_cfg.repeat_time = cfg.repeat_time; + + test_res = ut_btn_process(lvl, &btn, &cfg, exp_out, &exp_btn, &exp_cfg); + if(!test_res) pass = 0; + + // Before New state repeat + lvl = 1; + btn.state = 1; + btn.new_state = 0; + btn.state_time = 4999; + btn.transition_cntr = 0; + btn.dbnc_active = 0; + cfg.act_lvl = 1; + cfg.dbnc_lim = 10; + cfg.repeat_time = 5000; + + exp_out = 1; + exp_btn.state = 1; + exp_btn.new_state = 1; + exp_btn.state_time = 5000; + exp_btn.transition_cntr = 0; + exp_btn.dbnc_active = 0; + exp_cfg.act_lvl = cfg.act_lvl; + exp_cfg.dbnc_lim = cfg.dbnc_lim; + exp_cfg.repeat_time = cfg.repeat_time; + + test_res = ut_btn_process(lvl, &btn, &cfg, exp_out, &exp_btn, &exp_cfg); + if(!test_res) pass = 0; + + // Before New state repeat + lvl = 1; + btn.state = 1; + btn.new_state = 0; + btn.state_time = 5000; + btn.transition_cntr = 0; + btn.dbnc_active = 0; + cfg.act_lvl = 1; + cfg.dbnc_lim = 10; + cfg.repeat_time = 5000; + + exp_out = 1; + exp_btn.state = 1; + exp_btn.new_state = 0; + exp_btn.state_time = 5001; + exp_btn.transition_cntr = 0; + exp_btn.dbnc_active = 0; + exp_cfg.act_lvl = cfg.act_lvl; + exp_cfg.dbnc_lim = cfg.dbnc_lim; + exp_cfg.repeat_time = cfg.repeat_time; + + test_res = ut_btn_process(lvl, &btn, &cfg, exp_out, &exp_btn, &exp_cfg); + if(!test_res) pass = 0; + + // Before New state repeat + lvl = 1; + btn.state = 1; + btn.new_state = 0; + btn.state_time = 19999; + btn.transition_cntr = 0; + btn.dbnc_active = 0; + cfg.act_lvl = 1; + cfg.dbnc_lim = 10; + cfg.repeat_time = 5000; + + exp_out = 1; + exp_btn.state = 1; + exp_btn.new_state = 1; + exp_btn.state_time = 20000; + exp_btn.transition_cntr = 0; + exp_btn.dbnc_active = 0; + exp_cfg.act_lvl = cfg.act_lvl; + exp_cfg.dbnc_lim = cfg.dbnc_lim; + exp_cfg.repeat_time = cfg.repeat_time; + + test_res = ut_btn_process(lvl, &btn, &cfg, exp_out, &exp_btn, &exp_cfg); + if(!test_res) pass = 0; + + // Before New state repeat + lvl = 1; + btn.state = 1; + btn.new_state = 0; + btn.state_time = 0xFFFE; + btn.transition_cntr = 0; + btn.dbnc_active = 0; + cfg.act_lvl = 1; + cfg.dbnc_lim = 10; + cfg.repeat_time = 255; + + exp_out = 1; + exp_btn.state = 1; + exp_btn.new_state = 0; + exp_btn.state_time = 0xFFFF; + exp_btn.transition_cntr = 0; + exp_btn.dbnc_active = 0; + exp_cfg.act_lvl = cfg.act_lvl; + exp_cfg.dbnc_lim = cfg.dbnc_lim; + exp_cfg.repeat_time = cfg.repeat_time; + + test_res = ut_btn_process(lvl, &btn, &cfg, exp_out, &exp_btn, &exp_cfg); + if(!test_res) pass = 0; + + return pass; +} + +static int ut_btn_ch_process(uint8_t btn_ch, btn_t* btn, uint8_t din_lvl, uint8_t exp_out, btn_t* exp_btn, uint8_t exp_din_ch) +{ + printf(" Input: Btn-Ch:%d Din-Lvl:%d\n", btn_ch, din_lvl); + printf(" Input: State:%d New-State:%d State-time:%d Transition-cntr:%d Debounce-act:%d \n", btn->state, btn->new_state, btn->state_time, btn->transition_cntr, btn->dbnc_active); + + mock_board_din_write_ch(NOT_ACCESED_DIN_CH); + mock_board_din_write_data(exp_din_ch, din_lvl); + + uint8_t out = btn_ch_process(btn_ch, btn); + + uint8_t din_ch = mock_board_din_read_ch(); + + printf(" Output: %d \n", out); + printf(" Output: State:%d New-State:%d State-time:%d Transition-cntr:%d Debounce-act:%d \n", btn->state, btn->new_state, btn->state_time, btn->transition_cntr, btn->dbnc_active); + printf(" Output: Din-Ch:%d \n", din_ch); + + printf("Expected: %d \n", exp_out); + printf("Expected: State:%d New-State:%d State-time:%d Transition-cntr:%d Debounce-act:%d \n", exp_btn->state, exp_btn->new_state, exp_btn->state_time, exp_btn->transition_cntr, exp_btn->dbnc_active); + printf("Expected: Din-Ch:%d \n", exp_din_ch); + + int equal = 1; + if(btn->state != exp_btn->state) equal = 0; + if(btn->new_state != exp_btn->new_state) equal = 0; + if(btn->state_time != exp_btn->state_time) equal = 0; + if(btn->transition_cntr != exp_btn->transition_cntr) equal = 0; + if(btn->dbnc_active != exp_btn->dbnc_active) equal = 0; + + if((out==exp_out)&&(equal)&&(din_ch==exp_din_ch)) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_btn_ch_process_test(void) +{ + printf("******************************************************\n"); + printf("uint8_t btn_ch_process(uint8_t btn_ch, btn_t* btn) \n"); + + int test_res; + int pass = 1; + + uint8_t btn_ch; + btn_t btn; + uint8_t din_lvl; + uint8_t exp_out; + btn_t exp_btn; + uint8_t exp_din_ch; + + // Mapping check 1 + btn_ch = BTN_1; + btn.state = 0; + btn.new_state = 0; + btn.state_time = 150; + btn.transition_cntr = 9; + btn.dbnc_active = 1; + din_lvl = BSP_DIN_LOW; + + exp_out = 1; + exp_btn.state = 1; + exp_btn.new_state = 1; + exp_btn.state_time = 0; + exp_btn.transition_cntr = 0; + exp_btn.dbnc_active = 0; + exp_din_ch = BSP_DIN1; + + test_res = ut_btn_ch_process(btn_ch, &btn, din_lvl, exp_out, &exp_btn, exp_din_ch); + if(!test_res) pass = 0; + + // Mapping check 2 + btn_ch = BTN_2; + btn.state = 0; + btn.new_state = 0; + btn.state_time = 150; + btn.transition_cntr = 9; + btn.dbnc_active = 1; + din_lvl = BSP_DIN_LOW; + + exp_out = 1; + exp_btn.state = 1; + exp_btn.new_state = 1; + exp_btn.state_time = 0; + exp_btn.transition_cntr = 0; + exp_btn.dbnc_active = 0; + exp_din_ch = BSP_DIN3; + + test_res = ut_btn_ch_process(btn_ch, &btn, din_lvl, exp_out, &exp_btn, exp_din_ch); + if(!test_res) pass = 0; + + // Mapping check 3 + btn_ch = BTN_3; + btn.state = 0; + btn.new_state = 0; + btn.state_time = 150; + btn.transition_cntr = 9; + btn.dbnc_active = 1; + din_lvl = BSP_DIN_LOW; + + exp_out = 1; + exp_btn.state = 1; + exp_btn.new_state = 1; + exp_btn.state_time = 0; + exp_btn.transition_cntr = 0; + exp_btn.dbnc_active = 0; + exp_din_ch = BSP_DIN4; + + test_res = ut_btn_ch_process(btn_ch, &btn, din_lvl, exp_out, &exp_btn, exp_din_ch); + if(!test_res) pass = 0; + + // Mapping check 4 + btn_ch = BTN_4; + btn.state = 0; + btn.new_state = 0; + btn.state_time = 150; + btn.transition_cntr = 9; + btn.dbnc_active = 1; + din_lvl = BSP_DIN_HIGH; + + exp_out = 1; + exp_btn.state = 1; + exp_btn.new_state = 1; + exp_btn.state_time = 0; + exp_btn.transition_cntr = 0; + exp_btn.dbnc_active = 0; + exp_din_ch = BSP_DIN5; + + test_res = ut_btn_ch_process(btn_ch, &btn, din_lvl, exp_out, &exp_btn, exp_din_ch); + if(!test_res) pass = 0; + + // Mapping check 5 + btn_ch = BTN_5; + btn.state = 0; + btn.new_state = 0; + btn.state_time = 150; + btn.transition_cntr = 9; + btn.dbnc_active = 1; + din_lvl = BSP_DIN_HIGH; + + exp_out = 1; + exp_btn.state = 1; + exp_btn.new_state = 1; + exp_btn.state_time = 0; + exp_btn.transition_cntr = 0; + exp_btn.dbnc_active = 0; + exp_din_ch = BSP_DIN6; + + test_res = ut_btn_ch_process(btn_ch, &btn, din_lvl, exp_out, &exp_btn, exp_din_ch); + if(!test_res) pass = 0; + + // Mapping check 6 + btn_ch = BTN_6; + btn.state = 0; + btn.new_state = 0; + btn.state_time = 150; + btn.transition_cntr = 9; + btn.dbnc_active = 1; + din_lvl = BSP_DIN_LOW; + + exp_out = 1; + exp_btn.state = 1; + exp_btn.new_state = 1; + exp_btn.state_time = 0; + exp_btn.transition_cntr = 0; + exp_btn.dbnc_active = 0; + exp_din_ch = BSP_DIN7; + + test_res = ut_btn_ch_process(btn_ch, &btn, din_lvl, exp_out, &exp_btn, exp_din_ch); + if(!test_res) pass = 0; + + // Mapping check 6N + btn_ch = BTN_6N; + btn.state = 0; + btn.new_state = 0; + btn.state_time = 150; + btn.transition_cntr = 9; + btn.dbnc_active = 1; + din_lvl = BSP_DIN_LOW; + + exp_out = 1; + exp_btn.state = 1; + exp_btn.new_state = 1; + exp_btn.state_time = 0; + exp_btn.transition_cntr = 0; + exp_btn.dbnc_active = 0; + exp_din_ch = BSP_DIN7N; + + test_res = ut_btn_ch_process(btn_ch, &btn, din_lvl, exp_out, &exp_btn, exp_din_ch); + if(!test_res) pass = 0; + + // Wrong channel + btn_ch = 0; + btn.state = 1; + btn.new_state = 0; + btn.state_time = 150; + btn.transition_cntr = 9; + btn.dbnc_active = 1; + din_lvl = BSP_DIN_LOW; + + exp_out = 0; + exp_btn.state = 1; + exp_btn.new_state = 0; + exp_btn.state_time = 150; + exp_btn.transition_cntr = 9; + exp_btn.dbnc_active = 1; + exp_din_ch = NOT_ACCESED_DIN_CH; + + test_res = ut_btn_ch_process(btn_ch, &btn, din_lvl, exp_out, &exp_btn, exp_din_ch); + if(!test_res) pass = 0; + + return pass; +} + +static int ut_btn_ch_set_pull(uint8_t btn_ch, int8_t lvl, int8_t exp_dout_lvl, uint8_t exp_dout_ch) +{ + printf(" Input: Btn-Ch:%d Din-Lvl:%d\n", btn_ch, lvl); + + mock_board_dout_write_ch(NOT_ACCESED_DOUT_CH); + mock_board_dout_write_data(exp_dout_ch, NOT_ACCESED_DOUT_LVL); + + btn_ch_set_pull(btn_ch, lvl); + + uint8_t dout_ch = mock_board_dout_read_ch(); + int8_t dout = mock_board_dout_read_data(exp_dout_ch); + + printf(" Output: Dout-Ch:%d Dout-Lvl:%d \n", dout_ch, dout); + printf("Expected: Dout-Ch:%d Dout-Lvl:%d \n", exp_dout_ch, exp_dout_lvl); + + if((dout==exp_dout_lvl)&&(dout_ch==exp_dout_ch)) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_btn_ch_set_pull_test(void) +{ + printf("******************************************************\n"); + printf("void btn_ch_set_pull(uint8_t btn_ch, int8_t lvl) \n"); + + int test_res; + int pass = 1; + + uint8_t btn_ch; + int8_t lvl; + int8_t exp_dout_lvl; + uint8_t exp_dout_ch; + + // Mapping check 1 + btn_ch = BTN_6; + lvl = 0; + exp_dout_lvl = BSP_DOUT_LOW; + exp_dout_ch = BSP_DOUT5; + test_res = ut_btn_ch_set_pull(btn_ch, lvl, exp_dout_lvl, exp_dout_ch); + if(!test_res) pass = 0; + + // Mapping check 2 + btn_ch = BTN_6N; + lvl = 1; + exp_dout_lvl = BSP_DOUT_HIGH; + exp_dout_ch = BSP_DOUT5; + test_res = ut_btn_ch_set_pull(btn_ch, lvl, exp_dout_lvl, exp_dout_ch); + if(!test_res) pass = 0; + + // Define check 1 + btn_ch = BTN_6N; + lvl = BTN_PULL_LOW; + exp_dout_lvl = BSP_DOUT_LOW; + exp_dout_ch = BSP_DOUT5; + test_res = ut_btn_ch_set_pull(btn_ch, lvl, exp_dout_lvl, exp_dout_ch); + if(!test_res) pass = 0; + + // Define check 2 + btn_ch = BTN_6N; + lvl = BTN_PULL_HIGH; + exp_dout_lvl = BSP_DOUT_HIGH; + exp_dout_ch = BSP_DOUT5; + test_res = ut_btn_ch_set_pull(btn_ch, lvl, exp_dout_lvl, exp_dout_ch); + if(!test_res) pass = 0; + + // Define check 3 + btn_ch = BTN_6N; + lvl = BTN_PULL_NONE; + exp_dout_lvl = BSP_DOUT_HIZ; + exp_dout_ch = BSP_DOUT5; + test_res = ut_btn_ch_set_pull(btn_ch, lvl, exp_dout_lvl, exp_dout_ch); + if(!test_res) pass = 0; + + // Wrong channel + btn_ch = 0; + lvl = 0; + exp_dout_lvl = NOT_ACCESED_DOUT_LVL; + exp_dout_ch = NOT_ACCESED_DOUT_CH; + test_res = ut_btn_ch_set_pull(btn_ch, lvl, exp_dout_lvl, exp_dout_ch); + if(!test_res) pass = 0; + + return pass; +} diff --git a/firmware/tests/ut_hw/ut_buttons.h b/firmware/tests/ut_hw/ut_buttons.h new file mode 100644 index 0000000..dfc509d --- /dev/null +++ b/firmware/tests/ut_hw/ut_buttons.h @@ -0,0 +1,12 @@ +#ifndef UT_HW_BUTTONS_H_ +#define UT_HW_BUTTONS_H_ + +#include +#include + +int ut_btn_reset_test(void); +int ut_btn_process_test(void); +int ut_btn_ch_process_test(void); +int ut_btn_ch_set_pull_test(void); + +#endif /* UT_HW_BUTTONS_H_ */ diff --git a/firmware/tests/ut_hw/ut_hb_control.c b/firmware/tests/ut_hw/ut_hb_control.c new file mode 100644 index 0000000..8092595 --- /dev/null +++ b/firmware/tests/ut_hw/ut_hb_control.c @@ -0,0 +1,2638 @@ +#include "ut_hb_control.h" + +#include "..\mock_board\mock_board_halfbridge.h" + +#include "..\..\src\hw\hb_control.h" + +static void print_fb_struct(hb_feedback_t* f1) +{ + printf("Sup-U:%d Sup-I:%d Sup-P:%d \n", f1->analog.sup_voltage, f1->analog.sup_current, f1->analog.sup_power); + printf("Out-U:%d Out-I:%d Out-P:%d Out-Z:%d \n", f1->analog.out_voltage, f1->analog.out_current, f1->analog.out_power, f1->analog.out_impedance); + printf("Low:%d PWM:%d \n", f1->analog.low_side_ctrl, f1->analog.pwm); + printf("Enabled:%d Warnin:%d Fault:%d Fused:%d \n", f1->enabled, f1->warning_act, f1->fault_act, f1->fused); + printf("Sup-UVP:%d Sup-OVP:%d Sup-OCP:%d Sup-OPP:%d \n", f1->warnings.sup_uvp, f1->warnings.sup_ovp, f1->warnings.sup_ocp, f1->warnings.sup_opp); + printf("Out-OVP:%d Out-OCP:%d Out-OPP:%d Out-Short:%d Out-Open:%d \n", f1->warnings.out_ovp, f1->warnings.out_ocp, f1->warnings.out_opp, f1->warnings.out_short, f1->warnings.out_open); + printf("Sup-UVP:%d Sup-OVP:%d Sup-OCP:%d Sup-OPP:%d \n", f1->faults.sup_uvp, f1->faults.sup_ovp, f1->faults.sup_ocp, f1->faults.sup_opp); + printf("Out-OVP:%d Out-OCP:%d Out-OPP:%d Out-Short:%d Out-Open:%d \n", f1->faults.out_ovp, f1->faults.out_ocp, f1->faults.out_opp, f1->faults.out_short, f1->faults.out_open); +} + +static void print_ctrl_struct(hb_control_t* c1) +{ + printf("Enabled:%d \n", c1->enabled); + printf("Sup UVP: Sev:%d W-time:%d F-time:%d \n", c1->out_faults.sup_uvp.severity, c1->out_faults.sup_uvp.w_time, c1->out_faults.sup_uvp.f_time); + printf("Sup OVP: Sev:%d W-time:%d F-time:%d \n", c1->out_faults.sup_ovp.severity, c1->out_faults.sup_ovp.w_time, c1->out_faults.sup_ovp.f_time); + printf("Sup OCP: Sev:%d W-time:%d F-time:%d \n", c1->out_faults.sup_ocp.severity, c1->out_faults.sup_ocp.w_time, c1->out_faults.sup_ocp.f_time); + printf("Sup OPP: Sev:%d W-time:%d F-time:%d \n", c1->out_faults.sup_opp.severity, c1->out_faults.sup_opp.w_time, c1->out_faults.sup_opp.f_time); + printf("Out OVP: Sev:%d W-time:%d F-time:%d \n", c1->out_faults.out_ovp.severity, c1->out_faults.out_ovp.w_time, c1->out_faults.out_ovp.f_time); + printf("Out OCP: Sev:%d W-time:%d F-time:%d \n", c1->out_faults.out_ocp.severity, c1->out_faults.out_ocp.w_time, c1->out_faults.out_ocp.f_time); + printf("Out OPP: Sev:%d W-time:%d F-time:%d \n", c1->out_faults.out_opp.severity, c1->out_faults.out_opp.w_time, c1->out_faults.out_opp.f_time); + printf("Out Short: Sev:%d W-time:%d F-time:%d \n", c1->out_faults.out_short.severity, c1->out_faults.out_short.w_time, c1->out_faults.out_short.f_time); + printf("Out Open: Sev:%d W-time:%d F-time:%d \n", c1->out_faults.out_open.severity, c1->out_faults.out_open.w_time, c1->out_faults.out_open.f_time); + printf("EN-Sup-uvp:%d EN-Sup-ovp:%d EN-Sup-ocp:%d EN-Sup-opp:%d \n", c1->out_faults_en.sup_uvp, c1->out_faults_en.sup_ovp, c1->out_faults_en.sup_ocp, c1->out_faults_en.sup_opp); + printf("EN-Out-ovp:%d EN-Out-ocp:%d EN-Out-opp:%d EN-Out-open:%d EN-Out-short:%d \n", c1->out_faults_en.out_ovp, c1->out_faults_en.out_ocp, c1->out_faults_en.out_opp, c1->out_faults_en.out_open, c1->out_faults_en.out_short); + printf("Fuse: state:%d count:%d timer:%d \n", c1->out_fuse.state, c1->out_fuse.count, c1->out_fuse.timer); + printf("Fuse-Cfg: cooldown:%d Retry-time:%d \n", c1->out_fuse_cfg.cooldown_time, c1->out_fuse_cfg.retry_time); +} + +static int ut_hb_is_equal_fb_struct(hb_feedback_t* f1, hb_feedback_t* f2, uint8_t exp_out, hb_feedback_t* exp_f1, hb_feedback_t* exp_f2) +{ + uint8_t out = hb_is_equal_fb_struct(f1, f2); + + int f1_equal = 1; + if(f1->analog.out_voltage != exp_f1->analog.out_voltage ) f1_equal=0; + if(f1->analog.out_current != exp_f1->analog.out_current ) f1_equal= 0; + if(f1->analog.sup_voltage != exp_f1->analog.sup_voltage ) f1_equal= 0; + if(f1->analog.sup_current != exp_f1->analog.sup_current ) f1_equal= 0; + if(f1->analog.out_power != exp_f1->analog.out_power ) f1_equal= 0; + if(f1->analog.sup_power != exp_f1->analog.sup_power ) f1_equal= 0; + if(f1->analog.out_impedance != exp_f1->analog.out_impedance ) f1_equal= 0; + if(f1->analog.low_side_ctrl != exp_f1->analog.low_side_ctrl ) f1_equal= 0; + if(f1->analog.pwm != exp_f1->analog.pwm ) f1_equal= 0; + if(f1->enabled != exp_f1->enabled ) f1_equal= 0; + if(f1->warning_act != exp_f1->warning_act ) f1_equal= 0; + if(f1->fault_act != exp_f1->fault_act ) f1_equal= 0; + if(f1->fused != exp_f1->fused ) f1_equal= 0; + if(f1->warnings.sup_uvp != exp_f1->warnings.sup_uvp ) f1_equal= 0; + if(f1->warnings.sup_ovp != exp_f1->warnings.sup_ovp ) f1_equal= 0; + if(f1->warnings.sup_ocp != exp_f1->warnings.sup_ocp ) f1_equal= 0; + if(f1->warnings.sup_opp != exp_f1->warnings.sup_opp ) f1_equal= 0; + if(f1->warnings.out_ovp != exp_f1->warnings.out_ovp ) f1_equal= 0; + if(f1->warnings.out_ocp != exp_f1->warnings.out_ocp ) f1_equal= 0; + if(f1->warnings.out_opp != exp_f1->warnings.out_opp ) f1_equal= 0; + if(f1->warnings.out_short != exp_f1->warnings.out_short ) f1_equal= 0; + if(f1->warnings.out_open != exp_f1->warnings.out_open ) f1_equal= 0; + if(f1->faults.sup_uvp != exp_f1->faults.sup_uvp ) f1_equal= 0; + if(f1->faults.sup_ovp != exp_f1->faults.sup_ovp ) f1_equal= 0; + if(f1->faults.sup_ocp != exp_f1->faults.sup_ocp ) f1_equal= 0; + if(f1->faults.sup_opp != exp_f1->faults.sup_opp ) f1_equal= 0; + if(f1->faults.out_ovp != exp_f1->faults.out_ovp ) f1_equal= 0; + if(f1->faults.out_ocp != exp_f1->faults.out_ocp ) f1_equal= 0; + if(f1->faults.out_opp != exp_f1->faults.out_opp ) f1_equal= 0; + if(f1->faults.out_short != exp_f1->faults.out_short ) f1_equal= 0; + if(f1->faults.out_open != exp_f1->faults.out_open ) f1_equal= 0; + + int f2_equal = 1; + if(f2->analog.out_voltage != exp_f2->analog.out_voltage ) f2_equal=0; + if(f2->analog.out_current != exp_f2->analog.out_current ) f2_equal= 0; + if(f2->analog.sup_voltage != exp_f2->analog.sup_voltage ) f2_equal= 0; + if(f2->analog.sup_current != exp_f2->analog.sup_current ) f2_equal= 0; + if(f2->analog.out_power != exp_f2->analog.out_power ) f2_equal= 0; + if(f2->analog.sup_power != exp_f2->analog.sup_power ) f2_equal= 0; + if(f2->analog.out_impedance != exp_f2->analog.out_impedance ) f2_equal= 0; + if(f2->analog.low_side_ctrl != exp_f2->analog.low_side_ctrl ) f2_equal= 0; + if(f2->analog.pwm != exp_f2->analog.pwm ) f2_equal= 0; + if(f2->enabled != exp_f2->enabled ) f2_equal= 0; + if(f2->warning_act != exp_f2->warning_act ) f2_equal= 0; + if(f2->fault_act != exp_f2->fault_act ) f2_equal= 0; + if(f2->fused != exp_f2->fused ) f2_equal= 0; + if(f2->warnings.sup_uvp != exp_f2->warnings.sup_uvp ) f2_equal= 0; + if(f2->warnings.sup_ovp != exp_f2->warnings.sup_ovp ) f2_equal= 0; + if(f2->warnings.sup_ocp != exp_f2->warnings.sup_ocp ) f2_equal= 0; + if(f2->warnings.sup_opp != exp_f2->warnings.sup_opp ) f2_equal= 0; + if(f2->warnings.out_ovp != exp_f2->warnings.out_ovp ) f2_equal= 0; + if(f2->warnings.out_ocp != exp_f2->warnings.out_ocp ) f2_equal= 0; + if(f2->warnings.out_opp != exp_f2->warnings.out_opp ) f2_equal= 0; + if(f2->warnings.out_short != exp_f2->warnings.out_short ) f2_equal= 0; + if(f2->warnings.out_open != exp_f2->warnings.out_open ) f2_equal= 0; + if(f2->faults.sup_uvp != exp_f2->faults.sup_uvp ) f2_equal= 0; + if(f2->faults.sup_ovp != exp_f2->faults.sup_ovp ) f2_equal= 0; + if(f2->faults.sup_ocp != exp_f2->faults.sup_ocp ) f2_equal= 0; + if(f2->faults.sup_opp != exp_f2->faults.sup_opp ) f2_equal= 0; + if(f2->faults.out_ovp != exp_f2->faults.out_ovp ) f2_equal= 0; + if(f2->faults.out_ocp != exp_f2->faults.out_ocp ) f2_equal= 0; + if(f2->faults.out_opp != exp_f2->faults.out_opp ) f2_equal= 0; + if(f2->faults.out_short != exp_f2->faults.out_short ) f2_equal= 0; + if(f2->faults.out_open != exp_f2->faults.out_open ) f2_equal= 0; + + printf("f1-unchanged:%d f2-unchanged:%d \n", f1_equal, f2_equal); + printf(" Output: %d \n", out); + printf("Expected: %d \n", exp_out); + + if((out==exp_out)&&(f1_equal)&&(f2_equal)) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_hb_is_equal_fb_struct_test(void) +{ + printf("******************************************************\n"); + printf("uint8_t hb_is_equal_fb_struct(hb_feedback_t* f1, hb_feedback_t* f2) \n"); + + int test_res; + int pass = 1; + + hb_feedback_t f1; + hb_feedback_t f2; + + uint8_t exp_out; + hb_feedback_t exp_f1; + hb_feedback_t exp_f2; + + // EQUAL + f1.analog.out_voltage = 0xAAAA; + f1.analog.out_current = 0xAAAA; + f1.analog.sup_voltage = 0xAAAA; + f1.analog.sup_current = 0xAAAA; + f1.analog.out_power = 0xAAAA; + f1.analog.sup_power = 0xAAAA; + f1.analog.out_impedance = 0xAAAA; + f1.analog.low_side_ctrl = 0xAA; + f1.analog.pwm = 0xAAAA; + f1.enabled = 0xAA; + f1.warning_act = 0xAA; + f1.fault_act = 0xAA; + f1.fused = 0xAA; + f1.warnings.sup_uvp = 0xAA; + f1.warnings.sup_ovp = 0xAA; + f1.warnings.sup_ocp = 0xAA; + f1.warnings.sup_opp = 0xAA; + f1.warnings.out_ovp = 0xAA; + f1.warnings.out_ocp = 0xAA; + f1.warnings.out_opp = 0xAA; + f1.warnings.out_short = 0xAA; + f1.warnings.out_open = 0xAA; + f1.faults.sup_uvp = 0xAA; + f1.faults.sup_ovp = 0xAA; + f1.faults.sup_ocp = 0xAA; + f1.faults.sup_opp = 0xAA; + f1.faults.out_ovp = 0xAA; + f1.faults.out_ocp = 0xAA; + f1.faults.out_opp = 0xAA; + f1.faults.out_short = 0xAA; + f1.faults.out_open = 0xAA; + + f2.analog.out_voltage = 0xAAAA; + f2.analog.out_current = 0xAAAA; + f2.analog.sup_voltage = 0xAAAA; + f2.analog.sup_current = 0xAAAA; + f2.analog.out_power = 0xAAAA; + f2.analog.sup_power = 0xAAAA; + f2.analog.out_impedance = 0xAAAA; + f2.analog.low_side_ctrl = 0xAA; + f2.analog.pwm = 0xAAAA; + f2.enabled = 0xAA; + f2.warning_act = 0xAA; + f2.fault_act = 0xAA; + f2.fused = 0xAA; + f2.warnings.sup_uvp = 0xAA; + f2.warnings.sup_ovp = 0xAA; + f2.warnings.sup_ocp = 0xAA; + f2.warnings.sup_opp = 0xAA; + f2.warnings.out_ovp = 0xAA; + f2.warnings.out_ocp = 0xAA; + f2.warnings.out_opp = 0xAA; + f2.warnings.out_short = 0xAA; + f2.warnings.out_open = 0xAA; + f2.faults.sup_uvp = 0xAA; + f2.faults.sup_ovp = 0xAA; + f2.faults.sup_ocp = 0xAA; + f2.faults.sup_opp = 0xAA; + f2.faults.out_ovp = 0xAA; + f2.faults.out_ocp = 0xAA; + f2.faults.out_opp = 0xAA; + f2.faults.out_short = 0xAA; + f2.faults.out_open = 0xAA; + + exp_out = 1; + + exp_f1.analog.out_voltage = f1.analog.out_voltage; + exp_f1.analog.out_current = f1.analog.out_current; + exp_f1.analog.sup_voltage = f1.analog.sup_voltage; + exp_f1.analog.sup_current = f1.analog.sup_current; + exp_f1.analog.out_power = f1.analog.out_power; + exp_f1.analog.sup_power = f1.analog.sup_power; + exp_f1.analog.out_impedance = f1.analog.out_impedance; + exp_f1.analog.low_side_ctrl = f1.analog.low_side_ctrl; + exp_f1.analog.pwm = f1.analog.pwm; + exp_f1.enabled = f1.enabled; + exp_f1.warning_act = f1.warning_act; + exp_f1.fault_act = f1.fault_act; + exp_f1.fused = f1.fused; + exp_f1.warnings.sup_uvp = f1.warnings.sup_uvp; + exp_f1.warnings.sup_ovp = f1.warnings.sup_ovp; + exp_f1.warnings.sup_ocp = f1.warnings.sup_ocp; + exp_f1.warnings.sup_opp = f1.warnings.sup_opp; + exp_f1.warnings.out_ovp = f1.warnings.out_ovp; + exp_f1.warnings.out_ocp = f1.warnings.out_ocp; + exp_f1.warnings.out_opp = f1.warnings.out_opp; + exp_f1.warnings.out_short = f1.warnings.out_short; + exp_f1.warnings.out_open = f1.warnings.out_open; + exp_f1.faults.sup_uvp = f1.faults.sup_uvp; + exp_f1.faults.sup_ovp = f1.faults.sup_ovp; + exp_f1.faults.sup_ocp = f1.faults.sup_ocp; + exp_f1.faults.sup_opp = f1.faults.sup_opp; + exp_f1.faults.out_ovp = f1.faults.out_ovp; + exp_f1.faults.out_ocp = f1.faults.out_ocp; + exp_f1.faults.out_opp = f1.faults.out_opp; + exp_f1.faults.out_short = f1.faults.out_short; + exp_f1.faults.out_open = f1.faults.out_open; + + exp_f2.analog.out_voltage = f2.analog.out_voltage; + exp_f2.analog.out_current = f2.analog.out_current; + exp_f2.analog.sup_voltage = f2.analog.sup_voltage; + exp_f2.analog.sup_current = f2.analog.sup_current; + exp_f2.analog.out_power = f2.analog.out_power; + exp_f2.analog.sup_power = f2.analog.sup_power; + exp_f2.analog.out_impedance = f2.analog.out_impedance; + exp_f2.analog.low_side_ctrl = f2.analog.low_side_ctrl; + exp_f2.analog.pwm = f2.analog.pwm; + exp_f2.enabled = f2.enabled; + exp_f2.warning_act = f2.warning_act; + exp_f2.fault_act = f2.fault_act; + exp_f2.fused = f2.fused; + exp_f2.warnings.sup_uvp = f2.warnings.sup_uvp; + exp_f2.warnings.sup_ovp = f2.warnings.sup_ovp; + exp_f2.warnings.sup_ocp = f2.warnings.sup_ocp; + exp_f2.warnings.sup_opp = f2.warnings.sup_opp; + exp_f2.warnings.out_ovp = f2.warnings.out_ovp; + exp_f2.warnings.out_ocp = f2.warnings.out_ocp; + exp_f2.warnings.out_opp = f2.warnings.out_opp; + exp_f2.warnings.out_short = f2.warnings.out_short; + exp_f2.warnings.out_open = f2.warnings.out_open; + exp_f2.faults.sup_uvp = f2.faults.sup_uvp; + exp_f2.faults.sup_ovp = f2.faults.sup_ovp; + exp_f2.faults.sup_ocp = f2.faults.sup_ocp; + exp_f2.faults.sup_opp = f2.faults.sup_opp; + exp_f2.faults.out_ovp = f2.faults.out_ovp; + exp_f2.faults.out_ocp = f2.faults.out_ocp; + exp_f2.faults.out_opp = f2.faults.out_opp; + exp_f2.faults.out_short = f2.faults.out_short; + exp_f2.faults.out_open = f2.faults.out_open; + + test_res = ut_hb_is_equal_fb_struct(&f1, &f2, exp_out, &exp_f1, &exp_f2); + if(!test_res) pass = 0; + + // NOT EQUAL + f1.analog.out_voltage = 0xAAAA; + f1.analog.out_current = 0xAAAA; + f1.analog.sup_voltage = 0xAAAA; + f1.analog.sup_current = 0xAAAA; + f1.analog.out_power = 0xAAAA; + f1.analog.sup_power = 0xAAAA; + f1.analog.out_impedance = 0xAAAA; + f1.analog.low_side_ctrl = 0xAA; + f1.analog.pwm = 0xAAAA; + f1.enabled = 0xAA; + f1.warning_act = 0xAA; + f1.fault_act = 0xAA; + f1.fused = 0xAA; + f1.warnings.sup_uvp = 0xAA; + f1.warnings.sup_ovp = 0xAA; + f1.warnings.sup_ocp = 0xAA; + f1.warnings.sup_opp = 0xAA; + f1.warnings.out_ovp = 0xAA; + f1.warnings.out_ocp = 0xAA; + f1.warnings.out_opp = 0xAA; + f1.warnings.out_short = 0xAA; + f1.warnings.out_open = 0xAA; + f1.faults.sup_uvp = 0xAA; + f1.faults.sup_ovp = 0xAA; + f1.faults.sup_ocp = 0xAA; + f1.faults.sup_opp = 0xAA; + f1.faults.out_ovp = 0xAA; + f1.faults.out_ocp = 0xAA; + f1.faults.out_opp = 0xAA; + f1.faults.out_short = 0xAA; + f1.faults.out_open = 0xAA; + + f2.analog.out_voltage = 0x5555; + f2.analog.out_current = 0x5555; + f2.analog.sup_voltage = 0x5555; + f2.analog.sup_current = 0x5555; + f2.analog.out_power = 0x5555; + f2.analog.sup_power = 0x5555; + f2.analog.out_impedance = 0x5555; + f2.analog.low_side_ctrl = 0x55; + f2.analog.pwm = 0x5555; + f2.enabled = 0x55; + f2.warning_act = 0x55; + f2.fault_act = 0x55; + f2.fused = 0x55; + f2.warnings.sup_uvp = 0x55; + f2.warnings.sup_ovp = 0x55; + f2.warnings.sup_ocp = 0x55; + f2.warnings.sup_opp = 0x55; + f2.warnings.out_ovp = 0x55; + f2.warnings.out_ocp = 0x55; + f2.warnings.out_opp = 0x55; + f2.warnings.out_short = 0x55; + f2.warnings.out_open = 0x55; + f2.faults.sup_uvp = 0x55; + f2.faults.sup_ovp = 0x55; + f2.faults.sup_ocp = 0x55; + f2.faults.sup_opp = 0x55; + f2.faults.out_ovp = 0x55; + f2.faults.out_ocp = 0x55; + f2.faults.out_opp = 0x55; + f2.faults.out_short = 0x55; + f2.faults.out_open = 0x55; + + exp_out = 0; + + exp_f1.analog.out_voltage = f1.analog.out_voltage; + exp_f1.analog.out_current = f1.analog.out_current; + exp_f1.analog.sup_voltage = f1.analog.sup_voltage; + exp_f1.analog.sup_current = f1.analog.sup_current; + exp_f1.analog.out_power = f1.analog.out_power; + exp_f1.analog.sup_power = f1.analog.sup_power; + exp_f1.analog.out_impedance = f1.analog.out_impedance; + exp_f1.analog.low_side_ctrl = f1.analog.low_side_ctrl; + exp_f1.analog.pwm = f1.analog.pwm; + exp_f1.enabled = f1.enabled; + exp_f1.warning_act = f1.warning_act; + exp_f1.fault_act = f1.fault_act; + exp_f1.fused = f1.fused; + exp_f1.warnings.sup_uvp = f1.warnings.sup_uvp; + exp_f1.warnings.sup_ovp = f1.warnings.sup_ovp; + exp_f1.warnings.sup_ocp = f1.warnings.sup_ocp; + exp_f1.warnings.sup_opp = f1.warnings.sup_opp; + exp_f1.warnings.out_ovp = f1.warnings.out_ovp; + exp_f1.warnings.out_ocp = f1.warnings.out_ocp; + exp_f1.warnings.out_opp = f1.warnings.out_opp; + exp_f1.warnings.out_short = f1.warnings.out_short; + exp_f1.warnings.out_open = f1.warnings.out_open; + exp_f1.faults.sup_uvp = f1.faults.sup_uvp; + exp_f1.faults.sup_ovp = f1.faults.sup_ovp; + exp_f1.faults.sup_ocp = f1.faults.sup_ocp; + exp_f1.faults.sup_opp = f1.faults.sup_opp; + exp_f1.faults.out_ovp = f1.faults.out_ovp; + exp_f1.faults.out_ocp = f1.faults.out_ocp; + exp_f1.faults.out_opp = f1.faults.out_opp; + exp_f1.faults.out_short = f1.faults.out_short; + exp_f1.faults.out_open = f1.faults.out_open; + + exp_f2.analog.out_voltage = f2.analog.out_voltage; + exp_f2.analog.out_current = f2.analog.out_current; + exp_f2.analog.sup_voltage = f2.analog.sup_voltage; + exp_f2.analog.sup_current = f2.analog.sup_current; + exp_f2.analog.out_power = f2.analog.out_power; + exp_f2.analog.sup_power = f2.analog.sup_power; + exp_f2.analog.out_impedance = f2.analog.out_impedance; + exp_f2.analog.low_side_ctrl = f2.analog.low_side_ctrl; + exp_f2.analog.pwm = f2.analog.pwm; + exp_f2.enabled = f2.enabled; + exp_f2.warning_act = f2.warning_act; + exp_f2.fault_act = f2.fault_act; + exp_f2.fused = f2.fused; + exp_f2.warnings.sup_uvp = f2.warnings.sup_uvp; + exp_f2.warnings.sup_ovp = f2.warnings.sup_ovp; + exp_f2.warnings.sup_ocp = f2.warnings.sup_ocp; + exp_f2.warnings.sup_opp = f2.warnings.sup_opp; + exp_f2.warnings.out_ovp = f2.warnings.out_ovp; + exp_f2.warnings.out_ocp = f2.warnings.out_ocp; + exp_f2.warnings.out_opp = f2.warnings.out_opp; + exp_f2.warnings.out_short = f2.warnings.out_short; + exp_f2.warnings.out_open = f2.warnings.out_open; + exp_f2.faults.sup_uvp = f2.faults.sup_uvp; + exp_f2.faults.sup_ovp = f2.faults.sup_ovp; + exp_f2.faults.sup_ocp = f2.faults.sup_ocp; + exp_f2.faults.sup_opp = f2.faults.sup_opp; + exp_f2.faults.out_ovp = f2.faults.out_ovp; + exp_f2.faults.out_ocp = f2.faults.out_ocp; + exp_f2.faults.out_opp = f2.faults.out_opp; + exp_f2.faults.out_short = f2.faults.out_short; + exp_f2.faults.out_open = f2.faults.out_open; + + test_res = ut_hb_is_equal_fb_struct(&f1, &f2, exp_out, &exp_f1, &exp_f2); + if(!test_res) pass = 0; + + return pass; +} + +static int ut_hb_is_equal_ctrl_struct(hb_control_t* c1, hb_control_t* c2, uint8_t exp_out, hb_control_t* exp_c1, hb_control_t* exp_c2) +{ + uint8_t out = hb_is_equal_ctrl_struct(c1, c2); + + int c1_equal = 1; + if(c1->enabled != exp_c1->enabled ) c1_equal = 0; + if(c1->out_faults.sup_uvp.severity != exp_c1->out_faults.sup_uvp.severity ) c1_equal = 0; + if(c1->out_faults.sup_uvp.w_time != exp_c1->out_faults.sup_uvp.w_time ) c1_equal = 0; + if(c1->out_faults.sup_uvp.f_time != exp_c1->out_faults.sup_uvp.f_time ) c1_equal = 0; + if(c1->out_faults.sup_ovp.severity != exp_c1->out_faults.sup_ovp.severity ) c1_equal = 0; + if(c1->out_faults.sup_ovp.w_time != exp_c1->out_faults.sup_ovp.w_time ) c1_equal = 0; + if(c1->out_faults.sup_ovp.f_time != exp_c1->out_faults.sup_ovp.f_time ) c1_equal = 0; + if(c1->out_faults.sup_ocp.severity != exp_c1->out_faults.sup_ocp.severity ) c1_equal = 0; + if(c1->out_faults.sup_ocp.w_time != exp_c1->out_faults.sup_ocp.w_time ) c1_equal = 0; + if(c1->out_faults.sup_ocp.f_time != exp_c1->out_faults.sup_ocp.f_time ) c1_equal = 0; + if(c1->out_faults.sup_opp.severity != exp_c1->out_faults.sup_opp.severity ) c1_equal = 0; + if(c1->out_faults.sup_opp.w_time != exp_c1->out_faults.sup_opp.w_time ) c1_equal = 0; + if(c1->out_faults.sup_opp.f_time != exp_c1->out_faults.sup_opp.f_time ) c1_equal = 0; + if(c1->out_faults.out_ovp.severity != exp_c1->out_faults.out_ovp.severity ) c1_equal = 0; + if(c1->out_faults.out_ovp.w_time != exp_c1->out_faults.out_ovp.w_time ) c1_equal = 0; + if(c1->out_faults.out_ovp.f_time != exp_c1->out_faults.out_ovp.f_time ) c1_equal = 0; + if(c1->out_faults.out_ocp.severity != exp_c1->out_faults.out_ocp.severity ) c1_equal = 0; + if(c1->out_faults.out_ocp.w_time != exp_c1->out_faults.out_ocp.w_time ) c1_equal = 0; + if(c1->out_faults.out_ocp.f_time != exp_c1->out_faults.out_ocp.f_time ) c1_equal = 0; + if(c1->out_faults.out_opp.severity != exp_c1->out_faults.out_opp.severity ) c1_equal = 0; + if(c1->out_faults.out_opp.w_time != exp_c1->out_faults.out_opp.w_time ) c1_equal = 0; + if(c1->out_faults.out_opp.f_time != exp_c1->out_faults.out_opp.f_time ) c1_equal = 0; + if(c1->out_faults.out_short.severity != exp_c1->out_faults.out_short.severity ) c1_equal = 0; + if(c1->out_faults.out_short.w_time != exp_c1->out_faults.out_short.w_time ) c1_equal = 0; + if(c1->out_faults.out_short.f_time != exp_c1->out_faults.out_short.f_time ) c1_equal = 0; + if(c1->out_faults.out_open.severity != exp_c1->out_faults.out_open.severity ) c1_equal = 0; + if(c1->out_faults.out_open.w_time != exp_c1->out_faults.out_open.w_time ) c1_equal = 0; + if(c1->out_faults.out_open.f_time != exp_c1->out_faults.out_open.f_time ) c1_equal = 0; + if(c1->out_faults_en.sup_uvp != exp_c1->out_faults_en.sup_uvp ) c1_equal = 0; + if(c1->out_faults_en.sup_ovp != exp_c1->out_faults_en.sup_ovp ) c1_equal = 0; + if(c1->out_faults_en.sup_ocp != exp_c1->out_faults_en.sup_ocp ) c1_equal = 0; + if(c1->out_faults_en.sup_opp != exp_c1->out_faults_en.sup_opp ) c1_equal = 0; + if(c1->out_faults_en.out_ovp != exp_c1->out_faults_en.out_ovp ) c1_equal = 0; + if(c1->out_faults_en.out_ocp != exp_c1->out_faults_en.out_ocp ) c1_equal = 0; + if(c1->out_faults_en.out_opp != exp_c1->out_faults_en.out_opp ) c1_equal = 0; + if(c1->out_faults_en.out_short != exp_c1->out_faults_en.out_short ) c1_equal = 0; + if(c1->out_faults_en.out_open != exp_c1->out_faults_en.out_open ) c1_equal = 0; + if(c1->out_fuse.state != exp_c1->out_fuse.state ) c1_equal = 0; + if(c1->out_fuse.count != exp_c1->out_fuse.count ) c1_equal = 0; + if(c1->out_fuse.timer != exp_c1->out_fuse.timer ) c1_equal = 0; + if(c1->out_fuse_cfg.cooldown_time != exp_c1->out_fuse_cfg.cooldown_time ) c1_equal = 0; + if(c1->out_fuse_cfg.retry_time != exp_c1->out_fuse_cfg.retry_time ) c1_equal = 0; + + int c2_equal = 1; + if(c2->enabled != exp_c2->enabled ) c2_equal = 0; + if(c2->out_faults.sup_uvp.severity != exp_c2->out_faults.sup_uvp.severity ) c2_equal = 0; + if(c2->out_faults.sup_uvp.w_time != exp_c2->out_faults.sup_uvp.w_time ) c2_equal = 0; + if(c2->out_faults.sup_uvp.f_time != exp_c2->out_faults.sup_uvp.f_time ) c2_equal = 0; + if(c2->out_faults.sup_ovp.severity != exp_c2->out_faults.sup_ovp.severity ) c2_equal = 0; + if(c2->out_faults.sup_ovp.w_time != exp_c2->out_faults.sup_ovp.w_time ) c2_equal = 0; + if(c2->out_faults.sup_ovp.f_time != exp_c2->out_faults.sup_ovp.f_time ) c2_equal = 0; + if(c2->out_faults.sup_ocp.severity != exp_c2->out_faults.sup_ocp.severity ) c2_equal = 0; + if(c2->out_faults.sup_ocp.w_time != exp_c2->out_faults.sup_ocp.w_time ) c2_equal = 0; + if(c2->out_faults.sup_ocp.f_time != exp_c2->out_faults.sup_ocp.f_time ) c2_equal = 0; + if(c2->out_faults.sup_opp.severity != exp_c2->out_faults.sup_opp.severity ) c2_equal = 0; + if(c2->out_faults.sup_opp.w_time != exp_c2->out_faults.sup_opp.w_time ) c2_equal = 0; + if(c2->out_faults.sup_opp.f_time != exp_c2->out_faults.sup_opp.f_time ) c2_equal = 0; + if(c2->out_faults.out_ovp.severity != exp_c2->out_faults.out_ovp.severity ) c2_equal = 0; + if(c2->out_faults.out_ovp.w_time != exp_c2->out_faults.out_ovp.w_time ) c2_equal = 0; + if(c2->out_faults.out_ovp.f_time != exp_c2->out_faults.out_ovp.f_time ) c2_equal = 0; + if(c2->out_faults.out_ocp.severity != exp_c2->out_faults.out_ocp.severity ) c2_equal = 0; + if(c2->out_faults.out_ocp.w_time != exp_c2->out_faults.out_ocp.w_time ) c2_equal = 0; + if(c2->out_faults.out_ocp.f_time != exp_c2->out_faults.out_ocp.f_time ) c2_equal = 0; + if(c2->out_faults.out_opp.severity != exp_c2->out_faults.out_opp.severity ) c2_equal = 0; + if(c2->out_faults.out_opp.w_time != exp_c2->out_faults.out_opp.w_time ) c2_equal = 0; + if(c2->out_faults.out_opp.f_time != exp_c2->out_faults.out_opp.f_time ) c2_equal = 0; + if(c2->out_faults.out_short.severity != exp_c2->out_faults.out_short.severity ) c2_equal = 0; + if(c2->out_faults.out_short.w_time != exp_c2->out_faults.out_short.w_time ) c2_equal = 0; + if(c2->out_faults.out_short.f_time != exp_c2->out_faults.out_short.f_time ) c2_equal = 0; + if(c2->out_faults.out_open.severity != exp_c2->out_faults.out_open.severity ) c2_equal = 0; + if(c2->out_faults.out_open.w_time != exp_c2->out_faults.out_open.w_time ) c2_equal = 0; + if(c2->out_faults.out_open.f_time != exp_c2->out_faults.out_open.f_time ) c2_equal = 0; + if(c2->out_faults_en.sup_uvp != exp_c2->out_faults_en.sup_uvp ) c2_equal = 0; + if(c2->out_faults_en.sup_ovp != exp_c2->out_faults_en.sup_ovp ) c2_equal = 0; + if(c2->out_faults_en.sup_ocp != exp_c2->out_faults_en.sup_ocp ) c2_equal = 0; + if(c2->out_faults_en.sup_opp != exp_c2->out_faults_en.sup_opp ) c2_equal = 0; + if(c2->out_faults_en.out_ovp != exp_c2->out_faults_en.out_ovp ) c2_equal = 0; + if(c2->out_faults_en.out_ocp != exp_c2->out_faults_en.out_ocp ) c2_equal = 0; + if(c2->out_faults_en.out_opp != exp_c2->out_faults_en.out_opp ) c2_equal = 0; + if(c2->out_faults_en.out_short != exp_c2->out_faults_en.out_short ) c2_equal = 0; + if(c2->out_faults_en.out_open != exp_c2->out_faults_en.out_open ) c2_equal = 0; + if(c2->out_fuse.state != exp_c2->out_fuse.state ) c2_equal = 0; + if(c2->out_fuse.count != exp_c2->out_fuse.count ) c2_equal = 0; + if(c2->out_fuse.timer != exp_c2->out_fuse.timer ) c2_equal = 0; + if(c2->out_fuse_cfg.cooldown_time != exp_c2->out_fuse_cfg.cooldown_time ) c2_equal = 0; + if(c2->out_fuse_cfg.retry_time != exp_c2->out_fuse_cfg.retry_time ) c2_equal = 0; + + printf("c1-unchanged:%d c2-unchanged:%d \n", c1_equal, c2_equal); + printf(" Output: %d \n", out); + printf("Expected: %d \n", exp_out); + + if((out==exp_out)&&(c1_equal)&&(c2_equal)) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_hb_is_equal_ctrl_struct_test(void) +{ + printf("******************************************************\n"); + printf("uint8_t hb_is_equal_ctrl_struct(hb_control_t* c1, hb_control_t* c2) \n"); + + int test_res; + int pass = 1; + + hb_control_t c1; + hb_control_t c2; + + uint8_t exp_out; + hb_control_t exp_c1; + hb_control_t exp_c2; + + // EQUAL + c1.enabled = 0xAA; + c1.out_faults.sup_uvp.severity = FAULT_LVL_FAULT; + c1.out_faults.sup_uvp.w_time = 0xAAAA; + c1.out_faults.sup_uvp.f_time = 0xAAAA; + c1.out_faults.sup_ovp.severity = FAULT_LVL_FAULT; + c1.out_faults.sup_ovp.w_time = 0xAAAA; + c1.out_faults.sup_ovp.f_time = 0xAAAA; + c1.out_faults.sup_ocp.severity = FAULT_LVL_FAULT; + c1.out_faults.sup_ocp.w_time = 0xAAAA; + c1.out_faults.sup_ocp.f_time = 0xAAAA; + c1.out_faults.sup_opp.severity = FAULT_LVL_FAULT; + c1.out_faults.sup_opp.w_time = 0xAAAA; + c1.out_faults.sup_opp.f_time = 0xAAAA; + c1.out_faults.out_ovp.severity = FAULT_LVL_FAULT; + c1.out_faults.out_ovp.w_time = 0xAAAA; + c1.out_faults.out_ovp.f_time = 0xAAAA; + c1.out_faults.out_ocp.severity = FAULT_LVL_FAULT; + c1.out_faults.out_ocp.w_time = 0xAAAA; + c1.out_faults.out_ocp.f_time = 0xAAAA; + c1.out_faults.out_opp.severity = FAULT_LVL_FAULT; + c1.out_faults.out_opp.w_time = 0xAAAA; + c1.out_faults.out_opp.f_time = 0xAAAA; + c1.out_faults.out_short.severity = FAULT_LVL_FAULT; + c1.out_faults.out_short.w_time = 0xAAAA; + c1.out_faults.out_short.f_time = 0xAAAA; + c1.out_faults.out_open.severity = FAULT_LVL_FAULT; + c1.out_faults.out_open.w_time = 0xAAAA; + c1.out_faults.out_open.f_time = 0xAAAA; + c1.out_faults_en.sup_uvp = 0xAA; + c1.out_faults_en.sup_ovp = 0xAA; + c1.out_faults_en.sup_ocp = 0xAA; + c1.out_faults_en.sup_opp = 0xAA; + c1.out_faults_en.out_ovp = 0xAA; + c1.out_faults_en.out_ocp = 0xAA; + c1.out_faults_en.out_opp = 0xAA; + c1.out_faults_en.out_open = 0xAA; + c1.out_faults_en.out_short = 0xAA; + c1.out_fuse.state = FUSE_ACTIVE; + c1.out_fuse.count = 0xAA; + c1.out_fuse.timer = 0xAAAA; + c1.out_fuse_cfg.cooldown_time = 0xAAAA; + c1.out_fuse_cfg.retry_time = 0xAAAA; + + c2.enabled = 0xAA; + c2.out_faults.sup_uvp.severity = FAULT_LVL_FAULT; + c2.out_faults.sup_uvp.w_time = 0xAAAA; + c2.out_faults.sup_uvp.f_time = 0xAAAA; + c2.out_faults.sup_ovp.severity = FAULT_LVL_FAULT; + c2.out_faults.sup_ovp.w_time = 0xAAAA; + c2.out_faults.sup_ovp.f_time = 0xAAAA; + c2.out_faults.sup_ocp.severity = FAULT_LVL_FAULT; + c2.out_faults.sup_ocp.w_time = 0xAAAA; + c2.out_faults.sup_ocp.f_time = 0xAAAA; + c2.out_faults.sup_opp.severity = FAULT_LVL_FAULT; + c2.out_faults.sup_opp.w_time = 0xAAAA; + c2.out_faults.sup_opp.f_time = 0xAAAA; + c2.out_faults.out_ovp.severity = FAULT_LVL_FAULT; + c2.out_faults.out_ovp.w_time = 0xAAAA; + c2.out_faults.out_ovp.f_time = 0xAAAA; + c2.out_faults.out_ocp.severity = FAULT_LVL_FAULT; + c2.out_faults.out_ocp.w_time = 0xAAAA; + c2.out_faults.out_ocp.f_time = 0xAAAA; + c2.out_faults.out_opp.severity = FAULT_LVL_FAULT; + c2.out_faults.out_opp.w_time = 0xAAAA; + c2.out_faults.out_opp.f_time = 0xAAAA; + c2.out_faults.out_short.severity = FAULT_LVL_FAULT; + c2.out_faults.out_short.w_time = 0xAAAA; + c2.out_faults.out_short.f_time = 0xAAAA; + c2.out_faults.out_open.severity = FAULT_LVL_FAULT; + c2.out_faults.out_open.w_time = 0xAAAA; + c2.out_faults.out_open.f_time = 0xAAAA; + c2.out_faults_en.sup_uvp = 0xAA; + c2.out_faults_en.sup_ovp = 0xAA; + c2.out_faults_en.sup_ocp = 0xAA; + c2.out_faults_en.sup_opp = 0xAA; + c2.out_faults_en.out_ovp = 0xAA; + c2.out_faults_en.out_ocp = 0xAA; + c2.out_faults_en.out_opp = 0xAA; + c2.out_faults_en.out_open = 0xAA; + c2.out_faults_en.out_short = 0xAA; + c2.out_fuse.state = FUSE_ACTIVE; + c2.out_fuse.count = 0xAA; + c2.out_fuse.timer = 0xAAAA; + c2.out_fuse_cfg.cooldown_time = 0xAAAA; + c2.out_fuse_cfg.retry_time = 0xAAAA; + + exp_out = 1; + + exp_c1.enabled = c1.enabled; + exp_c1.out_faults.sup_uvp.severity = c1.out_faults.sup_uvp.severity; + exp_c1.out_faults.sup_uvp.w_time = c1.out_faults.sup_uvp.w_time; + exp_c1.out_faults.sup_uvp.f_time = c1.out_faults.sup_uvp.f_time; + exp_c1.out_faults.sup_ovp.severity = c1.out_faults.sup_ovp.severity; + exp_c1.out_faults.sup_ovp.w_time = c1.out_faults.sup_ovp.w_time; + exp_c1.out_faults.sup_ovp.f_time = c1.out_faults.sup_ovp.f_time; + exp_c1.out_faults.sup_ocp.severity = c1.out_faults.sup_ocp.severity; + exp_c1.out_faults.sup_ocp.w_time = c1.out_faults.sup_ocp.w_time; + exp_c1.out_faults.sup_ocp.f_time = c1.out_faults.sup_ocp.f_time; + exp_c1.out_faults.sup_opp.severity = c1.out_faults.sup_opp.severity; + exp_c1.out_faults.sup_opp.w_time = c1.out_faults.sup_opp.w_time; + exp_c1.out_faults.sup_opp.f_time = c1.out_faults.sup_opp.f_time; + exp_c1.out_faults.out_ovp.severity = c1.out_faults.out_ovp.severity; + exp_c1.out_faults.out_ovp.w_time = c1.out_faults.out_ovp.w_time; + exp_c1.out_faults.out_ovp.f_time = c1.out_faults.out_ovp.f_time; + exp_c1.out_faults.out_ocp.severity = c1.out_faults.out_ocp.severity; + exp_c1.out_faults.out_ocp.w_time = c1.out_faults.out_ocp.w_time; + exp_c1.out_faults.out_ocp.f_time = c1.out_faults.out_ocp.f_time; + exp_c1.out_faults.out_opp.severity = c1.out_faults.out_opp.severity; + exp_c1.out_faults.out_opp.w_time = c1.out_faults.out_opp.w_time; + exp_c1.out_faults.out_opp.f_time = c1.out_faults.out_opp.f_time; + exp_c1.out_faults.out_short.severity = c1.out_faults.out_short.severity; + exp_c1.out_faults.out_short.w_time = c1.out_faults.out_short.w_time; + exp_c1.out_faults.out_short.f_time = c1.out_faults.out_short.f_time; + exp_c1.out_faults.out_open.severity = c1.out_faults.out_open.severity; + exp_c1.out_faults.out_open.w_time = c1.out_faults.out_open.w_time; + exp_c1.out_faults.out_open.f_time = c1.out_faults.out_open.f_time; + exp_c1.out_faults_en.sup_uvp = c1.out_faults_en.sup_uvp; + exp_c1.out_faults_en.sup_ovp = c1.out_faults_en.sup_ovp; + exp_c1.out_faults_en.sup_ocp = c1.out_faults_en.sup_ocp; + exp_c1.out_faults_en.sup_opp = c1.out_faults_en.sup_opp; + exp_c1.out_faults_en.out_ovp = c1.out_faults_en.out_ovp; + exp_c1.out_faults_en.out_ocp = c1.out_faults_en.out_ocp; + exp_c1.out_faults_en.out_opp = c1.out_faults_en.out_opp; + exp_c1.out_faults_en.out_open = c1.out_faults_en.out_open; + exp_c1.out_faults_en.out_short = c1.out_faults_en.out_short; + exp_c1.out_fuse.state = c1.out_fuse.state; + exp_c1.out_fuse.count = c1.out_fuse.count; + exp_c1.out_fuse.timer = c1.out_fuse.timer; + exp_c1.out_fuse_cfg.cooldown_time = c1.out_fuse_cfg.cooldown_time; + exp_c1.out_fuse_cfg.retry_time = c1.out_fuse_cfg.retry_time; + + exp_c2.enabled = c2.enabled; + exp_c2.out_faults.sup_uvp.severity = c2.out_faults.sup_uvp.severity; + exp_c2.out_faults.sup_uvp.w_time = c2.out_faults.sup_uvp.w_time; + exp_c2.out_faults.sup_uvp.f_time = c2.out_faults.sup_uvp.f_time; + exp_c2.out_faults.sup_ovp.severity = c2.out_faults.sup_ovp.severity; + exp_c2.out_faults.sup_ovp.w_time = c2.out_faults.sup_ovp.w_time; + exp_c2.out_faults.sup_ovp.f_time = c2.out_faults.sup_ovp.f_time; + exp_c2.out_faults.sup_ocp.severity = c2.out_faults.sup_ocp.severity; + exp_c2.out_faults.sup_ocp.w_time = c2.out_faults.sup_ocp.w_time; + exp_c2.out_faults.sup_ocp.f_time = c2.out_faults.sup_ocp.f_time; + exp_c2.out_faults.sup_opp.severity = c2.out_faults.sup_opp.severity; + exp_c2.out_faults.sup_opp.w_time = c2.out_faults.sup_opp.w_time; + exp_c2.out_faults.sup_opp.f_time = c2.out_faults.sup_opp.f_time; + exp_c2.out_faults.out_ovp.severity = c2.out_faults.out_ovp.severity; + exp_c2.out_faults.out_ovp.w_time = c2.out_faults.out_ovp.w_time; + exp_c2.out_faults.out_ovp.f_time = c2.out_faults.out_ovp.f_time; + exp_c2.out_faults.out_ocp.severity = c2.out_faults.out_ocp.severity; + exp_c2.out_faults.out_ocp.w_time = c2.out_faults.out_ocp.w_time; + exp_c2.out_faults.out_ocp.f_time = c2.out_faults.out_ocp.f_time; + exp_c2.out_faults.out_opp.severity = c2.out_faults.out_opp.severity; + exp_c2.out_faults.out_opp.w_time = c2.out_faults.out_opp.w_time; + exp_c2.out_faults.out_opp.f_time = c2.out_faults.out_opp.f_time; + exp_c2.out_faults.out_short.severity = c2.out_faults.out_short.severity; + exp_c2.out_faults.out_short.w_time = c2.out_faults.out_short.w_time; + exp_c2.out_faults.out_short.f_time = c2.out_faults.out_short.f_time; + exp_c2.out_faults.out_open.severity = c2.out_faults.out_open.severity; + exp_c2.out_faults.out_open.w_time = c2.out_faults.out_open.w_time; + exp_c2.out_faults.out_open.f_time = c2.out_faults.out_open.f_time; + exp_c2.out_faults_en.sup_uvp = c2.out_faults_en.sup_uvp; + exp_c2.out_faults_en.sup_ovp = c2.out_faults_en.sup_ovp; + exp_c2.out_faults_en.sup_ocp = c2.out_faults_en.sup_ocp; + exp_c2.out_faults_en.sup_opp = c2.out_faults_en.sup_opp; + exp_c2.out_faults_en.out_ovp = c2.out_faults_en.out_ovp; + exp_c2.out_faults_en.out_ocp = c2.out_faults_en.out_ocp; + exp_c2.out_faults_en.out_opp = c2.out_faults_en.out_opp; + exp_c2.out_faults_en.out_open = c2.out_faults_en.out_open; + exp_c2.out_faults_en.out_short = c2.out_faults_en.out_short; + exp_c2.out_fuse.state = c2.out_fuse.state; + exp_c2.out_fuse.count = c2.out_fuse.count; + exp_c2.out_fuse.timer = c2.out_fuse.timer; + exp_c2.out_fuse_cfg.cooldown_time = c2.out_fuse_cfg.cooldown_time; + exp_c2.out_fuse_cfg.retry_time = c2.out_fuse_cfg.retry_time; + + test_res = ut_hb_is_equal_ctrl_struct(&c1, &c2, exp_out, &exp_c1, &exp_c2); + if(!test_res) pass = 0; + + // NOT EQUAL + c1.enabled = 0xAA; + c1.out_faults.sup_uvp.severity = FAULT_LVL_FAULT; + c1.out_faults.sup_uvp.w_time = 0xAAAA; + c1.out_faults.sup_uvp.f_time = 0xAAAA; + c1.out_faults.sup_ovp.severity = FAULT_LVL_FAULT; + c1.out_faults.sup_ovp.w_time = 0xAAAA; + c1.out_faults.sup_ovp.f_time = 0xAAAA; + c1.out_faults.sup_ocp.severity = FAULT_LVL_FAULT; + c1.out_faults.sup_ocp.w_time = 0xAAAA; + c1.out_faults.sup_ocp.f_time = 0xAAAA; + c1.out_faults.sup_opp.severity = FAULT_LVL_FAULT; + c1.out_faults.sup_opp.w_time = 0xAAAA; + c1.out_faults.sup_opp.f_time = 0xAAAA; + c1.out_faults.out_ovp.severity = FAULT_LVL_FAULT; + c1.out_faults.out_ovp.w_time = 0xAAAA; + c1.out_faults.out_ovp.f_time = 0xAAAA; + c1.out_faults.out_ocp.severity = FAULT_LVL_FAULT; + c1.out_faults.out_ocp.w_time = 0xAAAA; + c1.out_faults.out_ocp.f_time = 0xAAAA; + c1.out_faults.out_opp.severity = FAULT_LVL_FAULT; + c1.out_faults.out_opp.w_time = 0xAAAA; + c1.out_faults.out_opp.f_time = 0xAAAA; + c1.out_faults.out_short.severity = FAULT_LVL_FAULT; + c1.out_faults.out_short.w_time = 0xAAAA; + c1.out_faults.out_short.f_time = 0xAAAA; + c1.out_faults.out_open.severity = FAULT_LVL_FAULT; + c1.out_faults.out_open.w_time = 0xAAAA; + c1.out_faults.out_open.f_time = 0xAAAA; + c1.out_faults_en.sup_uvp = 0xAA; + c1.out_faults_en.sup_ovp = 0xAA; + c1.out_faults_en.sup_ocp = 0xAA; + c1.out_faults_en.sup_opp = 0xAA; + c1.out_faults_en.out_ovp = 0xAA; + c1.out_faults_en.out_ocp = 0xAA; + c1.out_faults_en.out_opp = 0xAA; + c1.out_faults_en.out_open = 0xAA; + c1.out_faults_en.out_short = 0xAA; + c1.out_fuse.state = FUSE_ACTIVE; + c1.out_fuse.count = 0xAA; + c1.out_fuse.timer = 0xAAAA; + c1.out_fuse_cfg.cooldown_time = 0xAAAA; + c1.out_fuse_cfg.retry_time = 0xAAAA; + + c2.enabled = 0x55; + c2.out_faults.sup_uvp.severity = FAULT_LVL_WARNING; + c2.out_faults.sup_uvp.w_time = 0x5555; + c2.out_faults.sup_uvp.f_time = 0x5555; + c2.out_faults.sup_ovp.severity = FAULT_LVL_WARNING; + c2.out_faults.sup_ovp.w_time = 0x5555; + c2.out_faults.sup_ovp.f_time = 0x5555; + c2.out_faults.sup_ocp.severity = FAULT_LVL_WARNING; + c2.out_faults.sup_ocp.w_time = 0x5555; + c2.out_faults.sup_ocp.f_time = 0x5555; + c2.out_faults.sup_opp.severity = FAULT_LVL_WARNING; + c2.out_faults.sup_opp.w_time = 0x5555; + c2.out_faults.sup_opp.f_time = 0x5555; + c2.out_faults.out_ovp.severity = FAULT_LVL_WARNING; + c2.out_faults.out_ovp.w_time = 0x5555; + c2.out_faults.out_ovp.f_time = 0x5555; + c2.out_faults.out_ocp.severity = FAULT_LVL_WARNING; + c2.out_faults.out_ocp.w_time = 0x5555; + c2.out_faults.out_ocp.f_time = 0x5555; + c2.out_faults.out_opp.severity = FAULT_LVL_WARNING; + c2.out_faults.out_opp.w_time = 0x5555; + c2.out_faults.out_opp.f_time = 0x5555; + c2.out_faults.out_short.severity = FAULT_LVL_WARNING; + c2.out_faults.out_short.w_time = 0x5555; + c2.out_faults.out_short.f_time = 0x5555; + c2.out_faults.out_open.severity = FAULT_LVL_WARNING; + c2.out_faults.out_open.w_time = 0x5555; + c2.out_faults.out_open.f_time = 0x5555; + c2.out_faults_en.sup_uvp = 0x55; + c2.out_faults_en.sup_ovp = 0x55; + c2.out_faults_en.sup_ocp = 0x55; + c2.out_faults_en.sup_opp = 0x55; + c2.out_faults_en.out_ovp = 0x55; + c2.out_faults_en.out_ocp = 0x55; + c2.out_faults_en.out_opp = 0x55; + c2.out_faults_en.out_open = 0x55; + c2.out_faults_en.out_short = 0x55; + c2.out_fuse.state = FUSE_COOLDOWN; + c2.out_fuse.count = 0x55; + c2.out_fuse.timer = 0x5555; + c2.out_fuse_cfg.cooldown_time = 0x5555; + c2.out_fuse_cfg.retry_time = 0x5555; + + exp_out = 0; + + exp_c1.enabled = c1.enabled; + exp_c1.out_faults.sup_uvp.severity = c1.out_faults.sup_uvp.severity; + exp_c1.out_faults.sup_uvp.w_time = c1.out_faults.sup_uvp.w_time; + exp_c1.out_faults.sup_uvp.f_time = c1.out_faults.sup_uvp.f_time; + exp_c1.out_faults.sup_ovp.severity = c1.out_faults.sup_ovp.severity; + exp_c1.out_faults.sup_ovp.w_time = c1.out_faults.sup_ovp.w_time; + exp_c1.out_faults.sup_ovp.f_time = c1.out_faults.sup_ovp.f_time; + exp_c1.out_faults.sup_ocp.severity = c1.out_faults.sup_ocp.severity; + exp_c1.out_faults.sup_ocp.w_time = c1.out_faults.sup_ocp.w_time; + exp_c1.out_faults.sup_ocp.f_time = c1.out_faults.sup_ocp.f_time; + exp_c1.out_faults.sup_opp.severity = c1.out_faults.sup_opp.severity; + exp_c1.out_faults.sup_opp.w_time = c1.out_faults.sup_opp.w_time; + exp_c1.out_faults.sup_opp.f_time = c1.out_faults.sup_opp.f_time; + exp_c1.out_faults.out_ovp.severity = c1.out_faults.out_ovp.severity; + exp_c1.out_faults.out_ovp.w_time = c1.out_faults.out_ovp.w_time; + exp_c1.out_faults.out_ovp.f_time = c1.out_faults.out_ovp.f_time; + exp_c1.out_faults.out_ocp.severity = c1.out_faults.out_ocp.severity; + exp_c1.out_faults.out_ocp.w_time = c1.out_faults.out_ocp.w_time; + exp_c1.out_faults.out_ocp.f_time = c1.out_faults.out_ocp.f_time; + exp_c1.out_faults.out_opp.severity = c1.out_faults.out_opp.severity; + exp_c1.out_faults.out_opp.w_time = c1.out_faults.out_opp.w_time; + exp_c1.out_faults.out_opp.f_time = c1.out_faults.out_opp.f_time; + exp_c1.out_faults.out_short.severity = c1.out_faults.out_short.severity; + exp_c1.out_faults.out_short.w_time = c1.out_faults.out_short.w_time; + exp_c1.out_faults.out_short.f_time = c1.out_faults.out_short.f_time; + exp_c1.out_faults.out_open.severity = c1.out_faults.out_open.severity; + exp_c1.out_faults.out_open.w_time = c1.out_faults.out_open.w_time; + exp_c1.out_faults.out_open.f_time = c1.out_faults.out_open.f_time; + exp_c1.out_faults_en.sup_uvp = c1.out_faults_en.sup_uvp; + exp_c1.out_faults_en.sup_ovp = c1.out_faults_en.sup_ovp; + exp_c1.out_faults_en.sup_ocp = c1.out_faults_en.sup_ocp; + exp_c1.out_faults_en.sup_opp = c1.out_faults_en.sup_opp; + exp_c1.out_faults_en.out_ovp = c1.out_faults_en.out_ovp; + exp_c1.out_faults_en.out_ocp = c1.out_faults_en.out_ocp; + exp_c1.out_faults_en.out_opp = c1.out_faults_en.out_opp; + exp_c1.out_faults_en.out_open = c1.out_faults_en.out_open; + exp_c1.out_faults_en.out_short = c1.out_faults_en.out_short; + exp_c1.out_fuse.state = c1.out_fuse.state; + exp_c1.out_fuse.count = c1.out_fuse.count; + exp_c1.out_fuse.timer = c1.out_fuse.timer; + exp_c1.out_fuse_cfg.cooldown_time = c1.out_fuse_cfg.cooldown_time; + exp_c1.out_fuse_cfg.retry_time = c1.out_fuse_cfg.retry_time; + + exp_c2.enabled = c2.enabled; + exp_c2.out_faults.sup_uvp.severity = c2.out_faults.sup_uvp.severity; + exp_c2.out_faults.sup_uvp.w_time = c2.out_faults.sup_uvp.w_time; + exp_c2.out_faults.sup_uvp.f_time = c2.out_faults.sup_uvp.f_time; + exp_c2.out_faults.sup_ovp.severity = c2.out_faults.sup_ovp.severity; + exp_c2.out_faults.sup_ovp.w_time = c2.out_faults.sup_ovp.w_time; + exp_c2.out_faults.sup_ovp.f_time = c2.out_faults.sup_ovp.f_time; + exp_c2.out_faults.sup_ocp.severity = c2.out_faults.sup_ocp.severity; + exp_c2.out_faults.sup_ocp.w_time = c2.out_faults.sup_ocp.w_time; + exp_c2.out_faults.sup_ocp.f_time = c2.out_faults.sup_ocp.f_time; + exp_c2.out_faults.sup_opp.severity = c2.out_faults.sup_opp.severity; + exp_c2.out_faults.sup_opp.w_time = c2.out_faults.sup_opp.w_time; + exp_c2.out_faults.sup_opp.f_time = c2.out_faults.sup_opp.f_time; + exp_c2.out_faults.out_ovp.severity = c2.out_faults.out_ovp.severity; + exp_c2.out_faults.out_ovp.w_time = c2.out_faults.out_ovp.w_time; + exp_c2.out_faults.out_ovp.f_time = c2.out_faults.out_ovp.f_time; + exp_c2.out_faults.out_ocp.severity = c2.out_faults.out_ocp.severity; + exp_c2.out_faults.out_ocp.w_time = c2.out_faults.out_ocp.w_time; + exp_c2.out_faults.out_ocp.f_time = c2.out_faults.out_ocp.f_time; + exp_c2.out_faults.out_opp.severity = c2.out_faults.out_opp.severity; + exp_c2.out_faults.out_opp.w_time = c2.out_faults.out_opp.w_time; + exp_c2.out_faults.out_opp.f_time = c2.out_faults.out_opp.f_time; + exp_c2.out_faults.out_short.severity = c2.out_faults.out_short.severity; + exp_c2.out_faults.out_short.w_time = c2.out_faults.out_short.w_time; + exp_c2.out_faults.out_short.f_time = c2.out_faults.out_short.f_time; + exp_c2.out_faults.out_open.severity = c2.out_faults.out_open.severity; + exp_c2.out_faults.out_open.w_time = c2.out_faults.out_open.w_time; + exp_c2.out_faults.out_open.f_time = c2.out_faults.out_open.f_time; + exp_c2.out_faults_en.sup_uvp = c2.out_faults_en.sup_uvp; + exp_c2.out_faults_en.sup_ovp = c2.out_faults_en.sup_ovp; + exp_c2.out_faults_en.sup_ocp = c2.out_faults_en.sup_ocp; + exp_c2.out_faults_en.sup_opp = c2.out_faults_en.sup_opp; + exp_c2.out_faults_en.out_ovp = c2.out_faults_en.out_ovp; + exp_c2.out_faults_en.out_ocp = c2.out_faults_en.out_ocp; + exp_c2.out_faults_en.out_opp = c2.out_faults_en.out_opp; + exp_c2.out_faults_en.out_open = c2.out_faults_en.out_open; + exp_c2.out_faults_en.out_short = c2.out_faults_en.out_short; + exp_c2.out_fuse.state = c2.out_fuse.state; + exp_c2.out_fuse.count = c2.out_fuse.count; + exp_c2.out_fuse.timer = c2.out_fuse.timer; + exp_c2.out_fuse_cfg.cooldown_time = c2.out_fuse_cfg.cooldown_time; + exp_c2.out_fuse_cfg.retry_time = c2.out_fuse_cfg.retry_time; + + test_res = ut_hb_is_equal_ctrl_struct(&c1, &c2, exp_out, &exp_c1, &exp_c2); + if(!test_res) pass = 0; + + return pass; +} + + +static const uint8_t NOT_ACCESD_LOW = 255; +static const uint16_t NOT_ACCESD_PWM = 0xFFFF; + +static int ut_hb_init(hb_feedback_t* hb_fb, hb_control_t* hb_ctrl, hb_meas_t* meas, uint8_t exp_low, uint16_t exp_pwm, hb_feedback_t* exp_hb_fb, hb_control_t* exp_hb_ctrl) +{ + printf("Input:\n"); + + mock_board_halfbridge_write_low(NOT_ACCESD_LOW); + mock_board_halfbridge_write_pwm(NOT_ACCESD_PWM); + mock_board_halfbridge_write_feedback(meas); + + hb_init(hb_fb, hb_ctrl); + + uint8_t out_low = mock_board_halfbridge_read_low(); + uint16_t out_pwm = mock_board_halfbridge_read_pwm(); + uint8_t fb_ok = hb_is_equal_fb_struct(hb_fb, exp_hb_fb); + uint8_t ctrl_ok = hb_is_equal_ctrl_struct(hb_ctrl, exp_hb_ctrl); + + printf(" Output: Low:%d PWM:%d FB:%d CTRL:%d \n", out_low, out_pwm, fb_ok, ctrl_ok); + printf("Expected: Low:%d PWM:%d \n", exp_low, exp_pwm); + + if((out_low==exp_low)&&(out_pwm==exp_pwm)&&(fb_ok)&&(ctrl_ok)) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_hb_init_test(void) +{ + printf("******************************************************\n"); + printf("void hb_init(hb_feedback_t* hb_fb, hb_control_t* hb_ctrl) \n"); + + int test_res; + int pass = 1; + + hb_feedback_t hb_fb; + hb_control_t hb_ctrl; + hb_meas_t meas; + uint8_t exp_low; + uint16_t exp_pwm; + hb_feedback_t exp_hb_fb; + hb_control_t exp_hb_ctrl; + + // Normal 1 + hb_fb.analog.out_voltage = 0xAAAA; + hb_fb.analog.out_current = 0xAAAA; + hb_fb.analog.sup_voltage = 0xAAAA; + hb_fb.analog.sup_current = 0xAAAA; + hb_fb.analog.out_power = 0xAAAA; + hb_fb.analog.sup_power = 0xAAAA; + hb_fb.analog.out_impedance = 0xAAAA; + hb_fb.analog.low_side_ctrl = 0xAA; + hb_fb.analog.pwm = 0xAAAA; + hb_fb.enabled = 0xAA; + hb_fb.warning_act = 0xAA; + hb_fb.fault_act = 0xAA; + hb_fb.fused = 0xAA; + hb_fb.warnings.sup_uvp = 0xAA; + hb_fb.warnings.sup_ovp = 0xAA; + hb_fb.warnings.sup_ocp = 0xAA; + hb_fb.warnings.sup_opp = 0xAA; + hb_fb.warnings.out_ovp = 0xAA; + hb_fb.warnings.out_ocp = 0xAA; + hb_fb.warnings.out_opp = 0xAA; + hb_fb.warnings.out_short = 0xAA; + hb_fb.warnings.out_open = 0xAA; + hb_fb.faults.sup_uvp = 0xAA; + hb_fb.faults.sup_ovp = 0xAA; + hb_fb.faults.sup_ocp = 0xAA; + hb_fb.faults.sup_opp = 0xAA; + hb_fb.faults.out_ovp = 0xAA; + hb_fb.faults.out_ocp = 0xAA; + hb_fb.faults.out_opp = 0xAA; + hb_fb.faults.out_short = 0xAA; + hb_fb.faults.out_open = 0xAA; + + hb_ctrl.enabled = 0xAA; + hb_ctrl.out_faults.sup_uvp.severity = FAULT_LVL_FAULT; + hb_ctrl.out_faults.sup_uvp.w_time = 0xAAAA; + hb_ctrl.out_faults.sup_uvp.f_time = 0xAAAA; + hb_ctrl.out_faults.sup_ovp.severity = FAULT_LVL_FAULT; + hb_ctrl.out_faults.sup_ovp.w_time = 0xAAAA; + hb_ctrl.out_faults.sup_ovp.f_time = 0xAAAA; + hb_ctrl.out_faults.sup_ocp.severity = FAULT_LVL_FAULT; + hb_ctrl.out_faults.sup_ocp.w_time = 0xAAAA; + hb_ctrl.out_faults.sup_ocp.f_time = 0xAAAA; + hb_ctrl.out_faults.sup_opp.severity = FAULT_LVL_FAULT; + hb_ctrl.out_faults.sup_opp.w_time = 0xAAAA; + hb_ctrl.out_faults.sup_opp.f_time = 0xAAAA; + hb_ctrl.out_faults.out_ovp.severity = FAULT_LVL_FAULT; + hb_ctrl.out_faults.out_ovp.w_time = 0xAAAA; + hb_ctrl.out_faults.out_ovp.f_time = 0xAAAA; + hb_ctrl.out_faults.out_ocp.severity = FAULT_LVL_FAULT; + hb_ctrl.out_faults.out_ocp.w_time = 0xAAAA; + hb_ctrl.out_faults.out_ocp.f_time = 0xAAAA; + hb_ctrl.out_faults.out_opp.severity = FAULT_LVL_FAULT; + hb_ctrl.out_faults.out_opp.w_time = 0xAAAA; + hb_ctrl.out_faults.out_opp.f_time = 0xAAAA; + hb_ctrl.out_faults.out_short.severity = FAULT_LVL_FAULT; + hb_ctrl.out_faults.out_short.w_time = 0xAAAA; + hb_ctrl.out_faults.out_short.f_time = 0xAAAA; + hb_ctrl.out_faults.out_open.severity = FAULT_LVL_FAULT; + hb_ctrl.out_faults.out_open.w_time = 0xAAAA; + hb_ctrl.out_faults.out_open.f_time = 0xAAAA; + hb_ctrl.out_faults_en.sup_uvp = 0xAA; + hb_ctrl.out_faults_en.sup_ovp = 0xAA; + hb_ctrl.out_faults_en.sup_ocp = 0xAA; + hb_ctrl.out_faults_en.sup_opp = 0xAA; + hb_ctrl.out_faults_en.out_ovp = 0xAA; + hb_ctrl.out_faults_en.out_ocp = 0xAA; + hb_ctrl.out_faults_en.out_opp = 0xAA; + hb_ctrl.out_faults_en.out_short = 0xAA; + hb_ctrl.out_faults_en.out_open = 0xAA; + hb_ctrl.out_fuse.state = FUSE_ACTIVE; + hb_ctrl.out_fuse.count = 0xAAAA; + hb_ctrl.out_fuse.timer = 0xAAAA; + hb_ctrl.out_fuse_cfg.cooldown_time = 0xAAAA; + hb_ctrl.out_fuse_cfg.retry_time = 0xAAAA; + + meas.out_voltage = 12000; + meas.out_current = 100; + meas.sup_voltage = 0; + meas.sup_current = 0; + meas.out_power = 0; + meas.sup_power = 1200; + meas.out_impedance = 0xFFFF; + meas.low_side_ctrl = 0; + meas.pwm = 0; + + exp_low = 0; + exp_pwm = 0; + + exp_hb_fb.analog.out_voltage = meas.out_voltage; + exp_hb_fb.analog.out_current = meas.out_current; + exp_hb_fb.analog.sup_voltage = meas.sup_voltage; + exp_hb_fb.analog.sup_current = meas.sup_current; + exp_hb_fb.analog.out_power = meas.out_power; + exp_hb_fb.analog.sup_power = meas.sup_power; + exp_hb_fb.analog.out_impedance = meas.out_impedance; + exp_hb_fb.analog.low_side_ctrl = meas.low_side_ctrl; + exp_hb_fb.analog.pwm = meas.pwm; + exp_hb_fb.enabled = 0; + exp_hb_fb.warning_act = 0; + exp_hb_fb.fault_act = 0; + exp_hb_fb.fused = 0; + exp_hb_fb.warnings.sup_uvp = 0; + exp_hb_fb.warnings.sup_ovp = 0; + exp_hb_fb.warnings.sup_ocp = 0; + exp_hb_fb.warnings.sup_opp = 0; + exp_hb_fb.warnings.out_ovp = 0; + exp_hb_fb.warnings.out_ocp = 0; + exp_hb_fb.warnings.out_opp = 0; + exp_hb_fb.warnings.out_short = 0; + exp_hb_fb.warnings.out_open = 0; + exp_hb_fb.faults.sup_uvp = 0; + exp_hb_fb.faults.sup_ovp = 0; + exp_hb_fb.faults.sup_ocp = 0; + exp_hb_fb.faults.sup_opp = 0; + exp_hb_fb.faults.out_ovp = 0; + exp_hb_fb.faults.out_ocp = 0; + exp_hb_fb.faults.out_opp = 0; + exp_hb_fb.faults.out_short = 0; + exp_hb_fb.faults.out_open = 0; + + exp_hb_ctrl.enabled = 0; + exp_hb_ctrl.out_faults.sup_uvp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.sup_uvp.w_time = 0; + exp_hb_ctrl.out_faults.sup_uvp.f_time = 0; + exp_hb_ctrl.out_faults.sup_ovp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.sup_ovp.w_time = 0; + exp_hb_ctrl.out_faults.sup_ovp.f_time = 0; + exp_hb_ctrl.out_faults.sup_ocp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.sup_ocp.w_time = 0; + exp_hb_ctrl.out_faults.sup_ocp.f_time = 0; + exp_hb_ctrl.out_faults.sup_opp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.sup_opp.w_time = 0; + exp_hb_ctrl.out_faults.sup_opp.f_time = 0; + exp_hb_ctrl.out_faults.out_ovp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.out_ovp.w_time = 0; + exp_hb_ctrl.out_faults.out_ovp.f_time = 0; + exp_hb_ctrl.out_faults.out_ocp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.out_ocp.w_time = 0; + exp_hb_ctrl.out_faults.out_ocp.f_time = 0; + exp_hb_ctrl.out_faults.out_opp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.out_opp.w_time = 0; + exp_hb_ctrl.out_faults.out_opp.f_time = 0; + exp_hb_ctrl.out_faults.out_short.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.out_short.w_time = 0; + exp_hb_ctrl.out_faults.out_short.f_time = 0; + exp_hb_ctrl.out_faults.out_open.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.out_open.w_time = 0; + exp_hb_ctrl.out_faults.out_open.f_time = 0; + exp_hb_ctrl.out_faults_en.sup_uvp = 0; + exp_hb_ctrl.out_faults_en.sup_ovp = 0; + exp_hb_ctrl.out_faults_en.sup_ocp = 1; + exp_hb_ctrl.out_faults_en.sup_opp = 0; + exp_hb_ctrl.out_faults_en.out_ovp = 0; + exp_hb_ctrl.out_faults_en.out_ocp = 1; + exp_hb_ctrl.out_faults_en.out_opp = 0; + exp_hb_ctrl.out_faults_en.out_short = 1; + exp_hb_ctrl.out_faults_en.out_open = 0; + exp_hb_ctrl.out_fuse.state = FUSE_OFF; + exp_hb_ctrl.out_fuse.count = 0; + exp_hb_ctrl.out_fuse.timer = 0; + exp_hb_ctrl.out_fuse_cfg.cooldown_time = 1000; + exp_hb_ctrl.out_fuse_cfg.retry_time = 1000; + + test_res = ut_hb_init(&hb_fb, &hb_ctrl, &meas, exp_low, exp_pwm, &exp_hb_fb, &exp_hb_ctrl); + if(!test_res) pass = 0; + + return pass; +} + +static int ut_hb_enable(hb_control_t* hb_ctrl, uint8_t exp_low, uint16_t exp_pwm, hb_control_t* exp_hb_ctrl) +{ + printf(" Input:\n"); + + mock_board_halfbridge_write_low(NOT_ACCESD_LOW); + mock_board_halfbridge_write_pwm(NOT_ACCESD_PWM); + + hb_enable(hb_ctrl); + + uint8_t out_low = mock_board_halfbridge_read_low(); + uint16_t out_pwm = mock_board_halfbridge_read_pwm(); + uint8_t ctrl_ok = hb_is_equal_ctrl_struct(hb_ctrl, exp_hb_ctrl); + + printf(" Output: Low:%d PWM:%d Ctrl:%d\n", out_low, out_pwm, ctrl_ok); + printf("Expected: Low:%d PWM:%d \n", exp_low, exp_pwm); + + if((out_low==exp_low)&&(out_pwm==exp_pwm)&&(ctrl_ok)) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_hb_enable_test(void) +{ + printf("******************************************************\n"); + printf("void hb_enable(hb_control_t* hb_ctrl) \n"); + + int test_res; + int pass = 1; + + hb_control_t hb_ctrl; + uint8_t exp_low; + uint16_t exp_pwm; + hb_control_t exp_hb_ctrl; + + // Normal 1 + hb_ctrl.enabled = 0; + hb_ctrl.out_faults.sup_uvp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.sup_uvp.w_time = 0; + hb_ctrl.out_faults.sup_uvp.f_time = 0; + hb_ctrl.out_faults.sup_ovp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.sup_ovp.w_time = 0; + hb_ctrl.out_faults.sup_ovp.f_time = 0; + hb_ctrl.out_faults.sup_ocp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.sup_ocp.w_time = 0; + hb_ctrl.out_faults.sup_ocp.f_time = 0; + hb_ctrl.out_faults.sup_opp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.sup_opp.w_time = 0; + hb_ctrl.out_faults.sup_opp.f_time = 0; + hb_ctrl.out_faults.out_ovp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_ovp.w_time = 0; + hb_ctrl.out_faults.out_ovp.f_time = 0; + hb_ctrl.out_faults.out_ocp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_ocp.w_time = 0; + hb_ctrl.out_faults.out_ocp.f_time = 0; + hb_ctrl.out_faults.out_opp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_opp.w_time = 0; + hb_ctrl.out_faults.out_opp.f_time = 0; + hb_ctrl.out_faults.out_short.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_short.w_time = 0; + hb_ctrl.out_faults.out_short.f_time = 0; + hb_ctrl.out_faults.out_open.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_open.w_time = 0; + hb_ctrl.out_faults.out_open.f_time = 0; + hb_ctrl.out_faults_en.sup_uvp = 0; + hb_ctrl.out_faults_en.sup_ovp = 0; + hb_ctrl.out_faults_en.sup_ocp = 1; + hb_ctrl.out_faults_en.sup_opp = 0; + hb_ctrl.out_faults_en.out_ovp = 0; + hb_ctrl.out_faults_en.out_ocp = 1; + hb_ctrl.out_faults_en.out_opp = 0; + hb_ctrl.out_faults_en.out_short = 1; + hb_ctrl.out_faults_en.out_open = 0; + hb_ctrl.out_fuse.state = FUSE_OFF; + hb_ctrl.out_fuse.count = 0; + hb_ctrl.out_fuse.timer = 0; + hb_ctrl.out_fuse_cfg.cooldown_time = 1000; + hb_ctrl.out_fuse_cfg.retry_time = 1000; + + exp_low = 1; + exp_pwm = 0; + + exp_hb_ctrl.enabled = 1; + exp_hb_ctrl.out_faults.sup_uvp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.sup_uvp.w_time = 0; + exp_hb_ctrl.out_faults.sup_uvp.f_time = 0; + exp_hb_ctrl.out_faults.sup_ovp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.sup_ovp.w_time = 0; + exp_hb_ctrl.out_faults.sup_ovp.f_time = 0; + exp_hb_ctrl.out_faults.sup_ocp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.sup_ocp.w_time = 0; + exp_hb_ctrl.out_faults.sup_ocp.f_time = 0; + exp_hb_ctrl.out_faults.sup_opp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.sup_opp.w_time = 0; + exp_hb_ctrl.out_faults.sup_opp.f_time = 0; + exp_hb_ctrl.out_faults.out_ovp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.out_ovp.w_time = 0; + exp_hb_ctrl.out_faults.out_ovp.f_time = 0; + exp_hb_ctrl.out_faults.out_ocp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.out_ocp.w_time = 0; + exp_hb_ctrl.out_faults.out_ocp.f_time = 0; + exp_hb_ctrl.out_faults.out_opp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.out_opp.w_time = 0; + exp_hb_ctrl.out_faults.out_opp.f_time = 0; + exp_hb_ctrl.out_faults.out_short.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.out_short.w_time = 0; + exp_hb_ctrl.out_faults.out_short.f_time = 0; + exp_hb_ctrl.out_faults.out_open.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.out_open.w_time = 0; + exp_hb_ctrl.out_faults.out_open.f_time = 0; + exp_hb_ctrl.out_faults_en.sup_uvp = 0; + exp_hb_ctrl.out_faults_en.sup_ovp = 0; + exp_hb_ctrl.out_faults_en.sup_ocp = 1; + exp_hb_ctrl.out_faults_en.sup_opp = 0; + exp_hb_ctrl.out_faults_en.out_ovp = 0; + exp_hb_ctrl.out_faults_en.out_ocp = 1; + exp_hb_ctrl.out_faults_en.out_opp = 0; + exp_hb_ctrl.out_faults_en.out_short = 1; + exp_hb_ctrl.out_faults_en.out_open = 0; + exp_hb_ctrl.out_fuse.state = FUSE_OFF; + exp_hb_ctrl.out_fuse.count = 0; + exp_hb_ctrl.out_fuse.timer = 0; + exp_hb_ctrl.out_fuse_cfg.cooldown_time = 1000; + exp_hb_ctrl.out_fuse_cfg.retry_time = 1000; + + test_res = ut_hb_enable(&hb_ctrl, exp_low, exp_pwm, &exp_hb_ctrl); + if(!test_res) pass = 0; + + return pass; +} + +static int ut_hb_disable(hb_control_t* hb_ctrl, uint8_t exp_low, uint16_t exp_pwm, hb_control_t* exp_hb_ctrl) +{ + printf(" Input:\n"); + + mock_board_halfbridge_write_low(NOT_ACCESD_LOW); + mock_board_halfbridge_write_pwm(NOT_ACCESD_PWM); + + hb_disable(hb_ctrl); + + uint8_t out_low = mock_board_halfbridge_read_low(); + uint16_t out_pwm = mock_board_halfbridge_read_pwm(); + uint8_t ctrl_ok = hb_is_equal_ctrl_struct(hb_ctrl, exp_hb_ctrl); + + printf(" Output: Low:%d PWM:%d Ctrl:%d\n", out_low, out_pwm, ctrl_ok); + printf("Expected: Low:%d PWM:%d \n", exp_low, exp_pwm); + + if((out_low==exp_low)&&(out_pwm==exp_pwm)&&(ctrl_ok)) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + + +int ut_hb_disable_test(void) +{ + printf("******************************************************\n"); + printf("void hb_disable(hb_control_t* hb_ctrl) \n"); + + int test_res; + int pass = 1; + + hb_control_t hb_ctrl; + uint8_t exp_low; + uint16_t exp_pwm; + hb_control_t exp_hb_ctrl; + + // Normal 1 + hb_ctrl.enabled = 1; + hb_ctrl.out_faults.sup_uvp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.sup_uvp.w_time = 0; + hb_ctrl.out_faults.sup_uvp.f_time = 0; + hb_ctrl.out_faults.sup_ovp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.sup_ovp.w_time = 0; + hb_ctrl.out_faults.sup_ovp.f_time = 0; + hb_ctrl.out_faults.sup_ocp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.sup_ocp.w_time = 0; + hb_ctrl.out_faults.sup_ocp.f_time = 0; + hb_ctrl.out_faults.sup_opp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.sup_opp.w_time = 0; + hb_ctrl.out_faults.sup_opp.f_time = 0; + hb_ctrl.out_faults.out_ovp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_ovp.w_time = 0; + hb_ctrl.out_faults.out_ovp.f_time = 0; + hb_ctrl.out_faults.out_ocp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_ocp.w_time = 0; + hb_ctrl.out_faults.out_ocp.f_time = 0; + hb_ctrl.out_faults.out_opp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_opp.w_time = 0; + hb_ctrl.out_faults.out_opp.f_time = 0; + hb_ctrl.out_faults.out_short.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_short.w_time = 0; + hb_ctrl.out_faults.out_short.f_time = 0; + hb_ctrl.out_faults.out_open.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_open.w_time = 0; + hb_ctrl.out_faults.out_open.f_time = 0; + hb_ctrl.out_faults_en.sup_uvp = 0; + hb_ctrl.out_faults_en.sup_ovp = 0; + hb_ctrl.out_faults_en.sup_ocp = 1; + hb_ctrl.out_faults_en.sup_opp = 0; + hb_ctrl.out_faults_en.out_ovp = 0; + hb_ctrl.out_faults_en.out_ocp = 1; + hb_ctrl.out_faults_en.out_opp = 0; + hb_ctrl.out_faults_en.out_short = 1; + hb_ctrl.out_faults_en.out_open = 0; + hb_ctrl.out_fuse.state = FUSE_OFF; + hb_ctrl.out_fuse.count = 0; + hb_ctrl.out_fuse.timer = 0; + hb_ctrl.out_fuse_cfg.cooldown_time = 1000; + hb_ctrl.out_fuse_cfg.retry_time = 1000; + + exp_low = 0; + exp_pwm = 0; + + exp_hb_ctrl.enabled = 0; + exp_hb_ctrl.out_faults.sup_uvp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.sup_uvp.w_time = 0; + exp_hb_ctrl.out_faults.sup_uvp.f_time = 0; + exp_hb_ctrl.out_faults.sup_ovp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.sup_ovp.w_time = 0; + exp_hb_ctrl.out_faults.sup_ovp.f_time = 0; + exp_hb_ctrl.out_faults.sup_ocp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.sup_ocp.w_time = 0; + exp_hb_ctrl.out_faults.sup_ocp.f_time = 0; + exp_hb_ctrl.out_faults.sup_opp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.sup_opp.w_time = 0; + exp_hb_ctrl.out_faults.sup_opp.f_time = 0; + exp_hb_ctrl.out_faults.out_ovp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.out_ovp.w_time = 0; + exp_hb_ctrl.out_faults.out_ovp.f_time = 0; + exp_hb_ctrl.out_faults.out_ocp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.out_ocp.w_time = 0; + exp_hb_ctrl.out_faults.out_ocp.f_time = 0; + exp_hb_ctrl.out_faults.out_opp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.out_opp.w_time = 0; + exp_hb_ctrl.out_faults.out_opp.f_time = 0; + exp_hb_ctrl.out_faults.out_short.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.out_short.w_time = 0; + exp_hb_ctrl.out_faults.out_short.f_time = 0; + exp_hb_ctrl.out_faults.out_open.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.out_open.w_time = 0; + exp_hb_ctrl.out_faults.out_open.f_time = 0; + exp_hb_ctrl.out_faults_en.sup_uvp = 0; + exp_hb_ctrl.out_faults_en.sup_ovp = 0; + exp_hb_ctrl.out_faults_en.sup_ocp = 1; + exp_hb_ctrl.out_faults_en.sup_opp = 0; + exp_hb_ctrl.out_faults_en.out_ovp = 0; + exp_hb_ctrl.out_faults_en.out_ocp = 1; + exp_hb_ctrl.out_faults_en.out_opp = 0; + exp_hb_ctrl.out_faults_en.out_short = 1; + exp_hb_ctrl.out_faults_en.out_open = 0; + exp_hb_ctrl.out_fuse.state = FUSE_OFF; + exp_hb_ctrl.out_fuse.count = 0; + exp_hb_ctrl.out_fuse.timer = 0; + exp_hb_ctrl.out_fuse_cfg.cooldown_time = 1000; + exp_hb_ctrl.out_fuse_cfg.retry_time = 1000; + + test_res = ut_hb_disable(&hb_ctrl, exp_low, exp_pwm, &exp_hb_ctrl); + if(!test_res) pass = 0; + + return pass; +} + +static int ut_hb_process(int16_t target, hb_feedback_t* hb_fb, hb_control_t* hb_ctrl, hb_meas_t* meas, uint8_t exp_low, uint16_t exp_pwm, hb_feedback_t* exp_hb_fb, hb_control_t* exp_hb_ctrl) +{ + printf(" Input: Target:%d Enabled:%d \n", target, hb_ctrl->enabled); + printf("Supply Voltage:%d Current:%d Power:%d \n", meas->sup_voltage, meas->sup_current, meas->sup_power); + printf("Output Voltage:%d Current:%d Power:%d Impedance:%d\n", meas->out_voltage, meas->out_current, meas->out_power, meas->out_impedance); + printf("Low side:%d PWM:%d \n", meas->low_side_ctrl, meas->pwm); + printf("Control struct input: \n"); + print_ctrl_struct(hb_ctrl); + + mock_board_halfbridge_write_low(NOT_ACCESD_LOW); + mock_board_halfbridge_write_pwm(NOT_ACCESD_PWM); + mock_board_halfbridge_write_feedback(meas); + + hb_process(target, hb_fb, hb_ctrl); + + uint8_t out_low = mock_board_halfbridge_read_low(); + uint16_t out_pwm = mock_board_halfbridge_read_pwm(); + uint8_t fb_ok = hb_is_equal_fb_struct(hb_fb, exp_hb_fb); + uint8_t ctrl_ok = hb_is_equal_ctrl_struct(hb_ctrl, exp_hb_ctrl); + + printf("\n"); + printf("Output: \n"); + printf("Low:%d PWM:%d FB:%d CTRL:%d \n", out_low, out_pwm, fb_ok, ctrl_ok); + print_fb_struct(hb_fb); + print_ctrl_struct(hb_ctrl); + + printf("\n"); + printf("Expected: \n"); + printf("Low:%d PWM:%d \n", exp_low, exp_pwm); + print_ctrl_struct(exp_hb_ctrl); + + if((out_low==exp_low)&&(out_pwm==exp_pwm)&&(fb_ok)&&(ctrl_ok)) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_hb_process_test(void) +{ + printf("******************************************************\n"); + printf("void hb_process(int16_t target, hb_feedback_t* hb_fb, hb_control_t* hb_ctrl) \n"); + + int test_res; + int pass = 1; + + int16_t target; + hb_feedback_t hb_fb; + hb_control_t hb_ctrl; + hb_meas_t meas; + + uint8_t exp_low; + uint16_t exp_pwm; + hb_feedback_t exp_hb_fb; + hb_control_t exp_hb_ctrl; + + // 0V target + printf("----- 0V target ------------------ \n"); + target = 0; + + hb_fb.analog.sup_voltage = 12000; + hb_fb.analog.sup_current = 100; + hb_fb.analog.sup_power = 1200; + hb_fb.analog.out_voltage = 0; + hb_fb.analog.out_current = 0; + hb_fb.analog.out_power = 0; + hb_fb.analog.out_impedance = 0xFFFF; + hb_fb.analog.low_side_ctrl = 1; + hb_fb.analog.pwm = 0; + hb_fb.enabled = 1; + hb_fb.warning_act = 0; + hb_fb.fault_act = 0; + hb_fb.fused = 0; + hb_fb.warnings.sup_uvp = 0; + hb_fb.warnings.sup_ovp = 0; + hb_fb.warnings.sup_ocp = 0; + hb_fb.warnings.sup_opp = 0; + hb_fb.warnings.out_ovp = 0; + hb_fb.warnings.out_ocp = 0; + hb_fb.warnings.out_opp = 0; + hb_fb.warnings.out_short = 0; + hb_fb.warnings.out_open = 0; + hb_fb.faults.sup_uvp = 0; + hb_fb.faults.sup_ovp = 0; + hb_fb.faults.sup_ocp = 0; + hb_fb.faults.sup_opp = 0; + hb_fb.faults.out_ovp = 0; + hb_fb.faults.out_ocp = 0; + hb_fb.faults.out_opp = 0; + hb_fb.faults.out_short = 0; + hb_fb.faults.out_open = 0; + + hb_ctrl.enabled = 1; + hb_ctrl.out_faults.sup_uvp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.sup_uvp.w_time = 0; + hb_ctrl.out_faults.sup_uvp.f_time = 0; + hb_ctrl.out_faults.sup_ovp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.sup_ovp.w_time = 0; + hb_ctrl.out_faults.sup_ovp.f_time = 0; + hb_ctrl.out_faults.sup_ocp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.sup_ocp.w_time = 0; + hb_ctrl.out_faults.sup_ocp.f_time = 0; + hb_ctrl.out_faults.sup_opp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.sup_opp.w_time = 0; + hb_ctrl.out_faults.sup_opp.f_time = 0; + hb_ctrl.out_faults.out_ovp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_ovp.w_time = 0; + hb_ctrl.out_faults.out_ovp.f_time = 0; + hb_ctrl.out_faults.out_ocp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_ocp.w_time = 0; + hb_ctrl.out_faults.out_ocp.f_time = 0; + hb_ctrl.out_faults.out_opp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_opp.w_time = 0; + hb_ctrl.out_faults.out_opp.f_time = 0; + hb_ctrl.out_faults.out_short.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_short.w_time = 0; + hb_ctrl.out_faults.out_short.f_time = 0; + hb_ctrl.out_faults.out_open.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_open.w_time = 0; + hb_ctrl.out_faults.out_open.f_time = 0; + hb_ctrl.out_faults_en.sup_uvp = 0; + hb_ctrl.out_faults_en.sup_ovp = 0; + hb_ctrl.out_faults_en.sup_ocp = 1; + hb_ctrl.out_faults_en.sup_opp = 0; + hb_ctrl.out_faults_en.out_ovp = 0; + hb_ctrl.out_faults_en.out_ocp = 1; + hb_ctrl.out_faults_en.out_opp = 0; + hb_ctrl.out_faults_en.out_short = 1; + hb_ctrl.out_faults_en.out_open = 0; + hb_ctrl.out_fuse.state = FUSE_OFF; + hb_ctrl.out_fuse.count = 0; + hb_ctrl.out_fuse.timer = 0; + hb_ctrl.out_fuse_cfg.cooldown_time = 1000; + hb_ctrl.out_fuse_cfg.retry_time = 1000; + + meas.sup_voltage = 12000; + meas.sup_current = 100; + meas.sup_power = 1200; + meas.out_voltage = 0; + meas.out_current = 0; + meas.out_power = 0; + meas.out_impedance = 0xFFFF; + meas.low_side_ctrl = 1; + meas.pwm = 0; + + exp_low = 1; + exp_pwm = 0; + + exp_hb_fb.analog.sup_voltage = meas.sup_voltage; + exp_hb_fb.analog.sup_current = meas.sup_current; + exp_hb_fb.analog.sup_power = meas.sup_power; + exp_hb_fb.analog.out_voltage = meas.out_voltage; + exp_hb_fb.analog.out_current = meas.out_current; + exp_hb_fb.analog.out_power = meas.out_power; + exp_hb_fb.analog.out_impedance = meas.out_impedance; + exp_hb_fb.analog.low_side_ctrl = meas.low_side_ctrl; + exp_hb_fb.analog.pwm = meas.pwm; + exp_hb_fb.enabled = 1; + exp_hb_fb.warning_act = 0; + exp_hb_fb.fault_act = 0; + exp_hb_fb.fused = 0; + exp_hb_fb.warnings.sup_uvp = 0; + exp_hb_fb.warnings.sup_ovp = 0; + exp_hb_fb.warnings.sup_ocp = 0; + exp_hb_fb.warnings.sup_opp = 0; + exp_hb_fb.warnings.out_ovp = 0; + exp_hb_fb.warnings.out_ocp = 0; + exp_hb_fb.warnings.out_opp = 0; + exp_hb_fb.warnings.out_short = 0; + exp_hb_fb.warnings.out_open = 0; + exp_hb_fb.faults.sup_uvp = 0; + exp_hb_fb.faults.sup_ovp = 0; + exp_hb_fb.faults.sup_ocp = 0; + exp_hb_fb.faults.sup_opp = 0; + exp_hb_fb.faults.out_ovp = 0; + exp_hb_fb.faults.out_ocp = 0; + exp_hb_fb.faults.out_opp = 0; + exp_hb_fb.faults.out_short = 0; + exp_hb_fb.faults.out_open = 0; + + exp_hb_ctrl.enabled = 1; + exp_hb_ctrl.out_faults.sup_uvp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.sup_uvp.w_time = 0; + exp_hb_ctrl.out_faults.sup_uvp.f_time = 0; + exp_hb_ctrl.out_faults.sup_ovp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.sup_ovp.w_time = 0; + exp_hb_ctrl.out_faults.sup_ovp.f_time = 0; + exp_hb_ctrl.out_faults.sup_ocp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.sup_ocp.w_time = 0; + exp_hb_ctrl.out_faults.sup_ocp.f_time = 0; + exp_hb_ctrl.out_faults.sup_opp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.sup_opp.w_time = 0; + exp_hb_ctrl.out_faults.sup_opp.f_time = 0; + exp_hb_ctrl.out_faults.out_ovp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.out_ovp.w_time = 0; + exp_hb_ctrl.out_faults.out_ovp.f_time = 0; + exp_hb_ctrl.out_faults.out_ocp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.out_ocp.w_time = 0; + exp_hb_ctrl.out_faults.out_ocp.f_time = 0; + exp_hb_ctrl.out_faults.out_opp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.out_opp.w_time = 0; + exp_hb_ctrl.out_faults.out_opp.f_time = 0; + exp_hb_ctrl.out_faults.out_short.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.out_short.w_time = 0; + exp_hb_ctrl.out_faults.out_short.f_time = 0; + exp_hb_ctrl.out_faults.out_open.severity = FAULT_LVL_WARNING; + exp_hb_ctrl.out_faults.out_open.w_time = 0; + exp_hb_ctrl.out_faults.out_open.f_time = 0; + exp_hb_ctrl.out_faults_en.sup_uvp = 0; + exp_hb_ctrl.out_faults_en.sup_ovp = 0; + exp_hb_ctrl.out_faults_en.sup_ocp = 1; + exp_hb_ctrl.out_faults_en.sup_opp = 0; + exp_hb_ctrl.out_faults_en.out_ovp = 1; + exp_hb_ctrl.out_faults_en.out_ocp = 1; + exp_hb_ctrl.out_faults_en.out_opp = 0; + exp_hb_ctrl.out_faults_en.out_short = 0; + exp_hb_ctrl.out_faults_en.out_open = 0; + exp_hb_ctrl.out_fuse.state = FUSE_OFF; + exp_hb_ctrl.out_fuse.count = 0; + exp_hb_ctrl.out_fuse.timer = 0; + exp_hb_ctrl.out_fuse_cfg.cooldown_time = 1000; + exp_hb_ctrl.out_fuse_cfg.retry_time = 1000; + + test_res = ut_hb_process(target, &hb_fb, &hb_ctrl, &meas, exp_low, exp_pwm, &exp_hb_fb, &exp_hb_ctrl); + if(!test_res) pass = 0; + + // 6V target + printf("----- 6V target ------------------ \n"); + target = 6000; + + hb_fb.analog.sup_voltage = 12000; + hb_fb.analog.sup_current = 100; + hb_fb.analog.sup_power = 1200; + hb_fb.analog.out_voltage = 0; + hb_fb.analog.out_current = 0; + hb_fb.analog.out_power = 0; + hb_fb.analog.out_impedance = 0xFFFF; + hb_fb.analog.low_side_ctrl = 1; + hb_fb.analog.pwm = 0; + hb_fb.enabled = 1; + hb_fb.warning_act = 0; + hb_fb.fault_act = 0; + hb_fb.fused = 0; + hb_fb.warnings.sup_uvp = 0; + hb_fb.warnings.sup_ovp = 0; + hb_fb.warnings.sup_ocp = 0; + hb_fb.warnings.sup_opp = 0; + hb_fb.warnings.out_ovp = 0; + hb_fb.warnings.out_ocp = 0; + hb_fb.warnings.out_opp = 0; + hb_fb.warnings.out_short = 0; + hb_fb.warnings.out_open = 0; + hb_fb.faults.sup_uvp = 0; + hb_fb.faults.sup_ovp = 0; + hb_fb.faults.sup_ocp = 0; + hb_fb.faults.sup_opp = 0; + hb_fb.faults.out_ovp = 0; + hb_fb.faults.out_ocp = 0; + hb_fb.faults.out_opp = 0; + hb_fb.faults.out_short = 0; + hb_fb.faults.out_open = 0; + + hb_ctrl.enabled = 1; + hb_ctrl.out_faults.sup_uvp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.sup_uvp.w_time = 0; + hb_ctrl.out_faults.sup_uvp.f_time = 0; + hb_ctrl.out_faults.sup_ovp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.sup_ovp.w_time = 0; + hb_ctrl.out_faults.sup_ovp.f_time = 0; + hb_ctrl.out_faults.sup_ocp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.sup_ocp.w_time = 0; + hb_ctrl.out_faults.sup_ocp.f_time = 0; + hb_ctrl.out_faults.sup_opp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.sup_opp.w_time = 0; + hb_ctrl.out_faults.sup_opp.f_time = 0; + hb_ctrl.out_faults.out_ovp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_ovp.w_time = 0; + hb_ctrl.out_faults.out_ovp.f_time = 0; + hb_ctrl.out_faults.out_ocp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_ocp.w_time = 0; + hb_ctrl.out_faults.out_ocp.f_time = 0; + hb_ctrl.out_faults.out_opp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_opp.w_time = 0; + hb_ctrl.out_faults.out_opp.f_time = 0; + hb_ctrl.out_faults.out_short.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_short.w_time = 0; + hb_ctrl.out_faults.out_short.f_time = 0; + hb_ctrl.out_faults.out_open.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_open.w_time = 0; + hb_ctrl.out_faults.out_open.f_time = 0; + hb_ctrl.out_faults_en.sup_uvp = 0; + hb_ctrl.out_faults_en.sup_ovp = 0; + hb_ctrl.out_faults_en.sup_ocp = 1; + hb_ctrl.out_faults_en.sup_opp = 0; + hb_ctrl.out_faults_en.out_ovp = 1; + hb_ctrl.out_faults_en.out_ocp = 1; + hb_ctrl.out_faults_en.out_opp = 0; + hb_ctrl.out_faults_en.out_short = 1; + hb_ctrl.out_faults_en.out_open = 0; + hb_ctrl.out_fuse.state = FUSE_OFF; + hb_ctrl.out_fuse.count = 0; + hb_ctrl.out_fuse.timer = 0; + hb_ctrl.out_fuse_cfg.cooldown_time = 1000; + hb_ctrl.out_fuse_cfg.retry_time = 1000; + + meas.sup_voltage = 12000; + meas.sup_current = 100; + meas.sup_power = 1200; + meas.out_voltage = 0; + meas.out_current = 0; + meas.out_power = 0; + meas.out_impedance = 0xFFFF; + meas.low_side_ctrl = 1; + meas.pwm = 0; + + exp_low = 1; + exp_pwm = 0x7FFF; + + exp_hb_fb.analog.sup_voltage = meas.sup_voltage; + exp_hb_fb.analog.sup_current = meas.sup_current; + exp_hb_fb.analog.sup_power = meas.sup_power; + exp_hb_fb.analog.out_voltage = meas.out_voltage; + exp_hb_fb.analog.out_current = meas.out_current; + exp_hb_fb.analog.out_power = meas.out_power; + exp_hb_fb.analog.out_impedance = meas.out_impedance; + exp_hb_fb.analog.low_side_ctrl = meas.low_side_ctrl; + exp_hb_fb.analog.pwm = meas.pwm; + exp_hb_fb.enabled = 1; + exp_hb_fb.warning_act = 0; + exp_hb_fb.fault_act = 0; + exp_hb_fb.fused = 0; + exp_hb_fb.warnings.sup_uvp = 0; + exp_hb_fb.warnings.sup_ovp = 0; + exp_hb_fb.warnings.sup_ocp = 0; + exp_hb_fb.warnings.sup_opp = 0; + exp_hb_fb.warnings.out_ovp = 0; + exp_hb_fb.warnings.out_ocp = 0; + exp_hb_fb.warnings.out_opp = 0; + exp_hb_fb.warnings.out_short = 0; + exp_hb_fb.warnings.out_open = 0; + exp_hb_fb.faults.sup_uvp = 0; + exp_hb_fb.faults.sup_ovp = 0; + exp_hb_fb.faults.sup_ocp = 0; + exp_hb_fb.faults.sup_opp = 0; + exp_hb_fb.faults.out_ovp = 0; + exp_hb_fb.faults.out_ocp = 0; + exp_hb_fb.faults.out_opp = 0; + exp_hb_fb.faults.out_short = 0; + exp_hb_fb.faults.out_open = 0; + + exp_hb_ctrl.enabled = 1; + exp_hb_ctrl.out_faults.sup_uvp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.sup_uvp.w_time = 0; + exp_hb_ctrl.out_faults.sup_uvp.f_time = 0; + exp_hb_ctrl.out_faults.sup_ovp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.sup_ovp.w_time = 0; + exp_hb_ctrl.out_faults.sup_ovp.f_time = 0; + exp_hb_ctrl.out_faults.sup_ocp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.sup_ocp.w_time = 0; + exp_hb_ctrl.out_faults.sup_ocp.f_time = 0; + exp_hb_ctrl.out_faults.sup_opp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.sup_opp.w_time = 0; + exp_hb_ctrl.out_faults.sup_opp.f_time = 0; + exp_hb_ctrl.out_faults.out_ovp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.out_ovp.w_time = 0; + exp_hb_ctrl.out_faults.out_ovp.f_time = 0; + exp_hb_ctrl.out_faults.out_ocp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.out_ocp.w_time = 0; + exp_hb_ctrl.out_faults.out_ocp.f_time = 0; + exp_hb_ctrl.out_faults.out_opp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.out_opp.w_time = 0; + exp_hb_ctrl.out_faults.out_opp.f_time = 0; + exp_hb_ctrl.out_faults.out_short.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.out_short.w_time = 0; + exp_hb_ctrl.out_faults.out_short.f_time = 0; + exp_hb_ctrl.out_faults.out_open.severity = FAULT_LVL_WARNING; + exp_hb_ctrl.out_faults.out_open.w_time = 0; + exp_hb_ctrl.out_faults.out_open.f_time = 0; + exp_hb_ctrl.out_faults_en.sup_uvp = 0; + exp_hb_ctrl.out_faults_en.sup_ovp = 0; + exp_hb_ctrl.out_faults_en.sup_ocp = 1; + exp_hb_ctrl.out_faults_en.sup_opp = 0; + exp_hb_ctrl.out_faults_en.out_ovp = 1; + exp_hb_ctrl.out_faults_en.out_ocp = 1; + exp_hb_ctrl.out_faults_en.out_opp = 0; + exp_hb_ctrl.out_faults_en.out_short = 1; + exp_hb_ctrl.out_faults_en.out_open = 0; + exp_hb_ctrl.out_fuse.state = FUSE_OFF; + exp_hb_ctrl.out_fuse.count = 0; + exp_hb_ctrl.out_fuse.timer = 0; + exp_hb_ctrl.out_fuse_cfg.cooldown_time = 1000; + exp_hb_ctrl.out_fuse_cfg.retry_time = 1000; + + test_res = ut_hb_process(target, &hb_fb, &hb_ctrl, &meas, exp_low, exp_pwm, &exp_hb_fb, &exp_hb_ctrl); + if(!test_res) pass = 0; + + // -1 / Handbrake target + printf("----- -1 Handbarke target ------------------ \n"); + target = -1; + + hb_fb.analog.sup_voltage = 12000; + hb_fb.analog.sup_current = 100; + hb_fb.analog.sup_power = 1200; + hb_fb.analog.out_voltage = 0; + hb_fb.analog.out_current = 0; + hb_fb.analog.out_power = 0; + hb_fb.analog.out_impedance = 0xFFFF; + hb_fb.analog.low_side_ctrl = 1; + hb_fb.analog.pwm = 0; + hb_fb.enabled = 1; + hb_fb.warning_act = 0; + hb_fb.fault_act = 0; + hb_fb.fused = 0; + hb_fb.warnings.sup_uvp = 0; + hb_fb.warnings.sup_ovp = 0; + hb_fb.warnings.sup_ocp = 0; + hb_fb.warnings.sup_opp = 0; + hb_fb.warnings.out_ovp = 0; + hb_fb.warnings.out_ocp = 0; + hb_fb.warnings.out_opp = 0; + hb_fb.warnings.out_short = 0; + hb_fb.warnings.out_open = 0; + hb_fb.faults.sup_uvp = 0; + hb_fb.faults.sup_ovp = 0; + hb_fb.faults.sup_ocp = 0; + hb_fb.faults.sup_opp = 0; + hb_fb.faults.out_ovp = 0; + hb_fb.faults.out_ocp = 0; + hb_fb.faults.out_opp = 0; + hb_fb.faults.out_short = 0; + hb_fb.faults.out_open = 0; + + hb_ctrl.enabled = 1; + hb_ctrl.out_faults.sup_uvp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.sup_uvp.w_time = 0; + hb_ctrl.out_faults.sup_uvp.f_time = 0; + hb_ctrl.out_faults.sup_ovp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.sup_ovp.w_time = 0; + hb_ctrl.out_faults.sup_ovp.f_time = 0; + hb_ctrl.out_faults.sup_ocp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.sup_ocp.w_time = 0; + hb_ctrl.out_faults.sup_ocp.f_time = 0; + hb_ctrl.out_faults.sup_opp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.sup_opp.w_time = 0; + hb_ctrl.out_faults.sup_opp.f_time = 0; + hb_ctrl.out_faults.out_ovp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_ovp.w_time = 0; + hb_ctrl.out_faults.out_ovp.f_time = 0; + hb_ctrl.out_faults.out_ocp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_ocp.w_time = 0; + hb_ctrl.out_faults.out_ocp.f_time = 0; + hb_ctrl.out_faults.out_opp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_opp.w_time = 0; + hb_ctrl.out_faults.out_opp.f_time = 0; + hb_ctrl.out_faults.out_short.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_short.w_time = 0; + hb_ctrl.out_faults.out_short.f_time = 0; + hb_ctrl.out_faults.out_open.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_open.w_time = 0; + hb_ctrl.out_faults.out_open.f_time = 0; + hb_ctrl.out_faults_en.sup_uvp = 0; + hb_ctrl.out_faults_en.sup_ovp = 0; + hb_ctrl.out_faults_en.sup_ocp = 1; + hb_ctrl.out_faults_en.sup_opp = 0; + hb_ctrl.out_faults_en.out_ovp = 0; + hb_ctrl.out_faults_en.out_ocp = 1; + hb_ctrl.out_faults_en.out_opp = 0; + hb_ctrl.out_faults_en.out_short = 1; + hb_ctrl.out_faults_en.out_open = 0; + hb_ctrl.out_fuse.state = FUSE_OFF; + hb_ctrl.out_fuse.count = 0; + hb_ctrl.out_fuse.timer = 0; + hb_ctrl.out_fuse_cfg.cooldown_time = 1000; + hb_ctrl.out_fuse_cfg.retry_time = 1000; + + meas.sup_voltage = 12000; + meas.sup_current = 100; + meas.sup_power = 1200; + meas.out_voltage = 0; + meas.out_current = 0; + meas.out_power = 0; + meas.out_impedance = 0xFFFF; + meas.low_side_ctrl = 1; + meas.pwm = 0; + + exp_low = 0; + exp_pwm = 0; + + exp_hb_fb.analog.sup_voltage = meas.sup_voltage; + exp_hb_fb.analog.sup_current = meas.sup_current; + exp_hb_fb.analog.sup_power = meas.sup_power; + exp_hb_fb.analog.out_voltage = meas.out_voltage; + exp_hb_fb.analog.out_current = meas.out_current; + exp_hb_fb.analog.out_power = meas.out_power; + exp_hb_fb.analog.out_impedance = meas.out_impedance; + exp_hb_fb.analog.low_side_ctrl = meas.low_side_ctrl; + exp_hb_fb.analog.pwm = meas.pwm; + exp_hb_fb.enabled = 1; + exp_hb_fb.warning_act = 0; + exp_hb_fb.fault_act = 0; + exp_hb_fb.fused = 0; + exp_hb_fb.warnings.sup_uvp = 0; + exp_hb_fb.warnings.sup_ovp = 0; + exp_hb_fb.warnings.sup_ocp = 0; + exp_hb_fb.warnings.sup_opp = 0; + exp_hb_fb.warnings.out_ovp = 0; + exp_hb_fb.warnings.out_ocp = 0; + exp_hb_fb.warnings.out_opp = 0; + exp_hb_fb.warnings.out_short = 0; + exp_hb_fb.warnings.out_open = 0; + exp_hb_fb.faults.sup_uvp = 0; + exp_hb_fb.faults.sup_ovp = 0; + exp_hb_fb.faults.sup_ocp = 0; + exp_hb_fb.faults.sup_opp = 0; + exp_hb_fb.faults.out_ovp = 0; + exp_hb_fb.faults.out_ocp = 0; + exp_hb_fb.faults.out_opp = 0; + exp_hb_fb.faults.out_short = 0; + exp_hb_fb.faults.out_open = 0; + + exp_hb_ctrl.enabled = 1; + exp_hb_ctrl.out_faults.sup_uvp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.sup_uvp.w_time = 0; + exp_hb_ctrl.out_faults.sup_uvp.f_time = 0; + exp_hb_ctrl.out_faults.sup_ovp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.sup_ovp.w_time = 0; + exp_hb_ctrl.out_faults.sup_ovp.f_time = 0; + exp_hb_ctrl.out_faults.sup_ocp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.sup_ocp.w_time = 0; + exp_hb_ctrl.out_faults.sup_ocp.f_time = 0; + exp_hb_ctrl.out_faults.sup_opp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.sup_opp.w_time = 0; + exp_hb_ctrl.out_faults.sup_opp.f_time = 0; + exp_hb_ctrl.out_faults.out_ovp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.out_ovp.w_time = 0; + exp_hb_ctrl.out_faults.out_ovp.f_time = 0; + exp_hb_ctrl.out_faults.out_ocp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.out_ocp.w_time = 0; + exp_hb_ctrl.out_faults.out_ocp.f_time = 0; + exp_hb_ctrl.out_faults.out_opp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.out_opp.w_time = 0; + exp_hb_ctrl.out_faults.out_opp.f_time = 0; + exp_hb_ctrl.out_faults.out_short.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.out_short.w_time = 0; + exp_hb_ctrl.out_faults.out_short.f_time = 0; + exp_hb_ctrl.out_faults.out_open.severity = FAULT_LVL_WARNING; + exp_hb_ctrl.out_faults.out_open.w_time = 0; + exp_hb_ctrl.out_faults.out_open.f_time = 0; + exp_hb_ctrl.out_faults_en.sup_uvp = 0; + exp_hb_ctrl.out_faults_en.sup_ovp = 0; + exp_hb_ctrl.out_faults_en.sup_ocp = 1; + exp_hb_ctrl.out_faults_en.sup_opp = 0; + exp_hb_ctrl.out_faults_en.out_ovp = 0; + exp_hb_ctrl.out_faults_en.out_ocp = 1; + exp_hb_ctrl.out_faults_en.out_opp = 0; + exp_hb_ctrl.out_faults_en.out_short = 0; + exp_hb_ctrl.out_faults_en.out_open = 0; + exp_hb_ctrl.out_fuse.state = FUSE_OFF; + exp_hb_ctrl.out_fuse.count = 0; + exp_hb_ctrl.out_fuse.timer = 0; + exp_hb_ctrl.out_fuse_cfg.cooldown_time = 1000; + exp_hb_ctrl.out_fuse_cfg.retry_time = 1000; + + test_res = ut_hb_process(target, &hb_fb, &hb_ctrl, &meas, exp_low, exp_pwm, &exp_hb_fb, &exp_hb_ctrl); + if(!test_res) pass = 0; + + // Warnings 1 + printf("----- Warning 1 ------------------ \n"); + target = 1000; + + hb_fb.analog.sup_voltage = 12000; + hb_fb.analog.sup_current = 100; + hb_fb.analog.sup_power = 1200; + hb_fb.analog.out_voltage = 0; + hb_fb.analog.out_current = 0; + hb_fb.analog.out_power = 0; + hb_fb.analog.out_impedance = 0xFFFF; + hb_fb.analog.low_side_ctrl = 1; + hb_fb.analog.pwm = 0; + hb_fb.enabled = 1; + hb_fb.warning_act = 0; + hb_fb.fault_act = 0; + hb_fb.fused = 0; + hb_fb.warnings.sup_uvp = 0; + hb_fb.warnings.sup_ovp = 0; + hb_fb.warnings.sup_ocp = 0; + hb_fb.warnings.sup_opp = 0; + hb_fb.warnings.out_ovp = 0; + hb_fb.warnings.out_ocp = 0; + hb_fb.warnings.out_opp = 0; + hb_fb.warnings.out_short = 0; + hb_fb.warnings.out_open = 0; + hb_fb.faults.sup_uvp = 0; + hb_fb.faults.sup_ovp = 0; + hb_fb.faults.sup_ocp = 0; + hb_fb.faults.sup_opp = 0; + hb_fb.faults.out_ovp = 0; + hb_fb.faults.out_ocp = 0; + hb_fb.faults.out_opp = 0; + hb_fb.faults.out_short = 0; + hb_fb.faults.out_open = 0; + + hb_ctrl.enabled = 1; + hb_ctrl.out_faults.sup_uvp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.sup_uvp.w_time = 0; + hb_ctrl.out_faults.sup_uvp.f_time = 0; + hb_ctrl.out_faults.sup_ovp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.sup_ovp.w_time = 0; + hb_ctrl.out_faults.sup_ovp.f_time = 0; + hb_ctrl.out_faults.sup_ocp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.sup_ocp.w_time = 0; + hb_ctrl.out_faults.sup_ocp.f_time = 0; + hb_ctrl.out_faults.sup_opp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.sup_opp.w_time = 0; + hb_ctrl.out_faults.sup_opp.f_time = 0; + hb_ctrl.out_faults.out_ovp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_ovp.w_time = 0; + hb_ctrl.out_faults.out_ovp.f_time = 0; + hb_ctrl.out_faults.out_ocp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_ocp.w_time = 0; + hb_ctrl.out_faults.out_ocp.f_time = 0; + hb_ctrl.out_faults.out_opp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_opp.w_time = 0; + hb_ctrl.out_faults.out_opp.f_time = 0; + hb_ctrl.out_faults.out_short.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_short.w_time = 0; + hb_ctrl.out_faults.out_short.f_time = 0; + hb_ctrl.out_faults.out_open.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_open.w_time = 0; + hb_ctrl.out_faults.out_open.f_time = 0; + hb_ctrl.out_faults_en.sup_uvp = 1; + hb_ctrl.out_faults_en.sup_ovp = 1; + hb_ctrl.out_faults_en.sup_ocp = 1; + hb_ctrl.out_faults_en.sup_opp = 1; + hb_ctrl.out_faults_en.out_ovp = 1; + hb_ctrl.out_faults_en.out_ocp = 1; + hb_ctrl.out_faults_en.out_opp = 1; + hb_ctrl.out_faults_en.out_short = 1; + hb_ctrl.out_faults_en.out_open = 1; + hb_ctrl.out_fuse.state = FUSE_OFF; + hb_ctrl.out_fuse.count = 0; + hb_ctrl.out_fuse.timer = 0; + hb_ctrl.out_fuse_cfg.cooldown_time = 1000; + hb_ctrl.out_fuse_cfg.retry_time = 1000; + + meas.sup_voltage = HW_HB_SUPPLY_VOLT_MAX_W+1000; + meas.sup_current = HW_HB_SUPPLY_CURRENT_MAX_W+1000; + meas.sup_power = HW_HB_SUPPLY_POWER_MAX_W+1000; + meas.out_voltage = HW_HB_OUT_VOLTAGE_MAX_W+1000; + meas.out_current = HW_HB_OUT_CURRENT_MAX_W+1000; + meas.out_power = HW_HB_OUT_POWER_MAX_W+1000; + meas.out_impedance = HW_HB_OUT_RESISTANCE_MIN_W-50; + meas.low_side_ctrl = 1; + meas.pwm = 0xFF00; + + exp_low = 1; + exp_pwm = 3855; + + exp_hb_fb.analog.sup_voltage = meas.sup_voltage; + exp_hb_fb.analog.sup_current = meas.sup_current; + exp_hb_fb.analog.sup_power = meas.sup_power; + exp_hb_fb.analog.out_voltage = meas.out_voltage; + exp_hb_fb.analog.out_current = meas.out_current; + exp_hb_fb.analog.out_power = meas.out_power; + exp_hb_fb.analog.out_impedance = meas.out_impedance; + exp_hb_fb.analog.low_side_ctrl = meas.low_side_ctrl; + exp_hb_fb.analog.pwm = meas.pwm; + exp_hb_fb.enabled = 1; + exp_hb_fb.warning_act = 1; + exp_hb_fb.fault_act = 0; + exp_hb_fb.fused = 0; + exp_hb_fb.warnings.sup_uvp = 0; + exp_hb_fb.warnings.sup_ovp = 1; + exp_hb_fb.warnings.sup_ocp = 1; + exp_hb_fb.warnings.sup_opp = 1; + exp_hb_fb.warnings.out_ovp = 1; + exp_hb_fb.warnings.out_ocp = 1; + exp_hb_fb.warnings.out_opp = 1; + exp_hb_fb.warnings.out_short = 1; + exp_hb_fb.warnings.out_open = 0; + exp_hb_fb.faults.sup_uvp = 0; + exp_hb_fb.faults.sup_ovp = 0; + exp_hb_fb.faults.sup_ocp = 0; + exp_hb_fb.faults.sup_opp = 0; + exp_hb_fb.faults.out_ovp = 0; + exp_hb_fb.faults.out_ocp = 0; + exp_hb_fb.faults.out_opp = 0; + exp_hb_fb.faults.out_short = 0; + exp_hb_fb.faults.out_open = 0; + + exp_hb_ctrl.enabled = 1; + exp_hb_ctrl.out_faults.sup_uvp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.sup_uvp.w_time = 0; + exp_hb_ctrl.out_faults.sup_uvp.f_time = 0; + exp_hb_ctrl.out_faults.sup_ovp.severity = FAULT_LVL_WARNING; + exp_hb_ctrl.out_faults.sup_ovp.w_time = 0; + exp_hb_ctrl.out_faults.sup_ovp.f_time = 0; + exp_hb_ctrl.out_faults.sup_ocp.severity = FAULT_LVL_WARNING; + exp_hb_ctrl.out_faults.sup_ocp.w_time = 0; + exp_hb_ctrl.out_faults.sup_ocp.f_time = 0; + exp_hb_ctrl.out_faults.sup_opp.severity = FAULT_LVL_WARNING; + exp_hb_ctrl.out_faults.sup_opp.w_time = 0; + exp_hb_ctrl.out_faults.sup_opp.f_time = 0; + exp_hb_ctrl.out_faults.out_ovp.severity = FAULT_LVL_WARNING; + exp_hb_ctrl.out_faults.out_ovp.w_time = 0; + exp_hb_ctrl.out_faults.out_ovp.f_time = 0; + exp_hb_ctrl.out_faults.out_ocp.severity = FAULT_LVL_WARNING; + exp_hb_ctrl.out_faults.out_ocp.w_time = 0; + exp_hb_ctrl.out_faults.out_ocp.f_time = 0; + exp_hb_ctrl.out_faults.out_opp.severity = FAULT_LVL_WARNING; + exp_hb_ctrl.out_faults.out_opp.w_time = 0; + exp_hb_ctrl.out_faults.out_opp.f_time = 0; + exp_hb_ctrl.out_faults.out_short.severity = FAULT_LVL_WARNING; + exp_hb_ctrl.out_faults.out_short.w_time = 0; + exp_hb_ctrl.out_faults.out_short.f_time = 0; + exp_hb_ctrl.out_faults.out_open.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.out_open.w_time = 0; + exp_hb_ctrl.out_faults.out_open.f_time = 0; + exp_hb_ctrl.out_faults_en.sup_uvp = 1; + exp_hb_ctrl.out_faults_en.sup_ovp = 1; + exp_hb_ctrl.out_faults_en.sup_ocp = 1; + exp_hb_ctrl.out_faults_en.sup_opp = 1; + exp_hb_ctrl.out_faults_en.out_ovp = 1; + exp_hb_ctrl.out_faults_en.out_ocp = 1; + exp_hb_ctrl.out_faults_en.out_opp = 1; + exp_hb_ctrl.out_faults_en.out_short = 1; + exp_hb_ctrl.out_faults_en.out_open = 1; + exp_hb_ctrl.out_fuse.state = FUSE_OFF; + exp_hb_ctrl.out_fuse.count = 0; + exp_hb_ctrl.out_fuse.timer = 0; + exp_hb_ctrl.out_fuse_cfg.cooldown_time = 1000; + exp_hb_ctrl.out_fuse_cfg.retry_time = 1000; + + test_res = ut_hb_process(target, &hb_fb, &hb_ctrl, &meas, exp_low, exp_pwm, &exp_hb_fb, &exp_hb_ctrl); + if(!test_res) pass = 0; + + // Warnings 2 + printf("----- Warning 2 ------------------ \n"); + target = 5000; + + hb_fb.analog.sup_voltage = 12000; + hb_fb.analog.sup_current = 100; + hb_fb.analog.sup_power = 1200; + hb_fb.analog.out_voltage = 0; + hb_fb.analog.out_current = 0; + hb_fb.analog.out_power = 0; + hb_fb.analog.out_impedance = 0xFFFF; + hb_fb.analog.low_side_ctrl = 1; + hb_fb.analog.pwm = 0; + hb_fb.enabled = 1; + hb_fb.warning_act = 0; + hb_fb.fault_act = 0; + hb_fb.fused = 0; + hb_fb.warnings.sup_uvp = 0; + hb_fb.warnings.sup_ovp = 0; + hb_fb.warnings.sup_ocp = 0; + hb_fb.warnings.sup_opp = 0; + hb_fb.warnings.out_ovp = 0; + hb_fb.warnings.out_ocp = 0; + hb_fb.warnings.out_opp = 0; + hb_fb.warnings.out_short = 0; + hb_fb.warnings.out_open = 0; + hb_fb.faults.sup_uvp = 0; + hb_fb.faults.sup_ovp = 0; + hb_fb.faults.sup_ocp = 0; + hb_fb.faults.sup_opp = 0; + hb_fb.faults.out_ovp = 0; + hb_fb.faults.out_ocp = 0; + hb_fb.faults.out_opp = 0; + hb_fb.faults.out_short = 0; + hb_fb.faults.out_open = 0; + + hb_ctrl.enabled = 1; + hb_ctrl.out_faults.sup_uvp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.sup_uvp.w_time = 0; + hb_ctrl.out_faults.sup_uvp.f_time = 0; + hb_ctrl.out_faults.sup_ovp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.sup_ovp.w_time = 0; + hb_ctrl.out_faults.sup_ovp.f_time = 0; + hb_ctrl.out_faults.sup_ocp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.sup_ocp.w_time = 0; + hb_ctrl.out_faults.sup_ocp.f_time = 0; + hb_ctrl.out_faults.sup_opp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.sup_opp.w_time = 0; + hb_ctrl.out_faults.sup_opp.f_time = 0; + hb_ctrl.out_faults.out_ovp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_ovp.w_time = 0; + hb_ctrl.out_faults.out_ovp.f_time = 0; + hb_ctrl.out_faults.out_ocp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_ocp.w_time = 0; + hb_ctrl.out_faults.out_ocp.f_time = 0; + hb_ctrl.out_faults.out_opp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_opp.w_time = 0; + hb_ctrl.out_faults.out_opp.f_time = 0; + hb_ctrl.out_faults.out_short.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_short.w_time = 0; + hb_ctrl.out_faults.out_short.f_time = 0; + hb_ctrl.out_faults.out_open.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_open.w_time = 0; + hb_ctrl.out_faults.out_open.f_time = 0; + hb_ctrl.out_faults_en.sup_uvp = 1; + hb_ctrl.out_faults_en.sup_ovp = 1; + hb_ctrl.out_faults_en.sup_ocp = 1; + hb_ctrl.out_faults_en.sup_opp = 1; + hb_ctrl.out_faults_en.out_ovp = 1; + hb_ctrl.out_faults_en.out_ocp = 1; + hb_ctrl.out_faults_en.out_opp = 1; + hb_ctrl.out_faults_en.out_short = 1; + hb_ctrl.out_faults_en.out_open = 1; + hb_ctrl.out_fuse.state = FUSE_OFF; + hb_ctrl.out_fuse.count = 0; + hb_ctrl.out_fuse.timer = 0; + hb_ctrl.out_fuse_cfg.cooldown_time = 1000; + hb_ctrl.out_fuse_cfg.retry_time = 1000; + + meas.sup_voltage = HW_HB_SUPPLY_VOLT_MIN_W-1000; + meas.sup_current = HW_HB_SUPPLY_CURRENT_MAX_W+1000; + meas.sup_power = HW_HB_SUPPLY_POWER_MAX_W+1000; + meas.out_voltage = HW_HB_OUT_VOLTAGE_MAX_W+1000; + meas.out_current = HW_HB_OUT_CURRENT_MAX_W+1000; + meas.out_power = HW_HB_OUT_POWER_MAX_W+1000; + meas.out_impedance = HW_HB_OUT_RESISTANCE_MAX_W+50; + meas.low_side_ctrl = 1; + meas.pwm = 0xFF00; + + exp_low = 1; + exp_pwm = 36408; + + exp_hb_fb.analog.sup_voltage = meas.sup_voltage; + exp_hb_fb.analog.sup_current = meas.sup_current; + exp_hb_fb.analog.sup_power = meas.sup_power; + exp_hb_fb.analog.out_voltage = meas.out_voltage; + exp_hb_fb.analog.out_current = meas.out_current; + exp_hb_fb.analog.out_power = meas.out_power; + exp_hb_fb.analog.out_impedance = meas.out_impedance; + exp_hb_fb.analog.low_side_ctrl = meas.low_side_ctrl; + exp_hb_fb.analog.pwm = meas.pwm; + exp_hb_fb.enabled = 1; + exp_hb_fb.warning_act = 1; + exp_hb_fb.fault_act = 0; + exp_hb_fb.fused = 0; + exp_hb_fb.warnings.sup_uvp = 1; + exp_hb_fb.warnings.sup_ovp = 0; + exp_hb_fb.warnings.sup_ocp = 1; + exp_hb_fb.warnings.sup_opp = 1; + exp_hb_fb.warnings.out_ovp = 1; + exp_hb_fb.warnings.out_ocp = 1; + exp_hb_fb.warnings.out_opp = 1; + exp_hb_fb.warnings.out_short = 0; + exp_hb_fb.warnings.out_open = 1; + exp_hb_fb.faults.sup_uvp = 0; + exp_hb_fb.faults.sup_ovp = 0; + exp_hb_fb.faults.sup_ocp = 0; + exp_hb_fb.faults.sup_opp = 0; + exp_hb_fb.faults.out_ovp = 0; + exp_hb_fb.faults.out_ocp = 0; + exp_hb_fb.faults.out_opp = 0; + exp_hb_fb.faults.out_short = 0; + exp_hb_fb.faults.out_open = 0; + + exp_hb_ctrl.enabled = 1; + exp_hb_ctrl.out_faults.sup_uvp.severity = FAULT_LVL_WARNING; + exp_hb_ctrl.out_faults.sup_uvp.w_time = 0; + exp_hb_ctrl.out_faults.sup_uvp.f_time = 0; + exp_hb_ctrl.out_faults.sup_ovp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.sup_ovp.w_time = 0; + exp_hb_ctrl.out_faults.sup_ovp.f_time = 0; + exp_hb_ctrl.out_faults.sup_ocp.severity = FAULT_LVL_WARNING; + exp_hb_ctrl.out_faults.sup_ocp.w_time = 0; + exp_hb_ctrl.out_faults.sup_ocp.f_time = 0; + exp_hb_ctrl.out_faults.sup_opp.severity = FAULT_LVL_WARNING; + exp_hb_ctrl.out_faults.sup_opp.w_time = 0; + exp_hb_ctrl.out_faults.sup_opp.f_time = 0; + exp_hb_ctrl.out_faults.out_ovp.severity = FAULT_LVL_WARNING; + exp_hb_ctrl.out_faults.out_ovp.w_time = 0; + exp_hb_ctrl.out_faults.out_ovp.f_time = 0; + exp_hb_ctrl.out_faults.out_ocp.severity = FAULT_LVL_WARNING; + exp_hb_ctrl.out_faults.out_ocp.w_time = 0; + exp_hb_ctrl.out_faults.out_ocp.f_time = 0; + exp_hb_ctrl.out_faults.out_opp.severity = FAULT_LVL_WARNING; + exp_hb_ctrl.out_faults.out_opp.w_time = 0; + exp_hb_ctrl.out_faults.out_opp.f_time = 0; + exp_hb_ctrl.out_faults.out_short.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.out_short.w_time = 0; + exp_hb_ctrl.out_faults.out_short.f_time = 0; + exp_hb_ctrl.out_faults.out_open.severity = FAULT_LVL_WARNING; + exp_hb_ctrl.out_faults.out_open.w_time = 0; + exp_hb_ctrl.out_faults.out_open.f_time = 0; + exp_hb_ctrl.out_faults_en.sup_uvp = 1; + exp_hb_ctrl.out_faults_en.sup_ovp = 1; + exp_hb_ctrl.out_faults_en.sup_ocp = 1; + exp_hb_ctrl.out_faults_en.sup_opp = 1; + exp_hb_ctrl.out_faults_en.out_ovp = 1; + exp_hb_ctrl.out_faults_en.out_ocp = 1; + exp_hb_ctrl.out_faults_en.out_opp = 1; + exp_hb_ctrl.out_faults_en.out_short = 1; + exp_hb_ctrl.out_faults_en.out_open = 1; + exp_hb_ctrl.out_fuse.state = FUSE_OFF; + exp_hb_ctrl.out_fuse.count = 0; + exp_hb_ctrl.out_fuse.timer = 0; + exp_hb_ctrl.out_fuse_cfg.cooldown_time = 1000; + exp_hb_ctrl.out_fuse_cfg.retry_time = 1000; + + test_res = ut_hb_process(target, &hb_fb, &hb_ctrl, &meas, exp_low, exp_pwm, &exp_hb_fb, &exp_hb_ctrl); + if(!test_res) pass = 0; + + // Faults 1 + printf("----- Faults 1 first sample ------------------ \n"); + target = 2500; + + hb_fb.analog.sup_voltage = 12000; + hb_fb.analog.sup_current = 100; + hb_fb.analog.sup_power = 1200; + hb_fb.analog.out_voltage = 0; + hb_fb.analog.out_current = 0; + hb_fb.analog.out_power = 0; + hb_fb.analog.out_impedance = 0xFFFF; + hb_fb.analog.low_side_ctrl = 1; + hb_fb.analog.pwm = 0; + hb_fb.enabled = 1; + hb_fb.warning_act = 0; + hb_fb.fault_act = 0; + hb_fb.fused = 0; + hb_fb.warnings.sup_uvp = 0; + hb_fb.warnings.sup_ovp = 0; + hb_fb.warnings.sup_ocp = 0; + hb_fb.warnings.sup_opp = 0; + hb_fb.warnings.out_ovp = 0; + hb_fb.warnings.out_ocp = 0; + hb_fb.warnings.out_opp = 0; + hb_fb.warnings.out_short = 0; + hb_fb.warnings.out_open = 0; + hb_fb.faults.sup_uvp = 0; + hb_fb.faults.sup_ovp = 0; + hb_fb.faults.sup_ocp = 0; + hb_fb.faults.sup_opp = 0; + hb_fb.faults.out_ovp = 0; + hb_fb.faults.out_ocp = 0; + hb_fb.faults.out_opp = 0; + hb_fb.faults.out_short = 0; + hb_fb.faults.out_open = 0; + + hb_ctrl.enabled = 1; + hb_ctrl.out_faults.sup_uvp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.sup_uvp.w_time = 0; + hb_ctrl.out_faults.sup_uvp.f_time = 0; + hb_ctrl.out_faults.sup_ovp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.sup_ovp.w_time = 0; + hb_ctrl.out_faults.sup_ovp.f_time = 0; + hb_ctrl.out_faults.sup_ocp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.sup_ocp.w_time = 0; + hb_ctrl.out_faults.sup_ocp.f_time = 0; + hb_ctrl.out_faults.sup_opp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.sup_opp.w_time = 0; + hb_ctrl.out_faults.sup_opp.f_time = 0; + hb_ctrl.out_faults.out_ovp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_ovp.w_time = 0; + hb_ctrl.out_faults.out_ovp.f_time = 0; + hb_ctrl.out_faults.out_ocp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_ocp.w_time = 0; + hb_ctrl.out_faults.out_ocp.f_time = 0; + hb_ctrl.out_faults.out_opp.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_opp.w_time = 0; + hb_ctrl.out_faults.out_opp.f_time = 0; + hb_ctrl.out_faults.out_short.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_short.w_time = 0; + hb_ctrl.out_faults.out_short.f_time = 0; + hb_ctrl.out_faults.out_open.severity = FAULT_LVL_OK; + hb_ctrl.out_faults.out_open.w_time = 0; + hb_ctrl.out_faults.out_open.f_time = 0; + hb_ctrl.out_faults_en.sup_uvp = 1; + hb_ctrl.out_faults_en.sup_ovp = 1; + hb_ctrl.out_faults_en.sup_ocp = 1; + hb_ctrl.out_faults_en.sup_opp = 1; + hb_ctrl.out_faults_en.out_ovp = 1; + hb_ctrl.out_faults_en.out_ocp = 1; + hb_ctrl.out_faults_en.out_opp = 1; + hb_ctrl.out_faults_en.out_short = 1; + hb_ctrl.out_faults_en.out_open = 1; + hb_ctrl.out_fuse.state = FUSE_OFF; + hb_ctrl.out_fuse.count = 0; + hb_ctrl.out_fuse.timer = 0; + hb_ctrl.out_fuse_cfg.cooldown_time = 1000; + hb_ctrl.out_fuse_cfg.retry_time = 1000; + + meas.sup_voltage = 20000; + meas.sup_current = 10000; + meas.sup_power = 50000; + meas.out_voltage = 12000; + meas.out_current = 10000; + meas.out_power = 50000; + meas.out_impedance = 200; + meas.low_side_ctrl = 1; + meas.pwm = 0xFF00; + + exp_low = 1; + exp_pwm = 8191; + + exp_hb_fb.analog.sup_voltage = meas.sup_voltage; + exp_hb_fb.analog.sup_current = meas.sup_current; + exp_hb_fb.analog.sup_power = meas.sup_power; + exp_hb_fb.analog.out_voltage = meas.out_voltage; + exp_hb_fb.analog.out_current = meas.out_current; + exp_hb_fb.analog.out_power = meas.out_power; + exp_hb_fb.analog.out_impedance = meas.out_impedance; + exp_hb_fb.analog.low_side_ctrl = meas.low_side_ctrl; + exp_hb_fb.analog.pwm = meas.pwm; + exp_hb_fb.enabled = 1; + exp_hb_fb.warning_act = 1; + exp_hb_fb.fault_act = 0; + exp_hb_fb.fused = 0; + exp_hb_fb.warnings.sup_uvp = 0; + exp_hb_fb.warnings.sup_ovp = 1; + exp_hb_fb.warnings.sup_ocp = 1; + exp_hb_fb.warnings.sup_opp = 1; + exp_hb_fb.warnings.out_ovp = 1; + exp_hb_fb.warnings.out_ocp = 1; + exp_hb_fb.warnings.out_opp = 1; + exp_hb_fb.warnings.out_short = 1; + exp_hb_fb.warnings.out_open = 0; + exp_hb_fb.faults.sup_uvp = 0; + exp_hb_fb.faults.sup_ovp = 0; + exp_hb_fb.faults.sup_ocp = 0; + exp_hb_fb.faults.sup_opp = 0; + exp_hb_fb.faults.out_ovp = 0; + exp_hb_fb.faults.out_ocp = 0; + exp_hb_fb.faults.out_opp = 0; + exp_hb_fb.faults.out_short = 0; + exp_hb_fb.faults.out_open = 0; + + exp_hb_ctrl.enabled = 1; + exp_hb_ctrl.out_faults.sup_uvp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.sup_uvp.w_time = 0; + exp_hb_ctrl.out_faults.sup_uvp.f_time = 0; + exp_hb_ctrl.out_faults.sup_ovp.severity = FAULT_LVL_WARNING; + exp_hb_ctrl.out_faults.sup_ovp.w_time = 0; + exp_hb_ctrl.out_faults.sup_ovp.f_time = 0; + exp_hb_ctrl.out_faults.sup_ocp.severity = FAULT_LVL_WARNING; + exp_hb_ctrl.out_faults.sup_ocp.w_time = 0; + exp_hb_ctrl.out_faults.sup_ocp.f_time = 0; + exp_hb_ctrl.out_faults.sup_opp.severity = FAULT_LVL_WARNING; + exp_hb_ctrl.out_faults.sup_opp.w_time = 0; + exp_hb_ctrl.out_faults.sup_opp.f_time = 0; + exp_hb_ctrl.out_faults.out_ovp.severity = FAULT_LVL_WARNING; + exp_hb_ctrl.out_faults.out_ovp.w_time = 0; + exp_hb_ctrl.out_faults.out_ovp.f_time = 0; + exp_hb_ctrl.out_faults.out_ocp.severity = FAULT_LVL_WARNING; + exp_hb_ctrl.out_faults.out_ocp.w_time = 0; + exp_hb_ctrl.out_faults.out_ocp.f_time = 0; + exp_hb_ctrl.out_faults.out_opp.severity = FAULT_LVL_WARNING; + exp_hb_ctrl.out_faults.out_opp.w_time = 0; + exp_hb_ctrl.out_faults.out_opp.f_time = 0; + exp_hb_ctrl.out_faults.out_short.severity = FAULT_LVL_WARNING; + exp_hb_ctrl.out_faults.out_short.w_time = 0; + exp_hb_ctrl.out_faults.out_short.f_time = 0; + exp_hb_ctrl.out_faults.out_open.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.out_open.w_time = 0; + exp_hb_ctrl.out_faults.out_open.f_time = 0; + exp_hb_ctrl.out_faults_en.sup_uvp = 1; + exp_hb_ctrl.out_faults_en.sup_ovp = 1; + exp_hb_ctrl.out_faults_en.sup_ocp = 1; + exp_hb_ctrl.out_faults_en.sup_opp = 1; + exp_hb_ctrl.out_faults_en.out_ovp = 1; + exp_hb_ctrl.out_faults_en.out_ocp = 1; + exp_hb_ctrl.out_faults_en.out_opp = 1; + exp_hb_ctrl.out_faults_en.out_short = 1; + exp_hb_ctrl.out_faults_en.out_open = 1; + exp_hb_ctrl.out_fuse.state = FUSE_OFF; + exp_hb_ctrl.out_fuse.count = 0; + exp_hb_ctrl.out_fuse.timer = 0; + exp_hb_ctrl.out_fuse_cfg.cooldown_time = 1000; + exp_hb_ctrl.out_fuse_cfg.retry_time = 1000; + + test_res = ut_hb_process(target, &hb_fb, &hb_ctrl, &meas, exp_low, exp_pwm, &exp_hb_fb, &exp_hb_ctrl); + if(!test_res) pass = 0; + + // Faults 1 + printf("----- Faults 1 transition sample ------------------ \n"); + target = 2500; + + hb_fb.analog.sup_voltage = 12000; + hb_fb.analog.sup_current = 100; + hb_fb.analog.sup_power = 1200; + hb_fb.analog.out_voltage = 0; + hb_fb.analog.out_current = 0; + hb_fb.analog.out_power = 0; + hb_fb.analog.out_impedance = 0xFFFF; + hb_fb.analog.low_side_ctrl = 1; + hb_fb.analog.pwm = 0; + hb_fb.enabled = 1; + hb_fb.warning_act = 0; + hb_fb.fault_act = 0; + hb_fb.fused = 0; + hb_fb.warnings.sup_uvp = 0; + hb_fb.warnings.sup_ovp = 0; + hb_fb.warnings.sup_ocp = 0; + hb_fb.warnings.sup_opp = 0; + hb_fb.warnings.out_ovp = 0; + hb_fb.warnings.out_ocp = 0; + hb_fb.warnings.out_opp = 0; + hb_fb.warnings.out_short = 0; + hb_fb.warnings.out_open = 0; + hb_fb.faults.sup_uvp = 0; + hb_fb.faults.sup_ovp = 0; + hb_fb.faults.sup_ocp = 0; + hb_fb.faults.sup_opp = 0; + hb_fb.faults.out_ovp = 0; + hb_fb.faults.out_ocp = 0; + hb_fb.faults.out_opp = 0; + hb_fb.faults.out_short = 0; + hb_fb.faults.out_open = 0; + + hb_ctrl.enabled = 1; + hb_ctrl.out_faults.sup_uvp.severity = FAULT_LVL_WARNING; + hb_ctrl.out_faults.sup_uvp.w_time = 499; + hb_ctrl.out_faults.sup_uvp.f_time = 499; + hb_ctrl.out_faults.sup_ovp.severity = FAULT_LVL_WARNING; + hb_ctrl.out_faults.sup_ovp.w_time = 499; + hb_ctrl.out_faults.sup_ovp.f_time = 499; + hb_ctrl.out_faults.sup_ocp.severity = FAULT_LVL_WARNING; + hb_ctrl.out_faults.sup_ocp.w_time = 499; + hb_ctrl.out_faults.sup_ocp.f_time = 499; + hb_ctrl.out_faults.sup_opp.severity = FAULT_LVL_WARNING; + hb_ctrl.out_faults.sup_opp.w_time = 499; + hb_ctrl.out_faults.sup_opp.f_time = 499; + hb_ctrl.out_faults.out_ovp.severity = FAULT_LVL_WARNING; + hb_ctrl.out_faults.out_ovp.w_time = 499; + hb_ctrl.out_faults.out_ovp.f_time = 499; + hb_ctrl.out_faults.out_ocp.severity = FAULT_LVL_WARNING; + hb_ctrl.out_faults.out_ocp.w_time = 499; + hb_ctrl.out_faults.out_ocp.f_time = 499; + hb_ctrl.out_faults.out_opp.severity = FAULT_LVL_WARNING; + hb_ctrl.out_faults.out_opp.w_time = 499; + hb_ctrl.out_faults.out_opp.f_time = 499; + hb_ctrl.out_faults.out_short.severity = FAULT_LVL_WARNING; + hb_ctrl.out_faults.out_short.w_time = 499; + hb_ctrl.out_faults.out_short.f_time = 499; + hb_ctrl.out_faults.out_open.severity = FAULT_LVL_WARNING; + hb_ctrl.out_faults.out_open.w_time = 499; + hb_ctrl.out_faults.out_open.f_time = 499; + hb_ctrl.out_faults_en.sup_uvp = 1; + hb_ctrl.out_faults_en.sup_ovp = 1; + hb_ctrl.out_faults_en.sup_ocp = 1; + hb_ctrl.out_faults_en.sup_opp = 1; + hb_ctrl.out_faults_en.out_ovp = 1; + hb_ctrl.out_faults_en.out_ocp = 1; + hb_ctrl.out_faults_en.out_opp = 1; + hb_ctrl.out_faults_en.out_short = 1; + hb_ctrl.out_faults_en.out_open = 1; + hb_ctrl.out_fuse.state = FUSE_OFF; + hb_ctrl.out_fuse.count = 0; + hb_ctrl.out_fuse.timer = 0; + hb_ctrl.out_fuse_cfg.cooldown_time = 1000; + hb_ctrl.out_fuse_cfg.retry_time = 1000; + + meas.sup_voltage = 20000; + meas.sup_current = 10000; + meas.sup_power = 50000; + meas.out_voltage = 12000; + meas.out_current = 10000; + meas.out_power = 50000; + meas.out_impedance = 200; + meas.low_side_ctrl = 1; + meas.pwm = 0xFF00; + + exp_low = 0; + exp_pwm = 0; + + exp_hb_fb.analog.sup_voltage = meas.sup_voltage; + exp_hb_fb.analog.sup_current = meas.sup_current; + exp_hb_fb.analog.sup_power = meas.sup_power; + exp_hb_fb.analog.out_voltage = meas.out_voltage; + exp_hb_fb.analog.out_current = meas.out_current; + exp_hb_fb.analog.out_power = meas.out_power; + exp_hb_fb.analog.out_impedance = meas.out_impedance; + exp_hb_fb.analog.low_side_ctrl = meas.low_side_ctrl; + exp_hb_fb.analog.pwm = meas.pwm; + exp_hb_fb.enabled = 1; + exp_hb_fb.warning_act = 0; + exp_hb_fb.fault_act = 1; + exp_hb_fb.fused = 1; + exp_hb_fb.warnings.sup_uvp = 0; + exp_hb_fb.warnings.sup_ovp = 0; + exp_hb_fb.warnings.sup_ocp = 0; + exp_hb_fb.warnings.sup_opp = 0; + exp_hb_fb.warnings.out_ovp = 0; + exp_hb_fb.warnings.out_ocp = 0; + exp_hb_fb.warnings.out_opp = 0; + exp_hb_fb.warnings.out_short = 0; + exp_hb_fb.warnings.out_open = 0; + exp_hb_fb.faults.sup_uvp = 0; + exp_hb_fb.faults.sup_ovp = 1; + exp_hb_fb.faults.sup_ocp = 1; + exp_hb_fb.faults.sup_opp = 1; + exp_hb_fb.faults.out_ovp = 1; + exp_hb_fb.faults.out_ocp = 1; + exp_hb_fb.faults.out_opp = 1; + exp_hb_fb.faults.out_short = 1; + exp_hb_fb.faults.out_open = 0; + + exp_hb_ctrl.enabled = 1; + exp_hb_ctrl.out_faults.sup_uvp.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.sup_uvp.w_time = 0; + exp_hb_ctrl.out_faults.sup_uvp.f_time = 0; + exp_hb_ctrl.out_faults.sup_ovp.severity = FAULT_LVL_FAULT; + exp_hb_ctrl.out_faults.sup_ovp.w_time = 500; + exp_hb_ctrl.out_faults.sup_ovp.f_time = 500; + exp_hb_ctrl.out_faults.sup_ocp.severity = FAULT_LVL_FAULT; + exp_hb_ctrl.out_faults.sup_ocp.w_time = 500; + exp_hb_ctrl.out_faults.sup_ocp.f_time = 500; + exp_hb_ctrl.out_faults.sup_opp.severity = FAULT_LVL_FAULT; + exp_hb_ctrl.out_faults.sup_opp.w_time = 500; + exp_hb_ctrl.out_faults.sup_opp.f_time = 500; + exp_hb_ctrl.out_faults.out_ovp.severity = FAULT_LVL_FAULT; + exp_hb_ctrl.out_faults.out_ovp.w_time = 500; + exp_hb_ctrl.out_faults.out_ovp.f_time = 500; + exp_hb_ctrl.out_faults.out_ocp.severity = FAULT_LVL_FAULT; + exp_hb_ctrl.out_faults.out_ocp.w_time = 500; + exp_hb_ctrl.out_faults.out_ocp.f_time = 500; + exp_hb_ctrl.out_faults.out_opp.severity = FAULT_LVL_FAULT; + exp_hb_ctrl.out_faults.out_opp.w_time = 500; + exp_hb_ctrl.out_faults.out_opp.f_time = 500; + exp_hb_ctrl.out_faults.out_short.severity = FAULT_LVL_FAULT; + exp_hb_ctrl.out_faults.out_short.w_time = 500; + exp_hb_ctrl.out_faults.out_short.f_time = 500; + exp_hb_ctrl.out_faults.out_open.severity = FAULT_LVL_OK; + exp_hb_ctrl.out_faults.out_open.w_time = 0; + exp_hb_ctrl.out_faults.out_open.f_time = 0; + exp_hb_ctrl.out_faults_en.sup_uvp = 1; + exp_hb_ctrl.out_faults_en.sup_ovp = 1; + exp_hb_ctrl.out_faults_en.sup_ocp = 1; + exp_hb_ctrl.out_faults_en.sup_opp = 1; + exp_hb_ctrl.out_faults_en.out_ovp = 1; + exp_hb_ctrl.out_faults_en.out_ocp = 1; + exp_hb_ctrl.out_faults_en.out_opp = 1; + exp_hb_ctrl.out_faults_en.out_short = 1; + exp_hb_ctrl.out_faults_en.out_open = 1; + exp_hb_ctrl.out_fuse.state = FUSE_ACTIVE; + exp_hb_ctrl.out_fuse.count = 1; + exp_hb_ctrl.out_fuse.timer = 0; + exp_hb_ctrl.out_fuse_cfg.cooldown_time = 1000; + exp_hb_ctrl.out_fuse_cfg.retry_time = 1000; + + test_res = ut_hb_process(target, &hb_fb, &hb_ctrl, &meas, exp_low, exp_pwm, &exp_hb_fb, &exp_hb_ctrl); + if(!test_res) pass = 0; + + return pass; +} diff --git a/firmware/tests/ut_hw/ut_hb_control.h b/firmware/tests/ut_hw/ut_hb_control.h new file mode 100644 index 0000000..5dbc2d4 --- /dev/null +++ b/firmware/tests/ut_hw/ut_hb_control.h @@ -0,0 +1,15 @@ +#ifndef UT_HW_HB_CONTROL_H_ +#define UT_HW_HB_CONTROL_H_ + +#include +#include + +int ut_hb_is_equal_fb_struct_test(void); +int ut_hb_is_equal_ctrl_struct_test(void); + +int ut_hb_init_test(void); +int ut_hb_enable_test(void); +int ut_hb_disable_test(void); +int ut_hb_process_test(void); + +#endif /* UT_HW_HB_CONTROL_H_ */ diff --git a/firmware/tests/ut_hw/ut_led_display.c b/firmware/tests/ut_hw/ut_led_display.c new file mode 100644 index 0000000..cce012d --- /dev/null +++ b/firmware/tests/ut_hw/ut_led_display.c @@ -0,0 +1,170 @@ +#include "ut_led_display.h" + +#include "..\mock_board\mock_board_odout.h" + +#include "..\..\src\hw\led_display.h" + +static uint8_t NOT_ACCESD_OD_CHANNEL = 255; +static uint8_t NOT_ACCESD_OD_LEVEL = BSP_ODOUT_HIGH; +static uint8_t NOT_ACCESD_PERCENT = 255; + +static int ut_led_dsp_set_image(uint8_t image, uint8_t exp_image) +{ + printf(" Input:%x \n", image); + + // Reset image + mock_board_odout_write_ch(NOT_ACCESD_OD_CHANNEL); + mock_board_odout_write_data(BSP_OD1,NOT_ACCESD_OD_LEVEL); + mock_board_odout_write_data(BSP_OD2,NOT_ACCESD_OD_LEVEL); + mock_board_odout_write_data(BSP_OD3,NOT_ACCESD_OD_LEVEL); + mock_board_odout_write_data(BSP_OD4,NOT_ACCESD_OD_LEVEL); + mock_board_odout_write_data(BSP_OD5,NOT_ACCESD_OD_LEVEL); + mock_board_odout_write_data(BSP_OD6,NOT_ACCESD_OD_LEVEL); + + led_dsp_set_image(image); + + // Read set OD output image + uint8_t i1 = mock_board_odout_read_data(BSP_OD1); + uint8_t i2 = mock_board_odout_read_data(BSP_OD2); + uint8_t i3 = mock_board_odout_read_data(BSP_OD3); + uint8_t i4 = mock_board_odout_read_data(BSP_OD4); + uint8_t i5 = mock_board_odout_read_data(BSP_OD5); + uint8_t i6 = mock_board_odout_read_data(BSP_OD6); + + uint8_t out_image = 0x00; + if(i1==BSP_ODOUT_LOW) out_image |= 0x01; + if(i2==BSP_ODOUT_LOW) out_image |= 0x02; + if(i3==BSP_ODOUT_LOW) out_image |= 0x04; + if(i4==BSP_ODOUT_LOW) out_image |= 0x08; + if(i5==BSP_ODOUT_LOW) out_image |= 0x10; + if(i6==BSP_ODOUT_LOW) out_image |= 0x20; + + printf(" Output:%x \n", out_image); + printf("Expected:%x \n", exp_image); + + if(out_image==exp_image) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_led_dsp_set_image_test(void) +{ + printf("******************************************************\n"); + printf("void led_dsp_set_image(uint8_t image) \n"); + + int test_res; + int pass = 1; + + uint8_t image; + uint8_t exp_image; + + // Normal 1 + image = 0x00; + exp_image = 0x00; + test_res = ut_led_dsp_set_image(image, exp_image); + if(!test_res) pass = 0; + + // Normal 1 + image = 0x3F; + exp_image = 0x3F; + test_res = ut_led_dsp_set_image(image, exp_image); + if(!test_res) pass = 0; + + // Normal 1 + image = 0xAA; + exp_image = 0x2A; + test_res = ut_led_dsp_set_image(image, exp_image); + if(!test_res) pass = 0; + + // Normal 1 + image = 0x55; + exp_image = 0x15; + test_res = ut_led_dsp_set_image(image, exp_image); + if(!test_res) pass = 0; + + return pass; +} + +static int ut_led_dsp_backligth_set(uint8_t percent, uint8_t exp_percent) +{ + printf(" Input:%d \n", percent); + + // Reset image + mock_board_odout_write_pwm(NOT_ACCESD_PERCENT); + + led_dsp_backligth_set(percent); + + // Read set OD output image + uint8_t pwm = mock_board_odout_read_pwm(); + + printf(" Output:%d \n", pwm); + printf("Expected:%d \n", exp_percent); + + if(pwm==exp_percent) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_led_dsp_backligth_set_test(void) +{ + printf("******************************************************\n"); + printf("void led_dsp_backligth_set(uint8_t percent) \n"); + + int test_res; + int pass = 1; + + uint8_t percent; + uint8_t exp_percent; + + // Normal 1 + percent = 0; + exp_percent = 0; + test_res = ut_led_dsp_backligth_set(percent, exp_percent); + if(!test_res) pass = 0; + + // Normal 1 + percent = 25; + exp_percent = 25; + test_res = ut_led_dsp_backligth_set(percent, exp_percent); + if(!test_res) pass = 0; + + // Normal 1 + percent = 50; + exp_percent = 50; + test_res = ut_led_dsp_backligth_set(percent, exp_percent); + if(!test_res) pass = 0; + + // Normal 1 + percent = 75; + exp_percent = 75; + test_res = ut_led_dsp_backligth_set(percent, exp_percent); + if(!test_res) pass = 0; + + // Normal 1 + percent = 100; + exp_percent = 100; + test_res = ut_led_dsp_backligth_set(percent, exp_percent); + if(!test_res) pass = 0; + + // Normal 1 + percent = 200; + exp_percent = 200; + test_res = ut_led_dsp_backligth_set(percent, exp_percent); + if(!test_res) pass = 0; + + return pass; +} diff --git a/firmware/tests/ut_hw/ut_led_display.h b/firmware/tests/ut_hw/ut_led_display.h new file mode 100644 index 0000000..0f345c8 --- /dev/null +++ b/firmware/tests/ut_hw/ut_led_display.h @@ -0,0 +1,10 @@ +#ifndef UT_HW_LED_DISPLAY_H_ +#define UT_HW_LED_DISPLAY_H_ + +#include +#include + +int ut_led_dsp_set_image_test(void); +int ut_led_dsp_backligth_set_test(void); + +#endif /* UT_HW_LED_DISPLAY_H_ */ diff --git a/firmware/tests/ut_hw/ut_startup.c b/firmware/tests/ut_hw/ut_startup.c new file mode 100644 index 0000000..81ad1f8 --- /dev/null +++ b/firmware/tests/ut_hw/ut_startup.c @@ -0,0 +1,48 @@ +#include "ut_startup.h" + +#include "..\mock_board\mock_board_setup.h" + +#include "..\..\src\hw\startup.h" + +static int ut_hw_startup(uint8_t exp_called) +{ + printf(" Input: \n"); + + mock_board_setup_reset_called(); + + hw_startup(); + + uint8_t called = mock_board_setup_read_called(); + + printf(" Output: Called:%d \n", called); + printf("Expected: Called:%d \n", exp_called); + + if(called==exp_called) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_hw_startup_test(void) +{ + printf("******************************************************\n"); + printf("void hw_startup(void) \n"); + + int test_res; + int pass = 1; + + uint8_t exp_called; + + // Normal 1 + exp_called = 1; + test_res = ut_hw_startup(exp_called); + if(!test_res) pass = 0; + + return pass; +} diff --git a/firmware/tests/ut_hw/ut_startup.h b/firmware/tests/ut_hw/ut_startup.h new file mode 100644 index 0000000..27e45af --- /dev/null +++ b/firmware/tests/ut_hw/ut_startup.h @@ -0,0 +1,9 @@ +#ifndef UT_HW_STARTUP_H_ +#define UT_HW_STARTUP_H_ + +#include +#include + +int ut_hw_startup_test(void); + +#endif /* UT_HW_STARTUP_H_ */ diff --git a/firmware/tests/ut_logic/ut_coil.c b/firmware/tests/ut_logic/ut_coil.c new file mode 100644 index 0000000..cc47e1f --- /dev/null +++ b/firmware/tests/ut_logic/ut_coil.c @@ -0,0 +1,86 @@ +#include "ut_coil.h" +#include "..\..\src\logic\coil.h" + +static int ut_coil_target(uint8_t force, uint8_t hbrake_act, int16_t exp_out) +{ + int16_t out = coil_target(force, hbrake_act); + + printf("Force:%d Handbrake:%d \n", force, hbrake_act); + printf("Output:%d Expected:%d\n", out, exp_out); + + if(out==exp_out) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_coil_target_test(void) +{ + printf("******************************************************\n"); + printf("int16_t coil_target(uint8_t force, uint8_t hbrake_act)\n"); + + int test_res; + int pass = 1; + + uint8_t force; + uint8_t hbrake; + + int16_t exp_out; + + force = 0; + hbrake = 0; + exp_out = 0; + test_res = ut_coil_target(force, hbrake, exp_out); + if(!test_res) pass = 0; + + force = 50; + hbrake = 0; + exp_out = COIL_LOCK_VOLTAGE/2; + test_res = ut_coil_target(force, hbrake, exp_out); + if(!test_res) pass = 0; + + force = 100; + hbrake = 0; + exp_out = COIL_LOCK_VOLTAGE; + test_res = ut_coil_target(force, hbrake, exp_out); + if(!test_res) pass = 0; + + force = 255; + hbrake = 0; + exp_out = COIL_LOCK_VOLTAGE; + test_res = ut_coil_target(force, hbrake, exp_out); + if(!test_res) pass = 0; + + force = 0; + hbrake = 1; + exp_out = COIL_TARGET_HANDBRAKE; + test_res = ut_coil_target(force, hbrake, exp_out); + if(!test_res) pass = 0; + + force = 50; + hbrake = 1; + exp_out = COIL_TARGET_HANDBRAKE; + test_res = ut_coil_target(force, hbrake, exp_out); + if(!test_res) pass = 0; + + force = 100; + hbrake = 1; + exp_out = COIL_TARGET_HANDBRAKE; + test_res = ut_coil_target(force, hbrake, exp_out); + if(!test_res) pass = 0; + + force = 255; + hbrake = 1; + exp_out = COIL_TARGET_HANDBRAKE; + test_res = ut_coil_target(force, hbrake, exp_out); + if(!test_res) pass = 0; + + return pass; +} + diff --git a/firmware/tests/ut_logic/ut_coil.h b/firmware/tests/ut_logic/ut_coil.h new file mode 100644 index 0000000..c2109a6 --- /dev/null +++ b/firmware/tests/ut_logic/ut_coil.h @@ -0,0 +1,9 @@ +#ifndef UT_COIL_H_ +#define UT_COIL_H_ + +#include +#include + +int ut_coil_target_test(void); + +#endif /* UT_COIL_H_ */ diff --git a/firmware/tests/ut_logic/ut_display.c b/firmware/tests/ut_logic/ut_display.c new file mode 100644 index 0000000..7bf489e --- /dev/null +++ b/firmware/tests/ut_logic/ut_display.c @@ -0,0 +1,552 @@ +#include "ut_display.h" +#include "..\..\src\logic\display.h" + +static const uint8_t BACKLIGHT_DIMM = DSP_BACKLIGHT_DIMM_PERCENT; +static const uint8_t BACKLIGHT_BRIGTH = DSP_BACKLIGHT_BRIGTH_PERCENT; + +static int ut_dsp_init_ctrl(dsp_ctrl_t* ctrl, dsp_ctrl_t* exp_ctrl) +{ + printf(" Input: lock:%d act-image:%x \n", ctrl->img_lock, ctrl->act_img); + + dsp_init_ctrl(ctrl); + + printf(" Output: lock:%d act-image:%x \n", ctrl->img_lock, ctrl->act_img); + printf("Expected: lock:%d act-image:%x \n", exp_ctrl->img_lock, exp_ctrl->act_img); + + if((ctrl->img_lock==exp_ctrl->img_lock)&&(ctrl->act_img==exp_ctrl->act_img)) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_dsp_init_ctrl_test(void) +{ + printf("******************************************************\n"); + printf("void dsp_init_ctrl(dsp_ctrl_t* ctrl) \n"); + + int test_res; + int pass = 1; + + dsp_ctrl_t ctrl; + dsp_ctrl_t exp_ctrl; + + ctrl.img_lock = 0; + ctrl.act_img = 0; + exp_ctrl.img_lock = 0; + exp_ctrl.act_img = 0x00; + test_res = ut_dsp_init_ctrl(&ctrl, &exp_ctrl); + if(!test_res) pass = 0; + + ctrl.img_lock = 1; + ctrl.act_img = 0xAA; + exp_ctrl.img_lock = 0; + exp_ctrl.act_img = 0x00; + test_res = ut_dsp_init_ctrl(&ctrl, &exp_ctrl); + if(!test_res) pass = 0; + + return pass; +} + +static int ut_dsp_set_lock(dsp_ctrl_t* ctrl, dsp_ctrl_t* exp_ctrl) +{ + printf(" Input: lock:%d act-image:%x \n", ctrl->img_lock, ctrl->act_img); + + dsp_set_lock(ctrl); + + printf(" Output: lock:%d act-image:%x \n", ctrl->img_lock, ctrl->act_img); + printf("Expected: lock:%d act-image:%x \n", exp_ctrl->img_lock, exp_ctrl->act_img); + + if((ctrl->img_lock==exp_ctrl->img_lock)&&(ctrl->act_img==exp_ctrl->act_img)) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_dsp_set_lock_test(void) +{ + printf("******************************************************\n"); + printf("void dsp_set_lock(dsp_ctrl_t* ctrl)\n"); + + int test_res; + int pass = 1; + + dsp_ctrl_t ctrl; + dsp_ctrl_t exp_ctrl; + + ctrl.img_lock = 0; + ctrl.act_img = 0x18; + exp_ctrl.img_lock = 1; + exp_ctrl.act_img = 0x18; + test_res = ut_dsp_set_lock(&ctrl, &exp_ctrl); + if(!test_res) pass = 0; + + ctrl.img_lock = 1; + ctrl.act_img = 0x3F; + exp_ctrl.img_lock = 1; + exp_ctrl.act_img = 0x3F; + test_res = ut_dsp_set_lock(&ctrl, &exp_ctrl); + if(!test_res) pass = 0; + + return pass; +} + +static int ut_dsp_reset_lock(dsp_ctrl_t* ctrl, dsp_ctrl_t* exp_ctrl) +{ + printf(" Input: lock:%d act-image:%x \n", ctrl->img_lock, ctrl->act_img); + + dsp_reset_lock(ctrl); + + printf(" Output: lock:%d act-image:%x \n", ctrl->img_lock, ctrl->act_img); + printf("Expected: lock:%d act-image:%x \n", exp_ctrl->img_lock, exp_ctrl->act_img); + + if((ctrl->img_lock==exp_ctrl->img_lock)&&(ctrl->act_img==exp_ctrl->act_img)) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_dsp_reset_lock_test(void) +{ + printf("******************************************************\n"); + printf("void dsp_reset_lock(dsp_ctrl_t* ctrl)\n"); + + int test_res; + int pass = 1; + + dsp_ctrl_t ctrl; + dsp_ctrl_t exp_ctrl; + + ctrl.img_lock = 0; + ctrl.act_img = 0x18; + exp_ctrl.img_lock = 0; + exp_ctrl.act_img = 0x18; + test_res = ut_dsp_reset_lock(&ctrl, &exp_ctrl); + if(!test_res) pass = 0; + + ctrl.img_lock = 1; + ctrl.act_img = 0x18; + exp_ctrl.img_lock = 0; + exp_ctrl.act_img = 0x18; + test_res = ut_dsp_reset_lock(&ctrl, &exp_ctrl); + if(!test_res) pass = 0; + + return pass; +} + +static int ut_dsp_img_percent(uint8_t value, dsp_style_t style, dsp_ctrl_t* ctrl, uint8_t exp_out, dsp_ctrl_t* exp_ctrl) +{ + printf(" Input: Percent:%d Style:%d lock:%d act-image:%x \n", value, style, ctrl->img_lock, ctrl->act_img); + + uint8_t out = dsp_img_percent(value, style, ctrl); + + printf(" Output: image:%x lock:%d act-image:%x \n", out, ctrl->img_lock, ctrl->act_img); + printf("Expected: image:%x lock:%d act-image:%x \n", exp_out, exp_ctrl->img_lock, exp_ctrl->act_img); + + if((out==exp_out)&&(ctrl->img_lock==exp_ctrl->img_lock)&&(ctrl->act_img==exp_ctrl->act_img)) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_dsp_img_percent_test(void) +{ + printf("******************************************************\n"); + printf("uint8_t dsp_img_percent(uint8_t value, dsp_style_t style, dsp_ctrl_t* ctrl)\n"); + + int test_res; + int pass = 1; + + uint8_t value; + dsp_style_t style; + dsp_ctrl_t ctrl; + uint8_t exp_out; + dsp_ctrl_t exp_ctrl; + + // Test lock + value = 50; + style = LED_DSP_BAR; + ctrl.img_lock = 1; + ctrl.act_img = 0x2A; + exp_out = 0x2A; + exp_ctrl.img_lock = ctrl.img_lock; + exp_ctrl.act_img = exp_out; + test_res = ut_dsp_img_percent(value, style, &ctrl, exp_out, &exp_ctrl); + if(!test_res) pass = 0; + + // Test styles + value = 50; + style = LED_DSP_BAR; + ctrl.img_lock = 0; + ctrl.act_img = 0x00; + exp_out = 0x07; + exp_ctrl.img_lock = ctrl.img_lock; + exp_ctrl.act_img = exp_out; + test_res = ut_dsp_img_percent(value, style, &ctrl, exp_out, &exp_ctrl); + if(!test_res) pass = 0; + + // Test styles + value = 50; + style = LED_DSP_DOT20; + ctrl.img_lock = 0; + ctrl.act_img = 0x00; + exp_out = 0x04; + exp_ctrl.img_lock = ctrl.img_lock; + exp_ctrl.act_img = exp_out; + test_res = ut_dsp_img_percent(value, style, &ctrl, exp_out, &exp_ctrl); + if(!test_res) pass = 0; + + // Test styles + value = 50; + style = LED_DSP_DOT10; + ctrl.img_lock = 0; + ctrl.act_img = 0x00; + exp_out = 0x0C; + exp_ctrl.img_lock = ctrl.img_lock; + exp_ctrl.act_img = exp_out; + test_res = ut_dsp_img_percent(value, style, &ctrl, exp_out, &exp_ctrl); + if(!test_res) pass = 0; + + // Test values + value = 0; + style = LED_DSP_DOT10; + ctrl.img_lock = 0; + ctrl.act_img = 0x00; + exp_out = 0x01; + exp_ctrl.img_lock = ctrl.img_lock; + exp_ctrl.act_img = exp_out; + test_res = ut_dsp_img_percent(value, style, &ctrl, exp_out, &exp_ctrl); + if(!test_res) pass = 0; + + // Test values + value = 10; + style = LED_DSP_DOT10; + ctrl.img_lock = 0; + ctrl.act_img = 0x00; + exp_out = 0x03; + exp_ctrl.img_lock = ctrl.img_lock; + exp_ctrl.act_img = exp_out; + test_res = ut_dsp_img_percent(value, style, &ctrl, exp_out, &exp_ctrl); + if(!test_res) pass = 0; + + // Test values + value = 20; + style = LED_DSP_DOT10; + ctrl.img_lock = 0; + ctrl.act_img = 0x00; + exp_out = 0x02; + exp_ctrl.img_lock = ctrl.img_lock; + exp_ctrl.act_img = exp_out; + test_res = ut_dsp_img_percent(value, style, &ctrl, exp_out, &exp_ctrl); + if(!test_res) pass = 0; + + // Test values + value = 30; + style = LED_DSP_DOT10; + ctrl.img_lock = 0; + ctrl.act_img = 0x00; + exp_out = 0x06; + exp_ctrl.img_lock = ctrl.img_lock; + exp_ctrl.act_img = exp_out; + test_res = ut_dsp_img_percent(value, style, &ctrl, exp_out, &exp_ctrl); + if(!test_res) pass = 0; + + // Test values + value = 40; + style = LED_DSP_DOT10; + ctrl.img_lock = 0; + ctrl.act_img = 0x00; + exp_out = 0x04; + exp_ctrl.img_lock = ctrl.img_lock; + exp_ctrl.act_img = exp_out; + test_res = ut_dsp_img_percent(value, style, &ctrl, exp_out, &exp_ctrl); + if(!test_res) pass = 0; + + // Test values + value = 50; + style = LED_DSP_DOT10; + ctrl.img_lock = 0; + ctrl.act_img = 0x00; + exp_out = 0x0C; + exp_ctrl.img_lock = ctrl.img_lock; + exp_ctrl.act_img = exp_out; + test_res = ut_dsp_img_percent(value, style, &ctrl, exp_out, &exp_ctrl); + if(!test_res) pass = 0; + + // Test values + value = 60; + style = LED_DSP_DOT10; + ctrl.img_lock = 0; + ctrl.act_img = 0x00; + exp_out = 0x08; + exp_ctrl.img_lock = ctrl.img_lock; + exp_ctrl.act_img = exp_out; + test_res = ut_dsp_img_percent(value, style, &ctrl, exp_out, &exp_ctrl); + if(!test_res) pass = 0; + + // Test values + value = 80; + style = LED_DSP_DOT10; + ctrl.img_lock = 0; + ctrl.act_img = 0x00; + exp_out = 0x10; + exp_ctrl.img_lock = ctrl.img_lock; + exp_ctrl.act_img = exp_out; + test_res = ut_dsp_img_percent(value, style, &ctrl, exp_out, &exp_ctrl); + if(!test_res) pass = 0; + + // Test values + value = 90; + style = LED_DSP_DOT10; + ctrl.img_lock = 0; + ctrl.act_img = 0x00; + exp_out = 0x30; + exp_ctrl.img_lock = ctrl.img_lock; + exp_ctrl.act_img = exp_out; + test_res = ut_dsp_img_percent(value, style, &ctrl, exp_out, &exp_ctrl); + if(!test_res) pass = 0; + + // Test values + value = 110; + style = LED_DSP_DOT10; + ctrl.img_lock = 0; + ctrl.act_img = 0x00; + exp_out = 0x20; + exp_ctrl.img_lock = ctrl.img_lock; + exp_ctrl.act_img = exp_out; + test_res = ut_dsp_img_percent(value, style, &ctrl, exp_out, &exp_ctrl); + if(!test_res) pass = 0; + + return pass; +} + +static int ut_dsp_img_raw(uint8_t image, dsp_ctrl_t* ctrl, uint8_t exp_out, dsp_ctrl_t* exp_ctrl) +{ + printf(" Input: Image:%x lock:%d act-image:%x \n", image, ctrl->img_lock, ctrl->act_img); + + uint8_t out = dsp_img_raw(image, ctrl); + + printf(" Output: image:%x lock:%d act-image:%x \n", out, ctrl->img_lock, ctrl->act_img); + printf("Expected: image:%x lock:%d act-image:%x \n", exp_out, exp_ctrl->img_lock, exp_ctrl->act_img); + + if((out==exp_out)&&(ctrl->img_lock==exp_ctrl->img_lock)&&(ctrl->act_img==exp_ctrl->act_img)) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_dsp_img_raw_test(void) +{ + printf("******************************************************\n"); + printf("uint8_t dsp_img_raw(int8_t image, dsp_ctrl_t* ctrl)\n"); + + int test_res; + int pass = 1; + + uint8_t image; + dsp_ctrl_t ctrl; + uint8_t exp_out; + dsp_ctrl_t exp_ctrl; + + // Test lock + image = 0x17; + ctrl.img_lock = 1; + ctrl.act_img = 0x2A; + exp_out = 0x2A; + exp_ctrl.img_lock = ctrl.img_lock; + exp_ctrl.act_img = exp_out; + test_res = ut_dsp_img_raw(image, &ctrl, exp_out, &exp_ctrl); + if(!test_res) pass = 0; + + // Test normal + image = 0x17; + ctrl.img_lock = 0; + ctrl.act_img = 0x00; + exp_out = 0x17; + exp_ctrl.img_lock = ctrl.img_lock; + exp_ctrl.act_img = exp_out; + test_res = ut_dsp_img_raw(image, &ctrl, exp_out, &exp_ctrl); + if(!test_res) pass = 0; + + // Test limit + image = 0xAA; + ctrl.img_lock = 0; + ctrl.act_img = 0x00; + exp_out = 0x2A; + exp_ctrl.img_lock = ctrl.img_lock; + exp_ctrl.act_img = exp_out; + test_res = ut_dsp_img_raw(image, &ctrl, exp_out, &exp_ctrl); + if(!test_res) pass = 0; + + // Test limit + image = 0xCC; + ctrl.img_lock = 0; + ctrl.act_img = 0x00; + exp_out = 0x0C; + exp_ctrl.img_lock = ctrl.img_lock; + exp_ctrl.act_img = exp_out; + test_res = ut_dsp_img_raw(image, &ctrl, exp_out, &exp_ctrl); + if(!test_res) pass = 0; + + return pass; +} + +static int ut_dsp_get_act_img(dsp_ctrl_t* ctrl, uint8_t exp_out, dsp_ctrl_t* exp_ctrl) +{ + printf(" Input: lock:%d act-image:%x \n", ctrl->img_lock, ctrl->act_img); + + uint8_t out = dsp_get_act_img(ctrl); + + printf(" Output: image:%x lock:%d act-image:%x \n", out, ctrl->img_lock, ctrl->act_img); + printf("Expected: image:%x lock:%d act-image:%x \n", exp_out, exp_ctrl->img_lock, exp_ctrl->act_img); + + if((out==exp_out)&&(ctrl->img_lock==exp_ctrl->img_lock)&&(ctrl->act_img==exp_ctrl->act_img)) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_dsp_get_act_img_test(void) +{ + printf("******************************************************\n"); + printf("uint8_t dsp_get_act_img(void)\n"); + + int test_res; + int pass = 1; + + dsp_ctrl_t ctrl; + uint8_t exp_out; + dsp_ctrl_t exp_ctrl; + + // Test + ctrl.img_lock = 0; + ctrl.act_img = 0x2A; + exp_out = 0x2A; + exp_ctrl.img_lock = ctrl.img_lock; + exp_ctrl.act_img = exp_out; + test_res = ut_dsp_get_act_img(&ctrl, exp_out, &exp_ctrl); + if(!test_res) pass = 0; + + // Test + ctrl.img_lock = 1; + ctrl.act_img = 0x3F; + exp_out = 0x3F; + exp_ctrl.img_lock = ctrl.img_lock; + exp_ctrl.act_img = exp_out; + test_res = ut_dsp_get_act_img(&ctrl, exp_out, &exp_ctrl); + if(!test_res) pass = 0; + + return pass; +} + +static int ut_dsp_backlight(uint8_t dimm_act, dsp_ctrl_t* ctrl, uint8_t exp_out, dsp_ctrl_t* exp_ctrl) +{ + printf(" Input: dimm-act:%d lock:%d act-image:%x \n", dimm_act, ctrl->img_lock, ctrl->act_img); + + uint8_t out = dsp_backlight(dimm_act); + + printf(" Output: percent:%x lock:%d act-image:%x \n", out, ctrl->img_lock, ctrl->act_img); + printf("Expected: percent:%x lock:%d act-image:%x \n", exp_out, exp_ctrl->img_lock, exp_ctrl->act_img); + + if((out==exp_out)&&(ctrl->img_lock==exp_ctrl->img_lock)&&(ctrl->act_img==exp_ctrl->act_img)) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_dsp_backlight_test(void) +{ + printf("******************************************************\n"); + printf("uint8_t dsp_backlight(uint8_t dimm_act)\n"); + + int test_res; + int pass = 1; + + uint8_t dimm_act; + dsp_ctrl_t ctrl; + uint8_t exp_out; + dsp_ctrl_t exp_ctrl; + + // Test + dimm_act = 0; + ctrl.img_lock = 0; + ctrl.act_img = 0x2A; + exp_out = DSP_BACKLIGHT_BRIGTH_PERCENT; + exp_ctrl.img_lock = ctrl.img_lock; + exp_ctrl.act_img = ctrl.act_img; + test_res = ut_dsp_backlight(dimm_act, &ctrl, exp_out, &exp_ctrl); + if(!test_res) pass = 0; + + // Test + dimm_act = 1; + ctrl.img_lock = 0; + ctrl.act_img = 0x2A; + exp_out = DSP_BACKLIGHT_DIMM_PERCENT; + exp_ctrl.img_lock = ctrl.img_lock; + exp_ctrl.act_img = ctrl.act_img; + test_res = ut_dsp_backlight(dimm_act, &ctrl, exp_out, &exp_ctrl); + if(!test_res) pass = 0; + + // Test lock ignore + dimm_act = 0; + ctrl.img_lock = 1; + ctrl.act_img = 0x2A; + exp_out = DSP_BACKLIGHT_BRIGTH_PERCENT; + exp_ctrl.img_lock = ctrl.img_lock; + exp_ctrl.act_img = ctrl.act_img; + test_res = ut_dsp_backlight(dimm_act, &ctrl, exp_out, &exp_ctrl); + if(!test_res) pass = 0; + + // Test lock ignore + dimm_act = 1; + ctrl.img_lock = 1; + ctrl.act_img = 0x2A; + exp_out = DSP_BACKLIGHT_DIMM_PERCENT; + exp_ctrl.img_lock = ctrl.img_lock; + exp_ctrl.act_img = ctrl.act_img; + test_res = ut_dsp_backlight(dimm_act, &ctrl, exp_out, &exp_ctrl); + if(!test_res) pass = 0; + + return pass; +} diff --git a/firmware/tests/ut_logic/ut_display.h b/firmware/tests/ut_logic/ut_display.h new file mode 100644 index 0000000..d085252 --- /dev/null +++ b/firmware/tests/ut_logic/ut_display.h @@ -0,0 +1,19 @@ +#ifndef UT_DISPLAY_H_ +#define UT_DISPLAY_H_ + +#include +#include +int ut_dsp_init_ctrl_test(void); + +int ut_dsp_set_lock_test(void); +int ut_dsp_reset_lock_test(void); + +int ut_dsp_img_percent_test(void); + +int ut_dsp_img_raw_test(void); + +int ut_dsp_get_act_img_test(void); + +int ut_dsp_backlight_test(void); + +#endif /* UT_DISPLAY_H_ */ diff --git a/firmware/tests/ut_logic/ut_force.c b/firmware/tests/ut_logic/ut_force.c new file mode 100644 index 0000000..5820e58 --- /dev/null +++ b/firmware/tests/ut_logic/ut_force.c @@ -0,0 +1,170 @@ +#include "ut_force.h" +#include "..\..\src\logic\force.h" + +static int ut_force_cycle_bmode(fbrake_mode_t bmode, fbrake_mode_t exp_out) +{ + fbrake_mode_t out = force_cycle_bmode(bmode); + + printf("Brake mode:%d\n", bmode); + printf("Output:%d Expected:%d\n", out, exp_out); + + if(out==exp_out) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_force_cycle_bmode_test(void) +{ + printf("******************************************************\n"); + printf("fbrake_mode_t force_cycle_bmode(fbrake_mode_t bmode)\n"); + + int test_res; + int pass = 1; + + fbrake_mode_t bmode; + + fbrake_mode_t exp_out; + + bmode = FORCE_BMODE_OPEN; + exp_out = FORCE_BMODE_KEEP; + test_res = ut_force_cycle_bmode(bmode,exp_out); + if(!test_res) pass = 0; + + bmode = FORCE_BMODE_KEEP; + exp_out = FORCE_BMODE_LOCK; + test_res = ut_force_cycle_bmode(bmode,exp_out); + if(!test_res) pass = 0; + + bmode = FORCE_BMODE_LOCK; + exp_out = FORCE_BMODE_OPEN; + test_res = ut_force_cycle_bmode(bmode,exp_out); + if(!test_res) pass = 0; + + return pass; +} + +static int ut_force_next(uint8_t handbrake, uint8_t brakes, fbrake_mode_t bmode, uint8_t user_force, uint16_t hbarke_act_time, uint8_t exp_out) +{ + uint8_t out = force_next(handbrake, brakes, bmode, user_force, hbarke_act_time); + + printf("Handbrake:%d Brakes:%d Brake-Mode:%d User-Force:%d Handbrake-time:%d\n", handbrake, brakes, bmode, user_force, hbarke_act_time); + printf("Output:%d Expected:%d\n", out, exp_out); + + if(out==exp_out) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_force_next_test(void) +{ + printf("******************************************************\n"); + printf("uint8_t force_next(uint8_t handbrake, uint8_t brakes, fbrake_mode_t bmode, uint8_t user_force, uint16_t hbarke_act_time)\n"); + + int test_res; + int pass = 1; + + uint8_t handbrake; + uint8_t brakes; + fbrake_mode_t bmode; + uint8_t user_force; + uint16_t hbarke_act_time; + + uint8_t exp_out; + + handbrake = 0; + brakes = 0; + bmode = FORCE_BMODE_OPEN; + user_force = 0; + hbarke_act_time = 0; + exp_out = 0; + test_res = ut_force_next(handbrake, brakes, bmode, user_force, hbarke_act_time, exp_out); + if(!test_res) pass = 0; + + handbrake = 0; + brakes = 0; + bmode = FORCE_BMODE_OPEN; + user_force = 99; + hbarke_act_time = 0; + exp_out = 99; + test_res = ut_force_next(handbrake, brakes, bmode, user_force, hbarke_act_time, exp_out); + if(!test_res) pass = 0; + + handbrake = 0; + brakes = 1; + bmode = FORCE_BMODE_OPEN; + user_force = 99; + hbarke_act_time = 0; + exp_out = 0; + test_res = ut_force_next(handbrake, brakes, bmode, user_force, hbarke_act_time, exp_out); + if(!test_res) pass = 0; + + handbrake = 0; + brakes = 1; + bmode = FORCE_BMODE_KEEP; + user_force = 99; + hbarke_act_time = 0; + exp_out = 99; + test_res = ut_force_next(handbrake, brakes, bmode, user_force, hbarke_act_time, exp_out); + if(!test_res) pass = 0; + + handbrake = 0; + brakes = 1; + bmode = FORCE_BMODE_LOCK; + user_force = 99; + hbarke_act_time = 0; + exp_out = 100; + test_res = ut_force_next(handbrake, brakes, bmode, user_force, hbarke_act_time, exp_out); + if(!test_res) pass = 0; + + handbrake = 1; + brakes = 1; + bmode = FORCE_BMODE_LOCK; + user_force = 99; + hbarke_act_time = 0; + exp_out = 0; + test_res = ut_force_next(handbrake, brakes, bmode, user_force, hbarke_act_time, exp_out); + if(!test_res) pass = 0; + + handbrake = 1; + brakes = 1; + bmode = FORCE_BMODE_LOCK; + user_force = 99; + hbarke_act_time = FORCE_MAX_HBRAKE_HOLD_TIME-1; + exp_out = 0; + test_res = ut_force_next(handbrake, brakes, bmode, user_force, hbarke_act_time, exp_out); + if(!test_res) pass = 0; + + handbrake = 1; + brakes = 1; + bmode = FORCE_BMODE_LOCK; + user_force = 99; + hbarke_act_time = FORCE_MAX_HBRAKE_HOLD_TIME; + exp_out = 100; + test_res = ut_force_next(handbrake, brakes, bmode, user_force, hbarke_act_time, exp_out); + if(!test_res) pass = 0; + + handbrake = 1; + brakes = 1; + bmode = FORCE_BMODE_LOCK; + user_force = 99; + hbarke_act_time = FORCE_MAX_HBRAKE_HOLD_TIME+1; + exp_out = 100; + test_res = ut_force_next(handbrake, brakes, bmode, user_force, hbarke_act_time, exp_out); + if(!test_res) pass = 0; + + return pass; +} diff --git a/firmware/tests/ut_logic/ut_force.h b/firmware/tests/ut_logic/ut_force.h new file mode 100644 index 0000000..e971dd5 --- /dev/null +++ b/firmware/tests/ut_logic/ut_force.h @@ -0,0 +1,10 @@ +#ifndef UT_FORCE_H_ +#define UT_FORCE_H_ + +#include +#include + +int ut_force_cycle_bmode_test(void); +int ut_force_next_test(void); + +#endif /* UT_FORCE_H_ */ diff --git a/firmware/tests/ut_logic/ut_pot.c b/firmware/tests/ut_logic/ut_pot.c new file mode 100644 index 0000000..200cbb9 --- /dev/null +++ b/firmware/tests/ut_logic/ut_pot.c @@ -0,0 +1,100 @@ +#include "ut_pot.h" +#include "..\..\src\logic\pot.h" + +static int ut_pot_mv_to_percent(uint16_t value, pot_cfg_t* cfg, uint8_t exp_out) +{ + uint8_t out = pot_mv_to_percent(value, cfg); + + printf("Value:%d Reference:%d Deadband:%d \n", value, cfg->reference, cfg->deadband); + printf("Output:%d Expected:%d\n", out, exp_out); + + if(out==exp_out) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_pot_mv_to_percent_test(void) +{ + printf("******************************************************\n"); + printf("uint8_t pot_mv_to_percent(uint16_t value, pot_cfg_t* cfg)\n"); + + int test_res; + int pass = 1; + + uint16_t value; + pot_cfg_t cfg; + + uint8_t exp_out; + + value = 0; + cfg.deadband = 500; + cfg.reference = 5000; + exp_out = 0; + test_res = ut_pot_mv_to_percent(value, &cfg, exp_out); + if(!test_res) pass = 0; + + value = 499; + cfg.deadband = 500; + cfg.reference = 5000; + exp_out = 0; + test_res = ut_pot_mv_to_percent(value, &cfg, exp_out); + if(!test_res) pass = 0; + + value = 500; + cfg.deadband = 500; + cfg.reference = 5000; + exp_out = 0; + test_res = ut_pot_mv_to_percent(value, &cfg, exp_out); + if(!test_res) pass = 0; + + value = 1500; + cfg.deadband = 500; + cfg.reference = 5000; + exp_out = 25; + test_res = ut_pot_mv_to_percent(value, &cfg, exp_out); + if(!test_res) pass = 0; + + value = 2500; + cfg.deadband = 500; + cfg.reference = 5000; + exp_out = 50; + test_res = ut_pot_mv_to_percent(value, &cfg, exp_out); + if(!test_res) pass = 0; + + value = 3500; + cfg.deadband = 500; + cfg.reference = 5000; + exp_out = 75; + test_res = ut_pot_mv_to_percent(value, &cfg, exp_out); + if(!test_res) pass = 0; + + value = 4500; + cfg.deadband = 500; + cfg.reference = 5000; + exp_out = 100; + test_res = ut_pot_mv_to_percent(value, &cfg, exp_out); + if(!test_res) pass = 0; + + value = 4501; + cfg.deadband = 500; + cfg.reference = 5000; + exp_out = 100; + test_res = ut_pot_mv_to_percent(value, &cfg, exp_out); + if(!test_res) pass = 0; + + value = 5000; + cfg.deadband = 500; + cfg.reference = 5000; + exp_out = 100; + test_res = ut_pot_mv_to_percent(value, &cfg, exp_out); + if(!test_res) pass = 0; + + return pass; +} diff --git a/firmware/tests/ut_logic/ut_pot.h b/firmware/tests/ut_logic/ut_pot.h new file mode 100644 index 0000000..0fb97d0 --- /dev/null +++ b/firmware/tests/ut_logic/ut_pot.h @@ -0,0 +1,9 @@ +#ifndef UT_POT_H_ +#define UT_POT_H_ + +#include +#include + +int ut_pot_mv_to_percent_test(void); + +#endif /* UT_POT_H_ */ diff --git a/firmware/tests/ut_logic/ut_user_force.c b/firmware/tests/ut_logic/ut_user_force.c new file mode 100644 index 0000000..b2525e8 --- /dev/null +++ b/firmware/tests/ut_logic/ut_user_force.c @@ -0,0 +1,419 @@ +#include "ut_user_force.h" +#include "..\..\src\logic\user_force.h" + +static int ut_user_force_btn(uint8_t prev_force, uint8_t up_act, uint8_t down_act, uint8_t delta, uint8_t exp_out) +{ + uint8_t out = user_force_btn(prev_force, up_act, down_act, delta); + + printf("Prev-Force:%d Up-act:%d Down-act:%d Delta:%d\n", prev_force, up_act, down_act, delta); + printf("Output:%d Expected:%d\n", out, exp_out); + + if(out==exp_out) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_user_force_btn_test(void) +{ + printf("******************************************************\n"); + printf("uint8_t user_force_btn(uint8_t prev_force, uint8_t up_act, uint8_t down_act, uint8_t delta)\n"); + + int test_res; + int pass = 1; + + uint8_t prev_force; + uint8_t up_act; + uint8_t down_act; + uint8_t delta; + + uint8_t exp_out; + + // No change + prev_force = 0; + up_act = 0; + down_act = 0; + delta = 5; + exp_out = 0; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + prev_force = USER_FORCE_MIN_PERCENT-1; + up_act = 0; + down_act = 0; + delta = 5; + exp_out = 0; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + prev_force = 50; + up_act = 0; + down_act = 0; + delta = 5; + exp_out = 50; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + prev_force = USER_FORCE_MAX_PERCENT+1; + up_act = 0; + down_act = 0; + delta = 5; + exp_out = 100; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + prev_force = 100; + up_act = 0; + down_act = 0; + delta = 5; + exp_out = 100; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + // Start 0 + prev_force = 0; + up_act = 1; + down_act = 0; + delta = 5; + exp_out = USER_FORCE_MIN_PERCENT; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + prev_force = 0; + up_act = 0; + down_act = 1; + delta = 5; + exp_out = 0; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + prev_force = 0; + up_act = 1; + down_act = 1; + delta = 5; + exp_out = 0; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + prev_force = 0; + up_act = 1; + down_act = 0; + delta = USER_FORCE_MIN_PERCENT+1; + exp_out = USER_FORCE_MIN_PERCENT+1; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + // Start 100 + prev_force = 100; + up_act = 1; + down_act = 0; + delta = 5; + exp_out = 100; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + prev_force = 100; + up_act = 0; + down_act = 1; + delta = 5; + exp_out = USER_FORCE_MAX_PERCENT; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + prev_force = 100; + up_act = 1; + down_act = 1; + delta = 5; + exp_out = USER_FORCE_MAX_PERCENT; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + prev_force = 100; + up_act = 0; + down_act = 1; + delta = 100-USER_FORCE_MAX_PERCENT+1; + exp_out = USER_FORCE_MAX_PERCENT-1; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + // Start 50 + prev_force = 50; + up_act = 1; + down_act = 0; + delta = 5; + exp_out = 55; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + prev_force = 50; + up_act = 0; + down_act = 1; + delta = 5; + exp_out = 45; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + prev_force = 50; + up_act = 1; + down_act = 1; + delta = 5; + exp_out = 45; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + prev_force = 50; + up_act = 1; + down_act = 0; + delta = 10; + exp_out = 60; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + prev_force = 50; + up_act = 0; + down_act = 1; + delta = 10; + exp_out = 40; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + // Start MIN_PERCENT+1 + prev_force = USER_FORCE_MIN_PERCENT+1; + up_act = 1; + down_act = 0; + delta = 5; + exp_out = prev_force+delta; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + prev_force = USER_FORCE_MIN_PERCENT+1; + up_act = 0; + down_act = 1; + delta = 5; + exp_out = 0; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + prev_force = USER_FORCE_MIN_PERCENT+1; + up_act = 1; + down_act = 1; + delta = 5; + exp_out = 0; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + // Start MAX_PERCENT-1 + prev_force = USER_FORCE_MAX_PERCENT-1; + up_act = 1; + down_act = 0; + delta = 5; + exp_out = 100; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + prev_force = USER_FORCE_MAX_PERCENT-1; + up_act = 0; + down_act = 1; + delta = 5; + exp_out = prev_force-delta; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + prev_force = USER_FORCE_MAX_PERCENT-1; + up_act = 1; + down_act = 1; + delta = 5; + exp_out = prev_force-delta; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + // Up down seq + prev_force = 0; + up_act = 1; + down_act = 0; + delta = 20; + exp_out = 20; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + prev_force = 20; + up_act = 1; + down_act = 0; + delta = 20; + exp_out = 40; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + prev_force = 40; + up_act = 1; + down_act = 0; + delta = 20; + exp_out = 60; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + prev_force = 60; + up_act = 1; + down_act = 0; + delta = 20; + exp_out = 80; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + prev_force = 80; + up_act = 1; + down_act = 0; + delta = 20; + exp_out = 100; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + prev_force = 100; + up_act = 1; + down_act = 0; + delta = 20; + exp_out = 100; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + prev_force = 100; + up_act = 0; + down_act = 1; + delta = 20; + exp_out = 80; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + prev_force = 80; + up_act = 0; + down_act = 1; + delta = 20; + exp_out = 60; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + prev_force = 60; + up_act = 0; + down_act = 1; + delta = 20; + exp_out = 40; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + prev_force = 40; + up_act = 0; + down_act = 1; + delta = 20; + exp_out = 20; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + prev_force = 20; + up_act = 0; + down_act = 1; + delta = 20; + exp_out = 0; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + prev_force = 0; + up_act = 0; + down_act = 1; + delta = 20; + exp_out = 0; + test_res = ut_user_force_btn(prev_force, up_act, down_act, delta, exp_out); + if(!test_res) pass = 0; + + return pass; +} + +static int ut_user_force_pot(uint8_t prev_force, uint8_t pot, uint8_t hyst, uint8_t exp_out) +{ + uint8_t out = user_force_pot(prev_force, pot, hyst); + + printf("Prev-Force:%d Pot-percent:%d Hysteresis:%d \n", prev_force, pot, hyst); + printf("Output:%d Expected:%d\n", out, exp_out); + + if(out==exp_out) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_user_force_pot_test(void) +{ + printf("******************************************************\n"); + printf("uint8_t user_force_pot(uint8_t prev_force, uint8_t pot, uint8_t hyst)\n"); + + int test_res; + int pass = 1; + + uint8_t prev_force; + uint8_t pot; + uint8_t hyst; + + uint8_t exp_out; + + prev_force = 50; + pot = 0; + hyst = 10; + exp_out = 0; + test_res = ut_user_force_pot(prev_force, pot, hyst, exp_out); + if(!test_res) pass = 0; + + prev_force = 50; + pot = USER_FORCE_MIN_PERCENT-1; + hyst = 10; + exp_out = 0; + test_res = ut_user_force_pot(prev_force, pot, hyst, exp_out); + if(!test_res) pass = 0; + + prev_force = 50; + pot = USER_FORCE_MIN_PERCENT; + hyst = 10; + exp_out = USER_FORCE_MIN_PERCENT; + test_res = ut_user_force_pot(prev_force, pot, hyst, exp_out); + if(!test_res) pass = 0; + + prev_force = 50; + pot = 50; + hyst = 10; + exp_out = 50; + test_res = ut_user_force_pot(prev_force, pot, hyst, exp_out); + if(!test_res) pass = 0; + + prev_force = 50; + pot = USER_FORCE_MAX_PERCENT; + hyst = 10; + exp_out = USER_FORCE_MAX_PERCENT; + test_res = ut_user_force_pot(prev_force, pot, hyst, exp_out); + if(!test_res) pass = 0; + + prev_force = 50; + pot = USER_FORCE_MAX_PERCENT+1; + hyst = 10; + exp_out = 100; + test_res = ut_user_force_pot(prev_force, pot, hyst, exp_out); + if(!test_res) pass = 0; + + prev_force = 50; + pot = 100; + hyst = 10; + exp_out = 100; + test_res = ut_user_force_pot(prev_force, pot, hyst, exp_out); + if(!test_res) pass = 0; + + return pass; +} diff --git a/firmware/tests/ut_logic/ut_user_force.h b/firmware/tests/ut_logic/ut_user_force.h new file mode 100644 index 0000000..cbaf5a6 --- /dev/null +++ b/firmware/tests/ut_logic/ut_user_force.h @@ -0,0 +1,10 @@ +#ifndef UT_USER_FORCE_H_ +#define UT_USER_FORCE_H_ + +#include +#include + +int ut_user_force_btn_test(void); +int ut_user_force_pot_test(void); + +#endif /* UT_USER_FORCE_H_ */ diff --git a/firmware/tests/ut_utils/ut_fault.c b/firmware/tests/ut_utils/ut_fault.c new file mode 100644 index 0000000..0abcdfd --- /dev/null +++ b/firmware/tests/ut_utils/ut_fault.c @@ -0,0 +1,951 @@ +#include "ut_fault.h" + +#include "..\..\src\hw\board\utils\faults.h" + +static int ut_fault_process(fault_t* fault, uint8_t w_trig, uint8_t f_trig, fault_cfg_t* cfg, uint8_t exp_out, fault_t* exp_out_fault, fault_cfg_t* exp_out_cfg) +{ + printf("W-Trig:%d F-trig:%d \n", w_trig, f_trig); + printf("Severity:%d W-time:%d F-time:%d \n", fault->severity, fault->w_time, fault->f_time); + printf("Delay:%d WtoF:%d \n", cfg->delay, cfg->wtof); + + uint8_t out = fault_process(fault, w_trig, f_trig, cfg); + + printf("Output:%d Expected:%d\n", out, exp_out); + printf(" Output: Severity:%d W-time:%d F-time:%d \n", fault->severity, fault->w_time, fault->f_time); + printf("Expected: Severity:%d W-time:%d F-time:%d \n", exp_out_fault->severity, exp_out_fault->w_time, exp_out_fault->f_time); + printf("Delay:%d WtoF:%d \n", cfg->delay, cfg->wtof); + + if((out==exp_out)&&(fault->severity==exp_out_fault->severity)&&(fault->w_time==exp_out_fault->w_time)&&(fault->f_time==exp_out_fault->f_time)&&(cfg->delay==exp_out_cfg->delay)&&(cfg->wtof==exp_out_cfg->wtof)) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_fault_process_test(void) +{ + printf("******************************************************\n"); + printf("uint8_t fault_process(fault_t* fault, uint8_t w_trig, uint8_t f_trig, fault_cfg_t* cfg)\n"); + + int test_res; + int pass = 1; + + fault_t fault; + uint8_t w_trig; + uint8_t f_trig; + fault_cfg_t cfg; + + uint8_t exp_out; + fault_t exp_out_fault; + fault_cfg_t exp_out_cfg; + + // NORMAL NO FAULT CONDITION ************************************************************************* + // No change test, start form OK + fault.severity = FAULT_LVL_OK; + fault.w_time = 0; + fault.f_time = 0; + w_trig = 0; + f_trig = 0; + cfg.delay = 0; + cfg.wtof = 0; + exp_out = 0; + exp_out_fault.severity = FAULT_LVL_OK; + exp_out_fault.w_time = 0; + exp_out_fault.f_time = 0; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // STARTING CONDITIONS ************************************************************************* + // Warning trigger test, start form OK + fault.severity = FAULT_LVL_OK; + fault.w_time = 0; + fault.f_time = 0; + w_trig = 1; + f_trig = 0; + cfg.delay = 0; + cfg.wtof = 0; + exp_out = 0; + exp_out_fault.severity = FAULT_LVL_WARNING; + exp_out_fault.w_time = 0; + exp_out_fault.f_time = 0; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // Fault trigger test, start form OK + fault.severity = FAULT_LVL_OK; + fault.w_time = 0; + fault.f_time = 0; + w_trig = 0; + f_trig = 1; + cfg.delay = 0; + cfg.wtof = 0; + exp_out = 1; + exp_out_fault.severity = FAULT_LVL_FAULT; + exp_out_fault.w_time = 0; + exp_out_fault.f_time = 0; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // Warning and Fault trigger test, start form OK + fault.severity = FAULT_LVL_OK; + fault.w_time = 0; + fault.f_time = 0; + w_trig = 1; + f_trig = 1; + cfg.delay = 0; + cfg.wtof = 0; + exp_out = 1; + exp_out_fault.severity = FAULT_LVL_FAULT; + exp_out_fault.w_time = 0; + exp_out_fault.f_time = 0; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // Wrong start severity WARNING, with no triggers + fault.severity = FAULT_LVL_WARNING; + fault.w_time = 0; + fault.f_time = 0; + w_trig = 0; + f_trig = 0; + cfg.delay = 0; + cfg.wtof = 0; + exp_out = 0; + exp_out_fault.severity = FAULT_LVL_OK; + exp_out_fault.w_time = 0; + exp_out_fault.f_time = 0; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // Wrong start severity FAULT, with no triggers + fault.severity = FAULT_LVL_FAULT; + fault.w_time = 0; + fault.f_time = 0; + w_trig = 0; + f_trig = 0; + cfg.delay = 0; + cfg.wtof = 0; + exp_out = 0; + exp_out_fault.severity = FAULT_LVL_OK; + exp_out_fault.w_time = 0; + exp_out_fault.f_time = 0; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // Wrong start times, with no triggers + fault.severity = FAULT_LVL_OK; + fault.w_time = 78; + fault.f_time = 56; + w_trig = 0; + f_trig = 0; + cfg.delay = 0; + cfg.wtof = 0; + exp_out = 0; + exp_out_fault.severity = FAULT_LVL_OK; + exp_out_fault.w_time = 0; + exp_out_fault.f_time = 0; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + + // TIME INCREASE TESTS - SECOND ITERATION WITH TRIGGER ACTIVE ************************************************************************* + // Warning time increase with continuing warning condition + fault.severity = FAULT_LVL_WARNING; + fault.w_time = 45; + fault.f_time = 0; + w_trig = 1; + f_trig = 0; + cfg.delay = 0; + cfg.wtof = 0; + exp_out = 0; + exp_out_fault.severity = FAULT_LVL_WARNING; + exp_out_fault.w_time = 46; + exp_out_fault.f_time = 0; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // Fault and warning time increase with continuing fault only condition + fault.severity = FAULT_LVL_FAULT; + fault.w_time = 78; + fault.f_time = 23; + w_trig = 0; + f_trig = 1; + cfg.delay = 0; + cfg.wtof = 0; + exp_out = 1; + exp_out_fault.severity = FAULT_LVL_FAULT; + exp_out_fault.w_time = 79; + exp_out_fault.f_time = 24; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // Fault and warning time increase with continuing both triggers condition + fault.severity = FAULT_LVL_FAULT; + fault.w_time = 57; + fault.f_time = 12; + w_trig = 1; + f_trig = 1; + cfg.delay = 0; + cfg.wtof = 0; + exp_out = 1; + exp_out_fault.severity = FAULT_LVL_FAULT; + exp_out_fault.w_time = 58; + exp_out_fault.f_time = 13; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // Time increase and transition to fault with both triggers + fault.severity = FAULT_LVL_WARNING; + fault.w_time = 0; + fault.f_time = 0; + w_trig = 1; + f_trig = 1; + cfg.delay = 0; + cfg.wtof = 0; + exp_out = 1; + exp_out_fault.severity = FAULT_LVL_FAULT; + exp_out_fault.w_time = 1; + exp_out_fault.f_time = 1; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // Warning time increase and transition to fault with only fault trigger + fault.severity = FAULT_LVL_WARNING; + fault.w_time = 0; + fault.f_time = 0; + w_trig = 0; + f_trig = 1; + cfg.delay = 0; + cfg.wtof = 0; + exp_out = 1; + exp_out_fault.severity = FAULT_LVL_FAULT; + exp_out_fault.w_time = 1; + exp_out_fault.f_time = 1; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // Time saturation + fault.severity = FAULT_LVL_FAULT; + fault.w_time = 65535; + fault.f_time = 65535; + w_trig = 1; + f_trig = 1; + cfg.delay = 0; + cfg.wtof = 0; + exp_out = 1; + exp_out_fault.severity = FAULT_LVL_FAULT; + exp_out_fault.w_time = 65535; + exp_out_fault.f_time = 65535; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // Fallback to warning and time increase + fault.severity = FAULT_LVL_FAULT; + fault.w_time = 784; + fault.f_time = 457; + w_trig = 1; + f_trig = 0; + cfg.delay = 0; + cfg.wtof = 0; + exp_out = 0; + exp_out_fault.severity = FAULT_LVL_WARNING; + exp_out_fault.w_time = 785; + exp_out_fault.f_time = 0; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // Fallback to OK and time reset from fault + fault.severity = FAULT_LVL_FAULT; + fault.w_time = 784; + fault.f_time = 457; + w_trig = 0; + f_trig = 0; + cfg.delay = 0; + cfg.wtof = 0; + exp_out = 0; + exp_out_fault.severity = FAULT_LVL_OK; + exp_out_fault.w_time = 0; + exp_out_fault.f_time = 0; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // Fallback to OK and time reset from warning + fault.severity = FAULT_LVL_WARNING; + fault.w_time = 479; + fault.f_time = 0; + w_trig = 0; + f_trig = 0; + cfg.delay = 0; + cfg.wtof = 0; + exp_out = 0; + exp_out_fault.severity = FAULT_LVL_OK; + exp_out_fault.w_time = 0; + exp_out_fault.f_time = 0; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // FAULT DELAY TESTS ************************************************************************* + // Not transition to fault + fault.severity = FAULT_LVL_OK; + fault.w_time = 0; + fault.f_time = 0; + w_trig = 1; + f_trig = 1; + cfg.delay = 100; + cfg.wtof = 0; + exp_out = 0; + exp_out_fault.severity = FAULT_LVL_WARNING; + exp_out_fault.w_time = 0; + exp_out_fault.f_time = 0; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // Not transition to fault second time + fault.severity = FAULT_LVL_WARNING; + fault.w_time = 0; + fault.f_time = 0; + w_trig = 1; + f_trig = 1; + cfg.delay = 100; + cfg.wtof = 0; + exp_out = 0; + exp_out_fault.severity = FAULT_LVL_WARNING; + exp_out_fault.w_time = 1; + exp_out_fault.f_time = 1; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // Not transition to fault before limit + fault.severity = FAULT_LVL_WARNING; + fault.w_time = 128; + fault.f_time = 98; + w_trig = 1; + f_trig = 1; + cfg.delay = 100; + cfg.wtof = 0; + exp_out = 0; + exp_out_fault.severity = FAULT_LVL_WARNING; + exp_out_fault.w_time = 129; + exp_out_fault.f_time = 99; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // Transition to fault at limit + fault.severity = FAULT_LVL_WARNING; + fault.w_time = 358; + fault.f_time = 99; + w_trig = 1; + f_trig = 1; + cfg.delay = 100; + cfg.wtof = 0; + exp_out = 1; + exp_out_fault.severity = FAULT_LVL_FAULT; + exp_out_fault.w_time = 359; + exp_out_fault.f_time = 100; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // Transition to fault after limit + fault.severity = FAULT_LVL_WARNING; + fault.w_time = 786; + fault.f_time = 100; + w_trig = 1; + f_trig = 1; + cfg.delay = 100; + cfg.wtof = 0; + exp_out = 1; + exp_out_fault.severity = FAULT_LVL_FAULT; + exp_out_fault.w_time = 787; + exp_out_fault.f_time = 101; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // Continued fault condition + fault.severity = FAULT_LVL_FAULT; + fault.w_time = 101; + fault.f_time = 101; + w_trig = 1; + f_trig = 1; + cfg.delay = 100; + cfg.wtof = 0; + exp_out = 1; + exp_out_fault.severity = FAULT_LVL_FAULT; + exp_out_fault.w_time = 102; + exp_out_fault.f_time = 102; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // Fallback to warning + fault.severity = FAULT_LVL_FAULT; + fault.w_time = 101; + fault.f_time = 101; + w_trig = 1; + f_trig = 0; + cfg.delay = 100; + cfg.wtof = 0; + exp_out = 0; + exp_out_fault.severity = FAULT_LVL_WARNING; + exp_out_fault.w_time = 102; + exp_out_fault.f_time = 0; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // Fallback to OK + fault.severity = FAULT_LVL_FAULT; + fault.w_time = 101; + fault.f_time = 101; + w_trig = 0; + f_trig = 0; + cfg.delay = 100; + cfg.wtof = 0; + exp_out = 0; + exp_out_fault.severity = FAULT_LVL_OK; + exp_out_fault.w_time = 0; + exp_out_fault.f_time = 0; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // Allready was fault condition, with lower time - fixes to correct state + fault.severity = FAULT_LVL_FAULT; + fault.w_time = 45; + fault.f_time = 45; + w_trig = 1; + f_trig = 1; + cfg.delay = 100; + cfg.wtof = 0; + exp_out = 0; + exp_out_fault.severity = FAULT_LVL_WARNING; + exp_out_fault.w_time = 46; + exp_out_fault.f_time = 46; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // WARNING TO FAULT TRANSITION TESTS ************************************************************************* + // Not transition to fault + fault.severity = FAULT_LVL_OK; + fault.w_time = 0; + fault.f_time = 0; + w_trig = 1; + f_trig = 0; + cfg.delay = 0; + cfg.wtof = 200; + exp_out = 0; + exp_out_fault.severity = FAULT_LVL_WARNING; + exp_out_fault.w_time = 0; + exp_out_fault.f_time = 0; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // Not transition to fault + fault.severity = FAULT_LVL_WARNING; + fault.w_time = 0; + fault.f_time = 0; + w_trig = 1; + f_trig = 0; + cfg.delay = 0; + cfg.wtof = 200; + exp_out = 0; + exp_out_fault.severity = FAULT_LVL_WARNING; + exp_out_fault.w_time = 1; + exp_out_fault.f_time = 0; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // Not transition to fault before limit + fault.severity = FAULT_LVL_WARNING; + fault.w_time = 198; + fault.f_time = 0; + w_trig = 1; + f_trig = 0; + cfg.delay = 0; + cfg.wtof = 200; + exp_out = 0; + exp_out_fault.severity = FAULT_LVL_WARNING; + exp_out_fault.w_time = 199; + exp_out_fault.f_time = 0; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // Not Transition to fault at limit + fault.severity = FAULT_LVL_WARNING; + fault.w_time = 199; + fault.f_time = 0; + w_trig = 1; + f_trig = 0; + cfg.delay = 0; + cfg.wtof = 200; + exp_out = 0; + exp_out_fault.severity = FAULT_LVL_WARNING; + exp_out_fault.w_time = 200; + exp_out_fault.f_time = 0; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // Transition to fault after limit + fault.severity = FAULT_LVL_WARNING; + fault.w_time = 200; + fault.f_time = 0; + w_trig = 1; + f_trig = 0; + cfg.delay = 0; + cfg.wtof = 200; + exp_out = 1; + exp_out_fault.severity = FAULT_LVL_FAULT; + exp_out_fault.w_time = 201; + exp_out_fault.f_time = 1; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // Continued fault + fault.severity = FAULT_LVL_FAULT; + fault.w_time = 201; + fault.f_time = 1; + w_trig = 1; + f_trig = 0; + cfg.delay = 0; + cfg.wtof = 200; + exp_out = 1; + exp_out_fault.severity = FAULT_LVL_FAULT; + exp_out_fault.w_time = 202; + exp_out_fault.f_time = 2; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // Fallback to ok + fault.severity = FAULT_LVL_FAULT; + fault.w_time = 247; + fault.f_time = 0; + w_trig = 0; + f_trig = 0; + cfg.delay = 0; + cfg.wtof = 200; + exp_out = 0; + exp_out_fault.severity = FAULT_LVL_OK; + exp_out_fault.w_time = 0; + exp_out_fault.f_time = 0; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // WARNING TO FAULT TRANSITION WITH FAULT DELAY TESTS ************************************************************************* + // Not transition to fault + fault.severity = FAULT_LVL_OK; + fault.w_time = 0; + fault.f_time = 0; + w_trig = 1; + f_trig = 0; + cfg.delay = 50; + cfg.wtof = 200; + exp_out = 0; + exp_out_fault.severity = FAULT_LVL_WARNING; + exp_out_fault.w_time = 0; + exp_out_fault.f_time = 0; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // Not transition to fault + fault.severity = FAULT_LVL_OK; + fault.w_time = 0; + fault.f_time = 0; + w_trig = 1; + f_trig = 1; + cfg.delay = 50; + cfg.wtof = 200; + exp_out = 0; + exp_out_fault.severity = FAULT_LVL_WARNING; + exp_out_fault.w_time = 0; + exp_out_fault.f_time = 0; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + fault.severity = FAULT_LVL_OK; + fault.w_time = 0; + fault.f_time = 0; + w_trig = 0; + f_trig = 1; + cfg.delay = 50; + cfg.wtof = 200; + exp_out = 0; + exp_out_fault.severity = FAULT_LVL_WARNING; + exp_out_fault.w_time = 0; + exp_out_fault.f_time = 0; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // Transition to fault at delay + fault.severity = FAULT_LVL_WARNING; + fault.w_time = 49; + fault.f_time = 49; + w_trig = 1; + f_trig = 1; + cfg.delay = 50; + cfg.wtof = 200; + exp_out = 1; + exp_out_fault.severity = FAULT_LVL_FAULT; + exp_out_fault.w_time = 50; + exp_out_fault.f_time = 50; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // No Transition to fault at wtof + fault.severity = FAULT_LVL_WARNING; + fault.w_time = 200; + fault.f_time = 0; + w_trig = 1; + f_trig = 0; + cfg.delay = 50; + cfg.wtof = 200; + exp_out = 0; + exp_out_fault.severity = FAULT_LVL_WARNING; + exp_out_fault.w_time = 201; + exp_out_fault.f_time = 1; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // No Transition to fault before wtof + delay + fault.severity = FAULT_LVL_WARNING; + fault.w_time = 248; + fault.f_time = 48; + w_trig = 1; + f_trig = 0; + cfg.delay = 50; + cfg.wtof = 200; + exp_out = 0; + exp_out_fault.severity = FAULT_LVL_WARNING; + exp_out_fault.w_time = 249; + exp_out_fault.f_time = 49; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // Transition to fault before wtof + delay + fault.severity = FAULT_LVL_WARNING; + fault.w_time = 249; + fault.f_time = 49; + w_trig = 1; + f_trig = 0; + cfg.delay = 50; + cfg.wtof = 200; + exp_out = 1; + exp_out_fault.severity = FAULT_LVL_FAULT; + exp_out_fault.w_time = 250; + exp_out_fault.f_time = 50; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // Continued wtof fault condition + fault.severity = FAULT_LVL_FAULT; + fault.w_time = 250; + fault.f_time = 50; + w_trig = 1; + f_trig = 0; + cfg.delay = 50; + cfg.wtof = 200; + exp_out = 1; + exp_out_fault.severity = FAULT_LVL_FAULT; + exp_out_fault.w_time = 251; + exp_out_fault.f_time = 51; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + // Continued wtof fault condition, without warning trigger + fault.severity = FAULT_LVL_FAULT; + fault.w_time = 350; + fault.f_time = 150; + w_trig = 0; + f_trig = 1; + cfg.delay = 50; + cfg.wtof = 200; + exp_out = 1; + exp_out_fault.severity = FAULT_LVL_FAULT; + exp_out_fault.w_time = 351; + exp_out_fault.f_time = 151; + exp_out_cfg.delay = cfg.delay; + exp_out_cfg.wtof = cfg.wtof; + test_res = ut_fault_process(&fault, w_trig, f_trig, &cfg, exp_out, &exp_out_fault, &exp_out_cfg); + if(!test_res) pass = 0; + + return pass; +} + +static int ut_fault_is_active(fault_t* fault, uint8_t exp_out, fault_t* exp_out_fault) +{ + printf("Severity:%d W-time:%d F-time:%d \n", fault->severity, fault->w_time, fault->f_time); + + uint8_t out = fault_is_active(fault); + + printf("Output:%d Expected:%d\n", out, exp_out); + printf(" Output: Severity:%d W-time:%d F-time:%d \n", fault->severity, fault->w_time, fault->f_time); + printf("Expected: Severity:%d W-time:%d F-time:%d \n", exp_out_fault->severity, exp_out_fault->w_time, exp_out_fault->f_time); + + if((out==exp_out)&&(fault->severity==exp_out_fault->severity)&&(fault->w_time==exp_out_fault->w_time)&&(fault->f_time==exp_out_fault->f_time)) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_fault_is_active_test(void) +{ + printf("******************************************************\n"); + printf("uint8_t fault_is_active(fault_t* fault)\n"); + + int test_res; + int pass = 1; + + fault_t fault; + + uint8_t exp_out; + fault_t exp_out_fault; + + fault.severity = FAULT_LVL_OK; + fault.w_time = 500; + fault.f_time = 300; + exp_out = 0; + exp_out_fault.severity = fault.severity; + exp_out_fault.w_time = fault.w_time; + exp_out_fault.f_time = fault.f_time; + test_res = ut_fault_is_active(&fault, exp_out, &exp_out_fault); + if(!test_res) pass = 0; + + fault.severity = FAULT_LVL_WARNING; + fault.w_time = 500; + fault.f_time = 300; + exp_out = 0; + exp_out_fault.severity = fault.severity; + exp_out_fault.w_time = fault.w_time; + exp_out_fault.f_time = fault.f_time; + test_res = ut_fault_is_active(&fault, exp_out, &exp_out_fault); + if(!test_res) pass = 0; + + fault.severity = FAULT_LVL_FAULT; + fault.w_time = 500; + fault.f_time = 300; + exp_out = 1; + exp_out_fault.severity = fault.severity; + exp_out_fault.w_time = fault.w_time; + exp_out_fault.f_time = fault.f_time; + test_res = ut_fault_is_active(&fault, exp_out, &exp_out_fault); + if(!test_res) pass = 0; + + return pass; +} + +static int ut_fault_is_warning(fault_t* fault, uint8_t exp_out, fault_t* exp_out_fault) +{ + printf("Severity:%d W-time:%d F-time:%d \n", fault->severity, fault->w_time, fault->f_time); + + uint8_t out = fault_is_warning(fault); + + printf("Output:%d Expected:%d\n", out, exp_out); + printf(" Output: Severity:%d W-time:%d F-time:%d \n", fault->severity, fault->w_time, fault->f_time); + printf("Expected: Severity:%d W-time:%d F-time:%d \n", exp_out_fault->severity, exp_out_fault->w_time, exp_out_fault->f_time); + + if((out==exp_out)&&(fault->severity==exp_out_fault->severity)&&(fault->w_time==exp_out_fault->w_time)&&(fault->f_time==exp_out_fault->f_time)) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_fault_is_warning_test(void) +{ + printf("******************************************************\n"); + printf("uint8_t fault_is_warning(fault_t* fault)\n"); + + int test_res; + int pass = 1; + + fault_t fault; + + uint8_t exp_out; + fault_t exp_out_fault; + + fault.severity = FAULT_LVL_OK; + fault.w_time = 500; + fault.f_time = 300; + exp_out = 0; + exp_out_fault.severity = fault.severity; + exp_out_fault.w_time = fault.w_time; + exp_out_fault.f_time = fault.f_time; + test_res = ut_fault_is_warning(&fault, exp_out, &exp_out_fault); + if(!test_res) pass = 0; + + fault.severity = FAULT_LVL_WARNING; + fault.w_time = 500; + fault.f_time = 300; + exp_out = 1; + exp_out_fault.severity = fault.severity; + exp_out_fault.w_time = fault.w_time; + exp_out_fault.f_time = fault.f_time; + test_res = ut_fault_is_warning(&fault, exp_out, &exp_out_fault); + if(!test_res) pass = 0; + + fault.severity = FAULT_LVL_FAULT; + fault.w_time = 500; + fault.f_time = 300; + exp_out = 1; + exp_out_fault.severity = fault.severity; + exp_out_fault.w_time = fault.w_time; + exp_out_fault.f_time = fault.f_time; + test_res = ut_fault_is_warning(&fault, exp_out, &exp_out_fault); + if(!test_res) pass = 0; + + return pass; +} + +static int ut_fault_reset(fault_t* fault, fault_t* exp_out_fault) +{ + printf("Severity:%d W-time:%d F-time:%d \n", fault->severity, fault->w_time, fault->f_time); + + fault_reset(fault); + + printf(" Output: Severity:%d W-time:%d F-time:%d \n", fault->severity, fault->w_time, fault->f_time); + printf("Expected: Severity:%d W-time:%d F-time:%d \n", exp_out_fault->severity, exp_out_fault->w_time, exp_out_fault->f_time); + + if((fault->severity==exp_out_fault->severity)&&(fault->w_time==exp_out_fault->w_time)&&(fault->f_time==exp_out_fault->f_time)) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_fault_reset_test(void) +{ + printf("******************************************************\n"); + printf("void fault_reset(fault_t* fault)\n"); + + int test_res; + int pass = 1; + + fault_t fault; + + fault_t exp_out_fault; + + fault.severity = FAULT_LVL_OK; + fault.w_time = 0; + fault.f_time = 0; + exp_out_fault.severity = FAULT_LVL_OK; + exp_out_fault.w_time = 0; + exp_out_fault.f_time = 0; + test_res = ut_fault_reset(&fault, &exp_out_fault); + if(!test_res) pass = 0; + + fault.severity = FAULT_LVL_WARNING; + fault.w_time = 500; + fault.f_time = 0; + exp_out_fault.severity = FAULT_LVL_OK; + exp_out_fault.w_time = 0; + exp_out_fault.f_time = 0; + test_res = ut_fault_reset(&fault, &exp_out_fault); + if(!test_res) pass = 0; + + fault.severity = FAULT_LVL_FAULT; + fault.w_time = 1000; + fault.f_time = 500; + exp_out_fault.severity = FAULT_LVL_OK; + exp_out_fault.w_time = 0; + exp_out_fault.f_time = 0; + test_res = ut_fault_reset(&fault, &exp_out_fault); + if(!test_res) pass = 0; + + return pass; +} + diff --git a/firmware/tests/ut_utils/ut_fault.h b/firmware/tests/ut_utils/ut_fault.h new file mode 100644 index 0000000..1024805 --- /dev/null +++ b/firmware/tests/ut_utils/ut_fault.h @@ -0,0 +1,12 @@ +#ifndef UT_FAULTS_H_ +#define UT_FAULTS_H_ + +#include +#include + +int ut_fault_process_test(void); +int ut_fault_is_active_test(void); +int ut_fault_is_warning_test(void); +int ut_fault_reset_test(void); + +#endif /* UT_FAULTS_H_ */ diff --git a/firmware/tests/ut_utils/ut_fuses.c b/firmware/tests/ut_utils/ut_fuses.c new file mode 100644 index 0000000..03b7138 --- /dev/null +++ b/firmware/tests/ut_utils/ut_fuses.c @@ -0,0 +1,79 @@ +#include "ut_fuses.h" + +#include "..\..\src\hw\board\utils\fuses.h" + +static int ut_fuse_reset(fuse_t* fuse, fuse_t* exp_out_fuse) +{ + printf("State:%d Timer:%d Count:%d \n", fuse->state, fuse->timer, fuse->count); + + fuse_reset(fuse); + + printf(" Output: State:%d Timer:%d Count:%d \n", fuse->state, fuse->timer, fuse->count); + printf("Expected: State:%d Timer:%d Count:%d \n", exp_out_fuse->state, exp_out_fuse->timer, exp_out_fuse->count); + + if((fuse->state==exp_out_fuse->state)&&(fuse->timer==exp_out_fuse->timer)&&(fuse->count==exp_out_fuse->count)) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_fuse_reset_test(void) +{ + printf("******************************************************\n"); + printf("void fuse_reset(fuse_t* fuse)\n"); + + int test_res; + int pass = 1; + + fuse_t fuse; + + fuse_t exp_out_fuse; + + // No change test + fuse.state = FUSE_OFF; + fuse.timer = 0; + fuse.count = 0; + exp_out_fuse.state = FUSE_OFF; + exp_out_fuse.timer = 0; + exp_out_fuse.count = 0; + test_res = ut_fuse_reset(&fuse, &exp_out_fuse); + if(!test_res) pass = 0; + + // No change test + fuse.state = FUSE_ACTIVE; + fuse.timer = 1254; + fuse.count = 124; + exp_out_fuse.state = FUSE_OFF; + exp_out_fuse.timer = 0; + exp_out_fuse.count = 0; + test_res = ut_fuse_reset(&fuse, &exp_out_fuse); + if(!test_res) pass = 0; + + // No change test + fuse.state = FUSE_COOLDOWN; + fuse.timer = 4578; + fuse.count = 14; + exp_out_fuse.state = FUSE_OFF; + exp_out_fuse.timer = 0; + exp_out_fuse.count = 0; + test_res = ut_fuse_reset(&fuse, &exp_out_fuse); + if(!test_res) pass = 0; + + // No change test + fuse.state = FUSE_RETRY; + fuse.timer = 0; + fuse.count = 0; + exp_out_fuse.state = FUSE_OFF; + exp_out_fuse.timer = 0; + exp_out_fuse.count = 0; + test_res = ut_fuse_reset(&fuse, &exp_out_fuse); + if(!test_res) pass = 0; + + return pass; +} diff --git a/firmware/tests/ut_utils/ut_fuses.h b/firmware/tests/ut_utils/ut_fuses.h new file mode 100644 index 0000000..87bd1b7 --- /dev/null +++ b/firmware/tests/ut_utils/ut_fuses.h @@ -0,0 +1,9 @@ +#ifndef UT_FUSES_H_ +#define UT_FUSES_H_ + +#include +#include + +int ut_fuse_reset_test(void); + +#endif /* UT_FUSES_H_ */ diff --git a/firmware/tests/ut_utils/ut_utils.c b/firmware/tests/ut_utils/ut_utils.c new file mode 100644 index 0000000..b260687 --- /dev/null +++ b/firmware/tests/ut_utils/ut_utils.c @@ -0,0 +1,1334 @@ +#include "ut_utils.h" + +#include "..\..\src\hw\board\utils\utils.h" + +static int ut_util_invert_8b(uint8_t x, uint8_t exp_out) +{ + printf(" Input:%d\n", x); + + uint8_t out = util_invert_8b(x); + + printf(" Output:%d\n", out); + printf("Expected:%d\n", exp_out); + + if(out==exp_out) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_util_invert_8b_test(void) +{ + printf("******************************************************\n"); + printf("uint8_t util_invert_8b(uint8_t x)\n"); + + int test_res; + int pass = 1; + + uint8_t inp; + uint8_t exp_out; + + inp = 0; + exp_out = 1; + test_res = ut_util_invert_8b(inp, exp_out); + if(!test_res) pass = 0; + + inp = 1; + exp_out = 0; + test_res = ut_util_invert_8b(inp, exp_out); + if(!test_res) pass = 0; + + inp = 257; + exp_out = 0; + test_res = ut_util_invert_8b(inp, exp_out); + if(!test_res) pass = 0; + + inp = -1; + exp_out = 0; + test_res = ut_util_invert_8b(inp, exp_out); + if(!test_res) pass = 0; + + return pass; +} + +static int ut_util_sat_add_8b(uint8_t x, uint8_t y, uint8_t exp_out) +{ + printf(" Input: x:%d y:%d\n", x, y); + + uint8_t out = util_sat_add_8b(x,y); + + printf(" Output:%d\n", out); + printf("Expected:%d\n", exp_out); + + if(out==exp_out) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_util_sat_add_8b_test(void) +{ + printf("******************************************************\n"); + printf("uint8_t util_sat_add_8b(uint8_t x, uint8_t y)\n"); + + int test_res; + int pass = 1; + + uint8_t inp_x; + uint8_t inp_y; + uint8_t exp_out; + + inp_x = 0; + inp_y = 0; + exp_out = 0; + test_res = ut_util_sat_add_8b(inp_x, inp_y, exp_out); + if(!test_res) pass = 0; + + inp_x = 5; + inp_y = 6; + exp_out = 11; + test_res = ut_util_sat_add_8b(inp_x, inp_y, exp_out); + if(!test_res) pass = 0; + + inp_x = 4; + inp_y = 9; + exp_out = 13; + test_res = ut_util_sat_add_8b(inp_x, inp_y, exp_out); + if(!test_res) pass = 0; + + inp_x = 254; + inp_y = 1; + exp_out = 255; + test_res = ut_util_sat_add_8b(inp_x, inp_y, exp_out); + if(!test_res) pass = 0; + + inp_x = 1; + inp_y = 254; + exp_out = 255; + test_res = ut_util_sat_add_8b(inp_x, inp_y, exp_out); + if(!test_res) pass = 0; + + inp_x = 1; + inp_y = 255; + exp_out = 255; + test_res = ut_util_sat_add_8b(inp_x, inp_y, exp_out); + if(!test_res) pass = 0; + + inp_x = 255; + inp_y = 1; + exp_out = 255; + test_res = ut_util_sat_add_8b(inp_x, inp_y, exp_out); + if(!test_res) pass = 0; + + inp_x = 255; + inp_y = 255; + exp_out = 255; + test_res = ut_util_sat_add_8b(inp_x, inp_y, exp_out); + if(!test_res) pass = 0; + + return pass; +} + + +static int ut_util_sat_subtract_8b(uint8_t x, uint8_t y, uint8_t exp_out) +{ + printf(" Input: x:%d y:%d\n", x, y); + + uint8_t out = util_sat_subtract_8b(x,y); + + printf(" Output:%d\n", out); + printf("Expected:%d\n", exp_out); + + if(out==exp_out) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_util_sat_subtract_8b_test(void) +{ + printf("******************************************************\n"); + printf("uint8_t util_sat_subtract_8b(uint8_t x, uint8_t y)\n"); + + int test_res; + int pass = 1; + + uint8_t inp_x; + uint8_t inp_y; + uint8_t exp_out; + + inp_x = 0; + inp_y = 0; + exp_out = 0; + test_res = ut_util_sat_subtract_8b(inp_x, inp_y, exp_out); + if(!test_res) pass = 0; + + inp_x = 50; + inp_y = 10; + exp_out = 40; + test_res = ut_util_sat_subtract_8b(inp_x, inp_y, exp_out); + if(!test_res) pass = 0; + + inp_x = 70; + inp_y = 0; + exp_out = 70; + test_res = ut_util_sat_subtract_8b(inp_x, inp_y, exp_out); + if(!test_res) pass = 0; + + inp_x = 60; + inp_y = 50; + exp_out = 10; + test_res = ut_util_sat_subtract_8b(inp_x, inp_y, exp_out); + if(!test_res) pass = 0; + + inp_x = 10; + inp_y = 50; + exp_out = 0; + test_res = ut_util_sat_subtract_8b(inp_x, inp_y, exp_out); + if(!test_res) pass = 0; + + inp_x = 0; + inp_y = 255; + exp_out = 0; + test_res = ut_util_sat_subtract_8b(inp_x, inp_y, exp_out); + if(!test_res) pass = 0; + + return pass; +} + +static int ut_util_sat_add_16b(uint16_t x, uint16_t y, uint16_t exp_out) +{ + printf(" Input: x:%d y:%d\n", x, y); + + uint16_t out = util_sat_add_16b(x,y); + + printf(" Output:%d\n", out); + printf("Expected:%d\n", exp_out); + + if(out==exp_out) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_util_sat_util_sat_add_16b_test(void) +{ + printf("******************************************************\n"); + printf("uint16_t util_sat_add_16b(uint16_t x, uint16_t y)\n"); + + int test_res; + int pass = 1; + + uint16_t inp_x; + uint16_t inp_y; + uint16_t exp_out; + + inp_x = 0; + inp_y = 0; + exp_out = 0; + test_res = ut_util_sat_add_16b(inp_x, inp_y, exp_out); + if(!test_res) pass = 0; + + inp_x = 10; + inp_y = 15; + exp_out = 25; + test_res = ut_util_sat_add_16b(inp_x, inp_y, exp_out); + if(!test_res) pass = 0; + + inp_x = 25; + inp_y = 35; + exp_out = 60; + test_res = ut_util_sat_add_16b(inp_x, inp_y, exp_out); + if(!test_res) pass = 0; + + inp_x = 0; + inp_y = 0xFFFF; + exp_out = 0xFFFF; + test_res = ut_util_sat_add_16b(inp_x, inp_y, exp_out); + if(!test_res) pass = 0; + + inp_x = 100; + inp_y = 0xFFFF; + exp_out = 0xFFFF; + test_res = ut_util_sat_add_16b(inp_x, inp_y, exp_out); + if(!test_res) pass = 0; + + inp_x = 45867; + inp_y = 47841; + exp_out = 0xFFFF; + test_res = ut_util_sat_add_16b(inp_x, inp_y, exp_out); + if(!test_res) pass = 0; + + inp_x = 0xFFFF; + inp_y = 0xFFFF; + exp_out = 0xFFFF; + test_res = ut_util_sat_add_16b(inp_x, inp_y, exp_out); + if(!test_res) pass = 0; + + return pass; +} + +static int ut_util_sat_subtract_16b(uint16_t x, uint16_t y, uint16_t exp_out) +{ + printf(" Input: x:%d y:%d\n", x, y); + + uint16_t out = util_sat_subtract_16b(x,y); + + printf(" Output:%d\n", out); + printf("Expected:%d\n", exp_out); + + if(out==exp_out) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_util_sat_subtract_16b_test(void) +{ + printf("******************************************************\n"); + printf("uint16_t util_sat_subtract_16b(uint16_t x, uint16_t y)\n"); + + int test_res; + int pass = 1; + + uint16_t inp_x; + uint16_t inp_y; + uint16_t exp_out; + + inp_x = 0; + inp_y = 0; + exp_out = 0; + test_res = ut_util_sat_subtract_16b(inp_x, inp_y, exp_out); + if(!test_res) pass = 0; + + inp_x = 50; + inp_y = 10; + exp_out = 40; + test_res = ut_util_sat_subtract_16b(inp_x, inp_y, exp_out); + if(!test_res) pass = 0; + + inp_x = 70; + inp_y = 0; + exp_out = 70; + test_res = ut_util_sat_subtract_16b(inp_x, inp_y, exp_out); + if(!test_res) pass = 0; + + inp_x = 60; + inp_y = 50; + exp_out = 10; + test_res = ut_util_sat_subtract_16b(inp_x, inp_y, exp_out); + if(!test_res) pass = 0; + + inp_x = 10; + inp_y = 50; + exp_out = 0; + test_res = ut_util_sat_subtract_16b(inp_x, inp_y, exp_out); + if(!test_res) pass = 0; + + inp_x = 401; + inp_y = 0x3FFF; + exp_out = 0; + test_res = ut_util_sat_subtract_16b(inp_x, inp_y, exp_out); + if(!test_res) pass = 0; + + inp_x = 0; + inp_y = 0x7FFF; + exp_out = 0; + test_res = ut_util_sat_subtract_16b(inp_x, inp_y, exp_out); + if(!test_res) pass = 0; + + inp_x = 0; + inp_y = 0xFFFF; + exp_out = 0; + test_res = ut_util_sat_subtract_16b(inp_x, inp_y, exp_out); + if(!test_res) pass = 0; + + return pass; +} + +static int ut_util_limit_u32b_to_u16b(uint32_t inp, uint16_t exp_out) +{ + printf(" Input: %d\n", inp); + + uint16_t out = util_limit_u32b_to_u16b(inp); + + printf(" Output:%d\n", out); + printf("Expected:%d\n", exp_out); + + if(out==exp_out) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_util_limit_u32b_to_u16b_test(void) +{ + printf("******************************************************\n"); + printf("uint16_t util_limit_u32b_to_u16b(uint32_t in)\n"); + + int test_res; + int pass = 1; + + uint32_t inp; + uint16_t exp_out; + + inp = 0; + exp_out = 0; + test_res = ut_util_limit_u32b_to_u16b(inp, exp_out); + if(!test_res) pass = 0; + + inp = 0x0000FFFE; + exp_out = 0xFFFE; + test_res = ut_util_limit_u32b_to_u16b(inp, exp_out); + if(!test_res) pass = 0; + + inp = 0x0000FFFF; + exp_out = 0xFFFF; + test_res = ut_util_limit_u32b_to_u16b(inp, exp_out); + if(!test_res) pass = 0; + + inp = 0x0001FFFF; + exp_out = 0xFFFF; + test_res = ut_util_limit_u32b_to_u16b(inp, exp_out); + if(!test_res) pass = 0; + + inp = 0x7FFFFFFF; + exp_out = 0xFFFF; + test_res = ut_util_limit_u32b_to_u16b(inp, exp_out); + if(!test_res) pass = 0; + + inp = 0xFFFFFFFF; + exp_out = 0xFFFF; + test_res = ut_util_limit_u32b_to_u16b(inp, exp_out); + if(!test_res) pass = 0; + + return pass; +} + +static int ut_util_limit_s32b_to_u16b(int32_t inp, uint16_t exp_out) +{ + printf(" Input: %d\n", inp); + + uint16_t out = util_limit_s32b_to_u16b(inp); + + printf(" Output:%d\n", out); + printf("Expected:%d\n", exp_out); + + if(out==exp_out) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_util_limit_s32b_to_u16b_test(void) +{ + printf("******************************************************\n"); + printf("uint16_t util_limit_s32b_to_u16b(int32_t in)\n"); + + int test_res; + int pass = 1; + + int32_t inp; + uint16_t exp_out; + + inp = 0; + exp_out = 0; + test_res = ut_util_limit_s32b_to_u16b(inp, exp_out); + if(!test_res) pass = 0; + + inp = -1; + exp_out = 0; + test_res = ut_util_limit_s32b_to_u16b(inp, exp_out); + if(!test_res) pass = 0; + + inp = -32768; + exp_out = 0; + test_res = ut_util_limit_s32b_to_u16b(inp, exp_out); + if(!test_res) pass = 0; + + inp = -2147483648; + exp_out = 0; + test_res = ut_util_limit_s32b_to_u16b(inp, exp_out); + if(!test_res) pass = 0; + + inp = 1; + exp_out = 1; + test_res = ut_util_limit_s32b_to_u16b(inp, exp_out); + if(!test_res) pass = 0; + + inp = 32767; + exp_out = 32767; + test_res = ut_util_limit_s32b_to_u16b(inp, exp_out); + if(!test_res) pass = 0; + + inp = 65535; + exp_out = 0xFFFF; + test_res = ut_util_limit_s32b_to_u16b(inp, exp_out); + if(!test_res) pass = 0; + + inp = 1000000000; + exp_out = 0xFFFF; + test_res = ut_util_limit_s32b_to_u16b(inp, exp_out); + if(!test_res) pass = 0; + + inp = 2147483647; + exp_out = 0xFFFF; + test_res = ut_util_limit_s32b_to_u16b(inp, exp_out); + if(!test_res) pass = 0; + + return pass; +} + +static int ut_util_convert_muldivoff(uint16_t raw, uint8_t mul, uint8_t div, int16_t offset, uint16_t exp_out) +{ + printf(" Input: Raw:%d Mul:%d Div:%d Offset:%d\n", raw, mul, div, offset); + uint16_t out = util_convert_muldivoff(raw, mul, div, offset); + + printf(" Output:%d\n", out); + printf("Expected:%d\n", exp_out); + + if(out==exp_out) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_util_convert_muldivoff_test(void) +{ + printf("******************************************************\n"); + printf("uint16_t util_convert_muldivoff(uint16_t raw, uint8_t mul, uint8_t div, int16_t offset) \n"); + + int test_res; + int pass = 1; + + uint16_t raw; + uint8_t mul; + uint8_t div; + int16_t offset; + uint16_t exp_out; + + // Normal case + raw = 100; + mul = 1; + div = 1; + offset = 100; + exp_out = 200; + test_res = ut_util_convert_muldivoff(raw, mul, div, offset, exp_out); + if(!test_res) pass = 0; + + // Normal case + raw = 0; + mul = 1; + div = 1; + offset = 0; + exp_out = 0; + test_res = ut_util_convert_muldivoff(raw, mul, div, offset, exp_out); + if(!test_res) pass = 0; + + // max raw + raw = 0xFFFF; + mul = 1; + div = 1; + offset = 0; + exp_out = 0xFFFF; + test_res = ut_util_convert_muldivoff(raw, mul, div, offset, exp_out); + if(!test_res) pass = 0; + + // Saturation + + raw = 40000; + mul = 1; + div = 1; + offset = 30000; + exp_out = 0xFFFF; + test_res = ut_util_convert_muldivoff(raw, mul, div, offset, exp_out); + if(!test_res) pass = 0; + + // Saturation - + raw = 20000; + mul = 1; + div = 1; + offset = -30000; + exp_out = 0; + test_res = ut_util_convert_muldivoff(raw, mul, div, offset, exp_out); + if(!test_res) pass = 0; + + // Multiplier + raw = 10; + mul = 30; + div = 1; + offset = 200; + exp_out = 500; + test_res = ut_util_convert_muldivoff(raw, mul, div, offset, exp_out); + if(!test_res) pass = 0; + + // Divider + raw = 10; + mul = 30; + div = 6; + offset = 200; + exp_out = 250; + test_res = ut_util_convert_muldivoff(raw, mul, div, offset, exp_out); + if(!test_res) pass = 0; + + // Zero mul + raw = 10; + mul = 0; + div = 6; + offset = 99; + exp_out = 99; + test_res = ut_util_convert_muldivoff(raw, mul, div, offset, exp_out); + if(!test_res) pass = 0; + + // Zero div + raw = 10; + mul = 2; + div = 0; + offset = 80; + exp_out = 100; + test_res = ut_util_convert_muldivoff(raw, mul, div, offset, exp_out); + if(!test_res) pass = 0; + + // Zero div + raw = 0xFFFE; + mul = 255; + div = 255; + offset = -1; + exp_out = 0xFFFD; + test_res = ut_util_convert_muldivoff(raw, mul, div, offset, exp_out); + if(!test_res) pass = 0; + + return pass; +} + +static int ut_util_sat_mul_kilo(uint16_t xk, uint16_t yk, uint16_t exp_out) +{ + printf(" Input: X:%d Y:%d \n", xk, yk); + + uint16_t out = util_sat_mul_kilo(xk, yk); + + printf(" Output:%d\n", out); + printf("Expected:%d\n", exp_out); + + if(out==exp_out) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_util_sat_mul_kilo_test(void) +{ + printf("******************************************************\n"); + printf("uint16_t util_sat_mul_kilo(uint16_t xk, uint16_t yk) \n"); + + int test_res; + int pass = 1; + + uint16_t xk; + uint16_t yk; + uint16_t exp_out; + + // Normal case + xk = 1000; + yk = 1000; + exp_out = 1000; + test_res = ut_util_sat_mul_kilo(xk, yk, exp_out); + if(!test_res) pass = 0; + + // Normal case + xk = 60000; + yk = 1; + exp_out = 60; + test_res = ut_util_sat_mul_kilo(xk, yk, exp_out); + if(!test_res) pass = 0; + + // Normal case + xk = 2; + yk = 30000; + exp_out = 60; + test_res = ut_util_sat_mul_kilo(xk, yk, exp_out); + if(!test_res) pass = 0; + + // Normal case + xk = 0xFFFF; + yk = 0xFFFF; + exp_out = 0xFFFF; + test_res = ut_util_sat_mul_kilo(xk, yk, exp_out); + if(!test_res) pass = 0; + + // Normal case + xk = 8095; + yk = 8095; + exp_out = 65529; + test_res = ut_util_sat_mul_kilo(xk, yk, exp_out); + if(!test_res) pass = 0; + + // Saturation + xk = 10000; + yk = 20000; + exp_out = 0xFFFF; + test_res = ut_util_sat_mul_kilo(xk, yk, exp_out); + if(!test_res) pass = 0; + + return pass; +} + +static int ut_util_sat_div_kilo(uint16_t top, uint16_t bot, uint16_t exp_out) +{ + printf(" Input: Top:%d Bottom:%d \n", top, bot); + + uint16_t out = util_sat_div_kilo(top, bot); + + printf(" Output:%d\n", out); + printf("Expected:%d\n", exp_out); + + if(out==exp_out) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_util_sat_div_kilo_test(void) +{ + printf("******************************************************\n"); + printf("uint16_t util_sat_div_kilo(uint16_t top, uint16_t bot) \n"); + + int test_res; + int pass = 1; + + uint16_t top; + uint16_t bot; + uint16_t exp_out; + + // Normal case + top = 1000; + bot = 1000; + exp_out = 1000; + test_res = ut_util_sat_div_kilo(top, bot, exp_out); + if(!test_res) pass = 0; + + // Normal case + top = 12000; + bot = 6000; + exp_out = 2000; + test_res = ut_util_sat_div_kilo(top, bot, exp_out); + if(!test_res) pass = 0; + + // Saturation + top = 40000; + bot = 500; + exp_out = 0xFFFF; + test_res = ut_util_sat_div_kilo(top, bot, exp_out); + if(!test_res) pass = 0; + + // Zero + top = 40000; + bot = 0; + exp_out = 0xFFFF; + test_res = ut_util_sat_div_kilo(top, bot, exp_out); + if(!test_res) pass = 0; + + // Zero + top = 0; + bot = 2000; + exp_out = 0; + test_res = ut_util_sat_div_kilo(top, bot, exp_out); + if(!test_res) pass = 0; + + return pass; +} + +static int ut_util_sat_ratio_16b(uint16_t top, uint16_t bot, uint16_t exp_out) +{ + printf(" Input: Top:%d Bottom:%d \n", top, bot); + + uint16_t out = util_sat_ratio_16b(top, bot); + + printf(" Output:%d\n", out); + printf("Expected:%d\n", exp_out); + + if(out==exp_out) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_util_sat_ratio_16b_test(void) +{ + printf("******************************************************\n"); + printf("uint16_t util_sat_ratio_16b(uint16_t top, uint16_t bot) \n"); + + int test_res; + int pass = 1; + + uint16_t top; + uint16_t bot; + uint16_t exp_out; + + // Normal case + top = 1000; + bot = 1000; + exp_out = 0xFFFF; + test_res = ut_util_sat_ratio_16b(top, bot, exp_out); + if(!test_res) pass = 0; + + // Normal case + top = 0xFFFF; + bot = 0xFFFF; + exp_out = 0xFFFF; + test_res = ut_util_sat_ratio_16b(top, bot, exp_out); + if(!test_res) pass = 0; + + // Normal case + top = 6000; + bot = 12000; + exp_out = 0x7FFF; + test_res = ut_util_sat_ratio_16b(top, bot, exp_out); + if(!test_res) pass = 0; + + // Normal case + top = 11000; + bot = 44000; + exp_out = 0x3FFF; + test_res = ut_util_sat_ratio_16b(top, bot, exp_out); + if(!test_res) pass = 0; + + // Zero + top = 0; + bot = 212; + exp_out = 0; + test_res = ut_util_sat_ratio_16b(top, bot, exp_out); + if(!test_res) pass = 0; + + // Zero + top = 158; + bot = 0; + exp_out = 0xFFFF; + test_res = ut_util_sat_ratio_16b(top, bot, exp_out); + if(!test_res) pass = 0; + + return pass; +} + +static int ut_util_percent_to_16b(uint8_t percent, uint16_t exp_out) +{ + printf(" Input: Percent:%d \n", percent); + + uint16_t out = util_percent_to_16b(percent); + + printf(" Output:%d\n", out); + printf("Expected:%d\n", exp_out); + + if(out==exp_out) + { + printf("PASS\n\n"); + return 1; + } + else + { + printf("FAIL\n\n"); + return 0; + } +} + +int ut_util_percent_to_16b_test(void) +{ + printf("******************************************************\n"); + printf("uint16_t util_percent_to_16b(uint8_t percent) \n"); + + int test_res; + int pass = 1; + + uint8_t percent; + uint16_t exp_out; + + // 0% + percent = 0; + exp_out = 0; + test_res = ut_util_percent_to_16b(percent, exp_out); + if(!test_res) pass = 0; + + // 25% + percent = 25; + exp_out = 16383; + test_res = ut_util_percent_to_16b(percent, exp_out); + if(!test_res) pass = 0; + + // 50% + percent = 50; + exp_out = 0x7FFF; + test_res = ut_util_percent_to_16b(percent, exp_out); + if(!test_res) pass = 0; + + // 75% + percent = 75; + exp_out = 49151; + test_res = ut_util_percent_to_16b(percent, exp_out); + if(!test_res) pass = 0; + + // 100% + percent = 100; + exp_out = 65535; + test_res = ut_util_percent_to_16b(percent, exp_out); + if(!test_res) pass = 0; + + // 200% + percent = 200; + exp_out = 0xFFFF; + test_res = ut_util_percent_to_16b(percent, exp_out); + if(!test_res) pass = 0; + + return pass; +} + +static int ut_util_interpolate_1d_u16b(uint16_t x, uint16_t* x_axis, uint16_t* y_values, uint8_t len_axis, uint16_t exp_out) +{ + printf(" Input: X:%d \n", x); + printf("X values, Y values\n"); + for(uint8_t i=0; i +#include + +int ut_util_invert_8b_test(void); +int ut_util_sat_add_8b_test(void); +int ut_util_sat_subtract_8b_test(void); +int ut_util_sat_util_sat_add_16b_test(void); +int ut_util_sat_subtract_16b_test(void); + +int ut_util_limit_u32b_to_u16b_test(void); +int ut_util_limit_s32b_to_u16b_test(void); + +int ut_util_convert_muldivoff_test(void); + +int ut_util_sat_mul_kilo_test(void); +int ut_util_sat_div_kilo_test(void); + +int ut_util_sat_ratio_16b_test(void); +int ut_util_percent_to_16b_test(void); + +int ut_util_interpolate_1d_u16b_test(void); +int ut_util_interpolate_2d_u16b_test(void); + +#endif /* UT_UTILS_H_ */ diff --git a/led board/LED_Interface.PrjPcb b/pcb/led board/LED_Interface.PrjPcb similarity index 100% rename from led board/LED_Interface.PrjPcb rename to pcb/led board/LED_Interface.PrjPcb diff --git a/led board/settings/Private_OutJob_v1.OutJob b/pcb/led board/settings/Private_OutJob_v1.OutJob similarity index 100% rename from led board/settings/Private_OutJob_v1.OutJob rename to pcb/led board/settings/Private_OutJob_v1.OutJob diff --git a/led board/source/Connections.SchDoc b/pcb/led board/source/Connections.SchDoc similarity index 100% rename from led board/source/Connections.SchDoc rename to pcb/led board/source/Connections.SchDoc diff --git a/led board/source/Cover_page.SchDoc b/pcb/led board/source/Cover_page.SchDoc similarity index 100% rename from led board/source/Cover_page.SchDoc rename to pcb/led board/source/Cover_page.SchDoc diff --git a/led board/source/History.SchDoc b/pcb/led board/source/History.SchDoc similarity index 100% rename from led board/source/History.SchDoc rename to pcb/led board/source/History.SchDoc diff --git a/led board/source/Index.SchDoc b/pcb/led board/source/Index.SchDoc similarity index 100% rename from led board/source/Index.SchDoc rename to pcb/led board/source/Index.SchDoc diff --git a/led board/source/LED_board.PcbDoc b/pcb/led board/source/LED_board.PcbDoc similarity index 100% rename from led board/source/LED_board.PcbDoc rename to pcb/led board/source/LED_board.PcbDoc diff --git a/led board/source/Miscellaneous.SchDoc b/pcb/led board/source/Miscellaneous.SchDoc similarity index 100% rename from led board/source/Miscellaneous.SchDoc rename to pcb/led board/source/Miscellaneous.SchDoc diff --git a/main board/settings/Private_OutJob_v2.OutJob b/pcb/main board/settings/Private_OutJob_v2.OutJob similarity index 100% rename from main board/settings/Private_OutJob_v2.OutJob rename to pcb/main board/settings/Private_OutJob_v2.OutJob diff --git a/main board/source/Chasis_inputs.SchDoc b/pcb/main board/source/Chasis_inputs.SchDoc similarity index 100% rename from main board/source/Chasis_inputs.SchDoc rename to pcb/main board/source/Chasis_inputs.SchDoc diff --git a/main board/source/Coil_driver.SchDoc b/pcb/main board/source/Coil_driver.SchDoc similarity index 100% rename from main board/source/Coil_driver.SchDoc rename to pcb/main board/source/Coil_driver.SchDoc diff --git a/main board/source/Controller.SchDoc b/pcb/main board/source/Controller.SchDoc similarity index 100% rename from main board/source/Controller.SchDoc rename to pcb/main board/source/Controller.SchDoc diff --git a/main board/source/Cover_page.SchDoc b/pcb/main board/source/Cover_page.SchDoc similarity index 100% rename from main board/source/Cover_page.SchDoc rename to pcb/main board/source/Cover_page.SchDoc diff --git a/main board/source/History.SchDoc b/pcb/main board/source/History.SchDoc similarity index 100% rename from main board/source/History.SchDoc rename to pcb/main board/source/History.SchDoc diff --git a/main board/source/Index.SchDoc b/pcb/main board/source/Index.SchDoc similarity index 100% rename from main board/source/Index.SchDoc rename to pcb/main board/source/Index.SchDoc diff --git a/main board/source/LEDs.SchDoc b/pcb/main board/source/LEDs.SchDoc similarity index 100% rename from main board/source/LEDs.SchDoc rename to pcb/main board/source/LEDs.SchDoc diff --git a/main board/source/Main_Connector.SchDoc b/pcb/main board/source/Main_Connector.SchDoc similarity index 100% rename from main board/source/Main_Connector.SchDoc rename to pcb/main board/source/Main_Connector.SchDoc diff --git a/main board/source/Miscellaneous.SchDoc b/pcb/main board/source/Miscellaneous.SchDoc similarity index 100% rename from main board/source/Miscellaneous.SchDoc rename to pcb/main board/source/Miscellaneous.SchDoc diff --git a/main board/source/Power.SchDoc b/pcb/main board/source/Power.SchDoc similarity index 100% rename from main board/source/Power.SchDoc rename to pcb/main board/source/Power.SchDoc diff --git a/main board/source/Speed_inputs.SchDoc b/pcb/main board/source/Speed_inputs.SchDoc similarity index 100% rename from main board/source/Speed_inputs.SchDoc rename to pcb/main board/source/Speed_inputs.SchDoc diff --git a/main board/source/USB.SchDoc b/pcb/main board/source/USB.SchDoc similarity index 100% rename from main board/source/USB.SchDoc rename to pcb/main board/source/USB.SchDoc diff --git a/main board/source/uDCCD_Controller.PcbDoc b/pcb/main board/source/uDCCD_Controller.PcbDoc similarity index 100% rename from main board/source/uDCCD_Controller.PcbDoc rename to pcb/main board/source/uDCCD_Controller.PcbDoc diff --git a/main board/uDCCD_Controller.PrjPcb b/pcb/main board/uDCCD_Controller.PrjPcb similarity index 100% rename from main board/uDCCD_Controller.PrjPcb rename to pcb/main board/uDCCD_Controller.PrjPcb diff --git a/test board/settings/Private_OutJob_v2.OutJob b/test board/settings/Private_OutJob_v2.OutJob deleted file mode 100644 index e76ca31..0000000 --- a/test board/settings/Private_OutJob_v2.OutJob +++ /dev/null @@ -1,793 +0,0 @@ -[OutputJobFile] -Version=1.0 -Caption= -Description= -VaultGUID= -ItemGUID= -ItemHRID= -RevisionGUID= -RevisionId= -VaultHRID= -AutoItemHRID= -NextRevId= -FolderGUID= -LifeCycleDefinitionGUID= -RevisionNamingSchemeGUID= - -[OutputGroup1] -Name= -Description= -TargetOutputMedium=PCB 3D Model -VariantName=[No Variations] -VariantScope=1 -CurrentConfigurationName= -TargetPrinter=Microsoft Print to PDF -PrinterOptions=Record=PrinterOptions|Copies=1|Duplex=1|TrueTypeOptions=3|Collate=1|PrintJobKind=1|PrintWhat=1 -OutputMedium1=Print Job -OutputMedium1_Type=Printer -OutputMedium1_Printer= -OutputMedium1_PrinterOptions=Record=PrinterOptions|Copies=1|Duplex=1|TrueTypeOptions=3|Collate=1|PrintJobKind=1|PrintWhat=1 -OutputMedium2=[VAR] PCBA Schematic -OutputMedium2_Type=Publish -OutputMedium3=PCB DOCS -OutputMedium3_Type=Publish -OutputMedium4=PCB 3D Model -OutputMedium4_Type=GeneratedFiles -OutputMedium5=PCB Gerbers -OutputMedium5_Type=GeneratedFiles -OutputMedium6=PCB Pick and Place -OutputMedium6_Type=GeneratedFiles -OutputMedium7=[VAR] PCBA Assembly Pictures -OutputMedium7_Type=Publish -OutputMedium8=[VAR] PCBA BOM -OutputMedium8_Type=GeneratedFiles -OutputMedium9=[VAR] PCBA Model -OutputMedium9_Type=GeneratedFiles -OutputMedium10=[VAR] PCBA Placement BOM -OutputMedium10_Type=GeneratedFiles -OutputType1=Schematic Print -OutputName1=Schematic -OutputCategory1=Documentation -OutputDocumentPath1=[Project Physical Documents] -OutputVariantName1= -OutputEnabled1=0 -OutputEnabled1_OutputMedium1=0 -OutputEnabled1_OutputMedium2=1 -OutputEnabled1_OutputMedium3=0 -OutputEnabled1_OutputMedium4=0 -OutputEnabled1_OutputMedium5=0 -OutputEnabled1_OutputMedium6=0 -OutputEnabled1_OutputMedium7=0 -OutputEnabled1_OutputMedium8=0 -OutputEnabled1_OutputMedium9=0 -OutputEnabled1_OutputMedium10=0 -OutputDefault1=0 -PageOptions1=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=0|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -Configuration1_Name1=OutputConfigurationParameter1 -Configuration1_Item1=Record=SchPrintView|ShowNoERC=False|ShowParamSet=True|ShowProbe=True|ShowBlanket=True|NoERCSymbolsToShow="Thin Cross","Thick Cross","Small Cross",Checkbox,Triangle|ShowNote=True|ShowNoteCollapsed=True|ShowOpenEnds=True|ExpandDesignator=True|ExpandNetLabel=False|ExpandPort=False|ExpandSheetNum=False|ExpandDocNum=False|PrintArea=0|PrintAreaRect.X1=0|PrintAreaRect.Y1=0|PrintAreaRect.X2=0|PrintAreaRect.Y2=0|DocumentPath=All SCH Documents -OutputType2=BOM_PartType -OutputName2=BOM -OutputCategory2=Report -OutputDocumentPath2= -OutputVariantName2=Default -OutputEnabled2=0 -OutputEnabled2_OutputMedium1=0 -OutputEnabled2_OutputMedium2=0 -OutputEnabled2_OutputMedium3=0 -OutputEnabled2_OutputMedium4=0 -OutputEnabled2_OutputMedium5=0 -OutputEnabled2_OutputMedium6=0 -OutputEnabled2_OutputMedium7=0 -OutputEnabled2_OutputMedium8=1 -OutputEnabled2_OutputMedium9=0 -OutputEnabled2_OutputMedium10=0 -OutputDefault2=0 -PageOptions2=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -Configuration2_Name1=ColumnNameFormat -Configuration2_Item1=CaptionAsName -Configuration2_Name2=General -Configuration2_Item2=OpenExported=False|AddToProject=False|ReportBOMViolationsInMessages=False|ForceFit=False|NotFitted=True|Database=False|DatabasePriority=False|IncludePcbData=False|IncludeVaultData=False|IncludeCloudData=False|IncludeDocumentData=True|IncludeAlternatives=False|ShowExportOptions=True|TemplateFilename=|TemplateVaultGuid=|TemplateItemGuid=|TemplateRevisionGuid=|BatchMode=2|FormWidth=1639|FormHeight=883|SupplierProdQty=1|SupplierAutoQty=False|SupplierUseCachedPricing=False|SupplierCurrency=USD|SolutionsPerItem=1|SuppliersPerSolution=1|ViewType=1|UseDirectApi=False|BomSetName= -Configuration2_Name3=GroupOrder -Configuration2_Item3=LibRef=True|Fitted=True|RESTRICT=True|Comment=True -Configuration2_Name4=SortOrder -Configuration2_Item4=Fitted=Up -Configuration2_Name5=VisibleOrder -Configuration2_Item5=Designator=180|Description=293|PACKAGE=90|VALUE=87|MANUFACTURER=109|PART#=112|Quantity=62|Fitted=76|RESTRICT=78 -Configuration2_Name6=VisibleOrder_Flat -Configuration2_Item6=Designator=180|Description=293|PACKAGE=90|VALUE=87|MANUFACTURER=109|PART#=112|Quantity=62|Fitted=76|RESTRICT=78 -OutputType3=Gerber -OutputName3=Gerber Files -OutputCategory3=Fabrication -OutputDocumentPath3= -OutputVariantName3= -OutputEnabled3=0 -OutputEnabled3_OutputMedium1=0 -OutputEnabled3_OutputMedium2=0 -OutputEnabled3_OutputMedium3=0 -OutputEnabled3_OutputMedium4=0 -OutputEnabled3_OutputMedium5=1 -OutputEnabled3_OutputMedium6=0 -OutputEnabled3_OutputMedium7=0 -OutputEnabled3_OutputMedium8=0 -OutputEnabled3_OutputMedium9=0 -OutputEnabled3_OutputMedium10=0 -OutputDefault3=0 -Configuration3_Name1=OutputConfigurationParameter1 -Configuration3_Item1=AddLayersToGroup.Group_0=0|AddLayersToGroup.Group_1=1|AddLayersToGroup.Group_2=2|AddLayersToGroup.Group_3=3|AddLayersToGroup.Group_4=4|AddLayersToGroup.Group_5=5|AddLayersToGroup.Group_6=7|AddLayersToGroup.Group_7=8|AddLayersToGroup.Set_0=16908289|AddLayersToGroup.Set_1=16908289|AddLayersToGroup.Set_2=16908289|AddLayersToGroup.Set_3=16908289|AddLayersToGroup.Set_4=16908289|AddLayersToGroup.Set_5=16908289|AddLayersToGroup.Set_6=16908289|AddLayersToGroup.Set_7=16908289|AddLayersToGroups.Count=8|AddToAllLayerClasses.Set= |AddToAllPlots.Set=SerializeLayerHash.Version~2,ClassName~TPlotLayerStateArray,16908289~1|BoardID=XKPBYTFL|CentrePlots=False|DrillDrawingSymbol=GraphicsSymbol|DrillDrawingSymbolSize=200000|EmbeddedApertures=True|FilmBorderSize=10000000|FilmYSize=160000000|FilmXSize=200000000|FlashAllFills=False|FlashPadShapes=True|G54OnApertureChange=False|GenerateDRCRulesFile=False|GenerateDRCRulesFile=False|GenerateReliefShapes=True|GenerateReports=False|GerberUnit=Metric|GerberUnit=Metric|IncludeUnconnectedMidLayerPads=False|LayerClassesMirror.Set= |LayerClassesPlot.Set= |LeadingAndTrailingZeroesMode=SuppressLeadingZeroes|MaxApertureSize=2500000|MergePadAndRegion=False|MinusApertureTolerance=39|MinusApertureTolerance=39|Mirror.Set=SerializeLayerHash.Version~2,ClassName~TPlotLayerStateArray|MirrorDrillDrawingPlots=False|MirrorDrillGuidePlots=False|NoRegularPolygons=False|NumberOfDecimals=4|NumberOfDecimals=4|OptimizeChangeLocationCommands=True|OptimizeChangeLocationCommands=True|OriginPosition=Relative|OutputFormat=Different|Panelize=False|Plot.Set=SerializeLayerHash.Version~2,ClassName~TPlotLayerStateArray,16973830~1,16973832~1,16973834~1,16777217~1,16842751~1,16973835~1,16908289~1,16777218~1,16777219~1|PlotBoardProfile=False|PlotBoardProfileFileName=uDCCD_Speed_extension.GM|PlotPositivePlaneLayers=False|PlotUsedDrillDrawingLayerPairs=False|PlotUsedDrillGuideLayerPairs=False|PlusApertureTolerance=39|PlusApertureTolerance=39|Record=GerberView|SoftwareArcs=False|Sorted=False|Sorted=False|UncheckPlotDrillDrawingLayerPair0_Backdrill=False|UncheckPlotDrillDrawingLayerPair0_Checked=False|UncheckPlotDrillDrawingLayerPair0_DrillType=Regular|UncheckPlotDrillDrawingLayerPair0_FileName=PE19-LidarBalancer_DUT.GD1|UncheckPlotDrillDrawingLayerPair0_HighLayer=Bottom Layer|UncheckPlotDrillDrawingLayerPair0_LowLayer=Top Layer|UncheckPlotDrillGuideLayerPair0_Backdrill=False|UncheckPlotDrillGuideLayerPair0_Checked=False|UncheckPlotDrillGuideLayerPair0_DrillType=Regular|UncheckPlotDrillGuideLayerPair0_FileName=PE19-LidarBalancer_DUT.GG1|UncheckPlotDrillGuideLayerPair0_HighLayer=Bottom Layer|UncheckPlotDrillGuideLayerPair0_LowLayer=Top Layer|UserLayerName.Caption0=DAQ_Controller-1.GM23|UserLayerName.Caption1=DAQ_Controller-1.GTP|UserLayerName.Caption10=DAQ_Controller-1.G1|UserLayerName.Caption11=DAQ_Controller-1.GM19|UserLayerName.Caption12=DAQ_Controller-1.GM10|UserLayerName.Caption13=DAQ_Controller-1.GBS|UserLayerName.Caption14=DAQ_Controller-1.GM7|UserLayerName.Caption15=DAQ_Controller-1.G2|UserLayerName.Caption16=DAQ_Controller-1.GM6|UserLayerName.Caption17=DAQ_Controller-1.GM16|UserLayerName.Caption18=DAQ_Controller-1.GBL|UserLayerName.Caption19=DAQ_Controller-1.GM5|UserLayerName.Caption2=DAQ_Controller-1.GTO|UserLayerName.Caption20=DAQ_Controller-1.GM15|UserLayerName.Caption21=DAQ_Controller-1.GM30|UserLayerName.Caption22=DAQ_Controller-1.GM32|UserLayerName.Caption23=PE19-LidarBalancer_DUT.GM14|UserLayerName.Caption24=PE19-LidarBalancer_DUT.GM29|UserLayerName.Caption25=DAQ_Controller-1.GM17|UserLayerName.Caption26=DAQ_Controller-1.GTL|UserLayerName.Caption27=PE19-LidarBalancer_DUT.GM18|UserLayerName.Caption28=DAQ_Controller-1.GBO|UserLayerName.Caption29=PE19-LidarBalancer_DUT.GM40|UserLayerName.Caption3=DAQ_Controller-1.GTS|UserLayerName.Caption30=DAQ_Controller-1.GPT|UserLayerName.Caption31=PE19-LidarBalancer_DUT.GM13|UserLayerName.Caption32=DAQ_Controller-1.GM21|UserLayerName.Caption33=DAQ_Controller-1.GM9|UserLayerName.Caption34=DAQ_Controller-1.GM11|UserLayerName.Caption35=DAQ_Controller-1.GM1|UserLayerName.Caption36=rBMC_module.G3|UserLayerName.Caption37=DAQ_Controller-1.GM8|UserLayerName.Caption38=rBMC_module.G2|UserLayerName.Caption39=DAQ_Controller-1.GM3|UserLayerName.Caption4=DAQ_Controller-1.GM4|UserLayerName.Caption40=DAQ_Controller-1.GM20|UserLayerName.Caption41=DAQ_Controller-1.GM31|UserLayerName.Caption42=DAQ_Controller-1.GM22|UserLayerName.Caption43=DAQ_Controller-1.GBP|UserLayerName.Caption5=DAQ_Controller-1.GM2|UserLayerName.Caption6=DAQ_Controller-1.GM12|UserLayerName.Caption7=DAQ_Controller-1.GPB|UserLayerName.Caption8=PE19-LidarBalancer_DUT.GM41|UserLayerName.Caption9=DAQ_Controller-1.GKO|UserLayerName.Count=44|UserLayerName.Layer0=16908311|UserLayerName.Layer1=16973832|UserLayerName.Layer10=16777218|UserLayerName.Layer11=16908307|UserLayerName.Layer12=16908298|UserLayerName.Layer13=16973835|UserLayerName.Layer14=16908295|UserLayerName.Layer15=16777219|UserLayerName.Layer16=16908294|UserLayerName.Layer17=16908304|UserLayerName.Layer18=16842751|UserLayerName.Layer19=16908293|UserLayerName.Layer2=16973830|UserLayerName.Layer20=16908303|UserLayerName.Layer21=16908318|UserLayerName.Layer22=16908320|UserLayerName.Layer23=16908302|UserLayerName.Layer24=16908317|UserLayerName.Layer25=16908305|UserLayerName.Layer26=16777217|UserLayerName.Layer27=16908306|UserLayerName.Layer28=16973831|UserLayerName.Layer29=16908328|UserLayerName.Layer3=16973834|UserLayerName.Layer30=16973848|UserLayerName.Layer31=16908301|UserLayerName.Layer32=16908309|UserLayerName.Layer33=16908297|UserLayerName.Layer34=16908299|UserLayerName.Layer35=16908289|UserLayerName.Layer36=16777220|UserLayerName.Layer37=16908296|UserLayerName.Layer38=16777221|UserLayerName.Layer39=16908291|UserLayerName.Layer4=16908292|UserLayerName.Layer40=16908308|UserLayerName.Layer41=16908319|UserLayerName.Layer42=16908310|UserLayerName.Layer43=16973833|UserLayerName.Layer5=16908290|UserLayerName.Layer6=16908300|UserLayerName.Layer7=16973849|UserLayerName.Layer8=16908329|UserLayerName.Layer9=16973837|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -OutputType4=Gerber -OutputName4=Gerber File Notes -OutputCategory4=Fabrication -OutputDocumentPath4= -OutputVariantName4= -OutputEnabled4=0 -OutputEnabled4_OutputMedium1=0 -OutputEnabled4_OutputMedium2=0 -OutputEnabled4_OutputMedium3=0 -OutputEnabled4_OutputMedium4=0 -OutputEnabled4_OutputMedium5=2 -OutputEnabled4_OutputMedium6=0 -OutputEnabled4_OutputMedium7=0 -OutputEnabled4_OutputMedium8=0 -OutputEnabled4_OutputMedium9=0 -OutputEnabled4_OutputMedium10=0 -OutputDefault4=0 -Configuration4_Name1=OutputConfigurationParameter1 -Configuration4_Item1=AddLayersToGroup.Group_0=0|AddLayersToGroup.Group_1=1|AddLayersToGroup.Group_2=2|AddLayersToGroup.Group_3=3|AddLayersToGroup.Group_4=4|AddLayersToGroup.Group_5=5|AddLayersToGroup.Group_6=7|AddLayersToGroup.Group_7=8|AddLayersToGroup.Set_0=16908289,16908290,16908291,16908295|AddLayersToGroup.Set_1=16908289,16908290,16908291,16908295|AddLayersToGroup.Set_2=16908289,16908290,16908291,16908295|AddLayersToGroup.Set_3=16908289,16908290,16908291,16908295|AddLayersToGroup.Set_4=16908289,16908290,16908291,16908295|AddLayersToGroup.Set_5=16908289,16908290,16908291,16908295|AddLayersToGroup.Set_6=16908289,16908290,16908291,16908295|AddLayersToGroup.Set_7=16908289,16908290,16908291,16908295|AddLayersToGroups.Count=8|AddToAllLayerClasses.Set= |AddToAllPlots.Set=SerializeLayerHash.Version~2,ClassName~TPlotLayerStateArray,16908289~1,16908290~1,16908291~1,16908295~1|BoardID=XKPBYTFL|CentrePlots=False|DrillDrawingSymbol=GraphicsSymbol|DrillDrawingSymbolSize=200000|EmbeddedApertures=True|FilmBorderSize=10000000|FilmYSize=160000000|FilmXSize=200000000|FlashAllFills=False|FlashPadShapes=True|G54OnApertureChange=False|GenerateDRCRulesFile=False|GenerateDRCRulesFile=False|GenerateReliefShapes=True|GenerateReports=False|GerberUnit=Metric|GerberUnit=Metric|IncludeUnconnectedMidLayerPads=False|LayerClassesMirror.Set= |LayerClassesPlot.Set= |LeadingAndTrailingZeroesMode=SuppressLeadingZeroes|MaxApertureSize=2500000|MergePadAndRegion=False|MinusApertureTolerance=39|MinusApertureTolerance=39|Mirror.Set=SerializeLayerHash.Version~2,ClassName~TPlotLayerStateArray|MirrorDrillDrawingPlots=False|MirrorDrillGuidePlots=False|NoRegularPolygons=False|NumberOfDecimals=4|NumberOfDecimals=4|OptimizeChangeLocationCommands=True|OptimizeChangeLocationCommands=True|OriginPosition=Relative|OutputFormat=Different|Panelize=False|Plot.Set=SerializeLayerHash.Version~2,ClassName~TPlotLayerStateArray|PlotBoardProfile=False|PlotBoardProfileFileName=uDCCD_Speed_extension.GM|PlotDrillDrawingLayerPair0_Backdrill=False|PlotDrillDrawingLayerPair0_Checked=True|PlotDrillDrawingLayerPair0_DrillType=Regular|PlotDrillDrawingLayerPair0_FileName=sPDM-620.GD1|PlotDrillDrawingLayerPair0_HighLayer=Bottom Layer|PlotDrillDrawingLayerPair0_LowLayer=Top Layer|PlotPositivePlaneLayers=False|PlotUsedDrillDrawingLayerPairs=True|PlotUsedDrillGuideLayerPairs=False|PlusApertureTolerance=39|PlusApertureTolerance=39|Record=GerberView|SoftwareArcs=False|Sorted=False|Sorted=False|UncheckPlotDrillGuideLayerPair0_Backdrill=False|UncheckPlotDrillGuideLayerPair0_Checked=False|UncheckPlotDrillGuideLayerPair0_DrillType=Regular|UncheckPlotDrillGuideLayerPair0_FileName=sPDM-620.GG1|UncheckPlotDrillGuideLayerPair0_HighLayer=Bottom Layer|UncheckPlotDrillGuideLayerPair0_LowLayer=Top Layer|UserLayerName.Caption0=DAQ_Controller-1.GM23|UserLayerName.Caption1=DAQ_Controller-1.GTP|UserLayerName.Caption10=DAQ_Controller-1.G1|UserLayerName.Caption11=DAQ_Controller-1.GM19|UserLayerName.Caption12=DAQ_Controller-1.GM10|UserLayerName.Caption13=DAQ_Controller-1.GBS|UserLayerName.Caption14=DAQ_Controller-1.GM7|UserLayerName.Caption15=DAQ_Controller-1.G2|UserLayerName.Caption16=DAQ_Controller-1.GM6|UserLayerName.Caption17=DAQ_Controller-1.GM16|UserLayerName.Caption18=DAQ_Controller-1.GBL|UserLayerName.Caption19=DAQ_Controller-1.GM5|UserLayerName.Caption2=DAQ_Controller-1.GTO|UserLayerName.Caption20=DAQ_Controller-1.GM15|UserLayerName.Caption21=DAQ_Controller-1.GM30|UserLayerName.Caption22=DAQ_Controller-1.GM32|UserLayerName.Caption23=sPDM-620.GM14|UserLayerName.Caption24=sPDM-620.GM29|UserLayerName.Caption25=DAQ_Controller-1.GM17|UserLayerName.Caption26=DAQ_Controller-1.GTL|UserLayerName.Caption27=sPDM-620.GM18|UserLayerName.Caption28=DAQ_Controller-1.GBO|UserLayerName.Caption29=sPDM-620.GM40|UserLayerName.Caption3=DAQ_Controller-1.GTS|UserLayerName.Caption30=DAQ_Controller-1.GPT|UserLayerName.Caption31=sPDM-620.GM13|UserLayerName.Caption32=DAQ_Controller-1.GM21|UserLayerName.Caption33=DAQ_Controller-1.GM9|UserLayerName.Caption34=DAQ_Controller-1.GM11|UserLayerName.Caption35=DAQ_Controller-1.GM1|UserLayerName.Caption36=rBMC_module.G3|UserLayerName.Caption37=DAQ_Controller-1.GM8|UserLayerName.Caption38=rBMC_module.G2|UserLayerName.Caption39=DAQ_Controller-1.GM3|UserLayerName.Caption4=DAQ_Controller-1.GM4|UserLayerName.Caption40=DAQ_Controller-1.GM20|UserLayerName.Caption41=DAQ_Controller-1.GM31|UserLayerName.Caption42=DAQ_Controller-1.GM22|UserLayerName.Caption43=DAQ_Controller-1.GKO|UserLayerName.Caption5=DAQ_Controller-1.GM2|UserLayerName.Caption6=DAQ_Controller-1.GM12|UserLayerName.Caption7=DAQ_Controller-1.GPB|UserLayerName.Caption8=sPDM-620.GM41|UserLayerName.Caption9=DAQ_Controller-1.GBP|UserLayerName.Count=44|UserLayerName.Layer0=16908311|UserLayerName.Layer1=16973832|UserLayerName.Layer10=16777218|UserLayerName.Layer11=16908307|UserLayerName.Layer12=16908298|UserLayerName.Layer13=16973835|UserLayerName.Layer14=16908295|UserLayerName.Layer15=16777219|UserLayerName.Layer16=16908294|UserLayerName.Layer17=16908304|UserLayerName.Layer18=16842751|UserLayerName.Layer19=16908293|UserLayerName.Layer2=16973830|UserLayerName.Layer20=16908303|UserLayerName.Layer21=16908318|UserLayerName.Layer22=16908320|UserLayerName.Layer23=16908302|UserLayerName.Layer24=16908317|UserLayerName.Layer25=16908305|UserLayerName.Layer26=16777217|UserLayerName.Layer27=16908306|UserLayerName.Layer28=16973831|UserLayerName.Layer29=16908328|UserLayerName.Layer3=16973834|UserLayerName.Layer30=16973848|UserLayerName.Layer31=16908301|UserLayerName.Layer32=16908309|UserLayerName.Layer33=16908297|UserLayerName.Layer34=16908299|UserLayerName.Layer35=16908289|UserLayerName.Layer36=16777220|UserLayerName.Layer37=16908296|UserLayerName.Layer38=16777221|UserLayerName.Layer39=16908291|UserLayerName.Layer4=16908292|UserLayerName.Layer40=16908308|UserLayerName.Layer41=16908319|UserLayerName.Layer42=16908310|UserLayerName.Layer43=16973837|UserLayerName.Layer5=16908290|UserLayerName.Layer6=16908300|UserLayerName.Layer7=16973849|UserLayerName.Layer8=16908329|UserLayerName.Layer9=16973833|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -OutputType5=NC Drill -OutputName5=NC Drill Files -OutputCategory5=Fabrication -OutputDocumentPath5= -OutputVariantName5= -OutputEnabled5=0 -OutputEnabled5_OutputMedium1=0 -OutputEnabled5_OutputMedium2=0 -OutputEnabled5_OutputMedium3=0 -OutputEnabled5_OutputMedium4=0 -OutputEnabled5_OutputMedium5=3 -OutputEnabled5_OutputMedium6=0 -OutputEnabled5_OutputMedium7=0 -OutputEnabled5_OutputMedium8=0 -OutputEnabled5_OutputMedium9=0 -OutputEnabled5_OutputMedium10=0 -OutputDefault5=0 -Configuration5_Name1=OutputConfigurationParameter1 -Configuration5_Item1=BoardEdgeRoutToolDia=2000000|GenerateBoardEdgeRout=False|GenerateDrilledSlotsG85=False|GenerateEIADrillFile=False|GenerateSeparatePlatedNonPlatedFiles=True|GenerateSeparateViaTypeFiles=False|GenerateToolsByDrillSymbols=False|NumberOfDecimals=4|NumberOfUnits=4|OptimizeChangeLocationCommands=True|OriginPosition=Relative|Record=DrillView|Units=Metric|ZeroesMode=SuppressTrailingZeroes|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -OutputType6=Pick Place -OutputName6=PNP CSV -OutputCategory6=Assembly -OutputDocumentPath6= -OutputVariantName6= -OutputEnabled6=0 -OutputEnabled6_OutputMedium1=0 -OutputEnabled6_OutputMedium2=0 -OutputEnabled6_OutputMedium3=0 -OutputEnabled6_OutputMedium4=0 -OutputEnabled6_OutputMedium5=0 -OutputEnabled6_OutputMedium6=1 -OutputEnabled6_OutputMedium7=0 -OutputEnabled6_OutputMedium8=0 -OutputEnabled6_OutputMedium9=0 -OutputEnabled6_OutputMedium10=0 -OutputDefault6=0 -Configuration6_Name1=OutputConfigurationParameter1 -Configuration6_Item1=Record=PickPlaceView|Units=Metric|GenerateCSVFormat=True|GenerateTextFormat=False|ShowUnits=True|Separator=.|ExcludeFilterParam=True|IncludeVariations=True|IncludeStandardNoBOM=False|Filter= |FilterActive=False|YFlip=False|Column#1=Name:Designator,Fixed:True,Metric:False,Visible:True,Sort:None,Position:0|Column#2=Name:Comment,Fixed:True,Metric:False,Visible:False,Sort:None,Position:1|Column#3=Name:Layer,Fixed:True,Metric:False,Visible:True,Sort:Descending,SortIndex:0,Position:4|Column#4=Name:Footprint,Fixed:True,Metric:False,Visible:False,Sort:None,Position:56|Column#5=Name:Footprint Description,Fixed:True,Metric:False,Visible:False,Sort:None,Position:6|Column#6=Name:Center-X,Fixed:True,Metric:True,Visible:True,Sort:None,Position:2|Column#7=Name:Center-Y,Fixed:True,Metric:True,Visible:True,Sort:None,Position:3|Column#8=Name:Rotation,Fixed:True,Metric:False,Visible:True,Sort:None,Position:5|Column#9=Name:Description,Fixed:True,Metric:False,Visible:False,Sort:None,Position:7|Column#10=Name:ComponentKind,Fixed:True,Metric:False,Visible:False,Sort:None,Position:8|Column#11=Name:Height,Fixed:True,Metric:True,Visible:False,Sort:None,Position:9|Column#12=Name:Ref-X,Fixed:True,Metric:True,Visible:False,Sort:None,Position:10|Column#13=Name:Ref-Y,Fixed:True,Metric:True,Visible:False,Sort:None,Position:11|Column#14=Name:Pad-X,Fixed:True,Metric:True,Visible:False,Sort:None,Position:12|Column#15=Name:Pad-Y,Fixed:True,Metric:True,Visible:False,Sort:None,Position:13|Column#16=Name:Variation,Fixed:True,Metric:False,Visible:False,Sort:None,Position:14|Column#17=Name:_ANGLE,Fixed:False,Metric:False,Visible:False,Sort:None,Position:15|Column#18=Name:_PURPOSE,Fixed:False,Metric:False,Visible:False,Sort:None,Position:34|Column#19=Name:_Vreverse,Fixed:False,Metric:False,Visible:False,Sort:None,Position:46|Column#20=Name:_LOAD_CAPACITANCE,Fixed:False,Metric:False,Visible:False,Sort:None,Position:28|Column#21=Name:PART#,Fixed:False,Metric:False,Visible:False,Sort:None,Position:48|Column#22=Name:_Vf,Fixed:False,Metric:False,Visible:False,Sort:None,Position:42|Column#23=Name:PLACE,Fixed:False,Metric:False,Visible:False,Sort:None,Position:49|Column#24=Name:_RESISTANCE,Fixed:False,Metric:False,Visible:False,Sort:None,Position:36|Column#25=Name:VALID,Fixed:False,Metric:False,Visible:False,Sort:None,Position:54|Column#26=Name:_FB VOLTAGE,Fixed:False,Metric:False,Visible:False,Sort:None,Position:20|Column#27=Name:_TOLERANCE,Fixed:False,Metric:False,Visible:False,Sort:None,Position:39|Column#28=Name:_PITCH,Fixed:False,Metric:False,Visible:False,Sort:None,Position:31|Column#29=Name:_VDS,Fixed:False,Metric:False,Visible:False,Sort:None,Position:41|Column#30=Name:_hFE,Fixed:False,Metric:False,Visible:False,Sort:None,Position:22|Column#31=Name:_ROWS,Fixed:False,Metric:False,Visible:False,Sort:None,Position:37|Column#32=Name:_INDUCTANCE,Fixed:False,Metric:False,Visible:False,Sort:None,Position:24|Column#33=Name:_PSRR,Fixed:False,Metric:False,Visible:False,Sort:None,Position:33|Column#34=Name:_CURRENT_SAT,Fixed:False,Metric:False,Visible:False,Sort:None,Position:18|Column#35=Name:_CURRENT,Fixed:False,Metric:False,Visible:False,Sort:None,Position:17|Column#36=Name:_FREQUENCY,Fixed:False,Metric:False,Visible:False,Sort:None,Position:21|Column#37=Name:_IR,Fixed:False,Metric:False,Visible:False,Sort:None,Position:26|Column#38=Name:_IV,Fixed:False,Metric:False,Visible:False,Sort:None,Position:27|Column#39=Name:_RDS_ON,Fixed:False,Metric:False,Visible:False,Sort:None,Position:35|Column#40=Name:_TYPE,Fixed:False,Metric:False,Visible:False,Sort:None,Position:38|Column#41=Name:_CAPACITANCE,Fixed:False,Metric:False,Visible:False,Sort:None,Position:16|Column#42=Name:RESTRICT,Fixed:False,Metric:False,Visible:False,Sort:None,Position:51|Column#43=Name:_PINS,Fixed:False,Metric:False,Visible:False,Sort:None,Position:30|Column#44=Name:_POWER,Fixed:False,Metric:False,Visible:False,Sort:None,Position:32|Column#45=Name:_VGS,Fixed:False,Metric:False,Visible:False,Sort:None,Position:43|Column#46=Name:TEMPERATURE MIN,Fixed:False,Metric:False,Visible:False,Sort:None,Position:53|Column#47=Name:TEMPERATURE MAX,Fixed:False,Metric:False,Visible:False,Sort:None,Position:52|Column#48=Name:_VOLTAGE,Fixed:False,Metric:False,Visible:False,Sort:None,Position:45|Column#49=Name:_ESR,Fixed:False,Metric:False,Visible:False,Sort:None,Position:19|Column#50=Name:PACKAGE,Fixed:False,Metric:False,Visible:False,Sort:None,Position:47|Column#51=Name:VALUE,Fixed:False,Metric:False,Visible:False,Sort:None,Position:55|Column#52=Name:_Vce,Fixed:False,Metric:False,Visible:False,Sort:None,Position:40|Column#53=Name:_VGS_TH,Fixed:False,Metric:False,Visible:False,Sort:None,Position:44|Column#54=Name:_INPUT,Fixed:False,Metric:False,Visible:False,Sort:None,Position:25|Column#55=Name:_OUTPUT,Fixed:False,Metric:False,Visible:False,Sort:None,Position:29|Column#56=Name:PRICE,Fixed:False,Metric:False,Visible:False,Sort:None,Position:50|Column#57=Name:_IF,Fixed:False,Metric:False,Visible:False,Sort:None,Position:23|Column#58=Name:_PEAK POWER,Fixed:False,Metric:False,Visible:False,Sort:None,Position:66|Column#59=Name:_RAM,Fixed:False,Metric:False,Visible:False,Sort:None,Position:68|Column#60=Name:_R_DC,Fixed:False,Metric:False,Visible:False,Sort:None,Position:67|Column#61=Name:_PEAK CURRENT,Fixed:False,Metric:False,Visible:False,Sort:None,Position:65|Column#62=Name:_CPU,Fixed:False,Metric:False,Visible:False,Sort:None,Position:58|Column#63=Name:ART#,Fixed:False,Metric:False,Visible:False,Sort:None,Position:74|Column#64=Name:_CURRENT SAT,Fixed:False,Metric:False,Visible:False,Sort:None,Position:59|Column#65=Name:_Veb,Fixed:False,Metric:False,Visible:False,Sort:None,Position:71|Column#66=Name:_BW,Fixed:False,Metric:False,Visible:False,Sort:None,Position:57|Column#67=Name:MFR,Fixed:False,Metric:False,Visible:False,Sort:None,Position:75|Column#68=Name:_VOLTAGE_MAX,Fixed:False,Metric:False,Visible:False,Sort:None,Position:72|Column#69=Name:_FLASH,Fixed:False,Metric:False,Visible:False,Sort:None,Position:62|Column#70=Name:_VOLTAGE_MIN,Fixed:False,Metric:False,Visible:False,Sort:None,Position:73|Column#71=Name:_DC RESISTANCE,Fixed:False,Metric:False,Visible:False,Sort:None,Position:60|Column#72=Name:_EEPROM,Fixed:False,Metric:False,Visible:False,Sort:None,Position:61|Column#73=Name:_VDD,Fixed:False,Metric:False,Visible:False,Sort:None,Position:70|Column#74=Name:_GENDER,Fixed:False,Metric:False,Visible:False,Sort:None,Position:64|Column#75=Name:_FRQUENCY,Fixed:False,Metric:False,Visible:False,Sort:None,Position:63|Column#76=Name:_RDC,Fixed:False,Metric:False,Visible:False,Sort:None,Position:69|DocumentPath=C:\Giraffe360\Git\pcb-desing\PE-Production_Equipment\DAQ_Controller-1\SOURCE\DAQ_Controller-1.PcbDoc -OutputType7=ExportSTEP -OutputName7=MODEL -OutputCategory7=Export -OutputDocumentPath7= -OutputVariantName7= -OutputEnabled7=1 -OutputEnabled7_OutputMedium1=0 -OutputEnabled7_OutputMedium2=0 -OutputEnabled7_OutputMedium3=0 -OutputEnabled7_OutputMedium4=1 -OutputEnabled7_OutputMedium5=0 -OutputEnabled7_OutputMedium6=0 -OutputEnabled7_OutputMedium7=0 -OutputEnabled7_OutputMedium8=0 -OutputEnabled7_OutputMedium9=1 -OutputEnabled7_OutputMedium10=0 -OutputDefault7=0 -Configuration7_Name1=OutputConfigurationParameter1 -Configuration7_Item1=Record=ExportSTEPView|ExportComponentOptions=0|ExportModelsOption=2|ExportHolesOption=0|CanSelectPrimitives=False|IncludeMechanicalPadHoles=True|IncludeElectricalPadHoles=True|IncludeFreePadHoles=True|ExportFoldedBoard=False|ExportFoldedBoardRate=0|ComponentSuffixType=0|ComponentSuffix= |ExportCopperOption=0|ExportCopperLayer=0|ExportPadAndViaBarrelsOnly=False|IgnoreBoardCopperLayerColors=False|ExportAsSinglePart=False|IncludeCoverLayer=True|SkipFreeBodies=True|SkipHidden=False|DocumentPath=C:\Giraffe360\PCB_Design\Camera-4\Lidar_HMB\SOURCE\Lidar_HMB.PcbDoc -OutputType8=Assembly -OutputName8=ASM Overview -OutputCategory8=Assembly -OutputDocumentPath8= -OutputVariantName8= -OutputEnabled8=0 -OutputEnabled8_OutputMedium1=0 -OutputEnabled8_OutputMedium2=0 -OutputEnabled8_OutputMedium3=2 -OutputEnabled8_OutputMedium4=0 -OutputEnabled8_OutputMedium5=0 -OutputEnabled8_OutputMedium6=0 -OutputEnabled8_OutputMedium7=0 -OutputEnabled8_OutputMedium8=0 -OutputEnabled8_OutputMedium9=0 -OutputEnabled8_OutputMedium10=0 -OutputDefault8=0 -PageOptions8=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=0|PaperKind=A4|PaperIndex=9 -Configuration8_Name1=OutputConfigurationParameter1 -Configuration8_Item1=DesignatorDisplayMode=Physical|PrintArea=DesignExtent|PrintAreaLowerLeftCornerY=0|PrintAreaLowerLeftCornerX=0|PrintAreaUpperRightCornerY=0|PrintAreaUpperRightCornerX=0|Record=PcbPrintView|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration8_Name2=OutputConfigurationParameter2 -Configuration8_Item2=IncludeBoardCutouts=False|IncludeBottomLayerComponents=False|IncludeMultiLayerComponents=True|IncludeTopLayerComponents=True|IncludeViewports=True|Index=0|Mirror=False|Name=Top LayerAssembly Drawing|PadNumberFontSize=14|Record=PcbPrintOut|ShowHoles=False|ShowPadNets=False|ShowPadNumbers=False|SubstituteFonts=False|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration8_Name3=OutputConfigurationParameter3 -Configuration8_Item3=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical1|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration8_Name4=OutputConfigurationParameter4 -Configuration8_Item4=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=TopOverlay|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration8_Name5=OutputConfigurationParameter5 -Configuration8_Item5=CArc=Draft|CFill=Draft|Comment=Draft|Coordinate=Draft|CPad=Draft|CRegion=Draft|CText=Draft|CTrack=Draft|CVia=Draft|Designator=Draft|Dimension=Draft|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Draft|FFill=Draft|FPad=Draft|FRegion=Draft|FText=Draft|FTrack=Draft|FVia=Draft|Layer=TopSolder|Polygon=Draft|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration8_Name6=OutputConfigurationParameter6 -Configuration8_Item6=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical2|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration8_Name7=OutputConfigurationParameter7 -Configuration8_Item7=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical3|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration8_Name8=OutputConfigurationParameter8 -Configuration8_Item8=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical8|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration8_Name9=OutputConfigurationParameter9 -Configuration8_Item9=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical15|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration8_Name10=OutputConfigurationParameter10 -Configuration8_Item10=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical13|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration8_Name11=OutputConfigurationParameter11 -Configuration8_Item11=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical17|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -PcbPrintPreferences8=SubsititueFont_Default=True|SubsititueFont_Serif=True|SubsititueFont_SansSerif=True|PrintKeepOuts=False|NetColorOverride=True|PrintPositivePlaneLayers=False|V7_M0.Name=Mechanical Layer 1|V7_M0.Value=True|V7_M1.Name=Mechanical Layer 2|V7_M1.Value=True|V7_M2.Name=Mechanical Layer 3|V7_M2.Value=True|V7_M3.Name=Mechanical Layer 4|V7_M3.Value=True|V7_M4.Name=Mechanical Layer 5|V7_M4.Value=True|V7_M5.Name=Mechanical Layer 6|V7_M5.Value=True|V7_M6.Name=Mechanical Layer 7|V7_M6.Value=True|V7_M7.Name=Mechanical Layer 8|V7_M7.Value=True|V7_M8.Name=Mechanical Layer 9|V7_M8.Value=True|V7_M9.Name=Mechanical Layer 10|V7_M9.Value=True|V7_M10.Name=Mechanical Layer 11|V7_M10.Value=True|V7_M11.Name=Mechanical Layer 12|V7_M11.Value=True|V7_M12.Name=Mechanical Layer 13|V7_M12.Value=True|V7_M13.Name=Mechanical Layer 14|V7_M13.Value=True|V7_M14.Name=Mechanical Layer 15|V7_M14.Value=True|V7_M15.Name=Mechanical Layer 16|V7_M15.Value=True|V7_G0.Name=Top Layer|V7_G0.Value=30|V7_G1.Name=Mid Layer 1|V7_G1.Value=60|V7_G2.Name=Mid Layer 2|V7_G2.Value=90|V7_G3.Name=Mid Layer 3|V7_G3.Value=120|V7_G4.Name=Mid Layer 4|V7_G4.Value=150|V7_G5.Name=Mid Layer 5|V7_G5.Value=180|V7_G6.Name=Mid Layer 6|V7_G6.Value=210|V7_G7.Name=Mid Layer 7|V7_G7.Value=60|V7_G8.Name=Mid Layer 8|V7_G8.Value=90|V7_G9.Name=Mid Layer 9|V7_G9.Value=120|V7_G10.Name=Mid Layer 10|V7_G10.Value=150|V7_G11.Name=Mid Layer 11|V7_G11.Value=180|V7_G12.Name=Mid Layer 12|V7_G12.Value=210|V7_G13.Name=Mid Layer 13|V7_G13.Value=60|V7_G14.Name=Mid Layer 14|V7_G14.Value=95|V7_G15.Name=Mid Layer 15|V7_G15.Value=60|V7_G16.Name=Mid Layer 16|V7_G16.Value=90|V7_G17.Name=Mid Layer 17|V7_G17.Value=120|V7_G18.Name=Mid Layer 18|V7_G18.Value=150|V7_G19.Name=Mid Layer 19|V7_G19.Value=180|V7_G20.Name=Mid Layer 20|V7_G20.Value=210|V7_G21.Name=Mid Layer 21|V7_G21.Value=60|V7_G22.Name=Mid Layer 22|V7_G22.Value=90|V7_G23.Name=Mid Layer 23|V7_G23.Value=120|V7_G24.Name=Mid Layer 24|V7_G24.Value=150|V7_G25.Name=Mid Layer 25|V7_G25.Value=180|V7_G26.Name=Mid Layer 26|V7_G26.Value=210|V7_G27.Name=Mid Layer 27|V7_G27.Value=60|V7_G28.Name=Mid Layer 28|V7_G28.Value=95|V7_G29.Name=Mid Layer 29|V7_G29.Value=60|V7_G30.Name=Mid Layer 30|V7_G30.Value=95|V7_G31.Name=Bottom Layer|V7_G31.Value=90|V7_G32.Name=Top Overlay|V7_G32.Value=160|V7_G33.Name=Bottom Overlay|V7_G33.Value=140|V7_G34.Name=Top Paste|V7_G34.Value=0|V7_G35.Name=Bottom Paste|V7_G35.Value=0|V7_G36.Name=Top Solder Mask|V7_G36.Value=64|V7_G37.Name=Bottom Solder Mask|V7_G37.Value=0|V7_G38.Name=Drill Guide|V7_G38.Value=0|V7_G39.Name=Keep Out Layer|V7_G39.Value=120|V7_G40.Name=Drill Drawing|V7_G40.Value=0|V7_G41.Name=Multi Layer|V7_G41.Value=0|V7_G42.Name=Connect Layer|V7_G42.Value=0|V7_G43.Name=BackGround|V7_G43.Value=255|V7_G44.Name=DRC Errors|V7_G44.Value=0|V7_G45.Name=Highlight Layer|V7_G45.Value=0|V7_G46.Name=Grid Color 1|V7_G46.Value=0|V7_G47.Name=Grid Color 10|V7_G47.Value=0|V7_G48.Name=Pad Hole Layer|V7_G48.Value=210|V7_G49.Name=Via Hole Layer|V7_G49.Value=210|V7_G50.Name=Mechanical Layers|V7_G50.Value=90|V7_G51.Name=Internal Plane Layers|V7_G51.Value=0|V7_G52.Name=Internal Plane 1|V7_G52.Value=0|V7_G53.Name=Internal Plane 2|V7_G53.Value=0|V7_G54.Name=Internal Plane 3|V7_G54.Value=0|V7_G55.Name=Internal Plane 4|V7_G55.Value=0|V7_G56.Name=Internal Plane 5|V7_G56.Value=0|V7_G57.Name=Internal Plane 6|V7_G57.Value=0|V7_G58.Name=Internal Plane 7|V7_G58.Value=0|V7_G59.Name=Internal Plane 8|V7_G59.Value=0|V7_G60.Name=Internal Plane 9|V7_G60.Value=0|V7_G61.Name=Internal Plane 10|V7_G61.Value=0|V7_G62.Name=Internal Plane 11|V7_G62.Value=0|V7_G63.Name=Internal Plane 12|V7_G63.Value=0|V7_G64.Name=Internal Plane 13|V7_G64.Value=0|V7_G65.Name=Internal Plane 14|V7_G65.Value=0|V7_G66.Name=Internal Plane 15|V7_G66.Value=0|V7_G67.Name=Internal Plane 16|V7_G67.Value=0|V7_G68.Name=Mechanical Layer 1|V7_G68.Value=0|V7_G69.Name=Mechanical Layer 2|V7_G69.Value=10|V7_G70.Name=Mechanical Layer 3|V7_G70.Value=10|V7_G71.Name=Mechanical Layer 4|V7_G71.Value=90|V7_G72.Name=Mechanical Layer 5|V7_G72.Value=0|V7_G73.Name=Mechanical Layer 6|V7_G73.Value=90|V7_G74.Name=Mechanical Layer 7|V7_G74.Value=90|V7_G75.Name=Mechanical Layer 8|V7_G75.Value=10|V7_G76.Name=Mechanical Layer 9|V7_G76.Value=90|V7_G77.Name=Mechanical Layer 10|V7_G77.Value=90|V7_G78.Name=Mechanical Layer 11|V7_G78.Value=90|V7_G79.Name=Mechanical Layer 12|V7_G79.Value=90|V7_G80.Name=Mechanical Layer 13|V7_G80.Value=10|V7_G81.Name=Mechanical Layer 14|V7_G81.Value=90|V7_G82.Name=Mechanical Layer 15|V7_G82.Value=0|V7_G83.Name=Mechanical Layer 16|V7_G83.Value=0|V7_G84.Name=Dielectric Layer 1|V7_G84.Value=0|V7_G85.Name=Mechanical Layer 17|V7_G85.Value=0|V7_G86.Name=Mechanical Layer 19|V7_G86.Value=90|V7_G87.Name=Mechanical Layer 20|V7_G87.Value=90|V7_G88.Name=Mechanical Layer 21|V7_G88.Value=90|V7_G89.Name=Mechanical Layer 22|V7_G89.Value=0|V7_G90.Name=Mechanical Layer 23|V7_G90.Value=90|V7_G91.Name=Mechanical Layer 30|V7_G91.Value=90|V7_G92.Name=Mechanical Layer 31|V7_G92.Value=90|V7_G93.Name=Mechanical Layer 32|V7_G93.Value=90|V7_G94.Name=Dielectric Layer 2|V7_G94.Value=0|V7_G95.Name=Dielectric Layer 3|V7_G95.Value=0|V7_G96.Name=Dielectric Layer 4|V7_G96.Value=0|V7_G97.Name=Dielectric Layer 5|V7_G97.Value=0|Mechanical1=True|Mechanical2=True|Mechanical3=True|Mechanical4=True|Mechanical5=True|Mechanical6=True|Mechanical7=True|Mechanical8=True|Mechanical9=True|Mechanical10=True|Mechanical11=True|Mechanical12=True|Mechanical13=True|Mechanical14=True|Mechanical15=True|Mechanical16=True|Gray Level For TopLayer=30|Gray Level For MidLayer1=60|Gray Level For MidLayer2=90|Gray Level For MidLayer3=120|Gray Level For MidLayer4=150|Gray Level For MidLayer5=180|Gray Level For MidLayer6=210|Gray Level For MidLayer7=60|Gray Level For MidLayer8=90|Gray Level For MidLayer9=120|Gray Level For MidLayer10=150|Gray Level For MidLayer11=180|Gray Level For MidLayer12=210|Gray Level For MidLayer13=60|Gray Level For MidLayer14=95|Gray Level For MidLayer15=60|Gray Level For MidLayer16=90|Gray Level For MidLayer17=120|Gray Level For MidLayer18=150|Gray Level For MidLayer19=180|Gray Level For MidLayer20=210|Gray Level For MidLayer21=60|Gray Level For MidLayer22=90|Gray Level For MidLayer23=120|Gray Level For MidLayer24=150|Gray Level For MidLayer25=180|Gray Level For MidLayer26=210|Gray Level For MidLayer27=60|Gray Level For MidLayer28=95|Gray Level For MidLayer29=60|Gray Level For MidLayer30=95|Gray Level For BottomLayer=90|Gray Level For TopOverlay=160|Gray Level For BottomOverlay=140|Gray Level For TopPaste=0|Gray Level For BottomPaste=0|Gray Level For TopSolder=64|Gray Level For BottomSolder=0|Gray Level For InternalPlane1=0|Gray Level For InternalPlane2=0|Gray Level For InternalPlane3=0|Gray Level For InternalPlane4=0|Gray Level For InternalPlane5=0|Gray Level For InternalPlane6=0|Gray Level For InternalPlane7=0|Gray Level For InternalPlane8=0|Gray Level For InternalPlane9=0|Gray Level For InternalPlane10=0|Gray Level For InternalPlane11=0|Gray Level For InternalPlane12=0|Gray Level For InternalPlane13=0|Gray Level For InternalPlane14=0|Gray Level For InternalPlane15=0|Gray Level For InternalPlane16=0|Gray Level For DrillGuide=0|Gray Level For KeepOutLayer=120|Gray Level For Mechanical1=0|Gray Level For Mechanical2=10|Gray Level For Mechanical3=10|Gray Level For Mechanical4=90|Gray Level For Mechanical5=0|Gray Level For Mechanical6=90|Gray Level For Mechanical7=90|Gray Level For Mechanical8=10|Gray Level For Mechanical9=90|Gray Level For Mechanical10=90|Gray Level For Mechanical11=90|Gray Level For Mechanical12=90|Gray Level For Mechanical13=10|Gray Level For Mechanical14=90|Gray Level For Mechanical15=0|Gray Level For Mechanical16=0|Gray Level For DrillDrawing=0|Gray Level For MultiLayer=0|Gray Level For ConnectLayer=0|Gray Level For BackGroundLayer=255|Gray Level For DRCErrorLayer=0|Gray Level For HighlightLayer=0|Gray Level For GridColor1=0|Gray Level For GridColor10=0|Gray Level For PadHoleLayer=210|Gray Level For ViaHoleLayer=210|Color For TopLayer=255|Color For MidLayer1=32768|Color For MidLayer2=65280|Color For MidLayer3=8388608|Color For MidLayer4=16776960|Color For MidLayer5=8388736|Color For MidLayer6=16711935|Color For MidLayer7=32896|Color For MidLayer8=65535|Color For MidLayer9=8421504|Color For MidLayer10=32768|Color For MidLayer11=8388736|Color For MidLayer12=8421376|Color For MidLayer13=12632256|Color For MidLayer14=128|Color For MidLayer15=32768|Color For MidLayer16=65280|Color For MidLayer17=8388608|Color For MidLayer18=16776960|Color For MidLayer19=8388736|Color For MidLayer20=16711935|Color For MidLayer21=32896|Color For MidLayer22=65535|Color For MidLayer23=8421504|Color For MidLayer24=32768|Color For MidLayer25=8388736|Color For MidLayer26=8421376|Color For MidLayer27=12632256|Color For MidLayer28=8421376|Color For MidLayer29=12632256|Color For MidLayer30=128|Color For BottomLayer=16711680|Color For TopOverlay=32768|Color For BottomOverlay=7585984|Color For TopPaste=8388736|Color For BottomPaste=128|Color For TopSolder=3162822|Color For BottomSolder=7307173|Color For InternalPlane1=32768|Color For InternalPlane2=128|Color For InternalPlane3=8388736|Color For InternalPlane4=8421376|Color For InternalPlane5=32768|Color For InternalPlane6=128|Color For InternalPlane7=8388736|Color For InternalPlane8=8421376|Color For InternalPlane9=32768|Color For InternalPlane10=128|Color For InternalPlane11=8388736|Color For InternalPlane12=8421376|Color For InternalPlane13=32768|Color For InternalPlane14=128|Color For InternalPlane15=8388736|Color For InternalPlane16=8421376|Color For DrillGuide=128|Color For KeepOutLayer=8388736|Color For Mechanical1=8388736|Color For Mechanical2=8421376|Color For Mechanical3=32768|Color For Mechanical4=0|Color For Mechanical5=8388736|Color For Mechanical6=8421376|Color For Mechanical7=32768|Color For Mechanical8=0|Color For Mechanical9=8388736|Color For Mechanical10=8421376|Color For Mechanical11=32768|Color For Mechanical12=0|Color For Mechanical13=8388736|Color For Mechanical14=8421376|Color For Mechanical15=32768|Color For Mechanical16=0|Color For DrillDrawing=3408013|Color For MultiLayer=8421504|Color For ConnectLayer=8421376|Color For BackGroundLayer=15269887|Color For DRCErrorLayer=65280|Color For HighlightLayer=65535|Color For GridColor1=12632256|Color For GridColor10=11913679|Color For PadHoleLayer=6899487|Color For ViaHoleLayer=9279142 -OutputType9=Assembly -OutputName9=ASM Detail -OutputCategory9=Assembly -OutputDocumentPath9= -OutputVariantName9= -OutputEnabled9=0 -OutputEnabled9_OutputMedium1=0 -OutputEnabled9_OutputMedium2=0 -OutputEnabled9_OutputMedium3=3 -OutputEnabled9_OutputMedium4=0 -OutputEnabled9_OutputMedium5=0 -OutputEnabled9_OutputMedium6=0 -OutputEnabled9_OutputMedium7=0 -OutputEnabled9_OutputMedium8=0 -OutputEnabled9_OutputMedium9=0 -OutputEnabled9_OutputMedium10=0 -OutputDefault9=0 -PageOptions9=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=0|PaperKind=A4|PaperIndex=9 -Configuration9_Name1=OutputConfigurationParameter1 -Configuration9_Item1=DesignatorDisplayMode=Physical|PrintArea=DesignExtent|PrintAreaLowerLeftCornerY=117716535|PrintAreaLowerLeftCornerX=117716535|PrintAreaUpperRightCornerY=132283465|PrintAreaUpperRightCornerX=132283465|Record=PcbPrintView|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration9_Name2=OutputConfigurationParameter2 -Configuration9_Item2=IncludeBoardCutouts=False|IncludeBottomLayerComponents=False|IncludeMultiLayerComponents=True|IncludeTopLayerComponents=True|IncludeViewports=True|Index=0|Mirror=False|Name=Top Detail|PadNumberFontSize=14|Record=PcbPrintOut|ShowHoles=True|ShowPadNets=False|ShowPadNumbers=False|SubstituteFonts=False|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration9_Name3=OutputConfigurationParameter3 -Configuration9_Item3=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical29|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration9_Name4=OutputConfigurationParameter4 -Configuration9_Item4=CArc=Hidden|CFill=Hidden|Comment=Hidden|Coordinate=Hidden|CPad=Draft|CRegion=Hidden|CText=Hidden|CTrack=Hidden|CVia=Hidden|Designator=Hidden|Dimension=Hidden|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Hidden|FFill=Hidden|FPad=Draft|FRegion=Hidden|FText=Hidden|FTrack=Hidden|FVia=Hidden|Layer=TopLayer|Polygon=Hidden|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration9_Name5=OutputConfigurationParameter5 -Configuration9_Item5=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=TopOverlay|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration9_Name6=OutputConfigurationParameter6 -Configuration9_Item6=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical1|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration9_Name7=OutputConfigurationParameter7 -Configuration9_Item7=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical3|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration9_Name8=OutputConfigurationParameter8 -Configuration9_Item8=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical13|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration9_Name9=OutputConfigurationParameter9 -Configuration9_Item9=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical15|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -PcbPrintPreferences9=SubsititueFont_Default=True|SubsititueFont_Serif=True|SubsititueFont_SansSerif=True|PrintKeepOuts=False|NetColorOverride=True|PrintPositivePlaneLayers=False|V7_M0.Name=Mechanical Layer 1|V7_M0.Value=True|V7_M1.Name=Mechanical Layer 2|V7_M1.Value=True|V7_M2.Name=Mechanical Layer 3|V7_M2.Value=True|V7_M3.Name=Mechanical Layer 4|V7_M3.Value=True|V7_M4.Name=Mechanical Layer 5|V7_M4.Value=True|V7_M5.Name=Mechanical Layer 6|V7_M5.Value=True|V7_M6.Name=Mechanical Layer 7|V7_M6.Value=True|V7_M7.Name=Mechanical Layer 8|V7_M7.Value=True|V7_M8.Name=Mechanical Layer 9|V7_M8.Value=True|V7_M9.Name=Mechanical Layer 10|V7_M9.Value=True|V7_M10.Name=Mechanical Layer 11|V7_M10.Value=True|V7_M11.Name=Mechanical Layer 12|V7_M11.Value=True|V7_M12.Name=Mechanical Layer 13|V7_M12.Value=True|V7_M13.Name=Mechanical Layer 14|V7_M13.Value=True|V7_M14.Name=Mechanical Layer 15|V7_M14.Value=True|V7_M15.Name=Mechanical Layer 16|V7_M15.Value=True|V7_G0.Name=Top Layer|V7_G0.Value=10|V7_G1.Name=Mid Layer 1|V7_G1.Value=60|V7_G2.Name=Mid Layer 2|V7_G2.Value=90|V7_G3.Name=Mid Layer 3|V7_G3.Value=120|V7_G4.Name=Mid Layer 4|V7_G4.Value=150|V7_G5.Name=Mid Layer 5|V7_G5.Value=180|V7_G6.Name=Mid Layer 6|V7_G6.Value=210|V7_G7.Name=Mid Layer 7|V7_G7.Value=60|V7_G8.Name=Mid Layer 8|V7_G8.Value=90|V7_G9.Name=Mid Layer 9|V7_G9.Value=120|V7_G10.Name=Mid Layer 10|V7_G10.Value=150|V7_G11.Name=Mid Layer 11|V7_G11.Value=180|V7_G12.Name=Mid Layer 12|V7_G12.Value=210|V7_G13.Name=Mid Layer 13|V7_G13.Value=60|V7_G14.Name=Mid Layer 14|V7_G14.Value=95|V7_G15.Name=Mid Layer 15|V7_G15.Value=60|V7_G16.Name=Mid Layer 16|V7_G16.Value=90|V7_G17.Name=Mid Layer 17|V7_G17.Value=120|V7_G18.Name=Mid Layer 18|V7_G18.Value=150|V7_G19.Name=Mid Layer 19|V7_G19.Value=180|V7_G20.Name=Mid Layer 20|V7_G20.Value=210|V7_G21.Name=Mid Layer 21|V7_G21.Value=60|V7_G22.Name=Mid Layer 22|V7_G22.Value=90|V7_G23.Name=Mid Layer 23|V7_G23.Value=120|V7_G24.Name=Mid Layer 24|V7_G24.Value=150|V7_G25.Name=Mid Layer 25|V7_G25.Value=180|V7_G26.Name=Mid Layer 26|V7_G26.Value=210|V7_G27.Name=Mid Layer 27|V7_G27.Value=60|V7_G28.Name=Mid Layer 28|V7_G28.Value=95|V7_G29.Name=Mid Layer 29|V7_G29.Value=60|V7_G30.Name=Mid Layer 30|V7_G30.Value=95|V7_G31.Name=Bottom Layer|V7_G31.Value=10|V7_G32.Name=Top Overlay|V7_G32.Value=192|V7_G33.Name=Bottom Overlay|V7_G33.Value=192|V7_G34.Name=Top Paste|V7_G34.Value=0|V7_G35.Name=Bottom Paste|V7_G35.Value=0|V7_G36.Name=Top Solder Mask|V7_G36.Value=0|V7_G37.Name=Bottom Solder Mask|V7_G37.Value=0|V7_G38.Name=Drill Guide|V7_G38.Value=0|V7_G39.Name=Keep Out Layer|V7_G39.Value=120|V7_G40.Name=Drill Drawing|V7_G40.Value=0|V7_G41.Name=Multi Layer|V7_G41.Value=0|V7_G42.Name=Connect Layer|V7_G42.Value=0|V7_G43.Name=BackGround|V7_G43.Value=255|V7_G44.Name=DRC Errors|V7_G44.Value=0|V7_G45.Name=Highlight Layer|V7_G45.Value=0|V7_G46.Name=Grid Color 1|V7_G46.Value=0|V7_G47.Name=Grid Color 10|V7_G47.Value=0|V7_G48.Name=Pad Hole Layer|V7_G48.Value=210|V7_G49.Name=Via Hole Layer|V7_G49.Value=210|V7_G50.Name=Mechanical Layers|V7_G50.Value=90|V7_G51.Name=Internal Plane Layers|V7_G51.Value=0|V7_G52.Name=Internal Plane 1|V7_G52.Value=0|V7_G53.Name=Internal Plane 2|V7_G53.Value=0|V7_G54.Name=Internal Plane 3|V7_G54.Value=0|V7_G55.Name=Internal Plane 4|V7_G55.Value=0|V7_G56.Name=Internal Plane 5|V7_G56.Value=0|V7_G57.Name=Internal Plane 6|V7_G57.Value=0|V7_G58.Name=Internal Plane 7|V7_G58.Value=0|V7_G59.Name=Internal Plane 8|V7_G59.Value=0|V7_G60.Name=Internal Plane 9|V7_G60.Value=0|V7_G61.Name=Internal Plane 10|V7_G61.Value=0|V7_G62.Name=Internal Plane 11|V7_G62.Value=0|V7_G63.Name=Internal Plane 12|V7_G63.Value=0|V7_G64.Name=Internal Plane 13|V7_G64.Value=0|V7_G65.Name=Internal Plane 14|V7_G65.Value=0|V7_G66.Name=Internal Plane 15|V7_G66.Value=0|V7_G67.Name=Internal Plane 16|V7_G67.Value=0|V7_G68.Name=Mechanical Layer 1|V7_G68.Value=10|V7_G69.Name=Mechanical Layer 2|V7_G69.Value=90|V7_G70.Name=Mechanical Layer 3|V7_G70.Value=0|V7_G71.Name=Mechanical Layer 4|V7_G71.Value=0|V7_G72.Name=Mechanical Layer 5|V7_G72.Value=0|V7_G73.Name=Mechanical Layer 6|V7_G73.Value=0|V7_G74.Name=Mechanical Layer 7|V7_G74.Value=90|V7_G75.Name=Mechanical Layer 8|V7_G75.Value=10|V7_G76.Name=Mechanical Layer 9|V7_G76.Value=90|V7_G77.Name=Mechanical Layer 10|V7_G77.Value=90|V7_G78.Name=Mechanical Layer 11|V7_G78.Value=90|V7_G79.Name=Mechanical Layer 12|V7_G79.Value=90|V7_G80.Name=Mechanical Layer 13|V7_G80.Value=10|V7_G81.Name=Mechanical Layer 14|V7_G81.Value=10|V7_G82.Name=Mechanical Layer 15|V7_G82.Value=0|V7_G83.Name=Mechanical Layer 16|V7_G83.Value=10|V7_G84.Name=Dielectric Layer 1|V7_G84.Value=0|V7_G85.Name=Mechanical Layer 17|V7_G85.Value=10|V7_G86.Name=Mechanical Layer 19|V7_G86.Value=0|V7_G87.Name=Mechanical Layer 20|V7_G87.Value=0|V7_G88.Name=Mechanical Layer 21|V7_G88.Value=90|V7_G89.Name=Mechanical Layer 22|V7_G89.Value=90|V7_G90.Name=Mechanical Layer 23|V7_G90.Value=90|V7_G91.Name=Mechanical Layer 30|V7_G91.Value=10|V7_G92.Name=Mechanical Layer 31|V7_G92.Value=90|V7_G93.Name=Mechanical Layer 32|V7_G93.Value=90|V7_G94.Name=Dielectric Layer 2|V7_G94.Value=0|V7_G95.Name=Dielectric Layer 3|V7_G95.Value=0|V7_G96.Name=Dielectric Layer 4|V7_G96.Value=0|V7_G97.Name=Dielectric Layer 5|V7_G97.Value=0|V7_G98.Name=Mechanical Layer 29|V7_G98.Value=10|V7_G99.Name=Mechanical Layer 18|V7_G99.Value=10|Mechanical1=True|Mechanical2=True|Mechanical3=True|Mechanical4=True|Mechanical5=True|Mechanical6=True|Mechanical7=True|Mechanical8=True|Mechanical9=True|Mechanical10=True|Mechanical11=True|Mechanical12=True|Mechanical13=True|Mechanical14=True|Mechanical15=True|Mechanical16=True|Gray Level For TopLayer=10|Gray Level For MidLayer1=60|Gray Level For MidLayer2=90|Gray Level For MidLayer3=120|Gray Level For MidLayer4=150|Gray Level For MidLayer5=180|Gray Level For MidLayer6=210|Gray Level For MidLayer7=60|Gray Level For MidLayer8=90|Gray Level For MidLayer9=120|Gray Level For MidLayer10=150|Gray Level For MidLayer11=180|Gray Level For MidLayer12=210|Gray Level For MidLayer13=60|Gray Level For MidLayer14=95|Gray Level For MidLayer15=60|Gray Level For MidLayer16=90|Gray Level For MidLayer17=120|Gray Level For MidLayer18=150|Gray Level For MidLayer19=180|Gray Level For MidLayer20=210|Gray Level For MidLayer21=60|Gray Level For MidLayer22=90|Gray Level For MidLayer23=120|Gray Level For MidLayer24=150|Gray Level For MidLayer25=180|Gray Level For MidLayer26=210|Gray Level For MidLayer27=60|Gray Level For MidLayer28=95|Gray Level For MidLayer29=60|Gray Level For MidLayer30=95|Gray Level For BottomLayer=10|Gray Level For TopOverlay=192|Gray Level For BottomOverlay=192|Gray Level For TopPaste=0|Gray Level For BottomPaste=0|Gray Level For TopSolder=0|Gray Level For BottomSolder=0|Gray Level For InternalPlane1=0|Gray Level For InternalPlane2=0|Gray Level For InternalPlane3=0|Gray Level For InternalPlane4=0|Gray Level For InternalPlane5=0|Gray Level For InternalPlane6=0|Gray Level For InternalPlane7=0|Gray Level For InternalPlane8=0|Gray Level For InternalPlane9=0|Gray Level For InternalPlane10=0|Gray Level For InternalPlane11=0|Gray Level For InternalPlane12=0|Gray Level For InternalPlane13=0|Gray Level For InternalPlane14=0|Gray Level For InternalPlane15=0|Gray Level For InternalPlane16=0|Gray Level For DrillGuide=0|Gray Level For KeepOutLayer=120|Gray Level For Mechanical1=10|Gray Level For Mechanical2=90|Gray Level For Mechanical3=0|Gray Level For Mechanical4=0|Gray Level For Mechanical5=0|Gray Level For Mechanical6=0|Gray Level For Mechanical7=90|Gray Level For Mechanical8=10|Gray Level For Mechanical9=90|Gray Level For Mechanical10=90|Gray Level For Mechanical11=90|Gray Level For Mechanical12=90|Gray Level For Mechanical13=10|Gray Level For Mechanical14=10|Gray Level For Mechanical15=0|Gray Level For Mechanical16=10|Gray Level For DrillDrawing=0|Gray Level For MultiLayer=0|Gray Level For ConnectLayer=0|Gray Level For BackGroundLayer=255|Gray Level For DRCErrorLayer=0|Gray Level For HighlightLayer=0|Gray Level For GridColor1=0|Gray Level For GridColor10=0|Gray Level For PadHoleLayer=210|Gray Level For ViaHoleLayer=210|Color For TopLayer=255|Color For MidLayer1=32768|Color For MidLayer2=65280|Color For MidLayer3=8388608|Color For MidLayer4=16776960|Color For MidLayer5=8388736|Color For MidLayer6=16711935|Color For MidLayer7=32896|Color For MidLayer8=65535|Color For MidLayer9=8421504|Color For MidLayer10=32768|Color For MidLayer11=8388736|Color For MidLayer12=8421376|Color For MidLayer13=12632256|Color For MidLayer14=128|Color For MidLayer15=32768|Color For MidLayer16=65280|Color For MidLayer17=8388608|Color For MidLayer18=16776960|Color For MidLayer19=8388736|Color For MidLayer20=16711935|Color For MidLayer21=32896|Color For MidLayer22=65535|Color For MidLayer23=8421504|Color For MidLayer24=32768|Color For MidLayer25=8388736|Color For MidLayer26=8421376|Color For MidLayer27=12632256|Color For MidLayer28=8421376|Color For MidLayer29=12632256|Color For MidLayer30=128|Color For BottomLayer=16711680|Color For TopOverlay=32768|Color For BottomOverlay=7585984|Color For TopPaste=8388736|Color For BottomPaste=128|Color For TopSolder=3162822|Color For BottomSolder=7307173|Color For InternalPlane1=32768|Color For InternalPlane2=128|Color For InternalPlane3=8388736|Color For InternalPlane4=8421376|Color For InternalPlane5=32768|Color For InternalPlane6=128|Color For InternalPlane7=8388736|Color For InternalPlane8=8421376|Color For InternalPlane9=32768|Color For InternalPlane10=128|Color For InternalPlane11=8388736|Color For InternalPlane12=8421376|Color For InternalPlane13=32768|Color For InternalPlane14=128|Color For InternalPlane15=8388736|Color For InternalPlane16=8421376|Color For DrillGuide=128|Color For KeepOutLayer=8388736|Color For Mechanical1=8388736|Color For Mechanical2=8421376|Color For Mechanical3=32768|Color For Mechanical4=0|Color For Mechanical5=8388736|Color For Mechanical6=8421376|Color For Mechanical7=32768|Color For Mechanical8=0|Color For Mechanical9=8388736|Color For Mechanical10=8421376|Color For Mechanical11=32768|Color For Mechanical12=0|Color For Mechanical13=8388736|Color For Mechanical14=8421376|Color For Mechanical15=32768|Color For Mechanical16=0|Color For DrillDrawing=3408013|Color For MultiLayer=8421504|Color For ConnectLayer=8421376|Color For BackGroundLayer=15269887|Color For DRCErrorLayer=65280|Color For HighlightLayer=65535|Color For GridColor1=12632256|Color For GridColor10=11913679|Color For PadHoleLayer=6899487|Color For ViaHoleLayer=9279142 -OutputType10=PCB 3D Print -OutputName10=TopTexture -OutputCategory10=Documentation -OutputDocumentPath10= -OutputVariantName10= -OutputEnabled10=1 -OutputEnabled10_OutputMedium1=0 -OutputEnabled10_OutputMedium2=0 -OutputEnabled10_OutputMedium3=0 -OutputEnabled10_OutputMedium4=2 -OutputEnabled10_OutputMedium5=0 -OutputEnabled10_OutputMedium6=0 -OutputEnabled10_OutputMedium7=0 -OutputEnabled10_OutputMedium8=0 -OutputEnabled10_OutputMedium9=0 -OutputEnabled10_OutputMedium10=0 -OutputDefault10=0 -PageOptions10=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -Configuration10_Name1=OutputConfigurationParameter1 -Configuration10_Item1=Record=Pcb3DPrintView|ResX=600|ResY=600|ViewX=29527560|ViewY=22794078|LookAtX=132874016|LookAtY=128937008|LookAtZ=0|UpX=0|UpY=1|UpZ=0|FOV=45|QuatX=0|QuatY=0|QuatZ=0|QuatW=1|Zoom=4.00981332033562E-5|UnitsPercent=True|UnitsDPI=True|LockResAspect=True|ViewConfigType=.config_3d|CustomCamera=True|ViewFromTop=True|ScreenWidth=1184|ScreenHeight=914|ImageOutputType=1|ViewConfig=RECORD\3Board\2CFGALL.CONFIGURATIONKIND\33\2CFGALL.CONFIGURATIONDESC\3Enter%20description%20of%20new%20view%20configuration\2CFGALL.COMPONENTBODYREFPOINTCOLOR\316777215\2CFGALL.COMPONENTBODYSNAPPOINTCOLOR\316777215\2CFGALL.SHOWCOMPONENTSNAPMARKERS\3FALSE\2CFGALL.SHOWCOMPONENTSNAPREFERENCE\3FALSE\2CFGALL.SHOWCOMPONENTSNAPCUSTOM\3FALSE\2CFG3D.POSITIVETOPSOLDERMASK\3TRUE\2CFG3D.POSITIVEBOTTOMSOLDERMASK\3TRUE\2CFG3D.SHOWCOMPONENTBODIES\3FALSE\2CFG3D.SHOWCOMPONENTSTEPMODELS\3FALSE\2CFG3D.COMPONENTMODELPREFERENCE\30\2CFG3D.SHOWCOMPONENTAXES\3TRUE\2CFG3D.SHOWBOARDCORE\3TRUE\2CFG3D.SHOWBOARDPREPREG\3TRUE\2CFG3D.SHOWTOPSILKSCREEN\3TRUE\2CFG3D.SHOWBOTSILKSCREEN\3TRUE\2CFG3D.SHOWORIGINMARKER\3TRUE\2CFG3D.EYEDIST\32147483647\2CFG3D.SHOWCUTOUTS\3TRUE\2CFG3D.SHOWROUTETOOLPATH\3TRUE\2CFG3D.SHOWROOMS3D\3FALSE\2CFG3D.USESYSCOLORSFOR3D\3FALSE\2CFG3D.WORKSPACECOLOR\316777215\2CFG3D.BOARDCORECOLOR\34216160\2CFG3D.BOARDPREPREGCOLOR\30\2CFG3D.TOPSOLDERMASKCOLOR\35994299\2CFG3D.BOTSOLDERMASKCOLOR\35994299\2CFG3D.COPPERCOLOR\38315135\2CFG3D.TOPSILKSCREENCOLOR\316777215\2CFG3D.BOTSILKSCREENCOLOR\316777215\2CFG3D.WORKSPACELUMINANCEVARIATION\330\2CFG3D.WORKSPACEBEGINCOLOR\315238730\2CFG3D.WORKSPACEENDCOLOR\315238730\2CFG3D.WORKSPACECOLOROPACITY\31.000000\2CFG3D.BOARDCORECOLOROPACITY\30.900000\2CFG3D.BOARDPREPREGCOLOROPACITY\30.500000\2CFG3D.TOPSOLDERMASKCOLOROPACITY\30.900000\2CFG3D.BOTSOLDERMASKCOLOROPACITY\30.900000\2CFG3D.COPPERCOLOROPACITY\31.000000\2CFG3D.TOPSILKSCREENCOLOROPACITY\31.000000\2CFG3D.BOTSILKSCREENCOLOROPACITY\31.000000\2CFG3D.BOARDTHICKNESSSCALING\31.000000\2CFG3D.SHOWMECHANICALLAYERS\3FALSE\2CFG3D.MECHANICALLAYERSOPACITY\31.000000\2CFG3D.MECHCOVERLAYERUPDATED\3FALSE|DocumentPath=D:\Microrally\uDCCD_Controller_HW\Main board\Source\uDCCD_Controller.PcbDoc -OutputType11=PCB 3D Print -OutputName11=BotTexture -OutputCategory11=Documentation -OutputDocumentPath11= -OutputVariantName11= -OutputEnabled11=1 -OutputEnabled11_OutputMedium1=0 -OutputEnabled11_OutputMedium2=0 -OutputEnabled11_OutputMedium3=0 -OutputEnabled11_OutputMedium4=3 -OutputEnabled11_OutputMedium5=0 -OutputEnabled11_OutputMedium6=0 -OutputEnabled11_OutputMedium7=0 -OutputEnabled11_OutputMedium8=0 -OutputEnabled11_OutputMedium9=0 -OutputEnabled11_OutputMedium10=0 -OutputDefault11=0 -PageOptions11=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -Configuration11_Name1=OutputConfigurationParameter1 -Configuration11_Item1=Record=Pcb3DPrintView|ResX=600|ResY=600|ViewX=29527560|ViewY=22794078|LookAtX=132874016|LookAtY=128937008|LookAtZ=0|UpX=0|UpY=1|UpZ=0|FOV=45|QuatX=0|QuatY=1|QuatZ=0|QuatW=0|Zoom=4.00981332033562E-5|UnitsPercent=True|UnitsDPI=True|LockResAspect=True|ViewConfigType=.config_3d|CustomCamera=True|ViewFromTop=False|ScreenWidth=1184|ScreenHeight=914|ImageOutputType=1|ViewConfig=RECORD\3Board\2CFGALL.CONFIGURATIONKIND\33\2CFGALL.CONFIGURATIONDESC\3Enter%20description%20of%20new%20view%20configuration\2CFGALL.COMPONENTBODYREFPOINTCOLOR\316777215\2CFGALL.COMPONENTBODYSNAPPOINTCOLOR\316777215\2CFGALL.SHOWCOMPONENTSNAPMARKERS\3FALSE\2CFGALL.SHOWCOMPONENTSNAPREFERENCE\3FALSE\2CFGALL.SHOWCOMPONENTSNAPCUSTOM\3FALSE\2CFG3D.POSITIVETOPSOLDERMASK\3TRUE\2CFG3D.POSITIVEBOTTOMSOLDERMASK\3TRUE\2CFG3D.SHOWCOMPONENTBODIES\3FALSE\2CFG3D.SHOWCOMPONENTSTEPMODELS\3FALSE\2CFG3D.COMPONENTMODELPREFERENCE\30\2CFG3D.SHOWCOMPONENTAXES\3TRUE\2CFG3D.SHOWBOARDCORE\3TRUE\2CFG3D.SHOWBOARDPREPREG\3TRUE\2CFG3D.SHOWTOPSILKSCREEN\3TRUE\2CFG3D.SHOWBOTSILKSCREEN\3TRUE\2CFG3D.SHOWORIGINMARKER\3TRUE\2CFG3D.EYEDIST\32147483647\2CFG3D.SHOWCUTOUTS\3TRUE\2CFG3D.SHOWROUTETOOLPATH\3TRUE\2CFG3D.SHOWROOMS3D\3FALSE\2CFG3D.USESYSCOLORSFOR3D\3FALSE\2CFG3D.WORKSPACECOLOR\316777215\2CFG3D.BOARDCORECOLOR\34216160\2CFG3D.BOARDPREPREGCOLOR\30\2CFG3D.TOPSOLDERMASKCOLOR\35994299\2CFG3D.BOTSOLDERMASKCOLOR\35994299\2CFG3D.COPPERCOLOR\38315135\2CFG3D.TOPSILKSCREENCOLOR\316777215\2CFG3D.BOTSILKSCREENCOLOR\316777215\2CFG3D.WORKSPACELUMINANCEVARIATION\330\2CFG3D.WORKSPACEBEGINCOLOR\315238730\2CFG3D.WORKSPACEENDCOLOR\315238730\2CFG3D.WORKSPACECOLOROPACITY\31.000000\2CFG3D.BOARDCORECOLOROPACITY\30.900000\2CFG3D.BOARDPREPREGCOLOROPACITY\30.500000\2CFG3D.TOPSOLDERMASKCOLOROPACITY\30.900000\2CFG3D.BOTSOLDERMASKCOLOROPACITY\30.900000\2CFG3D.COPPERCOLOROPACITY\31.000000\2CFG3D.TOPSILKSCREENCOLOROPACITY\31.000000\2CFG3D.BOTSILKSCREENCOLOROPACITY\31.000000\2CFG3D.BOARDTHICKNESSSCALING\31.000000\2CFG3D.SHOWMECHANICALLAYERS\3FALSE\2CFG3D.MECHANICALLAYERSOPACITY\31.000000\2CFG3D.MECHCOVERLAYERUPDATED\3FALSE|DocumentPath=D:\Microrally\uDCCD_Controller_HW\Main board\Source\uDCCD_Controller.PcbDoc -OutputType12=PCB 3D Print -OutputName12=PCB Picture Top -OutputCategory12=Documentation -OutputDocumentPath12= -OutputVariantName12= -OutputEnabled12=0 -OutputEnabled12_OutputMedium1=0 -OutputEnabled12_OutputMedium2=0 -OutputEnabled12_OutputMedium3=6 -OutputEnabled12_OutputMedium4=0 -OutputEnabled12_OutputMedium5=0 -OutputEnabled12_OutputMedium6=0 -OutputEnabled12_OutputMedium7=1 -OutputEnabled12_OutputMedium8=0 -OutputEnabled12_OutputMedium9=0 -OutputEnabled12_OutputMedium10=0 -OutputDefault12=0 -PageOptions12=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=2.32|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -Configuration12_Name1=OutputConfigurationParameter1 -Configuration12_Item1=Record=Pcb3DPrintView|ResX=600|ResY=600|ViewX=46114880|ViewY=35598816|LookAtX=133146664|LookAtY=125013736|LookAtZ=-18408|UpX=0|UpY=1|UpZ=0|FOV=45|QuatX=0|QuatY=0|QuatZ=0|QuatW=1|Zoom=2.56750105372724E-5|UnitsPercent=True|UnitsDPI=True|LockResAspect=True|ViewConfigType=.config_3d|CustomCamera=True|ViewFromTop=True|ScreenWidth=1184|ScreenHeight=914|ImageOutputType=1|ViewConfig=RECORD\3Board\2CFGALL.CONFIGURATIONKIND\33\2CFGALL.CONFIGURATIONDESC\3Enter%20description%20of%20new%20view%20configuration\2CFGALL.COMPONENTBODYREFPOINTCOLOR\316777215\2CFGALL.COMPONENTBODYSNAPPOINTCOLOR\316777215\2CFGALL.SHOWCOMPONENTSNAPMARKERS\3FALSE\2CFGALL.SHOWCOMPONENTSNAPREFERENCE\3FALSE\2CFGALL.SHOWCOMPONENTSNAPCUSTOM\3FALSE\2CFG3D.POSITIVETOPSOLDERMASK\3TRUE\2CFG3D.POSITIVEBOTTOMSOLDERMASK\3TRUE\2CFG3D.SHOWCOMPONENTBODIES\3TRUE\2CFG3D.SHOWCOMPONENTSTEPMODELS\3TRUE\2CFG3D.COMPONENTMODELPREFERENCE\30\2CFG3D.SHOWCOMPONENTAXES\3TRUE\2CFG3D.SHOWBOARDCORE\3TRUE\2CFG3D.SHOWBOARDPREPREG\3TRUE\2CFG3D.SHOWTOPSILKSCREEN\3TRUE\2CFG3D.SHOWBOTSILKSCREEN\3TRUE\2CFG3D.SHOWORIGINMARKER\3TRUE\2CFG3D.EYEDIST\32147483647\2CFG3D.SHOWCUTOUTS\3TRUE\2CFG3D.SHOWROUTETOOLPATH\3TRUE\2CFG3D.SHOWROOMS3D\3FALSE\2CFG3D.USESYSCOLORSFOR3D\3FALSE\2CFG3D.WORKSPACECOLOR\316777215\2CFG3D.BOARDCORECOLOR\34216160\2CFG3D.BOARDPREPREGCOLOR\30\2CFG3D.TOPSOLDERMASKCOLOR\35994299\2CFG3D.BOTSOLDERMASKCOLOR\35994299\2CFG3D.COPPERCOLOR\38315135\2CFG3D.TOPSILKSCREENCOLOR\316777215\2CFG3D.BOTSILKSCREENCOLOR\316777215\2CFG3D.WORKSPACELUMINANCEVARIATION\330\2CFG3D.WORKSPACEBEGINCOLOR\316777215\2CFG3D.WORKSPACEENDCOLOR\315724527\2CFG3D.WORKSPACECOLOROPACITY\31.000000\2CFG3D.BOARDCORECOLOROPACITY\30.900000\2CFG3D.BOARDPREPREGCOLOROPACITY\30.500000\2CFG3D.TOPSOLDERMASKCOLOROPACITY\30.900000\2CFG3D.BOTSOLDERMASKCOLOROPACITY\30.900000\2CFG3D.COPPERCOLOROPACITY\31.000000\2CFG3D.TOPSILKSCREENCOLOROPACITY\31.000000\2CFG3D.BOTSILKSCREENCOLOROPACITY\31.000000\2CFG3D.BOARDTHICKNESSSCALING\31.000000\2CFG3D.SHOWMECHANICALLAYERS\3FALSE\2CFG3D.MECHANICALLAYERSOPACITY\31.000000\2CFG3D.MECHCOVERLAYERUPDATED\3FALSE|DocumentPath=D:\Microrally\uDCCD_Controller_HW\Main board\Source\uDCCD_Controller.PcbDoc -OutputType13=PCB 3D Print -OutputName13=PCB Picture Bot -OutputCategory13=Documentation -OutputDocumentPath13= -OutputVariantName13= -OutputEnabled13=0 -OutputEnabled13_OutputMedium1=0 -OutputEnabled13_OutputMedium2=0 -OutputEnabled13_OutputMedium3=7 -OutputEnabled13_OutputMedium4=0 -OutputEnabled13_OutputMedium5=0 -OutputEnabled13_OutputMedium6=0 -OutputEnabled13_OutputMedium7=2 -OutputEnabled13_OutputMedium8=0 -OutputEnabled13_OutputMedium9=0 -OutputEnabled13_OutputMedium10=0 -OutputDefault13=0 -PageOptions13=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=2.32|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -Configuration13_Name1=OutputConfigurationParameter1 -Configuration13_Item1=Record=Pcb3DPrintView|ResX=600|ResY=600|ViewX=46114880|ViewY=35598816|LookAtX=132601368|LookAtY=125013736|LookAtZ=646303|UpX=0|UpY=1|UpZ=0|FOV=45|QuatX=0|QuatY=1|QuatZ=0|QuatW=0|Zoom=2.56750105372724E-5|UnitsPercent=True|UnitsDPI=True|LockResAspect=True|ViewConfigType=.config_3d|CustomCamera=True|ViewFromTop=False|ScreenWidth=1184|ScreenHeight=914|ImageOutputType=1|ViewConfig=RECORD\3Board\2CFGALL.CONFIGURATIONKIND\33\2CFGALL.CONFIGURATIONDESC\3Enter%20description%20of%20new%20view%20configuration\2CFGALL.COMPONENTBODYREFPOINTCOLOR\316777215\2CFGALL.COMPONENTBODYSNAPPOINTCOLOR\316777215\2CFGALL.SHOWCOMPONENTSNAPMARKERS\3FALSE\2CFGALL.SHOWCOMPONENTSNAPREFERENCE\3FALSE\2CFGALL.SHOWCOMPONENTSNAPCUSTOM\3FALSE\2CFG3D.POSITIVETOPSOLDERMASK\3TRUE\2CFG3D.POSITIVEBOTTOMSOLDERMASK\3TRUE\2CFG3D.SHOWCOMPONENTBODIES\3TRUE\2CFG3D.SHOWCOMPONENTSTEPMODELS\3TRUE\2CFG3D.COMPONENTMODELPREFERENCE\30\2CFG3D.SHOWCOMPONENTAXES\3TRUE\2CFG3D.SHOWBOARDCORE\3TRUE\2CFG3D.SHOWBOARDPREPREG\3TRUE\2CFG3D.SHOWTOPSILKSCREEN\3TRUE\2CFG3D.SHOWBOTSILKSCREEN\3TRUE\2CFG3D.SHOWORIGINMARKER\3TRUE\2CFG3D.EYEDIST\32147483647\2CFG3D.SHOWCUTOUTS\3TRUE\2CFG3D.SHOWROUTETOOLPATH\3TRUE\2CFG3D.SHOWROOMS3D\3FALSE\2CFG3D.USESYSCOLORSFOR3D\3FALSE\2CFG3D.WORKSPACECOLOR\316777215\2CFG3D.BOARDCORECOLOR\34216160\2CFG3D.BOARDPREPREGCOLOR\30\2CFG3D.TOPSOLDERMASKCOLOR\35994299\2CFG3D.BOTSOLDERMASKCOLOR\35994299\2CFG3D.COPPERCOLOR\38315135\2CFG3D.TOPSILKSCREENCOLOR\316777215\2CFG3D.BOTSILKSCREENCOLOR\316777215\2CFG3D.WORKSPACELUMINANCEVARIATION\330\2CFG3D.WORKSPACEBEGINCOLOR\316777215\2CFG3D.WORKSPACEENDCOLOR\315724527\2CFG3D.WORKSPACECOLOROPACITY\31.000000\2CFG3D.BOARDCORECOLOROPACITY\30.900000\2CFG3D.BOARDPREPREGCOLOROPACITY\30.500000\2CFG3D.TOPSOLDERMASKCOLOROPACITY\30.900000\2CFG3D.BOTSOLDERMASKCOLOROPACITY\30.900000\2CFG3D.COPPERCOLOROPACITY\31.000000\2CFG3D.TOPSILKSCREENCOLOROPACITY\31.000000\2CFG3D.BOTSILKSCREENCOLOROPACITY\31.000000\2CFG3D.BOARDTHICKNESSSCALING\31.000000\2CFG3D.SHOWMECHANICALLAYERS\3FALSE\2CFG3D.MECHANICALLAYERSOPACITY\31.000000\2CFG3D.MECHCOVERLAYERUPDATED\3FALSE|DocumentPath=D:\Microrally\uDCCD_Controller_HW\Main board\Source\uDCCD_Controller.PcbDoc -OutputType14=PCB 3D Print -OutputName14=PCB Picture 1 -OutputCategory14=Documentation -OutputDocumentPath14= -OutputVariantName14= -OutputEnabled14=0 -OutputEnabled14_OutputMedium1=0 -OutputEnabled14_OutputMedium2=0 -OutputEnabled14_OutputMedium3=8 -OutputEnabled14_OutputMedium4=0 -OutputEnabled14_OutputMedium5=0 -OutputEnabled14_OutputMedium6=0 -OutputEnabled14_OutputMedium7=3 -OutputEnabled14_OutputMedium8=0 -OutputEnabled14_OutputMedium9=0 -OutputEnabled14_OutputMedium10=0 -OutputDefault14=0 -PageOptions14=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.75|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -Configuration14_Name1=OutputConfigurationParameter1 -Configuration14_Item1=Record=Pcb3DPrintView|ResX=600|ResY=600|ViewX=61261620|ViewY=47291488|LookAtX=133454520|LookAtY=126706752|LookAtZ=-18405.337890625|UpX=-0.420631378889084|UpY=-0.648587167263031|UpZ=-0.634353160858154|FOV=45|QuatX=-0.0764409825205803|QuatY=-0.328605175018311|QuatZ=0.904682576656342|QuatW=0.260240107774734|Zoom=1.93269459719063E-5|UnitsPercent=True|UnitsDPI=True|LockResAspect=True|ViewConfigType=.config_3d|CustomCamera=True|ViewFromTop=False|ScreenWidth=1184|ScreenHeight=914|ImageOutputType=1|ViewConfig=RECORD\3Board\2CFGALL.CONFIGURATIONKIND\33\2CFGALL.CONFIGURATIONDESC\3Enter%20description%20of%20new%20view%20configuration\2CFGALL.COMPONENTBODYREFPOINTCOLOR\316777215\2CFGALL.COMPONENTBODYSNAPPOINTCOLOR\316777215\2CFGALL.SHOWCOMPONENTSNAPMARKERS\3FALSE\2CFGALL.SHOWCOMPONENTSNAPREFERENCE\3FALSE\2CFGALL.SHOWCOMPONENTSNAPCUSTOM\3FALSE\2CFG3D.POSITIVETOPSOLDERMASK\3TRUE\2CFG3D.POSITIVEBOTTOMSOLDERMASK\3TRUE\2CFG3D.SHOWCOMPONENTBODIES\3TRUE\2CFG3D.SHOWCOMPONENTSTEPMODELS\3TRUE\2CFG3D.COMPONENTMODELPREFERENCE\30\2CFG3D.SHOWCOMPONENTAXES\3TRUE\2CFG3D.SHOWBOARDCORE\3TRUE\2CFG3D.SHOWBOARDPREPREG\3TRUE\2CFG3D.SHOWTOPSILKSCREEN\3TRUE\2CFG3D.SHOWBOTSILKSCREEN\3TRUE\2CFG3D.SHOWORIGINMARKER\3TRUE\2CFG3D.EYEDIST\32000\2CFG3D.SHOWCUTOUTS\3TRUE\2CFG3D.SHOWROUTETOOLPATH\3TRUE\2CFG3D.SHOWROOMS3D\3FALSE\2CFG3D.USESYSCOLORSFOR3D\3FALSE\2CFG3D.WORKSPACECOLOR\316777215\2CFG3D.BOARDCORECOLOR\34216160\2CFG3D.BOARDPREPREGCOLOR\30\2CFG3D.TOPSOLDERMASKCOLOR\35994299\2CFG3D.BOTSOLDERMASKCOLOR\35994299\2CFG3D.COPPERCOLOR\38315135\2CFG3D.TOPSILKSCREENCOLOR\316777215\2CFG3D.BOTSILKSCREENCOLOR\316777215\2CFG3D.WORKSPACELUMINANCEVARIATION\330\2CFG3D.WORKSPACEBEGINCOLOR\316777215\2CFG3D.WORKSPACEENDCOLOR\315724527\2CFG3D.WORKSPACECOLOROPACITY\31.000000\2CFG3D.BOARDCORECOLOROPACITY\30.900000\2CFG3D.BOARDPREPREGCOLOROPACITY\30.500000\2CFG3D.TOPSOLDERMASKCOLOROPACITY\30.900000\2CFG3D.BOTSOLDERMASKCOLOROPACITY\30.900000\2CFG3D.COPPERCOLOROPACITY\31.000000\2CFG3D.TOPSILKSCREENCOLOROPACITY\31.000000\2CFG3D.BOTSILKSCREENCOLOROPACITY\31.000000\2CFG3D.BOARDTHICKNESSSCALING\31.000000\2CFG3D.SHOWMECHANICALLAYERS\3FALSE\2CFG3D.MECHANICALLAYERSOPACITY\31.000000\2CFG3D.MECHCOVERLAYERUPDATED\3FALSE|DocumentPath=D:\Microrally\uDCCD_Controller_HW\Main board\Source\uDCCD_Controller.PcbDoc -OutputType15=PCB 3D Print -OutputName15=PCB Picture 2 -OutputCategory15=Documentation -OutputDocumentPath15= -OutputVariantName15= -OutputEnabled15=0 -OutputEnabled15_OutputMedium1=0 -OutputEnabled15_OutputMedium2=0 -OutputEnabled15_OutputMedium3=9 -OutputEnabled15_OutputMedium4=0 -OutputEnabled15_OutputMedium5=0 -OutputEnabled15_OutputMedium6=0 -OutputEnabled15_OutputMedium7=4 -OutputEnabled15_OutputMedium8=0 -OutputEnabled15_OutputMedium9=0 -OutputEnabled15_OutputMedium10=0 -OutputDefault15=0 -PageOptions15=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.92|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -Configuration15_Name1=OutputConfigurationParameter1 -Configuration15_Item1=Record=Pcb3DPrintView|ResX=600|ResY=600|ViewX=55774212|ViewY=43055432|LookAtX=130913112|LookAtY=123099560|LookAtZ=-18406.123046875|UpX=0.50720202922821|UpY=0.461718440055847|UpZ=-0.727710068225861|FOV=45|QuatX=-0.368430495262146|QuatY=0.146614402532578|QuatZ=-0.365239381790161|QuatW=0.842237174510956|Zoom=2.12284489663411E-5|UnitsPercent=True|UnitsDPI=True|LockResAspect=True|ViewConfigType=.config_3d|CustomCamera=True|ViewFromTop=False|ScreenWidth=1184|ScreenHeight=914|ImageOutputType=1|ViewConfig=RECORD\3Board\2CFGALL.CONFIGURATIONKIND\33\2CFGALL.CONFIGURATIONDESC\3Enter%20description%20of%20new%20view%20configuration\2CFGALL.COMPONENTBODYREFPOINTCOLOR\316777215\2CFGALL.COMPONENTBODYSNAPPOINTCOLOR\316777215\2CFGALL.SHOWCOMPONENTSNAPMARKERS\3FALSE\2CFGALL.SHOWCOMPONENTSNAPREFERENCE\3FALSE\2CFGALL.SHOWCOMPONENTSNAPCUSTOM\3FALSE\2CFG3D.POSITIVETOPSOLDERMASK\3TRUE\2CFG3D.POSITIVEBOTTOMSOLDERMASK\3TRUE\2CFG3D.SHOWCOMPONENTBODIES\3TRUE\2CFG3D.SHOWCOMPONENTSTEPMODELS\3TRUE\2CFG3D.COMPONENTMODELPREFERENCE\30\2CFG3D.SHOWCOMPONENTAXES\3TRUE\2CFG3D.SHOWBOARDCORE\3TRUE\2CFG3D.SHOWBOARDPREPREG\3TRUE\2CFG3D.SHOWTOPSILKSCREEN\3TRUE\2CFG3D.SHOWBOTSILKSCREEN\3TRUE\2CFG3D.SHOWORIGINMARKER\3TRUE\2CFG3D.EYEDIST\32000\2CFG3D.SHOWCUTOUTS\3TRUE\2CFG3D.SHOWROUTETOOLPATH\3TRUE\2CFG3D.SHOWROOMS3D\3FALSE\2CFG3D.USESYSCOLORSFOR3D\3FALSE\2CFG3D.WORKSPACECOLOR\316777215\2CFG3D.BOARDCORECOLOR\34216160\2CFG3D.BOARDPREPREGCOLOR\30\2CFG3D.TOPSOLDERMASKCOLOR\35994299\2CFG3D.BOTSOLDERMASKCOLOR\35994299\2CFG3D.COPPERCOLOR\38315135\2CFG3D.TOPSILKSCREENCOLOR\316777215\2CFG3D.BOTSILKSCREENCOLOR\316777215\2CFG3D.WORKSPACELUMINANCEVARIATION\330\2CFG3D.WORKSPACEBEGINCOLOR\316777215\2CFG3D.WORKSPACEENDCOLOR\315724527\2CFG3D.WORKSPACECOLOROPACITY\31.000000\2CFG3D.BOARDCORECOLOROPACITY\30.900000\2CFG3D.BOARDPREPREGCOLOROPACITY\30.500000\2CFG3D.TOPSOLDERMASKCOLOROPACITY\30.900000\2CFG3D.BOTSOLDERMASKCOLOROPACITY\30.900000\2CFG3D.COPPERCOLOROPACITY\31.000000\2CFG3D.TOPSILKSCREENCOLOROPACITY\31.000000\2CFG3D.BOTSILKSCREENCOLOROPACITY\31.000000\2CFG3D.BOARDTHICKNESSSCALING\31.000000\2CFG3D.SHOWMECHANICALLAYERS\3FALSE\2CFG3D.MECHANICALLAYERSOPACITY\31.000000\2CFG3D.MECHCOVERLAYERUPDATED\3FALSE|DocumentPath=D:\Microrally\uDCCD_Controller_HW\Main board\Source\uDCCD_Controller.PcbDoc -OutputType16=Composite -OutputName16=Gerber Notes -OutputCategory16=Documentation -OutputDocumentPath16= -OutputVariantName16= -OutputEnabled16=0 -OutputEnabled16_OutputMedium1=0 -OutputEnabled16_OutputMedium2=0 -OutputEnabled16_OutputMedium3=4 -OutputEnabled16_OutputMedium4=0 -OutputEnabled16_OutputMedium5=0 -OutputEnabled16_OutputMedium6=0 -OutputEnabled16_OutputMedium7=0 -OutputEnabled16_OutputMedium8=0 -OutputEnabled16_OutputMedium9=0 -OutputEnabled16_OutputMedium10=0 -OutputDefault16=0 -PageOptions16=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=0|PaperKind=A4|PaperIndex=9 -Configuration16_Name1=OutputConfigurationParameter1 -Configuration16_Item1=DesignatorDisplayMode=Physical|PrintArea=DesignExtent|PrintAreaLowerLeftCornerY=0|PrintAreaLowerLeftCornerX=0|PrintAreaUpperRightCornerY=0|PrintAreaUpperRightCornerX=0|Record=PcbPrintView|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration16_Name2=OutputConfigurationParameter2 -Configuration16_Item2=IncludeBoardCutouts=False|IncludeBottomLayerComponents=True|IncludeMultiLayerComponents=True|IncludeTopLayerComponents=True|IncludeViewports=False|Index=0|Mirror=False|Name=Gerber Notes|PadNumberFontSize=14|Record=PcbPrintOut|ShowHoles=False|ShowPadNets=False|ShowPadNumbers=False|SubstituteFonts=False|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration16_Name3=OutputConfigurationParameter3 -Configuration16_Item3=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=DrillDrawing|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration16_Name4=OutputConfigurationParameter4 -Configuration16_Item4=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=MultiLayer|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration16_Name5=OutputConfigurationParameter5 -Configuration16_Item5=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=TopSolder|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration16_Name6=OutputConfigurationParameter6 -Configuration16_Item6=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=TopOverlay|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration16_Name7=OutputConfigurationParameter7 -Configuration16_Item7=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical1|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration16_Name8=OutputConfigurationParameter8 -Configuration16_Item8=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical3|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration16_Name9=OutputConfigurationParameter9 -Configuration16_Item9=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical2|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration16_Name10=OutputConfigurationParameter10 -Configuration16_Item10=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical7|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -PcbPrintPreferences16=SubsititueFont_Default=True|SubsititueFont_Serif=True|SubsititueFont_SansSerif=True|PrintKeepOuts=False|NetColorOverride=True|PrintPositivePlaneLayers=False|V7_M0.Name=Mechanical Layer 1|V7_M0.Value=True|V7_M1.Name=Mechanical Layer 2|V7_M1.Value=True|V7_M2.Name=Mechanical Layer 3|V7_M2.Value=True|V7_M3.Name=Mechanical Layer 4|V7_M3.Value=True|V7_M4.Name=Mechanical Layer 5|V7_M4.Value=True|V7_M5.Name=Mechanical Layer 6|V7_M5.Value=True|V7_M6.Name=Mechanical Layer 7|V7_M6.Value=True|V7_M7.Name=Mechanical Layer 8|V7_M7.Value=True|V7_M8.Name=Mechanical Layer 9|V7_M8.Value=True|V7_M9.Name=Mechanical Layer 10|V7_M9.Value=True|V7_M10.Name=Mechanical Layer 11|V7_M10.Value=True|V7_M11.Name=Mechanical Layer 12|V7_M11.Value=True|V7_M12.Name=Mechanical Layer 13|V7_M12.Value=True|V7_M13.Name=Mechanical Layer 14|V7_M13.Value=True|V7_M14.Name=Mechanical Layer 15|V7_M14.Value=True|V7_M15.Name=Mechanical Layer 16|V7_M15.Value=True|V7_G0.Name=Top Layer|V7_G0.Value=30|V7_G1.Name=Mid Layer 1|V7_G1.Value=60|V7_G2.Name=Mid Layer 2|V7_G2.Value=90|V7_G3.Name=Mid Layer 3|V7_G3.Value=120|V7_G4.Name=Mid Layer 4|V7_G4.Value=150|V7_G5.Name=Mid Layer 5|V7_G5.Value=180|V7_G6.Name=Mid Layer 6|V7_G6.Value=210|V7_G7.Name=Mid Layer 7|V7_G7.Value=60|V7_G8.Name=Mid Layer 8|V7_G8.Value=90|V7_G9.Name=Mid Layer 9|V7_G9.Value=120|V7_G10.Name=Mid Layer 10|V7_G10.Value=150|V7_G11.Name=Mid Layer 11|V7_G11.Value=180|V7_G12.Name=Mid Layer 12|V7_G12.Value=210|V7_G13.Name=Mid Layer 13|V7_G13.Value=60|V7_G14.Name=Mid Layer 14|V7_G14.Value=95|V7_G15.Name=Mid Layer 15|V7_G15.Value=60|V7_G16.Name=Mid Layer 16|V7_G16.Value=90|V7_G17.Name=Mid Layer 17|V7_G17.Value=120|V7_G18.Name=Mid Layer 18|V7_G18.Value=150|V7_G19.Name=Mid Layer 19|V7_G19.Value=180|V7_G20.Name=Mid Layer 20|V7_G20.Value=210|V7_G21.Name=Mid Layer 21|V7_G21.Value=60|V7_G22.Name=Mid Layer 22|V7_G22.Value=90|V7_G23.Name=Mid Layer 23|V7_G23.Value=120|V7_G24.Name=Mid Layer 24|V7_G24.Value=150|V7_G25.Name=Mid Layer 25|V7_G25.Value=180|V7_G26.Name=Mid Layer 26|V7_G26.Value=210|V7_G27.Name=Mid Layer 27|V7_G27.Value=60|V7_G28.Name=Mid Layer 28|V7_G28.Value=95|V7_G29.Name=Mid Layer 29|V7_G29.Value=60|V7_G30.Name=Mid Layer 30|V7_G30.Value=95|V7_G31.Name=Bottom Layer|V7_G31.Value=90|V7_G32.Name=Top Overlay|V7_G32.Value=192|V7_G33.Name=Bottom Overlay|V7_G33.Value=140|V7_G34.Name=Top Paste|V7_G34.Value=0|V7_G35.Name=Bottom Paste|V7_G35.Value=0|V7_G36.Name=Top Solder Mask|V7_G36.Value=0|V7_G37.Name=Bottom Solder Mask|V7_G37.Value=0|V7_G38.Name=Drill Guide|V7_G38.Value=0|V7_G39.Name=Keep Out Layer|V7_G39.Value=120|V7_G40.Name=Drill Drawing|V7_G40.Value=0|V7_G41.Name=Multi Layer|V7_G41.Value=0|V7_G42.Name=Connect Layer|V7_G42.Value=0|V7_G43.Name=BackGround|V7_G43.Value=255|V7_G44.Name=DRC Errors|V7_G44.Value=0|V7_G45.Name=Highlight Layer|V7_G45.Value=0|V7_G46.Name=Grid Color 1|V7_G46.Value=0|V7_G47.Name=Grid Color 10|V7_G47.Value=0|V7_G48.Name=Pad Hole Layer|V7_G48.Value=210|V7_G49.Name=Via Hole Layer|V7_G49.Value=210|V7_G50.Name=Mechanical Layers|V7_G50.Value=90|V7_G51.Name=Internal Plane Layers|V7_G51.Value=0|V7_G52.Name=Internal Plane 1|V7_G52.Value=0|V7_G53.Name=Internal Plane 2|V7_G53.Value=0|V7_G54.Name=Internal Plane 3|V7_G54.Value=0|V7_G55.Name=Internal Plane 4|V7_G55.Value=0|V7_G56.Name=Internal Plane 5|V7_G56.Value=0|V7_G57.Name=Internal Plane 6|V7_G57.Value=0|V7_G58.Name=Internal Plane 7|V7_G58.Value=0|V7_G59.Name=Internal Plane 8|V7_G59.Value=0|V7_G60.Name=Internal Plane 9|V7_G60.Value=0|V7_G61.Name=Internal Plane 10|V7_G61.Value=0|V7_G62.Name=Internal Plane 11|V7_G62.Value=0|V7_G63.Name=Internal Plane 12|V7_G63.Value=0|V7_G64.Name=Internal Plane 13|V7_G64.Value=0|V7_G65.Name=Internal Plane 14|V7_G65.Value=0|V7_G66.Name=Internal Plane 15|V7_G66.Value=0|V7_G67.Name=Internal Plane 16|V7_G67.Value=0|V7_G68.Name=Mechanical Layer 1|V7_G68.Value=10|V7_G69.Name=Mechanical Layer 2|V7_G69.Value=10|V7_G70.Name=Mechanical Layer 3|V7_G70.Value=10|V7_G71.Name=Mechanical Layer 4|V7_G71.Value=90|V7_G72.Name=Mechanical Layer 5|V7_G72.Value=90|V7_G73.Name=Mechanical Layer 6|V7_G73.Value=90|V7_G74.Name=Mechanical Layer 7|V7_G74.Value=10|V7_G75.Name=Mechanical Layer 8|V7_G75.Value=90|V7_G76.Name=Mechanical Layer 9|V7_G76.Value=90|V7_G77.Name=Mechanical Layer 10|V7_G77.Value=90|V7_G78.Name=Mechanical Layer 11|V7_G78.Value=90|V7_G79.Name=Mechanical Layer 12|V7_G79.Value=90|V7_G80.Name=Mechanical Layer 13|V7_G80.Value=90|V7_G81.Name=Mechanical Layer 14|V7_G81.Value=90|V7_G82.Name=Mechanical Layer 15|V7_G82.Value=0|V7_G83.Name=Mechanical Layer 16|V7_G83.Value=0|V7_G84.Name=Dielectric Layer 1|V7_G84.Value=0|V7_G85.Name=Mechanical Layer 17|V7_G85.Value=0|V7_G86.Name=Mechanical Layer 19|V7_G86.Value=90|V7_G87.Name=Mechanical Layer 20|V7_G87.Value=90|V7_G88.Name=Mechanical Layer 21|V7_G88.Value=0|V7_G89.Name=Mechanical Layer 22|V7_G89.Value=90|V7_G90.Name=Mechanical Layer 23|V7_G90.Value=90|V7_G91.Name=Mechanical Layer 30|V7_G91.Value=90|V7_G92.Name=Mechanical Layer 31|V7_G92.Value=90|V7_G93.Name=Mechanical Layer 32|V7_G93.Value=90|V7_G94.Name=Dielectric Layer 2|V7_G94.Value=0|V7_G95.Name=Dielectric Layer 3|V7_G95.Value=0|V7_G96.Name=Dielectric Layer 4|V7_G96.Value=0|V7_G97.Name=Dielectric Layer 5|V7_G97.Value=0|V7_G98.Name=Mechanical Layer 18|V7_G98.Value=90|V7_G99.Name=Mechanical Layer 29|V7_G99.Value=90|V7_G100.Name=Mechanical Layer 40|V7_G100.Value=90|V7_G101.Name=Mechanical Layer 41|V7_G101.Value=90|Mechanical1=True|Mechanical2=True|Mechanical3=True|Mechanical4=True|Mechanical5=True|Mechanical6=True|Mechanical7=True|Mechanical8=True|Mechanical9=True|Mechanical10=True|Mechanical11=True|Mechanical12=True|Mechanical13=True|Mechanical14=True|Mechanical15=True|Mechanical16=True|Gray Level For TopLayer=30|Gray Level For MidLayer1=60|Gray Level For MidLayer2=90|Gray Level For MidLayer3=120|Gray Level For MidLayer4=150|Gray Level For MidLayer5=180|Gray Level For MidLayer6=210|Gray Level For MidLayer7=60|Gray Level For MidLayer8=90|Gray Level For MidLayer9=120|Gray Level For MidLayer10=150|Gray Level For MidLayer11=180|Gray Level For MidLayer12=210|Gray Level For MidLayer13=60|Gray Level For MidLayer14=95|Gray Level For MidLayer15=60|Gray Level For MidLayer16=90|Gray Level For MidLayer17=120|Gray Level For MidLayer18=150|Gray Level For MidLayer19=180|Gray Level For MidLayer20=210|Gray Level For MidLayer21=60|Gray Level For MidLayer22=90|Gray Level For MidLayer23=120|Gray Level For MidLayer24=150|Gray Level For MidLayer25=180|Gray Level For MidLayer26=210|Gray Level For MidLayer27=60|Gray Level For MidLayer28=95|Gray Level For MidLayer29=60|Gray Level For MidLayer30=95|Gray Level For BottomLayer=90|Gray Level For TopOverlay=192|Gray Level For BottomOverlay=140|Gray Level For TopPaste=0|Gray Level For BottomPaste=0|Gray Level For TopSolder=0|Gray Level For BottomSolder=0|Gray Level For InternalPlane1=0|Gray Level For InternalPlane2=0|Gray Level For InternalPlane3=0|Gray Level For InternalPlane4=0|Gray Level For InternalPlane5=0|Gray Level For InternalPlane6=0|Gray Level For InternalPlane7=0|Gray Level For InternalPlane8=0|Gray Level For InternalPlane9=0|Gray Level For InternalPlane10=0|Gray Level For InternalPlane11=0|Gray Level For InternalPlane12=0|Gray Level For InternalPlane13=0|Gray Level For InternalPlane14=0|Gray Level For InternalPlane15=0|Gray Level For InternalPlane16=0|Gray Level For DrillGuide=0|Gray Level For KeepOutLayer=120|Gray Level For Mechanical1=10|Gray Level For Mechanical2=10|Gray Level For Mechanical3=10|Gray Level For Mechanical4=90|Gray Level For Mechanical5=90|Gray Level For Mechanical6=90|Gray Level For Mechanical7=10|Gray Level For Mechanical8=90|Gray Level For Mechanical9=90|Gray Level For Mechanical10=90|Gray Level For Mechanical11=90|Gray Level For Mechanical12=90|Gray Level For Mechanical13=90|Gray Level For Mechanical14=90|Gray Level For Mechanical15=0|Gray Level For Mechanical16=0|Gray Level For DrillDrawing=0|Gray Level For MultiLayer=0|Gray Level For ConnectLayer=0|Gray Level For BackGroundLayer=255|Gray Level For DRCErrorLayer=0|Gray Level For HighlightLayer=0|Gray Level For GridColor1=0|Gray Level For GridColor10=0|Gray Level For PadHoleLayer=210|Gray Level For ViaHoleLayer=210|Color For TopLayer=255|Color For MidLayer1=32768|Color For MidLayer2=65280|Color For MidLayer3=8388608|Color For MidLayer4=16776960|Color For MidLayer5=8388736|Color For MidLayer6=16711935|Color For MidLayer7=32896|Color For MidLayer8=65535|Color For MidLayer9=8421504|Color For MidLayer10=32768|Color For MidLayer11=8388736|Color For MidLayer12=8421376|Color For MidLayer13=12632256|Color For MidLayer14=128|Color For MidLayer15=32768|Color For MidLayer16=65280|Color For MidLayer17=8388608|Color For MidLayer18=16776960|Color For MidLayer19=8388736|Color For MidLayer20=16711935|Color For MidLayer21=32896|Color For MidLayer22=65535|Color For MidLayer23=8421504|Color For MidLayer24=32768|Color For MidLayer25=8388736|Color For MidLayer26=8421376|Color For MidLayer27=12632256|Color For MidLayer28=8421376|Color For MidLayer29=12632256|Color For MidLayer30=128|Color For BottomLayer=16711680|Color For TopOverlay=32768|Color For BottomOverlay=7585984|Color For TopPaste=8388736|Color For BottomPaste=128|Color For TopSolder=3162822|Color For BottomSolder=7307173|Color For InternalPlane1=32768|Color For InternalPlane2=128|Color For InternalPlane3=8388736|Color For InternalPlane4=8421376|Color For InternalPlane5=32768|Color For InternalPlane6=128|Color For InternalPlane7=8388736|Color For InternalPlane8=8421376|Color For InternalPlane9=32768|Color For InternalPlane10=128|Color For InternalPlane11=8388736|Color For InternalPlane12=8421376|Color For InternalPlane13=32768|Color For InternalPlane14=128|Color For InternalPlane15=8388736|Color For InternalPlane16=8421376|Color For DrillGuide=128|Color For KeepOutLayer=8388736|Color For Mechanical1=8388736|Color For Mechanical2=8421376|Color For Mechanical3=32768|Color For Mechanical4=0|Color For Mechanical5=8388736|Color For Mechanical6=8421376|Color For Mechanical7=32768|Color For Mechanical8=0|Color For Mechanical9=8388736|Color For Mechanical10=8421376|Color For Mechanical11=32768|Color For Mechanical12=0|Color For Mechanical13=8388736|Color For Mechanical14=8421376|Color For Mechanical15=32768|Color For Mechanical16=0|Color For DrillDrawing=3408013|Color For MultiLayer=8421504|Color For ConnectLayer=8421376|Color For BackGroundLayer=15269887|Color For DRCErrorLayer=65280|Color For HighlightLayer=65535|Color For GridColor1=12632256|Color For GridColor10=11913679|Color For PadHoleLayer=6899487|Color For ViaHoleLayer=9279142 -OutputType17=Composite -OutputName17=Design Notes -OutputCategory17=Documentation -OutputDocumentPath17= -OutputVariantName17= -OutputEnabled17=0 -OutputEnabled17_OutputMedium1=0 -OutputEnabled17_OutputMedium2=0 -OutputEnabled17_OutputMedium3=1 -OutputEnabled17_OutputMedium4=0 -OutputEnabled17_OutputMedium5=0 -OutputEnabled17_OutputMedium6=0 -OutputEnabled17_OutputMedium7=0 -OutputEnabled17_OutputMedium8=0 -OutputEnabled17_OutputMedium9=0 -OutputEnabled17_OutputMedium10=0 -OutputDefault17=0 -PageOptions17=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=0|PaperKind=A4|PaperIndex=9 -Configuration17_Name1=OutputConfigurationParameter1 -Configuration17_Item1=DesignatorDisplayMode=Physical|PrintArea=DesignExtent|PrintAreaLowerLeftCornerY=0|PrintAreaLowerLeftCornerX=0|PrintAreaUpperRightCornerY=0|PrintAreaUpperRightCornerX=0|Record=PcbPrintView|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration17_Name2=OutputConfigurationParameter2 -Configuration17_Item2=IncludeBoardCutouts=False|IncludeBottomLayerComponents=True|IncludeMultiLayerComponents=True|IncludeTopLayerComponents=True|IncludeViewports=False|Index=0|Mirror=False|Name=Gerber Notes|PadNumberFontSize=14|Record=PcbPrintOut|ShowHoles=False|ShowPadNets=False|ShowPadNumbers=False|SubstituteFonts=False|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration17_Name3=OutputConfigurationParameter3 -Configuration17_Item3=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical23|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration17_Name4=OutputConfigurationParameter4 -Configuration17_Item4=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical15|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration17_Name5=OutputConfigurationParameter5 -Configuration17_Item5=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=MultiLayer|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration17_Name6=OutputConfigurationParameter6 -Configuration17_Item6=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical17|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration17_Name7=OutputConfigurationParameter7 -Configuration17_Item7=CArc=Draft|CFill=Draft|Comment=Draft|Coordinate=Draft|CPad=Draft|CRegion=Draft|CText=Draft|CTrack=Draft|CVia=Draft|Designator=Draft|Dimension=Draft|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Draft|FFill=Draft|FPad=Draft|FRegion=Draft|FText=Draft|FTrack=Draft|FVia=Draft|Layer=TopSolder|Polygon=Draft|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration17_Name8=OutputConfigurationParameter8 -Configuration17_Item8=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=TopOverlay|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration17_Name9=OutputConfigurationParameter9 -Configuration17_Item9=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical1|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration17_Name10=OutputConfigurationParameter10 -Configuration17_Item10=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical9|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration17_Name11=OutputConfigurationParameter11 -Configuration17_Item11=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical3|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration17_Name12=OutputConfigurationParameter12 -Configuration17_Item12=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical13|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -PcbPrintPreferences17=SubsititueFont_Default=True|SubsititueFont_Serif=True|SubsititueFont_SansSerif=True|PrintKeepOuts=False|NetColorOverride=True|PrintPositivePlaneLayers=False|V7_M0.Name=Mechanical Layer 1|V7_M0.Value=True|V7_M1.Name=Mechanical Layer 2|V7_M1.Value=True|V7_M2.Name=Mechanical Layer 3|V7_M2.Value=True|V7_M3.Name=Mechanical Layer 4|V7_M3.Value=True|V7_M4.Name=Mechanical Layer 5|V7_M4.Value=True|V7_M5.Name=Mechanical Layer 6|V7_M5.Value=True|V7_M6.Name=Mechanical Layer 7|V7_M6.Value=True|V7_M7.Name=Mechanical Layer 8|V7_M7.Value=True|V7_M8.Name=Mechanical Layer 9|V7_M8.Value=True|V7_M9.Name=Mechanical Layer 10|V7_M9.Value=True|V7_M10.Name=Mechanical Layer 11|V7_M10.Value=True|V7_M11.Name=Mechanical Layer 12|V7_M11.Value=True|V7_M12.Name=Mechanical Layer 13|V7_M12.Value=True|V7_M13.Name=Mechanical Layer 14|V7_M13.Value=True|V7_M14.Name=Mechanical Layer 15|V7_M14.Value=True|V7_M15.Name=Mechanical Layer 16|V7_M15.Value=True|V7_G0.Name=Top Layer|V7_G0.Value=64|V7_G1.Name=Mid Layer 1|V7_G1.Value=60|V7_G2.Name=Mid Layer 2|V7_G2.Value=90|V7_G3.Name=Mid Layer 3|V7_G3.Value=120|V7_G4.Name=Mid Layer 4|V7_G4.Value=150|V7_G5.Name=Mid Layer 5|V7_G5.Value=180|V7_G6.Name=Mid Layer 6|V7_G6.Value=210|V7_G7.Name=Mid Layer 7|V7_G7.Value=60|V7_G8.Name=Mid Layer 8|V7_G8.Value=90|V7_G9.Name=Mid Layer 9|V7_G9.Value=120|V7_G10.Name=Mid Layer 10|V7_G10.Value=150|V7_G11.Name=Mid Layer 11|V7_G11.Value=180|V7_G12.Name=Mid Layer 12|V7_G12.Value=210|V7_G13.Name=Mid Layer 13|V7_G13.Value=60|V7_G14.Name=Mid Layer 14|V7_G14.Value=95|V7_G15.Name=Mid Layer 15|V7_G15.Value=60|V7_G16.Name=Mid Layer 16|V7_G16.Value=90|V7_G17.Name=Mid Layer 17|V7_G17.Value=120|V7_G18.Name=Mid Layer 18|V7_G18.Value=150|V7_G19.Name=Mid Layer 19|V7_G19.Value=180|V7_G20.Name=Mid Layer 20|V7_G20.Value=210|V7_G21.Name=Mid Layer 21|V7_G21.Value=60|V7_G22.Name=Mid Layer 22|V7_G22.Value=90|V7_G23.Name=Mid Layer 23|V7_G23.Value=120|V7_G24.Name=Mid Layer 24|V7_G24.Value=150|V7_G25.Name=Mid Layer 25|V7_G25.Value=180|V7_G26.Name=Mid Layer 26|V7_G26.Value=210|V7_G27.Name=Mid Layer 27|V7_G27.Value=60|V7_G28.Name=Mid Layer 28|V7_G28.Value=95|V7_G29.Name=Mid Layer 29|V7_G29.Value=60|V7_G30.Name=Mid Layer 30|V7_G30.Value=95|V7_G31.Name=Bottom Layer|V7_G31.Value=64|V7_G32.Name=Top Overlay|V7_G32.Value=160|V7_G33.Name=Bottom Overlay|V7_G33.Value=192|V7_G34.Name=Top Paste|V7_G34.Value=0|V7_G35.Name=Bottom Paste|V7_G35.Value=0|V7_G36.Name=Top Solder Mask|V7_G36.Value=64|V7_G37.Name=Bottom Solder Mask|V7_G37.Value=0|V7_G38.Name=Drill Guide|V7_G38.Value=0|V7_G39.Name=Keep Out Layer|V7_G39.Value=120|V7_G40.Name=Drill Drawing|V7_G40.Value=0|V7_G41.Name=Multi Layer|V7_G41.Value=0|V7_G42.Name=Connect Layer|V7_G42.Value=0|V7_G43.Name=BackGround|V7_G43.Value=255|V7_G44.Name=DRC Errors|V7_G44.Value=0|V7_G45.Name=Highlight Layer|V7_G45.Value=0|V7_G46.Name=Grid Color 1|V7_G46.Value=0|V7_G47.Name=Grid Color 10|V7_G47.Value=0|V7_G48.Name=Pad Hole Layer|V7_G48.Value=210|V7_G49.Name=Via Hole Layer|V7_G49.Value=210|V7_G50.Name=Mechanical Layers|V7_G50.Value=90|V7_G51.Name=Internal Plane Layers|V7_G51.Value=0|V7_G52.Name=Internal Plane 1|V7_G52.Value=0|V7_G53.Name=Internal Plane 2|V7_G53.Value=0|V7_G54.Name=Internal Plane 3|V7_G54.Value=0|V7_G55.Name=Internal Plane 4|V7_G55.Value=0|V7_G56.Name=Internal Plane 5|V7_G56.Value=0|V7_G57.Name=Internal Plane 6|V7_G57.Value=0|V7_G58.Name=Internal Plane 7|V7_G58.Value=0|V7_G59.Name=Internal Plane 8|V7_G59.Value=0|V7_G60.Name=Internal Plane 9|V7_G60.Value=0|V7_G61.Name=Internal Plane 10|V7_G61.Value=0|V7_G62.Name=Internal Plane 11|V7_G62.Value=0|V7_G63.Name=Internal Plane 12|V7_G63.Value=0|V7_G64.Name=Internal Plane 13|V7_G64.Value=0|V7_G65.Name=Internal Plane 14|V7_G65.Value=0|V7_G66.Name=Internal Plane 15|V7_G66.Value=0|V7_G67.Name=Internal Plane 16|V7_G67.Value=0|V7_G68.Name=Mechanical Layer 1|V7_G68.Value=10|V7_G69.Name=Mechanical Layer 2|V7_G69.Value=10|V7_G70.Name=Mechanical Layer 3|V7_G70.Value=10|V7_G71.Name=Mechanical Layer 4|V7_G71.Value=0|V7_G72.Name=Mechanical Layer 5|V7_G72.Value=0|V7_G73.Name=Mechanical Layer 6|V7_G73.Value=0|V7_G74.Name=Mechanical Layer 7|V7_G74.Value=90|V7_G75.Name=Mechanical Layer 8|V7_G75.Value=90|V7_G76.Name=Mechanical Layer 9|V7_G76.Value=10|V7_G77.Name=Mechanical Layer 10|V7_G77.Value=90|V7_G78.Name=Mechanical Layer 11|V7_G78.Value=90|V7_G79.Name=Mechanical Layer 12|V7_G79.Value=90|V7_G80.Name=Mechanical Layer 13|V7_G80.Value=10|V7_G81.Name=Mechanical Layer 14|V7_G81.Value=90|V7_G82.Name=Mechanical Layer 15|V7_G82.Value=0|V7_G83.Name=Mechanical Layer 16|V7_G83.Value=0|V7_G84.Name=Dielectric Layer 1|V7_G84.Value=0|V7_G85.Name=Mechanical Layer 17|V7_G85.Value=130|V7_G86.Name=Mechanical Layer 19|V7_G86.Value=0|V7_G87.Name=Mechanical Layer 20|V7_G87.Value=0|V7_G88.Name=Mechanical Layer 21|V7_G88.Value=90|V7_G89.Name=Mechanical Layer 22|V7_G89.Value=90|V7_G90.Name=Mechanical Layer 23|V7_G90.Value=0|V7_G91.Name=Mechanical Layer 30|V7_G91.Value=90|V7_G92.Name=Mechanical Layer 31|V7_G92.Value=90|V7_G93.Name=Mechanical Layer 32|V7_G93.Value=90|V7_G94.Name=Dielectric Layer 2|V7_G94.Value=0|V7_G95.Name=Dielectric Layer 3|V7_G95.Value=0|V7_G96.Name=Dielectric Layer 4|V7_G96.Value=0|V7_G97.Name=Dielectric Layer 5|V7_G97.Value=0|V7_G98.Name=Mechanical Layer 18|V7_G98.Value=90|V7_G99.Name=Mechanical Layer 29|V7_G99.Value=90|Mechanical1=True|Mechanical2=True|Mechanical3=True|Mechanical4=True|Mechanical5=True|Mechanical6=True|Mechanical7=True|Mechanical8=True|Mechanical9=True|Mechanical10=True|Mechanical11=True|Mechanical12=True|Mechanical13=True|Mechanical14=True|Mechanical15=True|Mechanical16=True|Gray Level For TopLayer=64|Gray Level For MidLayer1=60|Gray Level For MidLayer2=90|Gray Level For MidLayer3=120|Gray Level For MidLayer4=150|Gray Level For MidLayer5=180|Gray Level For MidLayer6=210|Gray Level For MidLayer7=60|Gray Level For MidLayer8=90|Gray Level For MidLayer9=120|Gray Level For MidLayer10=150|Gray Level For MidLayer11=180|Gray Level For MidLayer12=210|Gray Level For MidLayer13=60|Gray Level For MidLayer14=95|Gray Level For MidLayer15=60|Gray Level For MidLayer16=90|Gray Level For MidLayer17=120|Gray Level For MidLayer18=150|Gray Level For MidLayer19=180|Gray Level For MidLayer20=210|Gray Level For MidLayer21=60|Gray Level For MidLayer22=90|Gray Level For MidLayer23=120|Gray Level For MidLayer24=150|Gray Level For MidLayer25=180|Gray Level For MidLayer26=210|Gray Level For MidLayer27=60|Gray Level For MidLayer28=95|Gray Level For MidLayer29=60|Gray Level For MidLayer30=95|Gray Level For BottomLayer=64|Gray Level For TopOverlay=160|Gray Level For BottomOverlay=192|Gray Level For TopPaste=0|Gray Level For BottomPaste=0|Gray Level For TopSolder=64|Gray Level For BottomSolder=0|Gray Level For InternalPlane1=0|Gray Level For InternalPlane2=0|Gray Level For InternalPlane3=0|Gray Level For InternalPlane4=0|Gray Level For InternalPlane5=0|Gray Level For InternalPlane6=0|Gray Level For InternalPlane7=0|Gray Level For InternalPlane8=0|Gray Level For InternalPlane9=0|Gray Level For InternalPlane10=0|Gray Level For InternalPlane11=0|Gray Level For InternalPlane12=0|Gray Level For InternalPlane13=0|Gray Level For InternalPlane14=0|Gray Level For InternalPlane15=0|Gray Level For InternalPlane16=0|Gray Level For DrillGuide=0|Gray Level For KeepOutLayer=120|Gray Level For Mechanical1=10|Gray Level For Mechanical2=10|Gray Level For Mechanical3=10|Gray Level For Mechanical4=0|Gray Level For Mechanical5=0|Gray Level For Mechanical6=0|Gray Level For Mechanical7=90|Gray Level For Mechanical8=90|Gray Level For Mechanical9=10|Gray Level For Mechanical10=90|Gray Level For Mechanical11=90|Gray Level For Mechanical12=90|Gray Level For Mechanical13=10|Gray Level For Mechanical14=90|Gray Level For Mechanical15=0|Gray Level For Mechanical16=0|Gray Level For DrillDrawing=0|Gray Level For MultiLayer=0|Gray Level For ConnectLayer=0|Gray Level For BackGroundLayer=255|Gray Level For DRCErrorLayer=0|Gray Level For HighlightLayer=0|Gray Level For GridColor1=0|Gray Level For GridColor10=0|Gray Level For PadHoleLayer=210|Gray Level For ViaHoleLayer=210|Color For TopLayer=255|Color For MidLayer1=32768|Color For MidLayer2=65280|Color For MidLayer3=8388608|Color For MidLayer4=16776960|Color For MidLayer5=8388736|Color For MidLayer6=16711935|Color For MidLayer7=32896|Color For MidLayer8=65535|Color For MidLayer9=8421504|Color For MidLayer10=32768|Color For MidLayer11=8388736|Color For MidLayer12=8421376|Color For MidLayer13=12632256|Color For MidLayer14=128|Color For MidLayer15=32768|Color For MidLayer16=65280|Color For MidLayer17=8388608|Color For MidLayer18=16776960|Color For MidLayer19=8388736|Color For MidLayer20=16711935|Color For MidLayer21=32896|Color For MidLayer22=65535|Color For MidLayer23=8421504|Color For MidLayer24=32768|Color For MidLayer25=8388736|Color For MidLayer26=8421376|Color For MidLayer27=12632256|Color For MidLayer28=8421376|Color For MidLayer29=12632256|Color For MidLayer30=128|Color For BottomLayer=16711680|Color For TopOverlay=32768|Color For BottomOverlay=7585984|Color For TopPaste=8388736|Color For BottomPaste=128|Color For TopSolder=3162822|Color For BottomSolder=7307173|Color For InternalPlane1=32768|Color For InternalPlane2=128|Color For InternalPlane3=8388736|Color For InternalPlane4=8421376|Color For InternalPlane5=32768|Color For InternalPlane6=128|Color For InternalPlane7=8388736|Color For InternalPlane8=8421376|Color For InternalPlane9=32768|Color For InternalPlane10=128|Color For InternalPlane11=8388736|Color For InternalPlane12=8421376|Color For InternalPlane13=32768|Color For InternalPlane14=128|Color For InternalPlane15=8388736|Color For InternalPlane16=8421376|Color For DrillGuide=128|Color For KeepOutLayer=8388736|Color For Mechanical1=8388736|Color For Mechanical2=8421376|Color For Mechanical3=32768|Color For Mechanical4=0|Color For Mechanical5=8388736|Color For Mechanical6=8421376|Color For Mechanical7=32768|Color For Mechanical8=0|Color For Mechanical9=8388736|Color For Mechanical10=8421376|Color For Mechanical11=32768|Color For Mechanical12=0|Color For Mechanical13=8388736|Color For Mechanical14=8421376|Color For Mechanical15=32768|Color For Mechanical16=0|Color For DrillDrawing=3408013|Color For MultiLayer=8421504|Color For ConnectLayer=8421376|Color For BackGroundLayer=15269887|Color For DRCErrorLayer=65280|Color For HighlightLayer=65535|Color For GridColor1=12632256|Color For GridColor10=11913679|Color For PadHoleLayer=6899487|Color For ViaHoleLayer=9279142 -OutputType18=Composite -OutputName18=PCB Layers -OutputCategory18=Documentation -OutputDocumentPath18= -OutputVariantName18= -OutputEnabled18=0 -OutputEnabled18_OutputMedium1=0 -OutputEnabled18_OutputMedium2=0 -OutputEnabled18_OutputMedium3=5 -OutputEnabled18_OutputMedium4=0 -OutputEnabled18_OutputMedium5=0 -OutputEnabled18_OutputMedium6=0 -OutputEnabled18_OutputMedium7=0 -OutputEnabled18_OutputMedium8=0 -OutputEnabled18_OutputMedium9=0 -OutputEnabled18_OutputMedium10=0 -OutputDefault18=0 -PageOptions18=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=5.00|XCorrection=1.00|YCorrection=1.00|PrintKind=2|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PrintScaleName=PrintFitPageWidth|PaperKind=A4|PaperIndex=9 -Configuration18_Name1=OutputConfigurationParameter1 -Configuration18_Item1=DesignatorDisplayMode=Physical|PrintArea=DesignExtent|PrintAreaLowerLeftCornerY=117716535|PrintAreaLowerLeftCornerX=117716535|PrintAreaUpperRightCornerY=132283465|PrintAreaUpperRightCornerX=132283465|Record=PcbPrintView|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration18_Name2=OutputConfigurationParameter2 -Configuration18_Item2=IncludeBoardCutouts=False|IncludeBottomLayerComponents=True|IncludeMultiLayerComponents=True|IncludeTopLayerComponents=True|IncludeViewports=True|Index=0|Mirror=False|Name=Top Layer|PadNumberFontSize=14|Record=PcbPrintOut|ShowHoles=False|ShowPadNets=False|ShowPadNumbers=False|SubstituteFonts=False|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration18_Name3=OutputConfigurationParameter3 -Configuration18_Item3=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=TopLayer|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration18_Name4=OutputConfigurationParameter4 -Configuration18_Item4=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical5|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration18_Name5=OutputConfigurationParameter5 -Configuration18_Item5=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical1|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration18_Name6=OutputConfigurationParameter6 -Configuration18_Item6=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical3|Polygon=Full|PrintOutIndex=0|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration18_Name7=OutputConfigurationParameter7 -Configuration18_Item7=IncludeBoardCutouts=False|IncludeBottomLayerComponents=True|IncludeMultiLayerComponents=True|IncludeTopLayerComponents=True|IncludeViewports=True|Index=1|Mirror=False|Name=Mid 2|PadNumberFontSize=14|Record=PcbPrintOut|ShowHoles=False|ShowPadNets=False|ShowPadNumbers=False|SubstituteFonts=False|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration18_Name8=OutputConfigurationParameter8 -Configuration18_Item8=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=MidLayer1|Polygon=Full|PrintOutIndex=1|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration18_Name9=OutputConfigurationParameter9 -Configuration18_Item9=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical5|Polygon=Full|PrintOutIndex=1|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration18_Name10=OutputConfigurationParameter10 -Configuration18_Item10=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical1|Polygon=Full|PrintOutIndex=1|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration18_Name11=OutputConfigurationParameter11 -Configuration18_Item11=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical3|Polygon=Full|PrintOutIndex=1|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration18_Name12=OutputConfigurationParameter12 -Configuration18_Item12=IncludeBoardCutouts=False|IncludeBottomLayerComponents=True|IncludeMultiLayerComponents=True|IncludeTopLayerComponents=True|IncludeViewports=True|Index=2|Mirror=False|Name=Mid 3|PadNumberFontSize=14|Record=PcbPrintOut|ShowHoles=False|ShowPadNets=False|ShowPadNumbers=False|SubstituteFonts=False|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration18_Name13=OutputConfigurationParameter13 -Configuration18_Item13=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=MidLayer2|Polygon=Full|PrintOutIndex=2|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration18_Name14=OutputConfigurationParameter14 -Configuration18_Item14=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical5|Polygon=Full|PrintOutIndex=2|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration18_Name15=OutputConfigurationParameter15 -Configuration18_Item15=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical1|Polygon=Full|PrintOutIndex=2|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration18_Name16=OutputConfigurationParameter16 -Configuration18_Item16=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical3|Polygon=Full|PrintOutIndex=2|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration18_Name17=OutputConfigurationParameter17 -Configuration18_Item17=IncludeBoardCutouts=False|IncludeBottomLayerComponents=True|IncludeMultiLayerComponents=True|IncludeTopLayerComponents=True|IncludeViewports=True|Index=3|Mirror=False|Name=Bottom Layer|PadNumberFontSize=14|Record=PcbPrintOut|ShowHoles=False|ShowPadNets=False|ShowPadNumbers=False|SubstituteFonts=False|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration18_Name18=OutputConfigurationParameter18 -Configuration18_Item18=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=BottomLayer|Polygon=Full|PrintOutIndex=3|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration18_Name19=OutputConfigurationParameter19 -Configuration18_Item19=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical5|Polygon=Full|PrintOutIndex=3|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration18_Name20=OutputConfigurationParameter20 -Configuration18_Item20=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical1|Polygon=Full|PrintOutIndex=3|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -Configuration18_Name21=OutputConfigurationParameter21 -Configuration18_Item21=CArc=Full|CFill=Full|Comment=Full|Coordinate=Full|CPad=Full|CRegion=Full|CText=Full|CTrack=Full|CVia=Full|Designator=Full|Dimension=Full|DLayer1=TopLayer|DLayer2=BottomLayer|DrillType=Regular|FArc=Full|FFill=Full|FPad=Full|FRegion=Full|FText=Full|FTrack=Full|FVia=Full|Layer=Mechanical3|Polygon=Full|PrintOutIndex=3|Record=PcbPrintLayer|DocumentPath=Z:\MicroRally\Electronics\uDCCD_Controller\Main board\Source\uDCCD_Controller.PcbDoc -PcbPrintPreferences18=SubsititueFont_Default=True|SubsititueFont_Serif=True|SubsititueFont_SansSerif=True|PrintKeepOuts=False|NetColorOverride=True|PrintPositivePlaneLayers=False|V7_M0.Name=Mechanical Layer 1|V7_M0.Value=True|V7_M1.Name=Mechanical Layer 2|V7_M1.Value=True|V7_M2.Name=Mechanical Layer 3|V7_M2.Value=True|V7_M3.Name=Mechanical Layer 4|V7_M3.Value=True|V7_M4.Name=Mechanical Layer 5|V7_M4.Value=True|V7_M5.Name=Mechanical Layer 6|V7_M5.Value=True|V7_M6.Name=Mechanical Layer 7|V7_M6.Value=True|V7_M7.Name=Mechanical Layer 8|V7_M7.Value=True|V7_M8.Name=Mechanical Layer 9|V7_M8.Value=True|V7_M9.Name=Mechanical Layer 10|V7_M9.Value=True|V7_M10.Name=Mechanical Layer 11|V7_M10.Value=True|V7_M11.Name=Mechanical Layer 12|V7_M11.Value=True|V7_M12.Name=Mechanical Layer 13|V7_M12.Value=True|V7_M13.Name=Mechanical Layer 14|V7_M13.Value=True|V7_M14.Name=Mechanical Layer 15|V7_M14.Value=True|V7_M15.Name=Mechanical Layer 16|V7_M15.Value=True|V7_G0.Name=Top Layer|V7_G0.Value=64|V7_G1.Name=Mid Layer 1|V7_G1.Value=60|V7_G2.Name=Mid Layer 2|V7_G2.Value=90|V7_G3.Name=Mid Layer 3|V7_G3.Value=120|V7_G4.Name=Mid Layer 4|V7_G4.Value=150|V7_G5.Name=Mid Layer 5|V7_G5.Value=180|V7_G6.Name=Mid Layer 6|V7_G6.Value=210|V7_G7.Name=Mid Layer 7|V7_G7.Value=60|V7_G8.Name=Mid Layer 8|V7_G8.Value=90|V7_G9.Name=Mid Layer 9|V7_G9.Value=120|V7_G10.Name=Mid Layer 10|V7_G10.Value=150|V7_G11.Name=Mid Layer 11|V7_G11.Value=180|V7_G12.Name=Mid Layer 12|V7_G12.Value=210|V7_G13.Name=Mid Layer 13|V7_G13.Value=60|V7_G14.Name=Mid Layer 14|V7_G14.Value=95|V7_G15.Name=Mid Layer 15|V7_G15.Value=60|V7_G16.Name=Mid Layer 16|V7_G16.Value=90|V7_G17.Name=Mid Layer 17|V7_G17.Value=120|V7_G18.Name=Mid Layer 18|V7_G18.Value=150|V7_G19.Name=Mid Layer 19|V7_G19.Value=180|V7_G20.Name=Mid Layer 20|V7_G20.Value=210|V7_G21.Name=Mid Layer 21|V7_G21.Value=60|V7_G22.Name=Mid Layer 22|V7_G22.Value=90|V7_G23.Name=Mid Layer 23|V7_G23.Value=120|V7_G24.Name=Mid Layer 24|V7_G24.Value=150|V7_G25.Name=Mid Layer 25|V7_G25.Value=180|V7_G26.Name=Mid Layer 26|V7_G26.Value=210|V7_G27.Name=Mid Layer 27|V7_G27.Value=60|V7_G28.Name=Mid Layer 28|V7_G28.Value=95|V7_G29.Name=Mid Layer 29|V7_G29.Value=60|V7_G30.Name=Mid Layer 30|V7_G30.Value=95|V7_G31.Name=Bottom Layer|V7_G31.Value=64|V7_G32.Name=Top Overlay|V7_G32.Value=192|V7_G33.Name=Bottom Overlay|V7_G33.Value=192|V7_G34.Name=Top Paste|V7_G34.Value=0|V7_G35.Name=Bottom Paste|V7_G35.Value=0|V7_G36.Name=Top Solder Mask|V7_G36.Value=0|V7_G37.Name=Bottom Solder Mask|V7_G37.Value=0|V7_G38.Name=Drill Guide|V7_G38.Value=0|V7_G39.Name=Keep Out Layer|V7_G39.Value=120|V7_G40.Name=Drill Drawing|V7_G40.Value=0|V7_G41.Name=Multi Layer|V7_G41.Value=0|V7_G42.Name=Connect Layer|V7_G42.Value=0|V7_G43.Name=BackGround|V7_G43.Value=255|V7_G44.Name=DRC Errors|V7_G44.Value=0|V7_G45.Name=Highlight Layer|V7_G45.Value=0|V7_G46.Name=Grid Color 1|V7_G46.Value=0|V7_G47.Name=Grid Color 10|V7_G47.Value=0|V7_G48.Name=Pad Hole Layer|V7_G48.Value=210|V7_G49.Name=Via Hole Layer|V7_G49.Value=210|V7_G50.Name=Mechanical Layers|V7_G50.Value=90|V7_G51.Name=Internal Plane Layers|V7_G51.Value=0|V7_G52.Name=Internal Plane 1|V7_G52.Value=0|V7_G53.Name=Internal Plane 2|V7_G53.Value=0|V7_G54.Name=Internal Plane 3|V7_G54.Value=0|V7_G55.Name=Internal Plane 4|V7_G55.Value=0|V7_G56.Name=Internal Plane 5|V7_G56.Value=0|V7_G57.Name=Internal Plane 6|V7_G57.Value=0|V7_G58.Name=Internal Plane 7|V7_G58.Value=0|V7_G59.Name=Internal Plane 8|V7_G59.Value=0|V7_G60.Name=Internal Plane 9|V7_G60.Value=0|V7_G61.Name=Internal Plane 10|V7_G61.Value=0|V7_G62.Name=Internal Plane 11|V7_G62.Value=0|V7_G63.Name=Internal Plane 12|V7_G63.Value=0|V7_G64.Name=Internal Plane 13|V7_G64.Value=0|V7_G65.Name=Internal Plane 14|V7_G65.Value=0|V7_G66.Name=Internal Plane 15|V7_G66.Value=0|V7_G67.Name=Internal Plane 16|V7_G67.Value=0|V7_G68.Name=Mechanical Layer 1|V7_G68.Value=90|V7_G69.Name=Mechanical Layer 2|V7_G69.Value=90|V7_G70.Name=Mechanical Layer 3|V7_G70.Value=0|V7_G71.Name=Mechanical Layer 4|V7_G71.Value=0|V7_G72.Name=Mechanical Layer 5|V7_G72.Value=0|V7_G73.Name=Mechanical Layer 6|V7_G73.Value=0|V7_G74.Name=Mechanical Layer 7|V7_G74.Value=90|V7_G75.Name=Mechanical Layer 8|V7_G75.Value=90|V7_G76.Name=Mechanical Layer 9|V7_G76.Value=90|V7_G77.Name=Mechanical Layer 10|V7_G77.Value=90|V7_G78.Name=Mechanical Layer 11|V7_G78.Value=90|V7_G79.Name=Mechanical Layer 12|V7_G79.Value=90|V7_G80.Name=Mechanical Layer 13|V7_G80.Value=90|V7_G81.Name=Mechanical Layer 14|V7_G81.Value=90|V7_G82.Name=Mechanical Layer 15|V7_G82.Value=0|V7_G83.Name=Mechanical Layer 16|V7_G83.Value=90|V7_G84.Name=Dielectric Layer 1|V7_G84.Value=0|V7_G85.Name=Mechanical Layer 17|V7_G85.Value=90|V7_G86.Name=Mechanical Layer 19|V7_G86.Value=0|V7_G87.Name=Mechanical Layer 20|V7_G87.Value=0|V7_G88.Name=Mechanical Layer 21|V7_G88.Value=90|V7_G89.Name=Mechanical Layer 22|V7_G89.Value=90|V7_G90.Name=Mechanical Layer 23|V7_G90.Value=90|V7_G91.Name=Mechanical Layer 30|V7_G91.Value=90|V7_G92.Name=Mechanical Layer 31|V7_G92.Value=90|V7_G93.Name=Mechanical Layer 32|V7_G93.Value=90|V7_G94.Name=Dielectric Layer 2|V7_G94.Value=0|V7_G95.Name=Dielectric Layer 3|V7_G95.Value=0|V7_G96.Name=Dielectric Layer 4|V7_G96.Value=0|V7_G97.Name=Dielectric Layer 5|V7_G97.Value=0|Mechanical1=True|Mechanical2=True|Mechanical3=True|Mechanical4=True|Mechanical5=True|Mechanical6=True|Mechanical7=True|Mechanical8=True|Mechanical9=True|Mechanical10=True|Mechanical11=True|Mechanical12=True|Mechanical13=True|Mechanical14=True|Mechanical15=True|Mechanical16=True|Gray Level For TopLayer=64|Gray Level For MidLayer1=60|Gray Level For MidLayer2=90|Gray Level For MidLayer3=120|Gray Level For MidLayer4=150|Gray Level For MidLayer5=180|Gray Level For MidLayer6=210|Gray Level For MidLayer7=60|Gray Level For MidLayer8=90|Gray Level For MidLayer9=120|Gray Level For MidLayer10=150|Gray Level For MidLayer11=180|Gray Level For MidLayer12=210|Gray Level For MidLayer13=60|Gray Level For MidLayer14=95|Gray Level For MidLayer15=60|Gray Level For MidLayer16=90|Gray Level For MidLayer17=120|Gray Level For MidLayer18=150|Gray Level For MidLayer19=180|Gray Level For MidLayer20=210|Gray Level For MidLayer21=60|Gray Level For MidLayer22=90|Gray Level For MidLayer23=120|Gray Level For MidLayer24=150|Gray Level For MidLayer25=180|Gray Level For MidLayer26=210|Gray Level For MidLayer27=60|Gray Level For MidLayer28=95|Gray Level For MidLayer29=60|Gray Level For MidLayer30=95|Gray Level For BottomLayer=64|Gray Level For TopOverlay=192|Gray Level For BottomOverlay=192|Gray Level For TopPaste=0|Gray Level For BottomPaste=0|Gray Level For TopSolder=0|Gray Level For BottomSolder=0|Gray Level For InternalPlane1=0|Gray Level For InternalPlane2=0|Gray Level For InternalPlane3=0|Gray Level For InternalPlane4=0|Gray Level For InternalPlane5=0|Gray Level For InternalPlane6=0|Gray Level For InternalPlane7=0|Gray Level For InternalPlane8=0|Gray Level For InternalPlane9=0|Gray Level For InternalPlane10=0|Gray Level For InternalPlane11=0|Gray Level For InternalPlane12=0|Gray Level For InternalPlane13=0|Gray Level For InternalPlane14=0|Gray Level For InternalPlane15=0|Gray Level For InternalPlane16=0|Gray Level For DrillGuide=0|Gray Level For KeepOutLayer=120|Gray Level For Mechanical1=90|Gray Level For Mechanical2=90|Gray Level For Mechanical3=0|Gray Level For Mechanical4=0|Gray Level For Mechanical5=0|Gray Level For Mechanical6=0|Gray Level For Mechanical7=90|Gray Level For Mechanical8=90|Gray Level For Mechanical9=90|Gray Level For Mechanical10=90|Gray Level For Mechanical11=90|Gray Level For Mechanical12=90|Gray Level For Mechanical13=90|Gray Level For Mechanical14=90|Gray Level For Mechanical15=0|Gray Level For Mechanical16=90|Gray Level For DrillDrawing=0|Gray Level For MultiLayer=0|Gray Level For ConnectLayer=0|Gray Level For BackGroundLayer=255|Gray Level For DRCErrorLayer=0|Gray Level For HighlightLayer=0|Gray Level For GridColor1=0|Gray Level For GridColor10=0|Gray Level For PadHoleLayer=210|Gray Level For ViaHoleLayer=210|Color For TopLayer=255|Color For MidLayer1=32768|Color For MidLayer2=65280|Color For MidLayer3=8388608|Color For MidLayer4=16776960|Color For MidLayer5=8388736|Color For MidLayer6=16711935|Color For MidLayer7=32896|Color For MidLayer8=65535|Color For MidLayer9=8421504|Color For MidLayer10=32768|Color For MidLayer11=8388736|Color For MidLayer12=8421376|Color For MidLayer13=12632256|Color For MidLayer14=128|Color For MidLayer15=32768|Color For MidLayer16=65280|Color For MidLayer17=8388608|Color For MidLayer18=16776960|Color For MidLayer19=8388736|Color For MidLayer20=16711935|Color For MidLayer21=32896|Color For MidLayer22=65535|Color For MidLayer23=8421504|Color For MidLayer24=32768|Color For MidLayer25=8388736|Color For MidLayer26=8421376|Color For MidLayer27=12632256|Color For MidLayer28=8421376|Color For MidLayer29=12632256|Color For MidLayer30=128|Color For BottomLayer=16711680|Color For TopOverlay=32768|Color For BottomOverlay=7585984|Color For TopPaste=8388736|Color For BottomPaste=128|Color For TopSolder=3162822|Color For BottomSolder=7307173|Color For InternalPlane1=32768|Color For InternalPlane2=128|Color For InternalPlane3=8388736|Color For InternalPlane4=8421376|Color For InternalPlane5=32768|Color For InternalPlane6=128|Color For InternalPlane7=8388736|Color For InternalPlane8=8421376|Color For InternalPlane9=32768|Color For InternalPlane10=128|Color For InternalPlane11=8388736|Color For InternalPlane12=8421376|Color For InternalPlane13=32768|Color For InternalPlane14=128|Color For InternalPlane15=8388736|Color For InternalPlane16=8421376|Color For DrillGuide=128|Color For KeepOutLayer=8388736|Color For Mechanical1=8388736|Color For Mechanical2=8421376|Color For Mechanical3=32768|Color For Mechanical4=0|Color For Mechanical5=8388736|Color For Mechanical6=8421376|Color For Mechanical7=32768|Color For Mechanical8=0|Color For Mechanical9=8388736|Color For Mechanical10=8421376|Color For Mechanical11=32768|Color For Mechanical12=0|Color For Mechanical13=8388736|Color For Mechanical14=8421376|Color For Mechanical15=32768|Color For Mechanical16=0|Color For DrillDrawing=3408013|Color For MultiLayer=8421504|Color For ConnectLayer=8421376|Color For BackGroundLayer=15269887|Color For DRCErrorLayer=65280|Color For HighlightLayer=65535|Color For GridColor1=12632256|Color For GridColor10=11913679|Color For PadHoleLayer=6899487|Color For ViaHoleLayer=9279142 -OutputType19=BOM_PartType -OutputName19=Placement BOM -OutputCategory19=Report -OutputDocumentPath19= -OutputVariantName19=Default -OutputEnabled19=0 -OutputEnabled19_OutputMedium1=0 -OutputEnabled19_OutputMedium2=0 -OutputEnabled19_OutputMedium3=0 -OutputEnabled19_OutputMedium4=0 -OutputEnabled19_OutputMedium5=0 -OutputEnabled19_OutputMedium6=0 -OutputEnabled19_OutputMedium7=0 -OutputEnabled19_OutputMedium8=0 -OutputEnabled19_OutputMedium9=0 -OutputEnabled19_OutputMedium10=1 -OutputDefault19=0 -PageOptions19=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -Configuration19_Name1=ColumnNameFormat -Configuration19_Item1=CaptionAsName -Configuration19_Name2=General -Configuration19_Item2=OpenExported=False|AddToProject=False|ReportBOMViolationsInMessages=False|ForceFit=False|NotFitted=True|Database=False|DatabasePriority=False|IncludePcbData=True|IncludeVaultData=False|IncludeCloudData=False|IncludeDocumentData=True|IncludeAlternatives=False|ShowExportOptions=True|TemplateFilename=|TemplateVaultGuid=|TemplateItemGuid=|TemplateRevisionGuid=|BatchMode=2|FormWidth=1976|FormHeight=1154|SupplierProdQty=1|SupplierAutoQty=False|SupplierUseCachedPricing=False|SupplierCurrency=USD|SolutionsPerItem=1|SuppliersPerSolution=1|ViewType=1|UseDirectApi=False|BomSetName= -Configuration19_Name3=GroupOrder -Configuration19_Item3=LibRef=True|Comment=True|Layer=True|Fitted=True -Configuration19_Name4=SortOrder -Configuration19_Item4=Layer=Down -Configuration19_Name5=VisibleOrder -Configuration19_Item5=Designator=180|Description=293|PACKAGE=90|VALUE=87|MANUFACTURER=109|PART#=112|Quantity=62|RESTRICT=78|Layer=109|Fitted=100 -Configuration19_Name6=VisibleOrder_Flat -Configuration19_Item6=Designator=180|Description=293|PACKAGE=90|VALUE=87|MANUFACTURER=109|PART#=112|Quantity=62|RESTRICT=78|Layer=109|Fitted=100 - -[PublishSettings] -OutputFilePath2=Z:\MicroRally\Electronics\DataTracker\OUTPUTS\R1V1\DataTracker_R1V1_Schematic.PDF -ReleaseManaged2=0 -OutputBasePath2=OUTPUTS\ -OutputPathMedia2==UT_Output_file_name -OutputPathMediaValue2==UT_Output_file_name -OutputPathOutputer2=[Output Type] -OutputPathOutputerPrefix2= -OutputPathOutputerValue2= -OutputFileName2=Private_OutJob_v1.PDF -OutputFileNameMulti2= -UseOutputNameForMulti2=0 -OutputFileNameSpecial2==UT_Output_file_name+'_'+UT_PCB_Revision+UT_BOM_Version+'_Schematic' -OpenOutput2=0 -PromptOverwrite2=0 -PublishMethod2=0 -ZoomLevel2=50 -FitSCHPrintSizeToDoc2=1 -FitPCBPrintSizeToDoc2=1 -GenerateNetsInfo2=0 -MarkPins2=1 -MarkNetLabels2=1 -MarkPortsId2=1 -GenerateTOC2=1 -ShowComponentParameters2=1 -GlobalBookmarks2=0 -PDFACompliance2=Disabled -PDFVersion2=Default -OutputFilePath3=Z:\MicroRally\Electronics\DataTracker\OUTPUTS\DataTracker_R1_PCB.PDF -ReleaseManaged3=0 -OutputBasePath3=OUTPUTS\ -OutputPathMedia3==UT_Output_file_name -OutputPathMediaValue3==UT_Output_file_name -OutputPathOutputer3=[Output Type] -OutputPathOutputerPrefix3= -OutputPathOutputerValue3= -OutputFileName3=Private_OutJob_v1.PDF -OutputFileNameMulti3= -UseOutputNameForMulti3=0 -OutputFileNameSpecial3==UT_Output_file_name+'_'+UT_PCB_Revision+'_PCB' -OpenOutput3=0 -PromptOverwrite3=0 -PublishMethod3=0 -ZoomLevel3=50 -FitSCHPrintSizeToDoc3=1 -FitPCBPrintSizeToDoc3=1 -GenerateNetsInfo3=0 -MarkPins3=1 -MarkNetLabels3=1 -MarkPortsId3=1 -GenerateTOC3=1 -ShowComponentParameters3=0 -GlobalBookmarks3=0 -PDFACompliance3=Disabled -PDFVersion3=Default -OutputFilePath4=D:\Microrally\uDCCD_Controller_HW\Main board\OUTPUTS\uDCCD_Controller\ -ReleaseManaged4=0 -OutputBasePath4=OUTPUTS\ -OutputPathMedia4==UT_Output_file_name -OutputPathMediaValue4==UT_Output_file_name -OutputPathOutputer4=[Output Custom] -OutputPathOutputerPrefix4= -OutputPathOutputerValue4==UT_Output_file_name+'_'+UT_PCB_Revision+'_3D_MODEL' -OutputFileName4= -OutputFileNameMulti4==UT_Output_file_name+'_'+UT_PCB_Revision+'_'+OutputName -UseOutputNameForMulti4=0 -OutputFileNameSpecial4= -OpenOutput4=0 -OutputFilePath5=D:\Microrally\uDCCD_Controller_HW\Main board\OUTPUTS\uDCCD_Controller\ -ReleaseManaged5=0 -OutputBasePath5=OUTPUTS\ -OutputPathMedia5==UT_Output_file_name -OutputPathMediaValue5==UT_Output_file_name -OutputPathOutputer5=[Output Custom] -OutputPathOutputerPrefix5= -OutputPathOutputerValue5==UT_Output_file_name+'_'+UT_PCB_Revision+'_GERBERS' -OutputFileName5= -OutputFileNameMulti5==UT_Output_file_name+'_'+UT_PCB_Revision -UseOutputNameForMulti5=0 -OutputFileNameSpecial5= -OpenOutput5=0 -OutputFilePath6=F:\MicroRally\uDCCD Controller\Electronics\Main board\OUTPUTS\uDCCD_Controller\ -ReleaseManaged6=0 -OutputBasePath6=OUTPUTS\ -OutputPathMedia6==UT_Output_file_name -OutputPathMediaValue6==UT_Output_file_name -OutputPathOutputer6= -OutputPathOutputerPrefix6= -OutputPathOutputerValue6= -OutputFileName6= -OutputFileNameMulti6==UT_Output_file_name+'_'+UT_PCB_Revision+'_PNP' -UseOutputNameForMulti6=0 -OutputFileNameSpecial6= -OpenOutput6=0 -OutputFilePath7=Z:\MicroRally\Electronics\DataTracker\OUTPUTS\DataTracker_R1V1_PIC.PDF -ReleaseManaged7=0 -OutputBasePath7=OUTPUTS\ -OutputPathMedia7==UT_Output_file_name -OutputPathMediaValue7==UT_Output_file_name -OutputPathOutputer7=[Output Type] -OutputPathOutputerPrefix7= -OutputPathOutputerValue7= -OutputFileName7=Private_OutJob_v1.PDF -OutputFileNameMulti7= -UseOutputNameForMulti7=0 -OutputFileNameSpecial7==UT_Output_file_name+'_'+UT_PCB_Revision+UT_BOM_Version+'_PIC' -OpenOutput7=0 -PromptOverwrite7=0 -PublishMethod7=0 -ZoomLevel7=50 -FitSCHPrintSizeToDoc7=1 -FitPCBPrintSizeToDoc7=1 -GenerateNetsInfo7=0 -MarkPins7=1 -MarkNetLabels7=1 -MarkPortsId7=1 -GenerateTOC7=0 -ShowComponentParameters7=0 -GlobalBookmarks7=0 -PDFACompliance7=Disabled -PDFVersion7=Default -OutputFilePath8=F:\MicroRally\uDCCD Controller\Electronics\Main board\OUTPUTS\uDCCD_Controller\ -ReleaseManaged8=0 -OutputBasePath8=OUTPUTS\ -OutputPathMedia8==UT_Output_file_name -OutputPathMediaValue8==UT_Output_file_name -OutputPathOutputer8= -OutputPathOutputerPrefix8= -OutputPathOutputerValue8= -OutputFileName8= -OutputFileNameMulti8==UT_Output_file_name+'_'+UT_PCB_Revision+UT_BOM_Version+'_BOM' -UseOutputNameForMulti8=0 -OutputFileNameSpecial8= -OpenOutput8=0 -OutputFilePath9=D:\Microrally\uDCCD_Controller_HW\Main board\OUTPUTS\uDCCD_Controller\ -ReleaseManaged9=0 -OutputBasePath9=OUTPUTS\ -OutputPathMedia9==UT_Output_file_name -OutputPathMediaValue9==UT_Output_file_name -OutputPathOutputer9=[Output Custom] -OutputPathOutputerPrefix9=3D_MODEL -OutputPathOutputerValue9==UT_Output_file_name+'_'+UT_PCB_Revision+'_3D_MODEL' -OutputFileName9= -OutputFileNameMulti9==UT_Output_file_name+'_'+UT_PCB_Revision+UT_BOM_Version+'_MODEL' -UseOutputNameForMulti9=0 -OutputFileNameSpecial9= -OpenOutput9=0 -OutputFilePath10=Z:\MicroRally\Electronics\DataTracker\OUTPUTS\R1V1\ -ReleaseManaged10=0 -OutputBasePath10=OUTPUTS\ -OutputPathMedia10==UT_Output_file_name -OutputPathMediaValue10==UT_Output_file_name -OutputPathOutputer10= -OutputPathOutputerPrefix10= -OutputPathOutputerValue10= -OutputFileName10= -OutputFileNameMulti10==UT_Output_file_name+'_'+UT_PCB_Revision+UT_BOM_Version+'_Placement_BOM' -UseOutputNameForMulti10=0 -OutputFileNameSpecial10= -OpenOutput10=0 - -[GeneratedFilesSettings] -RelativeOutputPath2=Z:\MicroRally\Electronics\DataTracker\OUTPUTS\R1V1\DataTracker_R1V1_Schematic.PDF -OpenOutputs2=0 -RelativeOutputPath3=Z:\MicroRally\Electronics\DataTracker\OUTPUTS\DataTracker_R1_PCB.PDF -OpenOutputs3=0 -RelativeOutputPath4=D:\Microrally\uDCCD_Controller_HW\Main board\OUTPUTS\uDCCD_Controller\ -OpenOutputs4=0 -AddToProject4=0 -TimestampFolder4=0 -UseOutputName4=0 -OpenODBOutput4=0 -OpenGerberOutput4=0 -OpenNCDrillOutput4=0 -OpenIPCOutput4=0 -EnableReload4=0 -RelativeOutputPath5=D:\Microrally\uDCCD_Controller_HW\Main board\OUTPUTS\uDCCD_Controller\ -OpenOutputs5=0 -AddToProject5=0 -TimestampFolder5=0 -UseOutputName5=0 -OpenODBOutput5=0 -OpenGerberOutput5=0 -OpenNCDrillOutput5=0 -OpenIPCOutput5=0 -EnableReload5=0 -RelativeOutputPath6=F:\MicroRally\uDCCD Controller\Electronics\Main board\OUTPUTS\uDCCD_Controller\ -OpenOutputs6=0 -AddToProject6=0 -TimestampFolder6=0 -UseOutputName6=0 -OpenODBOutput6=0 -OpenGerberOutput6=0 -OpenNCDrillOutput6=0 -OpenIPCOutput6=0 -EnableReload6=0 -RelativeOutputPath7=Z:\MicroRally\Electronics\DataTracker\OUTPUTS\DataTracker_R1V1_PIC.PDF -OpenOutputs7=0 -RelativeOutputPath8=F:\MicroRally\uDCCD Controller\Electronics\Main board\OUTPUTS\uDCCD_Controller\ -OpenOutputs8=0 -AddToProject8=0 -TimestampFolder8=0 -UseOutputName8=0 -OpenODBOutput8=0 -OpenGerberOutput8=0 -OpenNCDrillOutput8=0 -OpenIPCOutput8=0 -EnableReload8=0 -RelativeOutputPath9=D:\Microrally\uDCCD_Controller_HW\Main board\OUTPUTS\uDCCD_Controller\ -OpenOutputs9=0 -AddToProject9=0 -TimestampFolder9=0 -UseOutputName9=0 -OpenODBOutput9=0 -OpenGerberOutput9=0 -OpenNCDrillOutput9=0 -OpenIPCOutput9=0 -EnableReload9=0 -RelativeOutputPath10=Z:\MicroRally\Electronics\DataTracker\OUTPUTS\R1V1\ -OpenOutputs10=0 -AddToProject10=0 -TimestampFolder10=0 -UseOutputName10=0 -OpenODBOutput10=0 -OpenGerberOutput10=0 -OpenNCDrillOutput10=0 -OpenIPCOutput10=0 -EnableReload10=0 - diff --git a/test board/source/Chasis.SchDoc b/test board/source/Chasis.SchDoc deleted file mode 100644 index 7797143..0000000 Binary files a/test board/source/Chasis.SchDoc and /dev/null differ diff --git a/test board/source/Cover_page.SchDoc b/test board/source/Cover_page.SchDoc deleted file mode 100644 index f27098c..0000000 Binary files a/test board/source/Cover_page.SchDoc and /dev/null differ diff --git a/test board/source/History.SchDoc b/test board/source/History.SchDoc deleted file mode 100644 index 60d792f..0000000 Binary files a/test board/source/History.SchDoc and /dev/null differ diff --git a/test board/source/Index.SchDoc b/test board/source/Index.SchDoc deleted file mode 100644 index ca8cd43..0000000 Binary files a/test board/source/Index.SchDoc and /dev/null differ diff --git a/test board/source/Main_Connector.SchDoc b/test board/source/Main_Connector.SchDoc deleted file mode 100644 index 6a186de..0000000 Binary files a/test board/source/Main_Connector.SchDoc and /dev/null differ diff --git a/test board/source/Miscellaneous.SchDoc b/test board/source/Miscellaneous.SchDoc deleted file mode 100644 index 83b8b77..0000000 Binary files a/test board/source/Miscellaneous.SchDoc and /dev/null differ diff --git a/test board/source/Power.SchDoc b/test board/source/Power.SchDoc deleted file mode 100644 index 0013563..0000000 Binary files a/test board/source/Power.SchDoc and /dev/null differ diff --git a/test board/source/User_interface.SchDoc b/test board/source/User_interface.SchDoc deleted file mode 100644 index 7236ea9..0000000 Binary files a/test board/source/User_interface.SchDoc and /dev/null differ diff --git a/test board/source/uDCCD_Test.PcbDoc b/test board/source/uDCCD_Test.PcbDoc deleted file mode 100644 index d1ae0ec..0000000 Binary files a/test board/source/uDCCD_Test.PcbDoc and /dev/null differ diff --git a/test board/uDCCD_Test.PrjPcb b/test board/uDCCD_Test.PrjPcb deleted file mode 100644 index aa4f17f..0000000 --- a/test board/uDCCD_Test.PrjPcb +++ /dev/null @@ -1,1245 +0,0 @@ -[Design] -Version=1.0 -HierarchyMode=0 -ChannelRoomNamingStyle=0 -ReleasesFolder= -ChannelDesignatorFormatString=$Component_$RoomName -ChannelRoomLevelSeperator=_ -OpenOutputs=1 -ArchiveProject=0 -TimestampOutput=0 -SeparateFolders=0 -TemplateLocationPath= -PinSwapBy_Netlabel=1 -PinSwapBy_Pin=1 -AllowPortNetNames=1 -AllowSheetEntryNetNames=1 -AppendSheetNumberToLocalNets=0 -NetlistSinglePinNets=0 -DefaultConfiguration=Sources -UserID=0xFFFFFFFF -DefaultPcbProtel=1 -DefaultPcbPcad=0 -ReorderDocumentsOnCompile=1 -NameNetsHierarchically=0 -PowerPortNamesTakePriority=0 -AutoSheetNumbering=1 -AutoCrossReferences=1 -NewIndexingOfSheetSymbols=1 -PushECOToAnnotationFile=1 -DItemRevisionGUID= -ReportSuppressedErrorsInMessages=0 -FSMCodingStyle=eFMSDropDownList_OneProcess -FSMEncodingStyle=eFMSDropDownList_OneHot -IsProjectConflictPreventionWarningsEnabled=0 -IsVirtualBomDocumentRemoved=0 -OutputPath= -LogFolderPath= -ManagedProjectGUID= -IncludeDesignInRelease=0 -CrossRefSheetStyle=1 -CrossRefLocationStyle=1 -CrossRefPorts=3 -CrossRefCrossSheets=1 -CrossRefSheetEntries=0 -CrossRefFollowFromMainSettings=1 - -[Preferences] -PrefsVaultGUID= -PrefsRevisionGUID= - -[Document1] -DocumentPath=Source\Cover_page.SchDoc -AnnotationEnabled=1 -AnnotateStartValue=1 -AnnotationIndexControlEnabled=0 -AnnotateSuffix= -AnnotateScope=All -AnnotateOrder=0 -DoLibraryUpdate=1 -DoDatabaseUpdate=1 -ClassGenCCAutoEnabled=0 -ClassGenCCAutoRoomEnabled=0 -ClassGenNCAutoScope=None -DItemRevisionGUID= -GenerateClassCluster=0 -DocumentUniqueId=LDHMPLYE - -[Document2] -DocumentPath=Source\Index.SchDoc -AnnotationEnabled=1 -AnnotateStartValue=1 -AnnotationIndexControlEnabled=0 -AnnotateSuffix= -AnnotateScope=All -AnnotateOrder=1 -DoLibraryUpdate=1 -DoDatabaseUpdate=1 -ClassGenCCAutoEnabled=0 -ClassGenCCAutoRoomEnabled=0 -ClassGenNCAutoScope=None -DItemRevisionGUID= -GenerateClassCluster=0 -DocumentUniqueId=YTPPCLSQ - -[Document3] -DocumentPath=Source\Main_Connector.SchDoc -AnnotationEnabled=1 -AnnotateStartValue=1 -AnnotationIndexControlEnabled=0 -AnnotateSuffix= -AnnotateScope=All -AnnotateOrder=2 -DoLibraryUpdate=1 -DoDatabaseUpdate=1 -ClassGenCCAutoEnabled=0 -ClassGenCCAutoRoomEnabled=0 -ClassGenNCAutoScope=None -DItemRevisionGUID= -GenerateClassCluster=0 -DocumentUniqueId=RFZMGWLN - -[Document4] -DocumentPath=Source\Power.SchDoc -AnnotationEnabled=1 -AnnotateStartValue=1 -AnnotationIndexControlEnabled=0 -AnnotateSuffix= -AnnotateScope=All -AnnotateOrder=-1 -DoLibraryUpdate=1 -DoDatabaseUpdate=1 -ClassGenCCAutoEnabled=1 -ClassGenCCAutoRoomEnabled=0 -ClassGenNCAutoScope=None -DItemRevisionGUID= -GenerateClassCluster=0 -DocumentUniqueId=TJOLVAEL - -[Document5] -DocumentPath=Source\Chasis.SchDoc -AnnotationEnabled=1 -AnnotateStartValue=1 -AnnotationIndexControlEnabled=0 -AnnotateSuffix= -AnnotateScope=All -AnnotateOrder=-1 -DoLibraryUpdate=1 -DoDatabaseUpdate=1 -ClassGenCCAutoEnabled=1 -ClassGenCCAutoRoomEnabled=0 -ClassGenNCAutoScope=None -DItemRevisionGUID= -GenerateClassCluster=0 -DocumentUniqueId=TDQWHPZQ - -[Document6] -DocumentPath=Source\User_interface.SchDoc -AnnotationEnabled=1 -AnnotateStartValue=100 -AnnotationIndexControlEnabled=1 -AnnotateSuffix= -AnnotateScope=All -AnnotateOrder=3 -DoLibraryUpdate=1 -DoDatabaseUpdate=1 -ClassGenCCAutoEnabled=0 -ClassGenCCAutoRoomEnabled=0 -ClassGenNCAutoScope=None -DItemRevisionGUID= -GenerateClassCluster=0 -DocumentUniqueId=ZEEOMNFV - -[Document7] -DocumentPath=Settings\Private_OutJob_v1.OutJob -AnnotationEnabled=1 -AnnotateStartValue=1 -AnnotationIndexControlEnabled=0 -AnnotateSuffix= -AnnotateScope=All -AnnotateOrder=-1 -DoLibraryUpdate=1 -DoDatabaseUpdate=1 -ClassGenCCAutoEnabled=1 -ClassGenCCAutoRoomEnabled=1 -ClassGenNCAutoScope=None -DItemRevisionGUID= -GenerateClassCluster=0 -DocumentUniqueId= - -[Document8] -DocumentPath=Source\Miscellaneous.SchDoc -AnnotationEnabled=1 -AnnotateStartValue=1 -AnnotationIndexControlEnabled=0 -AnnotateSuffix= -AnnotateScope=All -AnnotateOrder=10 -DoLibraryUpdate=1 -DoDatabaseUpdate=1 -ClassGenCCAutoEnabled=0 -ClassGenCCAutoRoomEnabled=0 -ClassGenNCAutoScope=None -DItemRevisionGUID= -GenerateClassCluster=0 -DocumentUniqueId=SCHJCSMX - -[Document9] -DocumentPath=Source\History.SchDoc -AnnotationEnabled=1 -AnnotateStartValue=1 -AnnotationIndexControlEnabled=0 -AnnotateSuffix= -AnnotateScope=All -AnnotateOrder=11 -DoLibraryUpdate=1 -DoDatabaseUpdate=1 -ClassGenCCAutoEnabled=0 -ClassGenCCAutoRoomEnabled=0 -ClassGenNCAutoScope=None -DItemRevisionGUID= -GenerateClassCluster=0 -DocumentUniqueId=JOZACUZN - -[Document10] -DocumentPath=Source\uDCCD_Test.PcbDoc -AnnotationEnabled=1 -AnnotateStartValue=1 -AnnotationIndexControlEnabled=0 -AnnotateSuffix= -AnnotateScope=All -AnnotateOrder=-1 -DoLibraryUpdate=1 -DoDatabaseUpdate=1 -ClassGenCCAutoEnabled=1 -ClassGenCCAutoRoomEnabled=0 -ClassGenNCAutoScope=None -DItemRevisionGUID= -GenerateClassCluster=0 -DocumentUniqueId=XKPBYTFL - -[ProjectVariant1] -UniqueID=0AFB962C-3AE5-4514-9A7A-535BD3DA0C73 -Description=Default -AllowFabrication=0 -ParameterCount=0 -VariationCount=6 -Variation1=Designator=R300|UniqueId=\AHYAEQKG|Kind=1|AlternatePart= -Variation2=Designator=R310|UniqueId=\RUQLBCAG|Kind=1|AlternatePart= -Variation3=Designator=R316|UniqueId=\ECSVITYM|Kind=1|AlternatePart= -Variation4=Designator=R301|UniqueId=\JAEKZEKR|Kind=1|AlternatePart= -Variation5=Designator=R402|UniqueId=\WHFRCJZA|Kind=1|AlternatePart= -Variation6=Designator=R407|UniqueId=\NJYJPBSG|Kind=1|AlternatePart= -ParamVariationCount=0 - -[Parameter1] -Name=UT_BOM_Version -Value=V1 - -[Parameter2] -Name=UT_Output_file_name -Value=uDCCD Test - -[Parameter3] -Name=UT_PCB_Designer -Value=Andis Zīle - -[Parameter4] -Name=UT_PCB_Revision -Value=R1 - -[Parameter5] -Name=UT_Project_Name -Value=uDCCD Test - -[Configuration1] -Name=Sources -ParameterCount=0 -ConstraintFileCount=0 -ReleaseItemId= -Variant=[No Variations] -OutputJobsCount=0 -ContentTypeGUID=CB6F2064-E317-11DF-B822-12313F0024A2 -ConfigurationType=Source - -[Generic_EDE] -OutputDir= - -[OutputGroup1] -Name=Netlist Outputs -Description= -TargetPrinter=HPB0227A544A35(HP Color Laser MFP 178 179) -PrinterOptions=Record=PrinterOptions|Copies=1|Duplex=1|TrueTypeOptions=3|Collate=1|PrintJobKind=1|PrintWhat=1 -OutputType1=CadnetixNetlist -OutputName1=Cadnetix Netlist -OutputDocumentPath1= -OutputVariantName1= -OutputDefault1=0 -OutputType2=CalayNetlist -OutputName2=Calay Netlist -OutputDocumentPath2= -OutputVariantName2= -OutputDefault2=0 -OutputType3=EDIF -OutputName3=EDIF for PCB -OutputDocumentPath3= -OutputVariantName3= -OutputDefault3=0 -OutputType4=EESofNetlist -OutputName4=EESof Netlist -OutputDocumentPath4= -OutputVariantName4= -OutputDefault4=0 -OutputType5=IntergraphNetlist -OutputName5=Intergraph Netlist -OutputDocumentPath5= -OutputVariantName5= -OutputDefault5=0 -OutputType6=MentorBoardStationNetlist -OutputName6=Mentor BoardStation Netlist -OutputDocumentPath6= -OutputVariantName6= -OutputDefault6=0 -OutputType7=MultiWire -OutputName7=MultiWire -OutputDocumentPath7= -OutputVariantName7= -OutputDefault7=0 -OutputType8=OrCadPCB2Netlist -OutputName8=Orcad/PCB2 Netlist -OutputDocumentPath8= -OutputVariantName8= -OutputDefault8=0 -OutputType9=PADSNetlist -OutputName9=PADS ASCII Netlist -OutputDocumentPath9= -OutputVariantName9= -OutputDefault9=0 -OutputType10=Pcad -OutputName10=Pcad for PCB -OutputDocumentPath10= -OutputVariantName10= -OutputDefault10=0 -OutputType11=PCADNetlist -OutputName11=PCAD Netlist -OutputDocumentPath11= -OutputVariantName11= -OutputDefault11=0 -OutputType12=PCADnltNetlist -OutputName12=PCADnlt Netlist -OutputDocumentPath12= -OutputVariantName12= -OutputDefault12=0 -OutputType13=Protel2Netlist -OutputName13=Protel2 Netlist -OutputDocumentPath13= -OutputVariantName13= -OutputDefault13=0 -OutputType14=ProtelNetlist -OutputName14=Protel -OutputDocumentPath14= -OutputVariantName14= -OutputDefault14=0 -OutputType15=RacalNetlist -OutputName15=Racal Netlist -OutputDocumentPath15= -OutputVariantName15= -OutputDefault15=0 -OutputType16=RINFNetlist -OutputName16=RINF Netlist -OutputDocumentPath16= -OutputVariantName16= -OutputDefault16=0 -OutputType17=SciCardsNetlist -OutputName17=SciCards Netlist -OutputDocumentPath17= -OutputVariantName17= -OutputDefault17=0 -OutputType18=TangoNetlist -OutputName18=Tango Netlist -OutputDocumentPath18= -OutputVariantName18= -OutputDefault18=0 -OutputType19=TelesisNetlist -OutputName19=Telesis Netlist -OutputDocumentPath19= -OutputVariantName19= -OutputDefault19=0 -OutputType20=WireListNetlist -OutputName20=WireList Netlist -OutputDocumentPath20= -OutputVariantName20= -OutputDefault20=0 -OutputType21=XSpiceNetlist -OutputName21=Mixed Sim Netlist -OutputDocumentPath21= -OutputVariantName21= -OutputDefault21=0 - -[OutputGroup2] -Name=Simulator Outputs -Description= -TargetPrinter=HPB0227A544A35(HP Color Laser MFP 178 179) -PrinterOptions=Record=PrinterOptions|Copies=1|Duplex=1|TrueTypeOptions=3|Collate=1|PrintJobKind=1|PrintWhat=1 -OutputType1=AdvSimNetlist -OutputName1=Mixed Sim -OutputDocumentPath1= -OutputVariantName1= -OutputDefault1=0 - -[OutputGroup3] -Name=Documentation Outputs -Description= -TargetPrinter=Virtual Printer -PrinterOptions=Record=PrinterOptions|Copies=1|Duplex=1|TrueTypeOptions=3|Collate=1|PrintJobKind=1|PrintWhat=0 -OutputType1=Composite -OutputName1=Composite Drawing -OutputDocumentPath1= -OutputVariantName1=[No Variations] -OutputDefault1=0 -PageOptions1=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType2=Harness Layout Drawing Print -OutputName2=Harness Layout Drawing Prints -OutputDocumentPath2= -OutputVariantName2= -OutputDefault2=0 -PageOptions2=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType3=Harness Wiring Diagram Print -OutputName3=Harness Wiring Diagram Prints -OutputDocumentPath3= -OutputVariantName3= -OutputDefault3=0 -PageOptions3=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType4=PCB 3D Print -OutputName4=PCB 3D Print -OutputDocumentPath4= -OutputVariantName4=[No Variations] -OutputDefault4=0 -PageOptions4=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType5=PCB 3D Video -OutputName5=PCB 3D Video -OutputDocumentPath5= -OutputVariantName5=[No Variations] -OutputDefault5=0 -PageOptions5=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType6=PCB Print -OutputName6=PCB Prints -OutputDocumentPath6= -OutputVariantName6=[No Variations] -OutputDefault6=0 -PageOptions6=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType7=PCBDrawing -OutputName7=Draftsman -OutputDocumentPath7= -OutputVariantName7=[No Variations] -OutputDefault7=0 -PageOptions7=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType8=PCBLIB Print -OutputName8=PCBLIB Prints -OutputDocumentPath8= -OutputVariantName8=[No Variations] -OutputDefault8=0 -PageOptions8=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType9=PDF3D -OutputName9=PDF3D -OutputDocumentPath9= -OutputVariantName9=[No Variations] -OutputDefault9=0 -PageOptions9=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType10=Report Print -OutputName10=Report Prints -OutputDocumentPath10= -OutputVariantName10= -OutputDefault10=0 -PageOptions10=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType11=Schematic Print -OutputName11=Schematic Prints -OutputDocumentPath11= -OutputVariantName11= -OutputDefault11=0 -PageOptions11=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -Configuration11_Name1=OutputConfigurationParameter1 -Configuration11_Item1=Record=SchPrintView|ShowNoERC=True|ShowParamSet=True|ShowProbe=True|ShowBlanket=True|NoERCSymbolsToShow="Thin Cross","Thick Cross","Small Cross",Checkbox,Triangle|ShowNote=True|ShowNoteCollapsed=True|ShowOpenEnds=True|ExpandDesignator=True|ExpandNetLabel=False|ExpandPort=False|ExpandSheetNum=False|ExpandDocNum=False|PrintArea=0|PrintAreaRect.X1=0|PrintAreaRect.Y1=0|PrintAreaRect.X2=0|PrintAreaRect.Y2=0|DocumentPath=Sheet1.SchDoc -OutputType12=SimView Print -OutputName12=SimView Prints -OutputDocumentPath12= -OutputVariantName12= -OutputDefault12=0 -PageOptions12=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType13=PCBDrawing -OutputName13=Draftsman -OutputDocumentPath13= -OutputVariantName13=[No Variations] -OutputDefault13=0 -PageOptions13=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType14=PCBDrawing -OutputName14=Draftsman -OutputDocumentPath14= -OutputVariantName14=[No Variations] -OutputDefault14=0 -PageOptions14=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 - -[OutputGroup4] -Name=Assembly Outputs -Description= -TargetPrinter=HPB0227A544A35(HP Color Laser MFP 178 179) -PrinterOptions=Record=PrinterOptions|Copies=1|Duplex=1|TrueTypeOptions=3|Collate=1|PrintJobKind=1|PrintWhat=1 -OutputType1=Assembly -OutputName1=Assembly Drawings -OutputDocumentPath1= -OutputVariantName1=[No Variations] -OutputDefault1=0 -PageOptions1=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType2=Pick Place -OutputName2=Generates pick and place files -OutputDocumentPath2= -OutputVariantName2=[No Variations] -OutputDefault2=0 -OutputType3=Test Points For Assembly -OutputName3=Test Point Report -OutputDocumentPath3= -OutputVariantName3=[No Variations] -OutputDefault3=0 - -[OutputGroup5] -Name=Fabrication Outputs -Description= -TargetPrinter=HPB0227A544A35(HP Color Laser MFP 178 179) -PrinterOptions=Record=PrinterOptions|Copies=1|Duplex=1|TrueTypeOptions=3|Collate=1|PrintJobKind=1|PrintWhat=1 -OutputType1=Board Stack Report -OutputName1=Report Board Stack -OutputDocumentPath1= -OutputVariantName1= -OutputDefault1=0 -PageOptions1=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType2=CompositeDrill -OutputName2=Composite Drill Drawing -OutputDocumentPath2= -OutputVariantName2=[No Variations] -OutputDefault2=0 -PageOptions2=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType3=Drill -OutputName3=Drill Drawing/Guides -OutputDocumentPath3= -OutputVariantName3=[No Variations] -OutputDefault3=0 -PageOptions3=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType4=Final -OutputName4=Final Artwork Prints -OutputDocumentPath4= -OutputVariantName4=[No Variations] -OutputDefault4=0 -PageOptions4=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType5=Gerber -OutputName5=Gerber Files -OutputDocumentPath5= -OutputVariantName5=[No Variations] -OutputDefault5=0 -OutputType6=Gerber X2 -OutputName6=Gerber X2 Files -OutputDocumentPath6= -OutputVariantName6=[No Variations] -OutputDefault6=0 -OutputType7=IPC2581 -OutputName7=IPC-2581 Files -OutputDocumentPath7= -OutputVariantName7=[No Variations] -OutputDefault7=0 -OutputType8=Mask -OutputName8=Solder/Paste Mask Prints -OutputDocumentPath8= -OutputVariantName8=[No Variations] -OutputDefault8=0 -PageOptions8=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType9=NC Drill -OutputName9=NC Drill Files -OutputDocumentPath9= -OutputVariantName9= -OutputDefault9=0 -OutputType10=ODB -OutputName10=ODB++ Files -OutputDocumentPath10= -OutputVariantName10=[No Variations] -OutputDefault10=0 -OutputType11=Plane -OutputName11=Power-Plane Prints -OutputDocumentPath11= -OutputVariantName11=[No Variations] -OutputDefault11=0 -PageOptions11=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType12=Test Points -OutputName12=Test Point Report -OutputDocumentPath12= -OutputVariantName12= -OutputDefault12=0 - -[OutputGroup6] -Name=Report Outputs -Description= -TargetPrinter=HPB0227A544A35(HP Color Laser MFP 178 179) -PrinterOptions=Record=PrinterOptions|Copies=1|Duplex=1|TrueTypeOptions=3|Collate=1|PrintJobKind=1|PrintWhat=1 -OutputType1=BOM_PartType -OutputName1=Bill of Materials -OutputDocumentPath1= -OutputVariantName1=[No Variations] -OutputDefault1=0 -PageOptions1=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType2=BOM_ReportCompare -OutputName2=BOM Compare -OutputDocumentPath2= -OutputVariantName2=[No Variations] -OutputDefault2=0 -PageOptions2=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType3=ComponentCrossReference -OutputName3=Component Cross Reference Report -OutputDocumentPath3= -OutputVariantName3=[No Variations] -OutputDefault3=0 -OutputType4=Export Comments -OutputName4=Export Comments -OutputDocumentPath4= -OutputVariantName4=[No Variations] -OutputDefault4=0 -PageOptions4=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType5=ReportHierarchy -OutputName5=Report Project Hierarchy -OutputDocumentPath5= -OutputVariantName5=[No Variations] -OutputDefault5=0 -OutputType6=Script -OutputName6=Script Output -OutputDocumentPath6= -OutputVariantName6=[No Variations] -OutputDefault6=0 -OutputType7=SimpleBOM -OutputName7=Simple BOM -OutputDocumentPath7= -OutputVariantName7=[No Variations] -OutputDefault7=0 -OutputType8=SinglePinNetReporter -OutputName8=Report Single Pin Nets -OutputDocumentPath8= -OutputVariantName8=[No Variations] -OutputDefault8=0 -OutputType9=Project History -OutputName9=Project History -OutputDocumentPath9= -OutputVariantName9=[No Variations] -OutputDefault9=0 -PageOptions9=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 - -[OutputGroup7] -Name=Other Outputs -Description= -TargetPrinter=HPB0227A544A35(HP Color Laser MFP 178 179) -PrinterOptions=Record=PrinterOptions|Copies=1|Duplex=1|TrueTypeOptions=3|Collate=1|PrintJobKind=1|PrintWhat=1 -OutputType1=Text Print -OutputName1=Text Print -OutputDocumentPath1= -OutputVariantName1= -OutputDefault1=0 -PageOptions1=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType2=Text Print -OutputName2=Text Print -OutputDocumentPath2= -OutputVariantName2= -OutputDefault2=0 -PageOptions2=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType3=Text Print -OutputName3=Text Print -OutputDocumentPath3= -OutputVariantName3= -OutputDefault3=0 -PageOptions3=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType4=Text Print -OutputName4=Text Print -OutputDocumentPath4= -OutputVariantName4= -OutputDefault4=0 -PageOptions4=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType5=Text Print -OutputName5=Text Print -OutputDocumentPath5= -OutputVariantName5= -OutputDefault5=0 -PageOptions5=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType6=Text Print -OutputName6=Text Print -OutputDocumentPath6= -OutputVariantName6= -OutputDefault6=0 -PageOptions6=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType7=Text Print -OutputName7=Text Print -OutputDocumentPath7= -OutputVariantName7= -OutputDefault7=0 -PageOptions7=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType8=Text Print -OutputName8=Text Print -OutputDocumentPath8= -OutputVariantName8= -OutputDefault8=0 -PageOptions8=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType9=Text Print -OutputName9=Text Print -OutputDocumentPath9= -OutputVariantName9= -OutputDefault9=0 -PageOptions9=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType10=Text Print -OutputName10=Text Print -OutputDocumentPath10= -OutputVariantName10= -OutputDefault10=0 -PageOptions10=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType11=Text Print -OutputName11=Text Print -OutputDocumentPath11= -OutputVariantName11= -OutputDefault11=0 -PageOptions11=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType12=Text Print -OutputName12=Text Print -OutputDocumentPath12= -OutputVariantName12= -OutputDefault12=0 -PageOptions12=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType13=Text Print -OutputName13=Text Print -OutputDocumentPath13= -OutputVariantName13= -OutputDefault13=0 -PageOptions13=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType14=Text Print -OutputName14=Text Print -OutputDocumentPath14= -OutputVariantName14= -OutputDefault14=0 -PageOptions14=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType15=Text Print -OutputName15=Text Print -OutputDocumentPath15= -OutputVariantName15= -OutputDefault15=0 -PageOptions15=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType16=Text Print -OutputName16=Text Print -OutputDocumentPath16= -OutputVariantName16= -OutputDefault16=0 -PageOptions16=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType17=Text Print -OutputName17=Text Print -OutputDocumentPath17= -OutputVariantName17= -OutputDefault17=0 -PageOptions17=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 - -[OutputGroup8] -Name=Validation Outputs -Description= -TargetPrinter=HPB0227A544A35(HP Color Laser MFP 178 179) -PrinterOptions=Record=PrinterOptions|Copies=1|Duplex=1|TrueTypeOptions=3|Collate=1|PrintJobKind=1|PrintWhat=1 -OutputType1=BOM_Violations -OutputName1=BOM Checks Report -OutputDocumentPath1= -OutputVariantName1= -OutputDefault1=0 -OutputType2=Component states check -OutputName2=Server's components states check -OutputDocumentPath2= -OutputVariantName2= -OutputDefault2=0 -OutputType3=Configuration compliance -OutputName3=Environment configuration compliance check -OutputDocumentPath3= -OutputVariantName3= -OutputDefault3=0 -OutputType4=Design Rules Check -OutputName4=Design Rules Check -OutputDocumentPath4= -OutputVariantName4= -OutputDefault4=0 -PageOptions4=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType5=Differences Report -OutputName5=Differences Report -OutputDocumentPath5= -OutputVariantName5= -OutputDefault5=0 -PageOptions5=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType6=Electrical Rules Check -OutputName6=Electrical Rules Check -OutputDocumentPath6= -OutputVariantName6= -OutputDefault6=0 -PageOptions6=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -OutputType7=Footprint Comparison Report -OutputName7=Footprint Comparison Report -OutputDocumentPath7= -OutputVariantName7= -OutputDefault7=0 - -[OutputGroup9] -Name=Export Outputs -Description= -TargetPrinter=HPB0227A544A35(HP Color Laser MFP 178 179) -PrinterOptions=Record=PrinterOptions|Copies=1|Duplex=1|TrueTypeOptions=3|Collate=1|PrintJobKind=1|PrintWhat=1 -OutputType1=AutoCAD dwg/dxf PCB -OutputName1=AutoCAD dwg/dxf File PCB -OutputDocumentPath1= -OutputVariantName1= -OutputDefault1=0 -OutputType2=AutoCAD dwg/dxf Schematic -OutputName2=AutoCAD dwg/dxf File Schematic -OutputDocumentPath2= -OutputVariantName2= -OutputDefault2=0 -OutputType3=ExportIDF -OutputName3=Export IDF -OutputDocumentPath3= -OutputVariantName3= -OutputDefault3=0 -OutputType4=ExportPARASOLID -OutputName4=Export PARASOLID -OutputDocumentPath4= -OutputVariantName4=[No Variations] -OutputDefault4=0 -OutputType5=ExportSTEP -OutputName5=Export STEP -OutputDocumentPath5= -OutputVariantName5=[No Variations] -OutputDefault5=0 -OutputType6=ExportVRML -OutputName6=Export VRML -OutputDocumentPath6= -OutputVariantName6=[No Variations] -OutputDefault6=0 -OutputType7=Save As/Export PCB -OutputName7=Save As/Export PCB -OutputDocumentPath7= -OutputVariantName7= -OutputDefault7=0 -OutputType8=Save As/Export Schematic -OutputName8=Save As/Export Schematic -OutputDocumentPath8= -OutputVariantName8= -OutputDefault8=0 -OutputType9=Specctra Design PCB -OutputName9=Specctra Design PCB -OutputDocumentPath9= -OutputVariantName9= -OutputDefault9=0 -OutputType10=Web ReviewOutputName -OutputName10=Web Review Data -OutputDocumentPath10= -OutputVariantName10= -OutputDefault10=0 - -[OutputGroup10] -Name=PostProcess Outputs -Description= -TargetPrinter=HPB0227A544A35(HP Color Laser MFP 178 179) -PrinterOptions=Record=PrinterOptions|Copies=1|Duplex=1|TrueTypeOptions=3|Collate=1|PrintJobKind=1|PrintWhat=1 -OutputType1=Copy Files -OutputName1=Copy Files -OutputDocumentPath1= -OutputVariantName1= -OutputDefault1=0 - -[Modification Levels] -Type1=1 -Type2=1 -Type3=1 -Type4=1 -Type5=1 -Type6=1 -Type7=1 -Type8=1 -Type9=1 -Type10=1 -Type11=1 -Type12=1 -Type13=1 -Type14=1 -Type15=1 -Type16=1 -Type17=1 -Type18=1 -Type19=1 -Type20=1 -Type21=1 -Type22=1 -Type23=1 -Type24=1 -Type25=1 -Type26=1 -Type27=1 -Type28=1 -Type29=1 -Type30=1 -Type31=1 -Type32=1 -Type33=1 -Type34=1 -Type35=1 -Type36=1 -Type37=1 -Type38=1 -Type39=1 -Type40=1 -Type41=1 -Type42=1 -Type43=1 -Type44=1 -Type45=1 -Type46=1 -Type47=1 -Type48=1 -Type49=1 -Type50=1 -Type51=1 -Type52=1 -Type53=1 -Type54=1 -Type55=1 -Type56=1 -Type57=1 -Type58=1 -Type59=1 -Type60=1 -Type61=1 -Type62=1 -Type63=1 -Type64=1 -Type65=1 -Type66=1 -Type67=1 -Type68=1 -Type69=1 -Type70=1 -Type71=1 -Type72=1 -Type73=1 -Type74=1 -Type75=1 -Type76=1 -Type77=1 -Type78=1 -Type79=1 -Type80=1 -Type81=1 -Type82=1 -Type83=1 -Type84=1 -Type85=1 -Type86=1 -Type87=1 -Type88=1 -Type89=1 -Type90=1 -Type91=1 -Type92=1 -Type93=1 -Type94=1 -Type95=1 -Type96=1 -Type97=1 -Type98=1 -Type99=1 -Type100=1 -Type101=1 -Type102=1 -Type103=1 -Type104=1 -Type105=1 -Type106=1 -Type107=1 -Type108=1 -Type109=1 -Type110=1 -Type111=1 -Type112=1 -Type113=1 -Type114=1 -Type115=1 -Type116=1 -Type117=1 -Type118=1 -Type119=1 -Type120=1 - -[Difference Levels] -Type1=1 -Type2=1 -Type3=1 -Type4=1 -Type5=1 -Type6=1 -Type7=1 -Type8=1 -Type9=1 -Type10=1 -Type11=1 -Type12=1 -Type13=1 -Type14=1 -Type15=1 -Type16=1 -Type17=1 -Type18=1 -Type19=1 -Type20=1 -Type21=1 -Type22=1 -Type23=1 -Type24=1 -Type25=1 -Type26=1 -Type27=1 -Type28=1 -Type29=1 -Type30=1 -Type31=1 -Type32=1 -Type33=1 -Type34=1 -Type35=1 -Type36=1 -Type37=1 -Type38=1 -Type39=1 -Type40=1 -Type41=1 -Type42=1 -Type43=1 -Type44=1 -Type45=1 -Type46=1 -Type47=1 -Type48=1 -Type49=1 -Type50=1 -Type51=1 -Type52=1 -Type53=1 -Type54=1 -Type55=1 -Type56=1 -Type57=1 -Type58=1 -Type59=1 -Type60=1 -Type61=1 -Type62=1 -Type63=1 -Type64=1 -Type65=1 -Type66=1 -Type67=1 -Type68=1 - -[Electrical Rules Check] -Type1=1 -Type2=1 -Type3=2 -Type4=1 -Type5=2 -Type6=2 -Type7=0 -Type8=1 -Type9=1 -Type10=1 -Type11=2 -Type12=2 -Type13=2 -Type14=1 -Type15=1 -Type16=1 -Type17=1 -Type18=1 -Type19=1 -Type20=0 -Type21=0 -Type22=0 -Type23=0 -Type24=1 -Type25=2 -Type26=0 -Type27=2 -Type28=1 -Type29=1 -Type30=1 -Type31=1 -Type32=2 -Type33=0 -Type34=2 -Type35=1 -Type36=2 -Type37=1 -Type38=2 -Type39=2 -Type40=2 -Type41=0 -Type42=2 -Type43=1 -Type44=0 -Type45=0 -Type46=0 -Type47=0 -Type48=0 -Type49=0 -Type50=2 -Type51=0 -Type52=0 -Type53=1 -Type54=1 -Type55=1 -Type56=2 -Type57=1 -Type58=1 -Type59=2 -Type60=0 -Type61=0 -Type62=0 -Type63=0 -Type64=0 -Type65=2 -Type66=3 -Type67=2 -Type68=2 -Type69=0 -Type70=2 -Type71=2 -Type72=2 -Type73=2 -Type74=1 -Type75=2 -Type76=1 -Type77=1 -Type78=1 -Type79=1 -Type80=2 -Type81=3 -Type82=3 -Type83=3 -Type84=3 -Type85=3 -Type86=2 -Type87=2 -Type88=2 -Type89=1 -Type90=1 -Type91=3 -Type92=3 -Type93=2 -Type94=2 -Type95=2 -Type96=2 -Type97=2 -Type98=0 -Type99=1 -Type100=2 -Type101=0 -Type102=2 -Type103=2 -Type104=1 -Type105=2 -Type106=2 -Type107=2 -Type108=2 -Type109=1 -Type110=1 -Type111=1 -Type112=1 -Type113=1 -Type114=2 -Type115=2 -Type116=2 -Type117=3 -Type118=3 -Type119=3 -AlternateItemFail=3 -Type122=2 -Type123=1 -Type124=1 -Type125=1 -Type126=1 -Type127=1 - -[ERC Connection Matrix] -L1=NNNNNNNNNNNWNNNWW -L2=NNWNNNNWWWNWNWNWN -L3=NWEENEEEENEWNEEWN -L4=NNENNNWEENNWNENWN -L5=NNNNNNNNNNNNNNNNN -L6=NNENNNNEENNWNENWN -L7=NNEWNNWEENNWNENWN -L8=NWEENEENEEENNEENN -L9=NWEENEEEENEWNEEWW -L10=NWNNNNNENNEWNNEWN -L11=NNENNNNEEENWNENWN -L12=WWWWNWWNWWWNWWWNN -L13=NNNNNNNNNNNWNNNWW -L14=NWEENEEEENEWNEEWW -L15=NNENNNNEEENWNENWW -L16=WWWWNWWNWWWNWWWNW -L17=WNNNNNNNWNNNWWWWN - -[Annotate] -SortOrder=1 -SortLocation=0 -ReplaceSubparts=0 -MatchParameter1=Comment -MatchStrictly1=1 -MatchParameter2=Library Reference -MatchStrictly2=1 -PhysicalNamingFormat=$Component_$RoomName -GlobalIndexSortOrder=3 -GlobalIndexSortLocation=0 - -[PrjClassGen] -CompClassManualEnabled=0 -CompClassManualRoomEnabled=0 -NetClassAutoBusEnabled=1 -NetClassAutoCompEnabled=0 -NetClassAutoNamedHarnessEnabled=0 -NetClassManualEnabled=1 -NetClassSeparateForBusSections=0 - -[LibraryUpdateOptions] -SelectedOnly=0 -UpdateVariants=1 -UpdateToLatestRevision=1 -PartTypes=0 -FullReplace=1 -UpdateDesignatorLock=1 -UpdatePartIDLock=1 -PreserveParameterLocations=1 -PreserveParameterVisibility=1 -DoGraphics=1 -DoParameters=1 -DoModels=1 -AddParameters=0 -RemoveParameters=0 -AddModels=1 -RemoveModels=1 -UpdateCurrentModels=1 - -[DatabaseUpdateOptions] -SelectedOnly=0 -UpdateVariants=1 -UpdateToLatestRevision=1 -PartTypes=0 - -[Comparison Options] -ComparisonOptions0=Kind=Net|MinPercent=75|MinMatch=3|ShowMatch=0|UseName=-1|InclAllRules=0 -ComparisonOptions1=Kind=Net Class|MinPercent=75|MinMatch=3|ShowMatch=0|UseName=-1|InclAllRules=0 -ComparisonOptions2=Kind=Component Class|MinPercent=75|MinMatch=3|ShowMatch=0|UseName=-1|InclAllRules=0 -ComparisonOptions3=Kind=Rule|MinPercent=75|MinMatch=3|ShowMatch=0|UseName=-1|InclAllRules=0 -ComparisonOptions4=Kind=Differential Pair|MinPercent=50|MinMatch=1|ShowMatch=0|UseName=0|InclAllRules=0 -ComparisonOptions5=Kind=Structure Class|MinPercent=75|MinMatch=3|ShowMatch=0|UseName=-1|InclAllRules=0 - -[SmartPDF] -PageOptions=Record=PageOptions|CenterHorizontal=True|CenterVertical=True|PrintScale=1.00|XCorrection=1.00|YCorrection=1.00|PrintKind=1|BorderSize=5000000|LeftOffset=0|BottomOffset=0|Orientation=2|PaperLength=1000|PaperWidth=1000|Scale=100|PaperSource=7|PrintQuality=-3|MediaType=1|DitherType=10|PrintScaleMode=1|PaperKind=A4|PaperIndex=9 -