Skip to content
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
653a080
Add support for Sequre S99, copied S60P settings
jonasius May 26, 2024
1521b5e
Add S99
jonasius May 26, 2024
a3b7abb
Add Sequre S99 with correct bootloader offset
jonasius May 26, 2024
5ea42a8
Add whitespaces according to coding style
jonasius May 26, 2024
2c5d2a0
Add whitespaces according to coding style
jonasius May 26, 2024
a306de5
Merge branch 'Ralim:dev' into dev
jonasius Jun 1, 2024
e327be5
Correct debug menu "Tip R" to "Tip uV"
jonasius Jun 2, 2024
a2615a5
Use SettingsOptions::PDNegTimeout in FS2711 driver
jonasius Jun 2, 2024
31ff398
Correct debug menu "Tip R" to "Tip uV"
jonasius Jun 3, 2024
6e53d85
Rename Sequre_S60 folder to Sequre
jonasius Jun 6, 2024
6ef1fbd
Support for S99
jonasius Jun 6, 2024
da28492
Add define for USB_PD_TIMEOUT, the default value for PDNegTimeout
jonasius Jun 6, 2024
f5d6d8b
Add define for USB_PD_TIMEOUT, the default value for PDNegTimeout
jonasius Jun 6, 2024
8514edf
Fix clang-format code style mismatches
jonasius Jun 6, 2024
b772e1d
Add S99 to overview table
jonasius Jun 19, 2024
c8c36d2
Fix clang-format code style mismatches
jonasius Jun 19, 2024
a626d5a
Fix missing PD related description of menu items and messages for POW…
jonasius Jun 25, 2024
c776390
Add pins for S99 v1.5 and probably S60P v1.2
jonasius Jun 25, 2024
e911726
Add experimental detection of separate USB-PD I2C bus for S99 v1.5 an…
jonasius Jun 25, 2024
51e08f3
Fix clang-format issues
jonasius Jun 25, 2024
0d74f77
Code cleanup, always init both I2C bus
jonasius Jun 25, 2024
56b91ac
Add missing __HAL_RCC_GPIOB_CLK_ENABLE
jonasius Jun 25, 2024
e6a3f38
4x faster PWM, add Timer changes from #1926
jonasius Jun 25, 2024
69493ba
Add missing braces
jonasius Jun 27, 2024
6ad0b65
Correct README to Sequre S60, S60P and S99
jonasius Jun 27, 2024
4634fa8
Fix showing displayPowerMenu for POW_PD and POW_PD_EXT 2
jonasius Jun 28, 2024
f21630e
Enable/add DC support for S60P
jonasius Jun 28, 2024
693c1a3
Merge branch 'dev' into dev
jonasius Jun 28, 2024
fa3d4d4
Merge branch 'dev' into dev
discip Jul 11, 2024
ae21be2
Merge branch 'dev' into dev
discip Jul 11, 2024
e79687e
Set equal USB_PD_TIMEOUT for all Sequre irons
jonasius Aug 5, 2024
a2734ee
Fix i2c_probe function
jonasius Aug 5, 2024
fcb1b37
Merge branch 'dev' of https://github.com/jonasius/IronOS into dev
jonasius Aug 5, 2024
a132d37
Merge remote-tracking branch 'upstream/dev' into dev
jonasius Aug 7, 2024
e667189
Add MODEL_S99
jonasius Aug 7, 2024
4b340c5
Add THERMAL_RUNAWAY config values for S99
jonasius Aug 7, 2024
2679a79
Merge branch 'dev' into dev
discip Aug 24, 2024
b036da9
Merge branch 'dev' into dev
discip Sep 4, 2024
35fd2f5
Merge branch 'dev' into dev
discip Nov 7, 2024
17f15bc
Merge branch 'Ralim:dev' into dev
jonasius Nov 19, 2024
02580da
Add probing for unused devices for testing/timing
jonasius Dec 6, 2024
867f1fc
Merge branch 'dev' into dev
discip Dec 6, 2024
a5560ae
Merge branch 'dev' into dev
discip Jan 13, 2025
69c5935
Merge remote-tracking branch 'upstream/dev' into dev
jonasius Jul 2, 2025
c5dc83a
Merge branch 'dev' into dev
discip Jul 9, 2025
5750e9a
Change Utils.h to Utils.hpp
jonasius Jul 15, 2025
f8b2c90
Merge branch 'dev' of https://github.com/jonasius/IronOS into dev
jonasius Jul 15, 2025
6881599
Merge branch 'dev' into dev
jonasius Dec 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
"Pinecilv2",
"S60",
"S60P",
"S99",
"TS101",
]
fail-fast: true
Expand Down
2 changes: 1 addition & 1 deletion Documentation/DebugMenu.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ This can be used for checking performance of the movement detection code.

This indicates the tip resistance that the device is currently using. For devices with multiple possible values to choose from (Pinecil V2), the appropriate value is automatically detected at every boot-up. Tip should be installed before boot-up or reading can not be done.

### Tip R
### Tip uV

This is the raw tip reading in μV. Tip must be installed or reading will be high/inaccurate. At cool, the range of 700-1000 is normal for larger tips and ~1500 for smaller tips (TS80). This is used to evaluate the calibration routines.

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ DOCKER_CMD=$(DOCKER_BIN) -f $(DOCKER_YML) run --rm builder
MKDOCS_YML=$(CURDIR)/scripts/IronOS-mkdocs.yml

# supported models
MODELS=TS100 TS80 TS80P Pinecil MHP30 Pinecilv2 S60 TS101 S60P # target names & dir names
MODELS=TS100 TS80 TS80P Pinecil MHP30 Pinecilv2 S60 TS101 S60P S99 # target names & dir names
MODELS_ML=Pinecil Pinecilv2 # target names
MODELS_MULTILANG=Pinecil_multi-lang Pinecilv2_multi-lang # dir names

Expand Down
2 changes: 1 addition & 1 deletion Translations/make_translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def get_debug_menu() -> List[str]:
"UpTime ",
"Move ",
"Tip Res",
"Tip R ",
"Tip uV ",
"Tip O ",
"HW G ",
"HW M ",
Expand Down
1 change: 1 addition & 0 deletions source/Core/BSP/MHP30/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
#define PROFILE_SUPPORT

#define POW_PD 1
#define USB_PD_TIMEOUT 20 // Default Timeout for USB-PD Protocol negotiation in x100ms
#define POW_PD_EXT 0
#define USB_PD_EPR_WATTAGE 0 /*No EPR*/
#define TEMP_NTC
Expand Down
1 change: 1 addition & 0 deletions source/Core/BSP/Miniware/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
#define ADC_VDD_MV 3300 // ADC max reading millivolts

#define POW_PD_EXT 0
#define USB_PD_TIMEOUT 20 // Default Timeout for USB-PD Protocol negotiation in x100ms

// Deriving the Voltage div:
// Vin_max = (3.3*(r1+r2))/(r2)
Expand Down
1 change: 1 addition & 0 deletions source/Core/BSP/Pinecil/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@
#define POW_PD 1
#define USB_PD_EPR_WATTAGE 0 /*No EPR (Yet?) */
#define POW_PD_EXT 0
#define USB_PD_TIMEOUT 20 // Default Timeout for USB-PD Protocol negotiation in x100ms
#define POW_QC 1
#define POW_DC 1
#define POW_QC_20V 1
Expand Down
1 change: 1 addition & 0 deletions source/Core/BSP/Pinecilv2/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@
#define POW_PD 1 // Supported features
#define USB_PD_EPR_WATTAGE 140 // USB PD EPR Wattage
#define POW_PD_EXT 0 // Future-proof macro for other models with other PD modes
#define USB_PD_TIMEOUT 20 // Default Timeout for USB-PD Protocol negotiation in x100ms
#define POW_QC 1 // Supported features
#define POW_DC 1 // Supported features
#define POW_QC_20V 1 // Supported features
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,36 @@
#define MOVEMENT_Pin GPIO_PIN_3
#define MOVEMENT_GPIO_Port GPIOA

#endif

#ifdef MODEL_S99

#define KEY_B_Pin GPIO_PIN_1
#define KEY_B_GPIO_Port GPIOB
#define TMP36_INPUT_Pin GPIO_PIN_5
#define TMP36_INPUT_GPIO_Port GPIOA
#define TMP36_ADC1_CHANNEL ADC_CHANNEL_5
#define TMP36_ADC2_CHANNEL ADC_CHANNEL_5
#define TIP_TEMP_Pin GPIO_PIN_0
#define TIP_TEMP_GPIO_Port GPIOA
#define TIP_TEMP_ADC1_CHANNEL ADC_CHANNEL_0
#define TIP_TEMP_ADC2_CHANNEL ADC_CHANNEL_0
#define VIN_Pin GPIO_PIN_4
#define VIN_GPIO_Port GPIOA
#define VIN_ADC1_CHANNEL ADC_CHANNEL_4
#define VIN_ADC2_CHANNEL ADC_CHANNEL_4
#define KEY_A_Pin GPIO_PIN_0
#define KEY_A_GPIO_Port GPIOB
#define PWM_Out_Pin GPIO_PIN_8
#define PWM_Out_GPIO_Port GPIOB
#define PWM_Out_CHANNEL TIM_CHANNEL_3 // Timer 4; channel 3
#define SCL2_Pin GPIO_PIN_6
#define SCL2_GPIO_Port GPIOB
#define SDA2_Pin GPIO_PIN_7
#define SDA2_GPIO_Port GPIOB
// Pin gets pulled high on movement
#define MOVEMENT_Pin GPIO_PIN_3
#define MOVEMENT_GPIO_Port GPIOA

#endif
#endif /* BSP_MINIWARE_PINS_H_ */
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "BSP.h"
#include "BSP_Power.h"
#include "FS2711.hpp"
#include "Pins.h"
#include "QC3.h"
#include "Settings.h"
Expand All @@ -16,9 +17,26 @@ void power_check() {
return; // We are using PD
}
#endif
#if POW_PD_EXT == 2
if (FS2711::has_run_selection()) {
return;
}
#endif
#ifdef POW_QC
QC_resync();
#endif
}

bool getIsPoweredByDCIN() { return false; }
bool getIsPoweredByDCIN() {
#if POW_PD_EXT == 2 && defined(POW_DC)
if (!FS2711::has_run_selection()) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

return true;
} else if (FS2711::debug_get_state().source_voltage > 0) {
return false;
} else {
return true;
}
#else
return false;
#endif
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 18 additions & 0 deletions source/Core/BSP/Sequre/ThermoModel.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* ThermoModel.cpp
*
* Created on: 1 May 2021
* Author: Ralim
*/
#include "TipThermoModel.h"
#include "Utils.h"
#include "configuration.h"

#if defined(TEMP_uV_LOOKUP_S60)
TemperatureType_t TipThermoModel::convertuVToDegC(uint32_t tipuVDelta) { return (tipuVDelta * 50) / 485; }
#elif defined(TEMP_uV_LOOKUP_S99)
// 42.85 uV / K -> 1/42.85 K/uV = 20/857
// TemperatureType_t TipThermoModel::convertuVToDegC(uint32_t tipuVDelta) { return (tipuVDelta * 20) / 857; }
// Measurement is probably with heating element in series, thats why the reading differs from the approx 42.85 uV/K
TemperatureType_t TipThermoModel::convertuVToDegC(uint32_t tipuVDelta) { return (tipuVDelta * 1) / 30; }
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
// Vin_max = (3.3*(r1+r2))/(r2)
// vdiv = (32768*4)/(vin_max*10)

#if defined(MODEL_S60) + defined(MODEL_S60P) == 0
#if defined(MODEL_S60) + defined(MODEL_S60P) + defined(MODEL_S99) == 0
#error "No model defined!"
#endif

Expand All @@ -144,7 +144,8 @@
#define POWER_LIMIT_STEPS 5
#define OP_AMP_GAIN_STAGE 536
#define TEMP_uV_LOOKUP_S60
#define USB_PD_VMAX 12 // Maximum voltage for PD to negotiate
#define USB_PD_VMAX 12 // Maximum voltage for PD to negotiate
#define USB_PD_TIMEOUT 1 // Default Timeout for USB-PD Protocol negotiation in x100ms

#define HARDWARE_MAX_WATTAGE_X10 600

Expand Down Expand Up @@ -175,7 +176,8 @@
#define POWER_LIMIT_STEPS 5
#define OP_AMP_GAIN_STAGE 536
#define TEMP_uV_LOOKUP_S60
#define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate
#define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate
#define USB_PD_TIMEOUT 1 // Default Timeout for USB-PD Protocol negotiation in x100ms

#define HARDWARE_MAX_WATTAGE_X10 600

Expand All @@ -197,6 +199,39 @@
#define MODEL_HAS_DCDC // We dont have DC/DC but have reallly fast PWM that gets us roughly the same place
#endif /* S60P */

#ifdef MODEL_S99
#define VOLTAGE_DIV 460 // Default divider scaler
#define CALIBRATION_OFFSET 200 // 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 70
#define POWER_LIMIT_STEPS 5
#define OP_AMP_GAIN_STAGE 237 // Two sequential op-amps 1st: 1+(9k29/997R)=10.31 2nd: 1+(22k/1k)=23 -> 10.31*23=237
#define TEMP_uV_LOOKUP_S99
#define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate
#define USB_PD_TIMEOUT 2 // Default Timeout for USB-PD Protocol negotiation in x100ms

#define HARDWARE_MAX_WATTAGE_X10 1300

#define TIP_THERMAL_MASS 8 // X10 watts to raise 1 deg C in 1 second
#define TIP_THERMAL_INERTIA 128 // We use a large inertia value to smooth out the drive to the tip since its stupidly sensitive

#define TIP_RESISTANCE 20 //(actually 2.5 ish but we need to be more conservative on pwm'ing watt limit) x10 ohms

#define OLED_128x32
#define GPIO_VIBRATION
#define POW_PD_EXT 2
#define USB_PD_EPR_WATTAGE 0 /*No EPR*/
#define POW_DC
#define DEBUG_POWER_MENU_BUTTON_B 1
#define HAS_POWER_DEBUG_MENU
#define TEMP_NTC
#define I2C_SOFT_BUS_2 // For now we are doing software I2C to get around hardware chip issues
#define OLED_I2CBB2

#define MODEL_HAS_DCDC // We dont have DC/DC but have reallly fast PWM that gets us roughly the same place
#endif /* S99 */

#define FLASH_LOGOADDR (0x08000000 + (62 * 1024))
#define SETTINGS_START_PAGE (0x08000000 + (63 * 1024))

Expand Down
File renamed without changes.
File renamed without changes.
11 changes: 0 additions & 11 deletions source/Core/BSP/Sequre_S60/ThermoModel.cpp

This file was deleted.

16 changes: 11 additions & 5 deletions source/Core/Drivers/FS2711.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#include "FS2711_defines.h"
#include "I2CBB2.hpp"
#include "configuration.h"
#include "Settings.h"
#include "Utils.h"
#if POW_PD_EXT == 2
#include "BSP.h"
#include "cmsis_os.h"
Expand All @@ -13,8 +15,6 @@
#error Max PD Voltage must be defined
#endif

#define PROTOCOL_TIMEOUT 100 // ms

extern int32_t powerSupplyWattageLimit;

fs2711_state_t FS2711::state;
Expand All @@ -34,10 +34,11 @@ void FS2711::start() {
state.req_pdo_num = 0xFF;

enable_protocol(false);
osDelay(PROTOCOL_TIMEOUT);
// PDNegTimeout is in 100ms, so x100 for ms
osDelay(getSettingValue(SettingsOptions::PDNegTimeout)*100);
select_protocol(FS2711_PROTOCOL_PD);
enable_protocol(true);
osDelay(PROTOCOL_TIMEOUT);
osDelay(getSettingValue(SettingsOptions::PDNegTimeout)*100);
}

uint8_t FS2711::selected_protocol() { return i2c_read(FS2711_REG_SELECT_PROTOCOL); }
Expand Down Expand Up @@ -161,6 +162,11 @@ void FS2711::negotiate() {
if (getSettingValue(SettingsOptions::USBPDMode) == 1) {
tip_resistance += 5;
}
#ifdef MODEL_HAS_DCDC
// If this device has step down DC/DC inductor to smooth out current spikes
// We can instead ignore resistance and go for max voltage we can accept; and rely on the DC/DC regulation to keep under current limit
tip_resistance = 255; // (Push to 25.5 ohms to effectively disable this check)
#endif

uint16_t pdo_min_mv = 0, pdo_max_mv = 0, pdo_max_curr = 0, pdo_type = 0;

Expand Down Expand Up @@ -226,7 +232,7 @@ bool FS2711::has_run_selection() { return state.req_pdo_num != 0xFF; }

uint16_t FS2711::source_voltage() { return state.source_voltage / 1000; }

// FS2711 does current in mV so it needs to be converted to x100 intead of x1000
// FS2711 does current in mA so it needs to be converted to x100 intead of x1000
uint16_t FS2711::source_currentx100() { return state.source_current / 10; }

uint16_t FS2711::debug_pdo_max_voltage(uint8_t pdoid) { return state.pdo_max_volt[pdoid]; }
Expand Down
3 changes: 2 additions & 1 deletion source/Core/Drivers/Font.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ const uint8_t disconnectedTip[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x37, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x04, 0x04, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
#endif

#if defined(MODEL_S60)+defined(MODEL_S60P) > 0
#if defined(MODEL_S60) + defined(MODEL_S60P) + defined(MODEL_S99) > 0

const uint8_t buttonA[] = {
// width = 42
// height = 16
Expand Down
2 changes: 1 addition & 1 deletion source/Core/Src/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ static const SettingConstants settingsConstants[(int)SettingsOptions::SettingsOp
{ 0, 9, 1, 0}, // AccelMissingWarningCounter
{ 0, 9, 1, 0}, // PDMissingWarningCounter
{ 0, 0xFFFF, 0, 41431 /*EN*/}, // UILanguage
{ 0, 50, 1, 20}, // PDNegTimeout
{ 0, 50, 1, USB_PD_TIMEOUT}, // PDNegTimeout
{ 0, 1, 1, 0}, // OLEDInversion
{ MIN_BRIGHTNESS, MAX_BRIGHTNESS, BRIGHTNESS_STEP, DEFAULT_BRIGHTNESS}, // OLEDBrightness
{ 0, 6, 1, 1}, // LOGOTime
Expand Down
10 changes: 5 additions & 5 deletions source/Core/Src/settingsGUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ static void displayInputMinVRange(void);
static void displayQCInputV(void);
#endif /* POW_QC */

#ifdef POW_PD
#if defined POW_PD || POW_PD_EXT == 2
static void displayPDNegTimeout(void);
static void displayUSBPDMode(void);
#endif /* POW_PD */
Expand Down Expand Up @@ -225,7 +225,7 @@ const menuitem rootSettingsMenu[] {
/* ^^^^ end of menu marker. DO NOT REMOVE ^^^^ */
};

#if defined(POW_DC) || defined(POW_QC) || defined(POW_PD)
#if defined(POW_DC) || defined(POW_QC) || defined(POW_PD) || POW_PD_EXT == 2
const menuitem powerMenu[] = {
/*
* Power Source
Expand All @@ -244,7 +244,7 @@ const menuitem powerMenu[] = {
/* Voltage input */
{SETTINGS_DESC(SettingsItemIndex::QCMaxVoltage), nullptr, displayQCInputV, nullptr, SettingsOptions::QCIdealVoltage, SettingsItemIndex::QCMaxVoltage, 4},
#endif
#ifdef POW_PD
#if defined(POW_PD) || POW_PD_EXT == 2
/* PD timeout setup */
{SETTINGS_DESC(SettingsItemIndex::PDNegTimeout), nullptr, displayPDNegTimeout, nullptr, SettingsOptions::PDNegTimeout, SettingsItemIndex::PDNegTimeout, 6},
/* Toggle PPS & EPR */
Expand Down Expand Up @@ -433,7 +433,7 @@ const menuitem advancedMenu[] = {
/* clang-format on */

const menuitem *subSettingsMenus[] {
#if defined(POW_DC) || defined(POW_QC) || defined(POW_PD)
#if defined(POW_DC) || defined(POW_QC) || defined(POW_PD) || POW_PD_EXT == 2
powerMenu,
#endif
solderingMenu, PowerSavingMenu, UIMenu, advancedMenu,
Expand Down Expand Up @@ -518,7 +518,7 @@ static void displayQCInputV(void) {

#endif /* POW_QC */

#ifdef POW_PD /* POW_PD */
#if defined(POW_PD) || POW_PD_EXT == 2 /* POW_PD */

static void displayPDNegTimeout(void) {
auto value = getSettingValue(SettingsOptions::PDNegTimeout);
Expand Down
4 changes: 4 additions & 0 deletions source/Core/Threads/OperatingModes/OperatingModes.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ extern "C" {
#include "USBPD.h"
#include "pd.h"
#endif
#if POW_PD_EXT == 2
#include "FS2711.hpp"
#include "FS2711_defines.h"
#endif

enum class OperatingMode {
StartupLogo = 0, // Showing the startup logo
Expand Down
7 changes: 7 additions & 0 deletions source/Core/Threads/OperatingModes/utils/SolderingCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ int8_t getPowerSourceNumber(void) {
#endif
}
}
#endif
#if POW_PD_EXT == 2
if (FS2711::has_run_selection()) {
poweredbyPD = true;
// FS2711IC has VBUS always connected
pdHasVBUSConnected = true;
}
#endif
if (poweredbyPD) {
if (pdHasVBUSConnected) {
Expand Down
Loading