Sequre T55 Support (#1928)
Some checks are pending
Docs / deploy-docs (push) Waiting to run
CI / build (MHP30) (push) Waiting to run
CI / build (Pinecil) (push) Waiting to run
CI / build (Pinecilv2) (push) Waiting to run
CI / build (S60) (push) Waiting to run
CI / build (S60P) (push) Waiting to run
CI / build (T55) (push) Waiting to run
CI / build (TS100) (push) Waiting to run
CI / build (TS101) (push) Waiting to run
CI / build (TS80) (push) Waiting to run
CI / build (TS80P) (push) Waiting to run
CI / build_multi-lang (Pinecil) (push) Waiting to run
CI / build_multi-lang (Pinecilv2) (push) Waiting to run
CI / upload_metadata (push) Blocked by required conditions
CI / tests (push) Waiting to run
CI / check_c-cpp (push) Waiting to run
CI / check_python (push) Waiting to run
CI / check_shell (push) Waiting to run
CI / check_readme (push) Waiting to run

* Add T55 to build

* Approx in T55

* Update ThermoModel.cpp

* use PT1000 lookup logic

* Handle no accelerometer

* Setup for temp reading

* Lock max temp

* No movement pin

* Compensate for heater coil resistance change

* Fix min offset for T55

* Fixup font for T55

* Update draw_profile_advanced.cpp

* Update draw_temperature_change.cpp

---------

Co-authored-by: discip <53649486+discip@users.noreply.github.com>
This commit is contained in:
Ben V. Brown
2024-07-24 19:06:26 +10:00
committed by GitHub
parent 84e53e11e0
commit d9c88c9e71
17 changed files with 283 additions and 34 deletions

View File

@@ -51,7 +51,8 @@ void Setup_HAL() {
HAL_ADCEx_InjectedStart(&hadc1); // enable injected readings
HAL_ADCEx_InjectedStart(&hadc2); // enable injected readings
// Setup movement pin
// Setup movement pin
#ifdef MOVEMENT_Pin
{
GPIO_InitTypeDef GPIO_InitStruct;
GPIO_InitStruct.Pin = MOVEMENT_Pin;
@@ -60,9 +61,11 @@ void Setup_HAL() {
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(MOVEMENT_GPIO_Port, &GPIO_InitStruct);
}
#endif
}
uint16_t getADCHandleTemp(uint8_t sample) {
#ifdef TMP36_ADC1_CHANNEL
static history<uint16_t, ADC_FILTER_LEN> filter = {{0}, 0, 0};
if (sample) {
uint32_t sum = 0;
@@ -72,6 +75,9 @@ uint16_t getADCHandleTemp(uint8_t sample) {
filter.update(sum);
}
return filter.average() >> 1;
#else
return 0;
#endif
}
uint16_t getADCVin(uint8_t sample) {
@@ -165,13 +171,19 @@ static void MX_ADC1_Init(void) {
hadc1.Init.NbrOfConversion = 1;
HAL_ADC_Init(&hadc1);
/**Configure Regular Channel
*/
/**Configure Regular Channel
*/
#ifdef TMP36_ADC1_CHANNEL
sConfig.Channel = TMP36_ADC1_CHANNEL;
sConfig.Rank = ADC_REGULAR_RANK_1;
sConfig.SamplingTime = ADC_SAMPLETIME_71CYCLES_5;
HAL_ADC_ConfigChannel(&hadc1, &sConfig);
#else
sConfig.Channel = VIN_ADC1_CHANNEL; // Filler
sConfig.Rank = ADC_REGULAR_RANK_1;
sConfig.SamplingTime = ADC_SAMPLETIME_71CYCLES_5;
HAL_ADC_ConfigChannel(&hadc1, &sConfig);
#endif
/**Configure Injected Channel
*/
// F in = 10.66 MHz