1
0
forked from me/IronOS

Unify settings for each model into once place

This commit is contained in:
Ben V. Brown
2021-09-15 20:24:41 +10:00
parent ebde786ca1
commit 2bfb8a6535
29 changed files with 377 additions and 212 deletions

View File

@@ -2,7 +2,7 @@
#include "BSP_Power.h"
#include "BSP_QC.h"
#include "Defines.h"
#include "Model_Config.h"
#include "configuration.h"
#include <stdbool.h>
#include <stdint.h>
/*

View File

@@ -2,7 +2,6 @@
#include "BSP.h"
#include "I2C_Wrapper.hpp"
#include "Model_Config.h"
#include "Pins.h"
#include "Setup.h"
#include "TipThermoModel.h"
@@ -13,6 +12,7 @@
#include "main.hpp"
#include <IRQ.h>
WS2812<GPIOA_BASE, WS2812_Pin, 1> ws2812;
volatile uint16_t PWMSafetyTimer = 0;
volatile uint8_t pendingPWM = 0;

View File

@@ -1,30 +0,0 @@
/*
* Model_Config.h
*
* Created on: 25 Jul 2020
* Author: Ralim
*/
#ifndef BSP_MINIWARE_MODEL_CONFIG_H_
#define BSP_MINIWARE_MODEL_CONFIG_H_
/*
* Lookup for mapping features <-> Models
*/
#ifndef MODEL_MHP30
#error "No model defined!"
#endif
#ifdef MODEL_MHP30
#define ACCEL_MSA
#define POW_PD
#define TEMP_NTC
#define I2C_SOFT
#define BATTFILTERDEPTH 8
#define OLED_I2CBB
#define ACCEL_EXITS_ON_MOVEMENT
#endif
#ifdef ACCEL_EXITS_ON_MOVEMENT
#define NO_SLEEP_MODE
#endif
#endif /* BSP_MINIWARE_MODEL_CONFIG_H_ */

View File

@@ -7,7 +7,7 @@
#ifndef BSP_MINIWARE_PINS_H_
#define BSP_MINIWARE_PINS_H_
#include "Model_Config.h"
#include "configuration.h"
// MHP30 pin map
#define KEY_B_Pin GPIO_PIN_0

View File

@@ -1,9 +1,9 @@
#include "BSP.h"
#include "BSP_Power.h"
#include "Model_Config.h"
#include "Pins.h"
#include "QC3.h"
#include "Settings.h"
#include "configuration.h"
#include "fusb_user.h"
#include "fusbpd.h"
#include "int_n.h"

View File

@@ -5,11 +5,12 @@
* Author: Ralim
*/
#include "BSP.h"
#include "Model_Config.h"
#include "Pins.h"
#include "QC3.h"
#include "Settings.h"
#include "configuration.h"
#include "stm32f1xx_hal.h"
#ifdef POW_QC
void QC_DPlusZero_Six() {
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, GPIO_PIN_RESET); // pull down D+

View File

@@ -8,7 +8,7 @@
#ifndef BSP_MINIWARE_SOFTWARE_I2C_H_
#define BSP_MINIWARE_SOFTWARE_I2C_H_
#include "BSP.h"
#include "Model_Config.h"
#include "configuration.h"
#include "stm32f1xx_hal.h"
#ifdef I2C_SOFT

View File

@@ -0,0 +1,157 @@
#ifndef CONFIGURATION_H_
#define CONFIGURATION_H_
#include "Settings.h"
#include "configuration.h"
#include <stdint.h>
/**
* Configuration.h
* Define here your default pre settings for TS80 or TS100
*
*/
//===========================================================================
//============================= Default Settings ============================
//===========================================================================
/**
* Default soldering temp is 320.0 C
* Temperature the iron sleeps at - default 150.0 C
*/
#define SLEEP_TEMP 150 // Default sleep temperature
#define BOOST_TEMP 420 // Default boost temp.
#define BOOST_MODE_ENABLED 1 // 0: Disable 1: Enable
/**
* Blink the temperature on the cooling screen when its > 50C
*/
#define COOLING_TEMP_BLINK 0 // 0: Disable 1: Enable
/**
* How many seconds/minutes we wait until going to sleep/shutdown.
* Values -> SLEEP_TIME * 10; i.e. 5*10 = 50 Seconds!
*/
#define SLEEP_TIME 5 // x10 Seconds
#define SHUTDOWN_TIME 10 // Minutes
/**
* Auto start off for safety.
* Pissible values are:
* 0 - none
* 1 - Soldering Temperature
* 2 - Sleep Temperature
* 3 - Sleep Off Temperature
*/
#define AUTO_START_MODE 0 // Default to none
/**
* Locking Mode
* When in soldering mode a long press on both keys toggle the lock of the buttons
* Possible values are:
* 0 - Desactivated
* 1 - Lock except boost
* 2 - Full lock
*/
#define LOCKING_MODE 0 // Default to desactivated for safety
/**
* OLED Orientation
*
*/
#define ORIENTATION_MODE 0 // 0: Right 1:Left 2:Automatic - Default right
#define REVERSE_BUTTON_TEMP_CHANGE 0 // 0:Default 1:Reverse - Reverse the plus and minus button assigment for temperature change
/**
* Temp change settings
*/
#define TEMP_CHANGE_SHORT_STEP 1 // Default temp change short step +1
#define TEMP_CHANGE_LONG_STEP 10 // Default temp change long step +10
#define TEMP_CHANGE_SHORT_STEP_MAX 50 // Temp change short step MAX value
#define TEMP_CHANGE_LONG_STEP_MAX 90 // Temp change long step MAX value
/* Power pulse for keeping power banks awake*/
#define POWER_PULSE_INCREMENT 1
#define POWER_PULSE_MAX 100 // x10 max watts
#define POWER_PULSE_WAIT_MAX 9 // 9*2.5s = 22.5 seconds
#define POWER_PULSE_DURATION_MAX 9 // 9*250ms = 2.25 seconds
#ifdef MODEL_TS100
#define POWER_PULSE_DEFAULT 0
#else
#define POWER_PULSE_DEFAULT 5
#endif
#define POWER_PULSE_WAIT_DEFAULT 4 // Default rate of the power pulse: 4*2500 = 10000 ms = 10 s
#define POWER_PULSE_DURATION_DEFAULT 1 // Default duration of the power pulse: 1*250 = 250 ms
/**
* OLED Orientation Sensitivity on Automatic mode!
* Motion Sensitivity <0=Off 1=Least Sensitive 9=Most Sensitive>
*/
#define SENSITIVITY 7 // Default 7
/**
* Detailed soldering screen
* Detailed idle screen (off for first time users)
*/
#define DETAILED_SOLDERING 0 // 0: Disable 1: Enable - Default 0
#define DETAILED_IDLE 0 // 0: Disable 1: Enable - Default 0
#define THERMAL_RUNAWAY_TIME_SEC 20
#define THERMAL_RUNAWAY_TEMP_C 20
#define CUT_OUT_SETTING 0 // default to no cut-off voltage
#define RECOM_VOL_CELL 33 // Minimum voltage per cell (Recommended 3.3V (33))
#define TEMPERATURE_INF 0 // default to 0
#define DESCRIPTION_SCROLL_SPEED 0 // 0: Slow 1: Fast - default to slow
#define ANIMATION_LOOP 1 // 0: off 1: on
#define ANIMATION_SPEED settingOffSpeed_t::MEDIUM
#define OP_AMP_Rf_MHP30 268500 // 268.5 Kilo-ohms -> Measured
#define OP_AMP_Rin_MHP30 1600 // 1.6 Kilo-ohms -> Measured
#define OP_AMP_GAIN_STAGE_MHP30 (1 + (OP_AMP_Rf_MHP30 / OP_AMP_Rin_MHP30))
// Deriving the Voltage div:
// Vin_max = (3.3*(r1+r2))/(r2)
// vdiv = (32768*4)/(vin_max*10)
#ifndef MODEL_MHP30
#error "No model defined!"
#endif
#ifdef MODEL_MHP30
#define SOLDERING_TEMP 200 // Default soldering temp is 200.0 °C
#define VOLTAGE_DIV 360 // Default for MHP30
#define PID_POWER_LIMIT 65 // Sets the max pwm power limit
#define CALIBRATION_OFFSET 0 // the adc offset in uV - MHP compensates automagically
#define POWER_LIMIT 65 // 65 watts default power limit
#define MAX_POWER_LIMIT 65 //
#define POWER_LIMIT_STEPS 1 //
#define OP_AMP_GAIN_STAGE OP_AMP_GAIN_STAGE_MHP30 //
#define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate
#define MODEL_HAS_DCDC // Has inductor to current filter
#define PID_TIM_HZ (16) //
#define THERMAL_MASS_OVERSHOOTS // We have overshoot so reverse direction of compensation
#define MAX_TEMP_C 300 // Max soldering temp selectable °C
#define MAX_TEMP_F 570 // Max soldering temp selectable °F
#define MIN_TEMP_C 10 // Min soldering temp selectable °C
#define MIN_TEMP_F 60 // Min soldering temp selectable °F
#define MIN_BOOST_TEMP_C 150 // The min settable temp for boost mode °C
#define MIN_BOOST_TEMP_F 300 // The min settable temp for boost mode °F
#define NO_DISPLAY_ROTATE // Disable OLED rotation by accel
#define SLEW_LIMIT 50 // Limit to 3.0 Watts per 64ms pid loop update rate slew rate
#define ACCEL_MSA
#define POW_PD
#define TEMP_NTC
#define I2C_SOFT
#define BATTFILTERDEPTH 8
#define OLED_I2CBB
#define ACCEL_EXITS_ON_MOVEMENT
#define HARDWARE_MAX_WATTAGE_X10 650
#define TIP_THERMAL_MASS 65 // TODO, needs refinement
#define tipResistance 60 // x10 ohms, ~6 typical
#endif
#ifdef ACCEL_EXITS_ON_MOVEMENT
#define NO_SLEEP_MODE
#endif
#endif

View File

@@ -1,4 +1,4 @@
#include "Model_Config.h"
#include "configuration.h"
#ifdef POW_PD
#include "BSP.h"
#include "I2C_Wrapper.hpp"

View File

@@ -7,11 +7,12 @@
#include "BSP.h"
#include "I2CBB.hpp"
#include "Model_Config.h"
#include "Pins.h"
#include "Setup.h"
#include "configuration.h"
#include "fusbpd.h"
#include <I2C_Wrapper.hpp>
void preRToSInit() {
/* Reset of all peripherals, Initializes the Flash interface and the Systick.
*/

View File

@@ -2,7 +2,6 @@
#include "BSP.h"
#include "I2C_Wrapper.hpp"
#include "Model_Config.h"
#include "Pins.h"
#include "Setup.h"
#include "TipThermoModel.h"
@@ -10,6 +9,7 @@
#include "history.hpp"
#include "main.hpp"
#include <IRQ.h>
volatile uint16_t PWMSafetyTimer = 0;
volatile uint8_t pendingPWM = 0;

View File

@@ -1,49 +0,0 @@
/*
* Model_Config.h
*
* Created on: 25 Jul 2020
* Author: Ralim
*/
#ifndef BSP_MINIWARE_MODEL_CONFIG_H_
#define BSP_MINIWARE_MODEL_CONFIG_H_
/*
* Lookup for mapping features <-> Models
*/
#if defined(MODEL_TS100) + defined(MODEL_TS80) + defined(MODEL_TS80P) > 1
#error "Multiple models defined!"
#elif defined(MODEL_TS100) + defined(MODEL_TS80) + defined(MODEL_TS80P) == 0
#error "No model defined!"
#endif
#ifdef MODEL_TS100
#define POW_DC
#define ACCEL_MMA
#define ACCEL_LIS
#define TEMP_TMP36
#define BATTFILTERDEPTH 32
#endif
#ifdef MODEL_TS80
#define ACCEL_LIS
#define POW_QC
#define TEMP_TMP36
#define LIS_ORI_FLIP
#define OLED_FLIP
#define BATTFILTERDEPTH 8
#endif
#ifdef MODEL_TS80P
#define ACCEL_LIS
#define ACCEL_MSA
#define POW_PD
#define POW_QC
#define TEMP_NTC
#define I2C_SOFT
#define LIS_ORI_FLIP
#define OLED_FLIP
#define BATTFILTERDEPTH 8
#endif
#endif /* BSP_MINIWARE_MODEL_CONFIG_H_ */

View File

@@ -7,7 +7,7 @@
#ifndef BSP_MINIWARE_PINS_H_
#define BSP_MINIWARE_PINS_H_
#include "Model_Config.h"
#include "configuration.h"
#ifdef MODEL_TS100

View File

@@ -1,9 +1,9 @@
#include "BSP.h"
#include "BSP_Power.h"
#include "Model_Config.h"
#include "Pins.h"
#include "QC3.h"
#include "Settings.h"
#include "configuration.h"
#include "fusb_user.h"
#include "fusbpd.h"
#include "int_n.h"

View File

@@ -5,11 +5,12 @@
* Author: Ralim
*/
#include "BSP.h"
#include "Model_Config.h"
#include "Pins.h"
#include "QC3.h"
#include "Settings.h"
#include "configuration.h"
#include "stm32f1xx_hal.h"
#ifdef POW_QC
void QC_DPlusZero_Six() {
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, GPIO_PIN_RESET); // pull down D+

View File

@@ -8,7 +8,7 @@
#ifndef BSP_MINIWARE_SOFTWARE_I2C_H_
#define BSP_MINIWARE_SOFTWARE_I2C_H_
#include "BSP.h"
#include "Model_Config.h"
#include "configuration.h"
#include "stm32f1xx_hal.h"
#ifdef I2C_SOFT

View File

@@ -1,10 +1,10 @@
#pragma once
#include "Model_Config.h"
#ifndef CONFIGURATION_H_
#define CONFIGURATION_H_
#include "Settings.h"
#include <stdint.h>
/**
* Configuration.h
* Define here your default pre settings for TS80 or TS100
* Define here your default pre settings for TS80(P) or TS100
*
*/
@@ -57,7 +57,7 @@
*
*/
#define ORIENTATION_MODE 0 // 0: Right 1:Left 2:Automatic - Default right
#define REVERSE_BUTTON_TEMP_CHANGE 0 // 0:Default 1:Reverse - Reverse the plus and minus button assigment for temperatur change
#define REVERSE_BUTTON_TEMP_CHANGE 0 // 0:Default 1:Reverse - Reverse the plus and minus button assigment for temperature change
/**
* Temp change settings
@@ -114,14 +114,16 @@
#define OP_AMP_GAIN_STAGE_TS80 (1 + (OP_AMP_Rf_TS80 / OP_AMP_Rin_TS80))
#define OP_AMP_Rf_MHP30 268500 // 268.5 Kilo-ohms -> Measured
#define OP_AMP_Rin_MHP30 1600 // 1.6 Kilo-ohms -> Measured
#define OP_AMP_GAIN_STAGE_MHP30 (1 + (OP_AMP_Rf_MHP30 / OP_AMP_Rin_MHP30))
// Deriving the Voltage div:
// Vin_max = (3.3*(r1+r2))/(r2)
// vdiv = (32768*4)/(vin_max*10)
#if defined(MODEL_TS100) + defined(MODEL_TS80) + defined(MODEL_TS80P) > 1
#error "Multiple models defined!"
#elif defined(MODEL_TS100) + defined(MODEL_TS80) + defined(MODEL_TS80P) == 0
#error "No model defined!"
#endif
#ifdef MODEL_TS100
#define SOLDERING_TEMP 320 // Default soldering temp is 320.0 °C
#define VOLTAGE_DIV 467 // 467 - Default divider from schematic
@@ -140,26 +142,10 @@
#define MIN_TEMP_F 60 // Min soldering temp selectable °F
#define MIN_BOOST_TEMP_C 250 // The min settable temp for boost mode °C
#define MIN_BOOST_TEMP_F 480 // The min settable temp for boost mode °F
#endif
#ifdef MODEL_Pinecil
#define SOLDERING_TEMP 320 // Default soldering temp is 320.0 °C
#define VOLTAGE_DIV 467 // 467 - Default divider from schematic
#define CALIBRATION_OFFSET 900 // 900 - Default adc offset in uV
#define PID_POWER_LIMIT 70 // Sets the max pwm power limit
#define POWER_LIMIT 0 // 0 watts default limit
#define MAX_POWER_LIMIT 65 //
#define POWER_LIMIT_STEPS 5 //
#define OP_AMP_GAIN_STAGE OP_AMP_GAIN_STAGE_TS100 // Uses TS100 resistors
#define TEMP_uV_LOOKUP_HAKKO // Use Hakko lookup table
#define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate
#define PID_TIM_HZ (8) // Tick rate of the PID loop
#define MAX_TEMP_C 450 // Max soldering temp selectable °C
#define MAX_TEMP_F 850 // Max soldering temp selectable °F
#define MIN_TEMP_C 10 // Min soldering temp selectable °C
#define MIN_TEMP_F 60 // Min soldering temp selectable °F
#define MIN_BOOST_TEMP_C 250 // The min settable temp for boost mode °C
#define MIN_BOOST_TEMP_F 480 // The min settable temp for boost mode °F
#define POW_DC
#define ACCEL_MMA
#define ACCEL_LIS
#define TEMP_TMP36
#endif
#ifdef MODEL_TS80
@@ -180,6 +166,11 @@
#define MIN_TEMP_F 60 // Min soldering temp selectable °F
#define MIN_BOOST_TEMP_C 250 // The min settable temp for boost mode °C
#define MIN_BOOST_TEMP_F 480 // The min settable temp for boost mode °F
#define ACCEL_LIS
#define POW_QC
#define TEMP_TMP36
#define LIS_ORI_FLIP
#define OLED_FLIP
#endif
#ifdef MODEL_TS80P
@@ -200,64 +191,31 @@
#define MIN_TEMP_F 60 // Min soldering temp selectable °F
#define MIN_BOOST_TEMP_C 250 // The min settable temp for boost mode °C
#define MIN_BOOST_TEMP_F 480 // The min settable temp for boost mode °F
#endif
#ifdef MODEL_MHP30
#define SOLDERING_TEMP 200 // Default soldering temp is 200.0 °C
#define VOLTAGE_DIV 360 // Default for MHP30
#define PID_POWER_LIMIT 65 // Sets the max pwm power limit
#define CALIBRATION_OFFSET 0 // the adc offset in uV - MHP compensates automagically
#define POWER_LIMIT 65 // 65 watts default power limit
#define MAX_POWER_LIMIT 65 //
#define POWER_LIMIT_STEPS 1 //
#define OP_AMP_GAIN_STAGE OP_AMP_GAIN_STAGE_MHP30 //
#define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate
#define MODEL_HAS_DCDC // Has inductor to current filter
#define PID_TIM_HZ (16) //
#define THERMAL_MASS_OVERSHOOTS // We have overshoot so reverse direction of compensation
#define MAX_TEMP_C 300 // Max soldering temp selectable °C
#define MAX_TEMP_F 570 // Max soldering temp selectable °F
#define MIN_TEMP_C 10 // Min soldering temp selectable °C
#define MIN_TEMP_F 60 // Min soldering temp selectable °F
#define MIN_BOOST_TEMP_C 150 // The min settable temp for boost mode °C
#define MIN_BOOST_TEMP_F 300 // The min settable temp for boost mode °F
#define NO_DISPLAY_ROTATE // Disable OLED rotation by accel
#define SLEW_LIMIT 50 // Limit to 3.0 Watts per 64ms pid loop update rate slew rate
#define ACCEL_LIS
#define ACCEL_MSA
#define POW_PD
#define POW_QC
#define TEMP_NTC
#define I2C_SOFT
#define LIS_ORI_FLIP
#define OLED_FLIP
#endif
#ifdef MODEL_TS100
const int32_t HARDWARE_MAX_WATTAGE_X10 = 750;
const int32_t TIP_THERMAL_MASS = 65; // X10 watts to raise 1 deg C in 1 second
const uint8_t tipResistance = 75; // x10 ohms, 7.5 typical for ts100 tips
#endif
#ifdef MODEL_Pinecil
const int32_t HARDWARE_MAX_WATTAGE_X10 = 750;
const int32_t TIP_THERMAL_MASS = 65; // X10 watts to raise 1 deg C in 1 second
const uint8_t tipResistance = 75; // x10 ohms, 7.5 typical for ts100 tips
#define HARDWARE_MAX_WATTAGE_X10 750
#define TIP_THERMAL_MASS 65 // X10 watts to raise 1 deg C in 1 second
#define tipResistance 75 // x10 ohms, 7.5 typical for ts100 tips
#endif
#ifdef MODEL_TS80
const int32_t HARDWARE_MAX_WATTAGE_X10 = 180;
const uint32_t TIP_THERMAL_MASS = 40;
const uint8_t tipResistance = 45; // x10 ohms, 4.5 typical for ts80 tips
#define HARDWARE_MAX_WATTAGE_X10 180
#define TIP_THERMAL_MASS 40
#define tipResistance 45 // x10 ohms, 4.5 typical for ts80 tips
#endif
#ifdef MODEL_TS80P
const int32_t HARDWARE_MAX_WATTAGE_X10 = 300;
const uint32_t TIP_THERMAL_MASS = 40;
const uint8_t tipResistance = 45; // x10 ohms, 4.5 typical for ts80 tips
#define HARDWARE_MAX_WATTAGE_X10 300
#define TIP_THERMAL_MASS 40
#define tipResistance 45 // x10 ohms, 4.5 typical for ts80 tips
#endif
#ifdef MODEL_MHP30
const int32_t HARDWARE_MAX_WATTAGE_X10 = 650;
const uint32_t TIP_THERMAL_MASS = 65; // TODO, needs refinement
const uint8_t tipResistance = 60; // x10 ohms, ~6 typical
#endif
#ifdef POW_QC_20V
#define QC_SETTINGS_MAX 3
#else
#define QC_SETTINGS_MAX 2
#endif

View File

@@ -1,4 +1,4 @@
#include "Model_Config.h"
#include "configuration.h"
#ifdef POW_PD
#include "BSP.h"
#include "I2CBB.hpp"

View File

@@ -7,11 +7,12 @@
#include "BSP.h"
#include "I2CBB.hpp"
#include "Model_Config.h"
#include "Pins.h"
#include "Setup.h"
#include "configuration.h"
#include "fusbpd.h"
#include <I2C_Wrapper.hpp>
void preRToSInit() {
/* Reset of all peripherals, Initializes the Flash interface and the Systick.
*/

View File

@@ -1,33 +0,0 @@
/*
* Model_Config.h
*
* Created on: 25 Jul 2020
* Author: Ralim
*/
#ifndef BSP_PINE64_MODEL_CONFIG_H_
#define BSP_PINE64_MODEL_CONFIG_H_
/*
* Lookup for mapping features <-> Models
*/
#if defined(MODEL_Pinecil) == 0
#error "No model defined!"
#endif
#ifdef MODEL_Pinecil
#define POW_PD
#define POW_QC
#define POW_DC
#define POW_QC_20V
#define ENABLE_QC2
#define TEMP_TMP36
#define ACCEL_BMA
#define ACCEL_SC7
#define HALL_SENSOR
#define HALL_SI7210
#define BATTFILTERDEPTH 32
#define DEBUG_UART_OUTPUT
#endif
#endif /* BSP_PINE64_MODEL_CONFIG_H_ */

View File

@@ -1,9 +1,9 @@
#include "BSP.h"
#include "BSP_Power.h"
#include "Model_Config.h"
#include "Pins.h"
#include "QC3.h"
#include "Settings.h"
#include "configuration.h"
#include "fusb_user.h"
#include "fusbpd.h"
#include "int_n.h"

View File

@@ -0,0 +1,151 @@
#ifndef CONFIGURATION_H_
#define CONFIGURATION_H_
#include "Settings.h"
#include <stdint.h>
/**
* Configuration.h
* Define here your default pre settings for Pinecil
*
*/
//===========================================================================
//============================= Default Settings ============================
//===========================================================================
/**
* Default soldering temp is 320.0 C
* Temperature the iron sleeps at - default 150.0 C
*/
#define SLEEP_TEMP 150 // Default sleep temperature
#define BOOST_TEMP 420 // Default boost temp.
#define BOOST_MODE_ENABLED 1 // 0: Disable 1: Enable
/**
* Blink the temperature on the cooling screen when its > 50C
*/
#define COOLING_TEMP_BLINK 0 // 0: Disable 1: Enable
/**
* How many seconds/minutes we wait until going to sleep/shutdown.
* Values -> SLEEP_TIME * 10; i.e. 5*10 = 50 Seconds!
*/
#define SLEEP_TIME 5 // x10 Seconds
#define SHUTDOWN_TIME 10 // Minutes
/**
* Auto start off for safety.
* Pissible values are:
* 0 - none
* 1 - Soldering Temperature
* 2 - Sleep Temperature
* 3 - Sleep Off Temperature
*/
#define AUTO_START_MODE 0 // Default to none
/**
* Locking Mode
* When in soldering mode a long press on both keys toggle the lock of the buttons
* Possible values are:
* 0 - Desactivated
* 1 - Lock except boost
* 2 - Full lock
*/
#define LOCKING_MODE 0 // Default to desactivated for safety
/**
* OLED Orientation
*
*/
#define ORIENTATION_MODE 0 // 0: Right 1:Left 2:Automatic - Default right
#define REVERSE_BUTTON_TEMP_CHANGE 0 // 0:Default 1:Reverse - Reverse the plus and minus button assigment for temperature change
/**
* Temp change settings
*/
#define TEMP_CHANGE_SHORT_STEP 1 // Default temp change short step +1
#define TEMP_CHANGE_LONG_STEP 10 // Default temp change long step +10
#define TEMP_CHANGE_SHORT_STEP_MAX 50 // Temp change short step MAX value
#define TEMP_CHANGE_LONG_STEP_MAX 90 // Temp change long step MAX value
/* Power pulse for keeping power banks awake*/
#define POWER_PULSE_INCREMENT 1
#define POWER_PULSE_MAX 100 // x10 max watts
#define POWER_PULSE_WAIT_MAX 9 // 9*2.5s = 22.5 seconds
#define POWER_PULSE_DURATION_MAX 9 // 9*250ms = 2.25 seconds
#ifdef MODEL_Pinecil
#define POWER_PULSE_DEFAULT 0
#else
#define POWER_PULSE_DEFAULT 5
#endif
#define POWER_PULSE_WAIT_DEFAULT 4 // Default rate of the power pulse: 4*2500 = 10000 ms = 10 s
#define POWER_PULSE_DURATION_DEFAULT 1 // Default duration of the power pulse: 1*250 = 250 ms
/**
* OLED Orientation Sensitivity on Automatic mode!
* Motion Sensitivity <0=Off 1=Least Sensitive 9=Most Sensitive>
*/
#define SENSITIVITY 7 // Default 7
/**
* Detailed soldering screen
* Detailed idle screen (off for first time users)
*/
#define DETAILED_SOLDERING 0 // 0: Disable 1: Enable - Default 0
#define DETAILED_IDLE 0 // 0: Disable 1: Enable - Default 0
#define THERMAL_RUNAWAY_TIME_SEC 20
#define THERMAL_RUNAWAY_TEMP_C 20
#define CUT_OUT_SETTING 0 // default to no cut-off voltage
#define RECOM_VOL_CELL 33 // Minimum voltage per cell (Recommended 3.3V (33))
#define TEMPERATURE_INF 0 // default to 0
#define DESCRIPTION_SCROLL_SPEED 0 // 0: Slow 1: Fast - default to slow
#define ANIMATION_LOOP 1 // 0: off 1: on
#define ANIMATION_SPEED settingOffSpeed_t::MEDIUM
#define OP_AMP_Rf_Pinecil 750 * 1000 // 750 Kilo-ohms -> From schematic, R1
#define OP_AMP_Rin_Pinecil 2370 // 2.37 Kilo-ohms -> From schematic, R2
#define OP_AMP_GAIN_STAGE_PINECIL (1 + (OP_AMP_Rf_Pinecil / OP_AMP_Rin_Pinecil))
#if defined(MODEL_Pinecil) == 0
#error "No model defined!"
#endif
#ifdef MODEL_Pinecil
#define SOLDERING_TEMP 320 // Default soldering temp is 320.0 °C
#define VOLTAGE_DIV 467 // 467 - Default divider from schematic
#define CALIBRATION_OFFSET 900 // 900 - Default adc offset in uV
#define PID_POWER_LIMIT 70 // Sets the max pwm power limit
#define POWER_LIMIT 0 // 0 watts default limit
#define MAX_POWER_LIMIT 65 //
#define POWER_LIMIT_STEPS 5 //
#define OP_AMP_GAIN_STAGE OP_AMP_GAIN_STAGE_PINECIL // Uses Pinecil resistors
#define TEMP_uV_LOOKUP_HAKKO // Use Hakko lookup table
#define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate
#define PID_TIM_HZ (8) // Tick rate of the PID loop
#define MAX_TEMP_C 450 // Max soldering temp selectable °C
#define MAX_TEMP_F 850 // Max soldering temp selectable °F
#define MIN_TEMP_C 10 // Min soldering temp selectable °C
#define MIN_TEMP_F 60 // Min soldering temp selectable °F
#define MIN_BOOST_TEMP_C 250 // The min settable temp for boost mode °C
#define MIN_BOOST_TEMP_F 480 // The min settable temp for boost mode °F
#define POW_PD
#define POW_QC
#define POW_DC
#define POW_QC_20V
#define ENABLE_QC2
#define TEMP_TMP36
#define ACCEL_BMA
#define ACCEL_SC7
#define HALL_SENSOR
#define HALL_SI7210
#define DEBUG_UART_OUTPUT
#define HARDWARE_MAX_WATTAGE_X10 750
#define TIP_THERMAL_MASS 65 // X10 watts to raise 1 deg C in 1 second
#define tipResistance 75 // x10 ohms, 7.5 typical for Pinecil tips
#endif
#endif

View File

@@ -1,4 +1,4 @@
#include "Model_Config.h"
#include "configuration.h"
#ifdef POW_PD
#include "BSP.h"
#include "I2C_Wrapper.hpp"

View File

@@ -4,7 +4,7 @@
* Created on: 13 Jun 2020
* Author: Ralim
*/
#include "Model_Config.h"
#include "configuration.h"
#ifdef POW_PD
#include "BSP.h"
#include "I2CBB.hpp"

View File

@@ -4,7 +4,7 @@
* Created on: 12 Jun 2020
* Author: Ralim
*/
#include "Model_Config.h"
#include "configuration.h"
#ifdef I2C_SOFT
#include "FreeRTOS.h"
#include <I2CBB.hpp>

View File

@@ -7,7 +7,7 @@
#ifndef BSP_MINIWARE_I2CBB_HPP_
#define BSP_MINIWARE_I2CBB_HPP_
#include "Model_Config.h"
#include "configuration.h"
#ifdef I2C_SOFT
#include "BSP.h"
#include "FreeRTOS.h"

View File

@@ -10,7 +10,7 @@
#ifndef OLED_HPP_
#define OLED_HPP_
#include "Font.h"
#include "Model_Config.h"
#include "configuration.h"
#include <BSP.h>
#include <stdbool.h>
#include <string.h>

View File

@@ -15,6 +15,12 @@
#include <string.h> // for memset
bool sanitiseSettings();
#ifdef POW_QC_20V
#define QC_SETTINGS_MAX 3
#else
#define QC_SETTINGS_MAX 2
#endif
/*
* This struct must be a multiple of 2 bytes as it is saved / restored from
* flash in uint16_t chunks

View File

@@ -12,17 +12,18 @@
#include "LIS2DH12.hpp"
#include "MMA8652FC.hpp"
#include "MSA301.h"
#include "Model_Config.h"
#include "QC3.h"
#include "SC7A20.hpp"
#include "Settings.h"
#include "TipThermoModel.h"
#include "cmsis_os.h"
#include "configuration.h"
#include "history.hpp"
#include "main.hpp"
#include "power.hpp"
#include "stdlib.h"
#include "task.h"
#define MOVFilter 8
uint8_t accelInit = 0;
TickType_t lastMovementTime = 0;