diff options
author | Ben V. Brown <[email protected]> | 2024-02-23 10:19:07 +1100 |
---|---|---|
committer | GitHub <[email protected]> | 2024-02-23 10:19:07 +1100 |
commit | 9f6f2f86ffe00fd7e38e083d8aef99a3db1e4a5c (patch) | |
tree | 453a6bb5d3d0128a7a54af4dc6c77becbc3059e8 | |
parent | baf2f26e59da8408ce49cf072441ea0ee69a41c6 (diff) | |
download | IronOS-9f6f2f86ffe00fd7e38e083d8aef99a3db1e4a5c.tar.gz IronOS-9f6f2f86ffe00fd7e38e083d8aef99a3db1e4a5c.zip |
Add S60P init code (#1884)
* Basic Init
* Add S60P to CI
-rw-r--r-- | .github/workflows/push.yml | 4 | ||||
-rw-r--r-- | README.md | 35 | ||||
-rw-r--r-- | source/Core/BSP/Sequre_S60/Pins.h | 31 | ||||
-rw-r--r-- | source/Core/BSP/Sequre_S60/configuration.h | 33 | ||||
-rw-r--r-- | source/Core/Drivers/Font.h | 2 | ||||
-rw-r--r-- | source/Makefile | 7 | ||||
-rwxr-xr-x | source/build.sh | 28 |
7 files changed, 103 insertions, 37 deletions
diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index cb64cb5c..663795e8 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -28,6 +28,7 @@ jobs: "MHP30", "Pinecilv2", "S60", + "S60P", "TS101", ] fail-fast: true @@ -71,7 +72,6 @@ jobs: source/Hexfile/LICENSE_RELEASE.md if-no-files-found: error - build_multi-lang: runs-on: ubuntu-22.04 container: @@ -119,7 +119,6 @@ jobs: source/Hexfile/LICENSE_RELEASE.md if-no-files-found: error - upload_metadata: needs: [build, build_multi-lang] runs-on: ubuntu-20.04 @@ -139,7 +138,6 @@ jobs: path: source/Hexfile/*.json if-no-files-found: error - tests: runs-on: ubuntu-22.04 container: @@ -21,16 +21,17 @@ This project is considered feature complete for use as a soldering iron, _so ple _This firmware does **NOT** support the USB port while running for changing settings. This is done through the onscreen menu only. Logos are edited on a computer and flashed like firmware._ -| Device | DC | QC | PD | EPR | BLE | Tip Sense | Recommended Purchase | Notes | -| :------------: | :-: | :-: | :-: | :-: | :-: | :-----: | :------------------: | :-------------------------------------------:| -| Miniware MHP30 | ❌ | ❌ | ✔️ | ❌ | ❌ | ✔️ | ✔️ | | -| Pinecil V1 | ✔️ | ✔️ | ✔️ | ❌ | ❌ | ❌ | ❌ * | | -| Pinecil V2 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | -| Miniware TS101 | ✔️ | ❌ | ✔️ | ✔️ | ❌ | ✔️ | ✔️ | Full OLED resolution not yet supported. | -| Sequre S60 | ❌ | ❌ | ✔️ | ❌ | ❌ | ❌ | ✔️ | Full OLED resolution not yet supported. | -| Miniware TS80P | ❌ | ✔️ | ✔️ | ❌ | ❌ | N/A | ✔️ | | -| Miniware TS100 | ✔️ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌** | | -| Miniware TS80 | ❌ | ✔️ | ❌ | ❌ | ❌ | N/A | ❌*** | | +| Device | DC | QC | PD | EPR | BLE | Tip Sense | Recommended Purchase | Notes | +| :------------: | :-: | :-: | :-: | :-: | :-: | :-------: | :------------------: | :-------------------------------------: | +| Miniware MHP30 | ❌ | ❌ | ✔️ | ❌ | ❌ | ✔️ | ✔️ | | +| Pinecil V1 | ✔️ | ✔️ | ✔️ | ❌ | ❌ | ❌ | ❌ \* | | +| Pinecil V2 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | +| Miniware TS101 | ✔️ | ❌ | ✔️ | ✔️ | ❌ | ✔️ | ✔️ | Full OLED resolution not yet supported. | +| Sequre S60 | ❌ | ❌ | ✔️ | ❌ | ❌ | ❌ | ✔️ | Full OLED resolution not yet supported. | +| Sequre S60P | ❌ | ❌ | ✔️ | ❌ | ❌ | ❌ | ✔️ | Full OLED resolution not yet supported. | +| Miniware TS80P | ❌ | ✔️ | ✔️ | ❌ | ❌ | N/A | ✔️ | | +| Miniware TS100 | ✔️ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌\*\* | | +| Miniware TS80 | ❌ | ✔️ | ❌ | ❌ | ❌ | N/A | ❌\*\*\* | | _Tip Sense_ refers to the device being able to choose between the 'usual' TS100 or Hakko T12 style tips and Pine64's custom shorter tips which have lower resistance and allow for more power. This is N/A for TS80/TS80P as there is only one model of tip for them. @@ -40,9 +41,9 @@ The TS101 and S60 feature a higher resolution OLED than other devices. Work is o \*PinecilV1 stopped being manufactured a long time ago now, all models for sale online are generally clones (or old stock). Vendors are trying to sell these for more than Pine64 sells the V2 for now. Thus the V1 is **_no longer recommended_**. -\**Please note that Miniware started shipping TS100's using cloned STM32 Chips. While these do work with IronOS, their DFU bootloader works terribly, and it is hard to get it to successfully flash larger firmware images like IronOS without timing out. This is the main reason why the TS100 is **_no longer recommended_**. +\*\*Please note that Miniware started shipping TS100's using cloned STM32 Chips. While these do work with IronOS, their DFU bootloader works terribly, and it is hard to get it to successfully flash larger firmware images like IronOS without timing out. This is the main reason why the TS100 is **_no longer recommended_**. -\**\*TS80 is replaced by TS80P. Production ramped down a long time ago and it's just existing stock clearing the system. It's marked not recommended being optimistic that people might pause and buy the far superior TS80P instead. This is the main reason why the TS80 is **_no longer recommended_**. +\*\*\*TS80 is replaced by TS80P. Production ramped down a long time ago and it's just existing stock clearing the system. It's marked not recommended being optimistic that people might pause and buy the far superior TS80P instead. This is the main reason why the TS80 is **_no longer recommended_**. ## Getting Started @@ -80,11 +81,11 @@ For notes on installation for your device, please refer to the flashing guide fo - [Custom boot up logo support](https://ralim.github.io/IronOS/Logo/)[^bootlogo] - Automatic LCD rotation based on the orientation - -[^bootlogo]: **BOOTUP LOGO NOTICE**: - IronOS supports both a bootup logo _AND_ bootup animations. - However, _**they are no longer included in this repo**_. - **Please, [read the docs](https://ralim.github.io/IronOS/Logo/) for more information**. +[^bootlogo]: + **BOOTUP LOGO NOTICE**: + IronOS supports both a bootup logo _AND_ bootup animations. + However, _**they are no longer included in this repo**_. + **Please, [read the docs](https://ralim.github.io/IronOS/Logo/) for more information**. ## Menu System diff --git a/source/Core/BSP/Sequre_S60/Pins.h b/source/Core/BSP/Sequre_S60/Pins.h index b818878f..9f0cfb56 100644 --- a/source/Core/BSP/Sequre_S60/Pins.h +++ b/source/Core/BSP/Sequre_S60/Pins.h @@ -40,4 +40,35 @@ #endif
+
+#ifdef MODEL_S60P
+
+#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_ */
diff --git a/source/Core/BSP/Sequre_S60/configuration.h b/source/Core/BSP/Sequre_S60/configuration.h index 36a2e113..399848b2 100644 --- a/source/Core/BSP/Sequre_S60/configuration.h +++ b/source/Core/BSP/Sequre_S60/configuration.h @@ -119,7 +119,7 @@ // Vin_max = (3.3*(r1+r2))/(r2) // vdiv = (32768*4)/(vin_max*10) -#if defined(MODEL_S60) == 0 +#if defined(MODEL_S60) + defined(MODEL_S60P) == 0 #error "No model defined!" #endif @@ -166,6 +166,37 @@ #define MODEL_HAS_DCDC // We dont have DC/DC but have reallly fast PWM that gets us roughly the same place #endif /* S60 */ + +#ifdef MODEL_S60P +#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 536 +#define TEMP_uV_LOOKUP_S60 +#define USB_PD_VMAX 12 // Maximum voltage for PD to negotiate + +#define HARDWARE_MAX_WATTAGE_X10 600 + +#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 1 +#define USB_PD_EPR_WATTAGE 0 /*No EPR*/ +#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 /* S60P */ #define FLASH_LOGOADDR (0x08000000 + (62 * 1024)) #define SETTINGS_START_PAGE (0x08000000 + (63 * 1024)) diff --git a/source/Core/Drivers/Font.h b/source/Core/Drivers/Font.h index 56f71abc..98946449 100644 --- a/source/Core/Drivers/Font.h +++ b/source/Core/Drivers/Font.h @@ -141,7 +141,7 @@ 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) > 0
+#if defined(MODEL_S60)+defined(MODEL_S60P) > 0
const uint8_t buttonA[] = {
// width = 42
// height = 16
diff --git a/source/Makefile b/source/Makefile index 4822cffe..a888def1 100644 --- a/source/Makefile +++ b/source/Makefile @@ -6,7 +6,7 @@ ALL_MINIWARE_MODELS=TS100 TS80 TS80P TS101 ALL_PINECIL_MODELS=Pinecil
ALL_PINECIL_V2_MODELS=Pinecilv2
ALL_MHP30_MODELS=MHP30
-ALL_SEQURE_MODELS=S60
+ALL_SEQURE_MODELS=S60 S60P
ALL_MODELS=$(ALL_MINIWARE_MODELS) $(ALL_PINECIL_MODELS) $(ALL_MHP30_MODELS) $(ALL_PINECIL_V2_MODELS) $(ALL_SEQURE_MODELS)
ifneq ($(model),$(filter $(model),$(ALL_MODELS)))
@@ -142,8 +142,13 @@ CPUFLAGS=-mcpu=cortex-m3 \ -mfloat-abi=soft
flash_size=62k
+ifeq ($(model),S60)
bootldr_size=0x4400
DEVICE_DFU_ADDRESS=0x08004400
+else
+bootldr_size=0x5000
+DEVICE_DFU_ADDRESS=0x08005000
+endif
DEVICE_DFU_VID_PID=0x1209:0xDB42
endif # ALL_SEQURE_MODELS
diff --git a/source/build.sh b/source/build.sh index be284183..53671a16 100755 --- a/source/build.sh +++ b/source/build.sh @@ -6,7 +6,7 @@ TRANSLATION_DIR="../Translations" # AVAILABLE_LANGUAGES will be calculating according to json files in $TRANSLATION_DIR AVAILABLE_LANGUAGES=() BUILD_LANGUAGES=() -AVAILABLE_MODELS=("TS100" "TS80" "TS80P" "Pinecil" "MHP30" "Pinecilv2" "S60" "TS101") +AVAILABLE_MODELS=("TS100" "TS80" "TS80P" "Pinecil" "MHP30" "Pinecilv2" "S60" "S60P" "TS101") BUILD_MODELS=() builder_info() { @@ -47,8 +47,8 @@ INFO : exit 1 } -StartBuild(){ - read -n 1 -r -s -p $'Press Enter to start the building process...\n' +StartBuild() { + read -n 1 -r -s -p $'Press Enter to start the building process...\n' } checkLastCommand() { @@ -87,17 +87,17 @@ declare -a largs=() while getopts "h:l:m:" option; do case "${option}" in - h) - usage - ;; - l) - IFS=' ' read -r -a largs <<< "${OPTARG}" - ;; - m) - IFS=' ' read -r -a margs <<< "${OPTARG}" - ;; - *) - usage + h) + usage + ;; + l) + IFS=' ' read -r -a largs <<<"${OPTARG}" + ;; + m) + IFS=' ' read -r -a margs <<<"${OPTARG}" + ;; + *) + usage ;; esac done |