Prusa MINI Firmware overview
|
#include "hwio_a3ides.h"
#include <inttypes.h>
#include "config.h"
#include "stm32f4xx_hal.h"
#include "cmsis_os.h"
#include "gpio.h"
#include "adc.h"
#include "sim_nozzle.h"
#include "sim_bed.h"
#include "sim_motion.h"
#include "Arduino.h"
#include "timer_defaults.h"
#include "hwio_pindef.h"
#include "filament_sensor.h"
#include "bsod.h"
|
void | Error_Handler (void) |
| This function is executed in case of error occurrence. More...
|
|
void | __pwm_set_val (TIM_HandleTypeDef *htim, uint32_t chan, int val) |
|
void | _hwio_pwm_analogWrite_set_val (int i_pwm, int val) |
|
void | _hwio_pwm_set_val (int i_pwm, int val) |
|
uint32_t | _pwm_get_chan (int i_pwm) |
|
TIM_HandleTypeDef * | _pwm_get_htim (int i_pwm) |
|
int | is_pwm_id_valid (int i_pwm) |
|
int | hwio_di_get_cnt (void) |
|
int | hwio_di_get_val (int i_di) |
|
int | hwio_do_get_cnt (void) |
|
int | hwio_do_get_val (int i_do) |
|
void | hwio_do_set_val (int i_do, int val) |
|
int | hwio_adc_get_cnt (void) |
|
int | hwio_adc_get_max (int i_adc) |
|
int | hwio_adc_get_val (int i_adc) |
|
int | hwio_dac_get_cnt (void) |
|
int | hwio_dac_get_max (int i_dac) |
|
void | hwio_dac_set_val (int i_dac, int val) |
|
int | hwio_pwm_get_cnt (void) |
|
int | hwio_pwm_get_max (int i_pwm) |
|
void | hwio_pwm_set_period_us (int i_pwm, int T_us) |
|
int | hwio_pwm_get_period_us (int i_pwm) |
|
void | hwio_pwm_set_prescaler (int i_pwm, int prescaler) |
|
int | hwio_pwm_get_prescaler (int i_pwm) |
|
void | hwio_pwm_set_prescaler_exp2 (int i_pwm, int exp) |
|
int | hwio_pwm_get_prescaler_log2 (int i_pwm) |
|
void | hwio_pwm_set_val (int i_pwm, int val) |
|
int | hwio_fan_get_cnt (void) |
|
void | hwio_fan_set_pwm (int i_fan, int val) |
|
int | hwio_heater_get_cnt (void) |
|
void | hwio_heater_set_pwm (int i_heater, int val) |
|
void | hwio_jogwheel_enable (void) |
|
void | hwio_jogwheel_disable (void) |
|
float | hwio_beeper_get_vol (void) |
|
void | hwio_beeper_set_vol (float vol) |
|
void | hwio_beeper_set_pwm (uint32_t per, uint32_t pul) |
|
void | hwio_beeper_tone (float frq, uint32_t del) |
|
void | hwio_beeper_tone2 (float frq, uint32_t del, float vol) |
|
void | hwio_beeper_notone (void) |
|
void | hwio_update_1ms (void) |
|
void | adc_ready (uint8_t index) |
|
uint8_t | adc_seq2idx (uint8_t seq) |
|
void | hwio_arduino_error (int err, uint32_t pin32) |
|
int | hwio_arduino_digitalRead (uint32_t ulPin) |
|
void | hwio_arduino_digitalWrite (uint32_t ulPin, uint32_t ulVal) |
|
void | hwio_arduino_digitalToggle (uint32_t ulPin) |
|
uint32_t | hwio_arduino_analogRead (uint32_t ulPin) |
|
void | hwio_arduino_analogWrite (uint32_t ulPin, uint32_t ulValue) |
|
void | hwio_arduino_pinMode (uint32_t ulPin, uint32_t ulMode) |
|
|
int | HAL_GPIO_Initialized |
|
int | HAL_ADC_Initialized |
|
int | HAL_PWM_Initialized |
|
TIM_HandleTypeDef | htim1 |
|
TIM_HandleTypeDef | htim2 |
|
TIM_HandleTypeDef | htim3 |
|
const uint32_t | _di_pin32 [] |
|
const uint32_t | _do_pin32 [] |
|
const uint32_t | _adc_pin32 [] |
|
const int | _adc_max [] = { 4095, 4095, 4095, 4095, 4095 } |
|
int | _adc_val [] = { 0, 0, 0, 0, 0 } |
|
const uint32_t | _dac_pin32 [] = {} |
|
const int | _dac_max [] = { 0 } |
|
int | _tim1_period_us = GEN_PERIOD_US(TIM1_default_Prescaler, TIM1_default_Period) |
|
int | _tim3_period_us = GEN_PERIOD_US(TIM3_default_Prescaler, TIM3_default_Period) |
|
const uint32_t | _pwm_pin32 [] |
|
const uint32_t | _pwm_chan [] |
|
TIM_HandleTypeDef * | _pwm_p_htim [] |
|
int *const | _pwm_period_us [] |
|
const int | _pwm_max [] = { TIM3_default_Period, TIM3_default_Period, TIM1_default_Period, TIM1_default_Period } |
|
const TIM_OC_InitTypeDef | sConfigOC_default |
|
const int | _pwm_analogWrite_max [_PWM_CNT] = { 0xff, 0xff, 0xff, 0xff } |
|
int | _pwm_analogWrite_val [_PWM_CNT] = { 0, 0, 0, 0 } |
|
const int * | _fan_max = &_pwm_analogWrite_max[_FAN_ID_MIN] |
|
int * | _fan_val = &_pwm_analogWrite_val[_FAN_ID_MIN] |
|
const int * | _heater_max = &_pwm_analogWrite_max[_HEATER_ID_MIN] |
|
int * | _heater_val = &_pwm_analogWrite_val[_HEATER_ID_MIN] |
|
int | hwio_jogwheel_enabled = 0 |
|
float | hwio_beeper_vol = 1.0F |
|
uint32_t | hwio_beeper_del = 0 |
|
const uint8_t | adc_seq [18] = { 4, 1, 4, 1, 4, 0, 4, 1, 4, 1, 4, 2, 4, 1, 4, 1, 4, 3 } |
|
◆ HWIO_ERR_UNINI_DIG_RD
#define HWIO_ERR_UNINI_DIG_RD 0x01 |
◆ HWIO_ERR_UNINI_DIG_WR
#define HWIO_ERR_UNINI_DIG_WR 0x02 |
◆ HWIO_ERR_UNINI_ANA_RD
#define HWIO_ERR_UNINI_ANA_RD 0x03 |
◆ HWIO_ERR_UNINI_ANA_WR
#define HWIO_ERR_UNINI_ANA_WR 0x04 |
◆ HWIO_ERR_UNDEF_DIG_RD
#define HWIO_ERR_UNDEF_DIG_RD 0x05 |
◆ HWIO_ERR_UNDEF_DIG_WR
#define HWIO_ERR_UNDEF_DIG_WR 0x06 |
◆ HWIO_ERR_UNDEF_ANA_RD
#define HWIO_ERR_UNDEF_ANA_RD 0x07 |
◆ HWIO_ERR_UNDEF_ANA_WR
#define HWIO_ERR_UNDEF_ANA_WR 0x08 |
◆ _DI_CNT
#define _DI_CNT (sizeof(_di_pin32) / sizeof(uint32_t)) |
◆ _DO_CNT
#define _DO_CNT (sizeof(_do_pin32) / sizeof(uint32_t)) |
◆ _ADC_CNT
#define _ADC_CNT (sizeof(_adc_pin32) / sizeof(uint32_t)) |
◆ _DAC_CNT
#define _DAC_CNT (sizeof(_dac_pin32) / sizeof(uint32_t)) |
◆ _FAN_ID_MIN
◆ _FAN_ID_MAX
◆ _FAN_CNT
◆ _HEATER_ID_MIN
◆ _HEATER_ID_MAX
◆ _HEATER_CNT
◆ _PWM_CNT
#define _PWM_CNT (sizeof(_pwm_pin32) / sizeof(uint32_t)) |
◆ Error_Handler()
This function is executed in case of error occurrence.
- Return values
-
◆ __pwm_set_val()
414 sConfigOC.
Pulse = val;
◆ _hwio_pwm_analogWrite_set_val()
void _hwio_pwm_analogWrite_set_val |
( |
int |
i_pwm, |
|
|
int |
val |
|
) |
| |
◆ _hwio_pwm_set_val()
void _hwio_pwm_set_val |
( |
int |
i_pwm, |
|
|
int |
val |
|
) |
| |
402 if ((chan == -1) || htim->
Instance == 0) {
◆ _pwm_get_chan()
uint32_t _pwm_get_chan |
( |
int |
i_pwm | ) |
|
◆ _pwm_get_htim()
◆ is_pwm_id_valid()
int is_pwm_id_valid |
( |
int |
i_pwm | ) |
|
271 return ((i_pwm >= 0) && (i_pwm <
_PWM_CNT));
◆ hwio_di_get_cnt()
int hwio_di_get_cnt |
( |
void |
| ) |
|
◆ hwio_di_get_val()
int hwio_di_get_val |
( |
int |
i_di | ) |
|
199 if ((i_di >= 0) && (i_di <
_DI_CNT))
◆ hwio_do_get_cnt()
int hwio_do_get_cnt |
( |
void |
| ) |
|
◆ hwio_do_get_val()
int hwio_do_get_val |
( |
int |
i_do | ) |
|
219 if ((i_do >= 0) && (i_do <
_DO_CNT))
◆ hwio_do_set_val()
void hwio_do_set_val |
( |
int |
i_do, |
|
|
int |
val |
|
) |
| |
226 if ((i_do >= 0) && (i_do <
_DO_CNT))
◆ hwio_adc_get_cnt()
int hwio_adc_get_cnt |
( |
void |
| ) |
|
◆ hwio_adc_get_max()
int hwio_adc_get_max |
( |
int |
i_adc | ) |
|
◆ hwio_adc_get_val()
int hwio_adc_get_val |
( |
int |
i_adc | ) |
|
248 if ((i_adc >= 0) && (i_adc <
_ADC_CNT))
◆ hwio_dac_get_cnt()
int hwio_dac_get_cnt |
( |
void |
| ) |
|
◆ hwio_dac_get_max()
int hwio_dac_get_max |
( |
int |
i_dac | ) |
|
◆ hwio_dac_set_val()
void hwio_dac_set_val |
( |
int |
i_dac, |
|
|
int |
val |
|
) |
| |
◆ hwio_pwm_get_cnt()
int hwio_pwm_get_cnt |
( |
void |
| ) |
|
◆ hwio_pwm_get_max()
int hwio_pwm_get_max |
( |
int |
i_pwm | ) |
|
◆ hwio_pwm_set_period_us()
void hwio_pwm_set_period_us |
( |
int |
i_pwm, |
|
|
int |
T_us |
|
) |
| |
292 if (T_us == *ptr_period_us)
298 *ptr_period_us = T_us;
◆ hwio_pwm_get_period_us()
int hwio_pwm_get_period_us |
( |
int |
i_pwm | ) |
|
◆ hwio_pwm_set_prescaler()
void hwio_pwm_set_prescaler |
( |
int |
i_pwm, |
|
|
int |
prescaler |
|
) |
| |
325 *ptr_period_us = T_us;
◆ hwio_pwm_get_prescaler()
int hwio_pwm_get_prescaler |
( |
int |
i_pwm | ) |
|
◆ hwio_pwm_set_prescaler_exp2()
void hwio_pwm_set_prescaler_exp2 |
( |
int |
i_pwm, |
|
|
int |
exp |
|
) |
| |
345 uint32_t prescaler = (1 << (exp)) - 1;
◆ hwio_pwm_get_prescaler_log2()
int hwio_pwm_get_prescaler_log2 |
( |
int |
i_pwm | ) |
|
356 while (prescaler != 0) {
358 prescaler = prescaler >> 1;
◆ hwio_pwm_set_val()
void hwio_pwm_set_val |
( |
int |
i_pwm, |
|
|
int |
val |
|
) |
| |
393 uint32_t pulse = (val * pwm_analogWrite_max) / pwm_max;
◆ hwio_fan_get_cnt()
int hwio_fan_get_cnt |
( |
void |
| ) |
|
◆ hwio_fan_set_pwm()
void hwio_fan_set_pwm |
( |
int |
i_fan, |
|
|
int |
val |
|
) |
| |
◆ hwio_heater_get_cnt()
int hwio_heater_get_cnt |
( |
void |
| ) |
|
◆ hwio_heater_set_pwm()
void hwio_heater_set_pwm |
( |
int |
i_heater, |
|
|
int |
val |
|
) |
| |
◆ hwio_jogwheel_enable()
◆ hwio_jogwheel_disable()
◆ hwio_beeper_get_vol()
float hwio_beeper_get_vol |
( |
void |
| ) |
|
◆ hwio_beeper_set_vol()
void hwio_beeper_set_vol |
( |
float |
vol | ) |
|
◆ hwio_beeper_set_pwm()
void hwio_beeper_set_pwm |
( |
uint32_t |
per, |
|
|
uint32_t |
pul |
|
) |
| |
502 sConfigOC.
Pulse = pul;
505 sConfigOC.
Pulse = per;
◆ hwio_beeper_tone()
void hwio_beeper_tone |
( |
float |
frq, |
|
|
uint32_t |
del |
|
) |
| |
523 per = (uint32_t)(84000000.0
F / frq);
◆ hwio_beeper_tone2()
void hwio_beeper_tone2 |
( |
float |
frq, |
|
|
uint32_t |
del, |
|
|
float |
vol |
|
) |
| |
◆ hwio_beeper_notone()
◆ hwio_update_1ms()
◆ adc_ready()
◆ adc_seq2idx()
554 { 4, 1, 4, 1, 4, 0, 4, 1, 4, 1, 4, 2, 4, 1, 4, 1, 4, 3 };
◆ hwio_arduino_error()
void hwio_arduino_error |
( |
int |
err, |
|
|
uint32_t |
pin32 |
|
) |
| |
570 strcat(text,
"HWIO error\n");
576 strcat(text,
"uninitialized\n");
582 strcat(text,
"undefined\n");
585 sprintf(text + strlen(text),
"pin #%u (0x%02x)\n", (
int)pin32, (
uint8_t)pin32);
591 strcat(text,
"digital ");
597 strcat(text,
"analog ");
605 strcat(text,
"read");
611 strcat(text,
"write");
◆ hwio_arduino_digitalRead()
int hwio_arduino_digitalRead |
( |
uint32_t |
ulPin | ) |
|
◆ hwio_arduino_digitalWrite()
void hwio_arduino_digitalWrite |
( |
uint32_t |
ulPin, |
|
|
uint32_t |
ulVal |
|
) |
| |
669 #ifdef SIM_HEATER_BED_ADC
673 #endif //SIM_HEATER_BED_ADC
678 #ifdef SIM_HEATER_NOZZLE_ADC
682 #endif //SIM_HEATER_NOZZLE_ADC
◆ hwio_arduino_digitalToggle()
void hwio_arduino_digitalToggle |
( |
uint32_t |
ulPin | ) |
|
◆ hwio_arduino_analogRead()
uint32_t hwio_arduino_analogRead |
( |
uint32_t |
ulPin | ) |
|
◆ hwio_arduino_analogWrite()
void hwio_arduino_analogWrite |
( |
uint32_t |
ulPin, |
|
|
uint32_t |
ulValue |
|
) |
| |
◆ hwio_arduino_pinMode()
void hwio_arduino_pinMode |
( |
uint32_t |
ulPin, |
|
|
uint32_t |
ulMode |
|
) |
| |
◆ HAL_GPIO_Initialized
◆ HAL_ADC_Initialized
◆ HAL_PWM_Initialized
◆ htim1
◆ htim2
◆ htim3
◆ _di_pin32
const uint32_t _di_pin32[] |
◆ _do_pin32
const uint32_t _do_pin32[] |
◆ _adc_pin32
const uint32_t _adc_pin32[] |
◆ _adc_max
const int _adc_max[] = { 4095, 4095, 4095, 4095, 4095 } |
◆ _adc_val
int _adc_val[] = { 0, 0, 0, 0, 0 } |
◆ _dac_pin32
const uint32_t _dac_pin32[] = {} |
◆ _dac_max
const int _dac_max[] = { 0 } |
◆ _tim1_period_us
◆ _tim3_period_us
◆ _pwm_pin32
const uint32_t _pwm_pin32[] |
◆ _pwm_chan
const uint32_t _pwm_chan[] |
◆ _pwm_p_htim
◆ _pwm_period_us
int* const _pwm_period_us[] |
◆ _pwm_max
◆ sConfigOC_default
◆ _pwm_analogWrite_max
const int _pwm_analogWrite_max[_PWM_CNT] = { 0xff, 0xff, 0xff, 0xff } |
◆ _pwm_analogWrite_val
int _pwm_analogWrite_val[_PWM_CNT] = { 0, 0, 0, 0 } |
◆ _fan_max
◆ _fan_val
◆ _heater_max
◆ _heater_val
◆ hwio_jogwheel_enabled
int hwio_jogwheel_enabled = 0 |
◆ hwio_beeper_vol
float hwio_beeper_vol = 1.0F |
◆ hwio_beeper_del
uint32_t hwio_beeper_del = 0 |
◆ adc_seq
const uint8_t adc_seq[18] = { 4, 1, 4, 1, 4, 0, 4, 1, 4, 1, 4, 2, 4, 1, 4, 1, 4, 3 } |
int is_pwm_id_valid(int i_pwm)
Definition: hwio_a3ides_2209_02.c:269
#define _DO_Z_STEP
Definition: hwio_a3ides.h:23
#define PIN_X_DIR
Definition: hwio_pindef.h:18
#define PIN_E_DIR
Definition: hwio_pindef.h:33
#define _DI_BTN_ENC
Definition: hwio_a3ides.h:14
#define PIN_E_ENABLE
Definition: hwio_pindef.h:35
int sim_motion_get_min_end(uint8_t axis)
#define PIN_FAN
Definition: hwio_pindef.h:39
#define _DI_X_DIAG
Definition: hwio_a3ides.h:12
#define PIN_TEMP_0
Definition: hwio_pindef.h:16
uint32_t Period
Definition: stm32f4xx_hal_tim.h:71
int HAL_PWM_Initialized
Definition: main.c:106
#define HWIO_PWM_HEATER_0
Definition: hwio_a3ides.h:55
#define TIM_OCNPOLARITY_HIGH
Definition: stm32f4xx_hal_tim.h:395
int _adc_val[]
Definition: hwio_a3ides_2209_02.c:85
HAL_StatusTypeDef HAL_TIM_Base_Init(TIM_HandleTypeDef *htim)
int sim_motion_get_diag(uint8_t axis)
const int _pwm_max[]
Definition: hwio_a3ides_2209_02.c:135
Definition: stm32f4xx_hal_def.h:57
void __pwm_set_val(TIM_HandleTypeDef *htim, uint32_t chan, int val)
Definition: hwio_a3ides_2209_02.c:408
#define PIN_Z_DIAG
Definition: hwio_pindef.h:31
void Error_Handler(void)
This function is executed in case of error occurrence.
Definition: main.c:1057
#define TIM_OCFAST_DISABLE
Definition: stm32f4xx_hal_tim.h:377
HAL_StatusTypeDef HAL_TIM_PWM_ConfigChannel(TIM_HandleTypeDef *htim, TIM_OC_InitTypeDef *sConfig, uint32_t Channel)
#define _DI_Z_MIN
Definition: hwio_a3ides.h:9
void hwio_beeper_tone(float frq, uint32_t del)
Definition: hwio_a3ides_2209_02.c:514
#define _DI_Y_DIAG
Definition: hwio_a3ides.h:11
const uint8_t adc_seq[18]
Definition: hwio_a3ides_2209_02.c:553
#define _PWM_CNT
Definition: hwio_a3ides_2209_02.c:136
void _hwio_pwm_analogWrite_set_val(int i_pwm, int val)
Definition: hwio_a3ides_2209_02.c:429
void hwio_do_set_val(int i_do, int val)
Definition: hwio_a3ides_2209_02.c:223
void app_error(void)
Definition: appmain.cpp:145
#define HWIO_ERR_UNDEF_ANA_RD
Definition: hwio_a3ides_2209_02.c:27
uint32_t ClockDivision
Definition: stm32f4xx_hal_tim.h:75
#define PIN_HEATER_0
Definition: hwio_pindef.h:14
#define _HEATER_ID_MAX
Definition: hwio_a3ides_2209_02.c:98
#define PIN_BTN_EN2
Definition: hwio_pindef.h:42
void hwio_pwm_set_val(int i_pwm, int val)
Definition: hwio_a3ides_2209_02.c:376
const uint32_t _do_pin32[]
Definition: hwio_a3ides_2209_02.c:57
#define _DO_Y_STEP
Definition: hwio_a3ides.h:28
#define HWIO_ERR_UNDEF_DIG_WR
Definition: hwio_a3ides_2209_02.c:26
int hwio_jogwheel_enabled
Definition: hwio_a3ides_2209_02.c:176
uint32_t OCPolarity
Definition: stm32f4xx_hal_tim.h:100
#define _DI_CNT
Definition: hwio_a3ides_2209_02.c:54
#define _ADC_TEMP_HEATBREAK
Definition: hwio_a3ides.h:36
int hwio_di_get_val(int i_di)
Definition: hwio_a3ides_2209_02.c:196
const int _adc_max[]
Definition: hwio_a3ides_2209_02.c:82
TIM_HandleTypeDef htim2
Definition: main.c:86
#define _HEATER_ID_MIN
Definition: hwio_a3ides_2209_02.c:97
#define TIM_OCIDLESTATE_RESET
Definition: stm32f4xx_hal_tim.h:405
uint32_t OCFastMode
Definition: stm32f4xx_hal_tim.h:107
#define _DO_X_STEP
Definition: hwio_a3ides.h:20
#define HWIO_ERR_UNDEF_ANA_WR
Definition: hwio_a3ides_2209_02.c:28
void sim_motion_set_dir(uint8_t axis, int state)
TIM_HandleTypeDef htim1
Definition: main.c:85
#define PIN_TEMP_BED
Definition: hwio_pindef.h:8
void hwio_beeper_set_pwm(uint32_t per, uint32_t pul)
Definition: hwio_a3ides_2209_02.c:491
uint32_t CounterMode
Definition: stm32f4xx_hal_tim.h:68
#define _ADC_CNT
Definition: hwio_a3ides_2209_02.c:83
#define _DO_Y_DIR
Definition: hwio_a3ides.h:27
int HAL_ADC_Initialized
Definition: main.c:105
#define TIM_OCMODE_PWM1
Definition: stm32f4xx_hal_tim.h:365
float hwio_beeper_vol
Definition: hwio_a3ides_2209_02.c:178
TIM Output Compare Configuration Structure definition.
Definition: stm32f4xx_hal_tim.h:92
#define F(str)
Definition: UHS_macros.h:164
#define TIM_CHANNEL_3
Definition: stm32f4xx_hal_tim.h:424
#define _DO_CNT
Definition: hwio_a3ides_2209_02.c:71
int HAL_GPIO_Initialized
Definition: main.c:104
int hwio_arduino_digitalRead(uint32_t ulPin)
Definition: hwio_a3ides_2209_02.c:619
#define _DI_BTN_EN2
Definition: hwio_a3ides.h:16
#define PIN_Z_MIN
Definition: hwio_pindef.h:11
#define HWIO_ERR_UNINI_DIG_WR
Definition: hwio_a3ides_2209_02.c:22
static int gpio_get(uint8_t pin8)
Definition: gpio.h:94
#define _DI_Z_DIAG
Definition: hwio_a3ides.h:13
#define TIM_CLOCKDIVISION_DIV1
Definition: stm32f4xx_hal_tim.h:351
#define HWIO_PWM_HEATER_BED
Definition: hwio_a3ides.h:54
#define PIN_HW_IDENTIFY
Definition: hwio_pindef.h:7
#define _DO_Z_DIR
Definition: hwio_a3ides.h:30
int _tim1_period_us
Definition: hwio_a3ides_2209_02.c:102
#define PIN_BTN_EN1
Definition: hwio_pindef.h:41
HAL_StatusTypeDef HAL_TIM_PWM_Start(TIM_HandleTypeDef *htim, uint32_t Channel)
#define PIN_BEEPER
Definition: hwio_pindef.h:6
void hwio_arduino_error(int err, uint32_t pin32)
Definition: hwio_a3ides_2209_02.c:565
#define _FAN_CNT
Definition: hwio_a3ides_2209_02.c:95
void sim_motion_set_ena(uint8_t axis, int state)
#define PIN_Z_ENABLE
Definition: hwio_pindef.h:30
int hwio_adc_get_val(int i_adc)
Definition: hwio_a3ides_2209_02.c:245
int hwio_do_get_val(int i_do)
Definition: hwio_a3ides_2209_02.c:216
#define PIN_Y_DIAG
Definition: hwio_pindef.h:26
void hwio_pwm_set_prescaler(int i_pwm, int prescaler)
Definition: hwio_a3ides_2209_02.c:306
#define _DO_Y_ENABLE
Definition: hwio_a3ides.h:29
void _hwio_pwm_set_val(int i_pwm, int val)
Definition: hwio_a3ides_2209_02.c:397
void sim_nozzle_set_power(float P)
Definition: sim_nozzle.c:57
void hwio_arduino_digitalWrite(uint32_t ulPin, uint32_t ulVal)
Definition: hwio_a3ides_2209_02.c:661
#define PIN_TEMP_HEATBREAK
Definition: hwio_pindef.h:10
void sim_motion_set_stp(uint8_t axis, int state)
#define HWIO_PWM_FAN1
Definition: hwio_a3ides.h:56
#define TIM_CHANNEL_2
Definition: stm32f4xx_hal_tim.h:423
uint32_t adc_val[ADC_CHAN_CNT]
Definition: adc.c:17
#define _HEATER_CNT
Definition: hwio_a3ides_2209_02.c:99
void sim_bed_set_power(float P)
Definition: sim_bed.c:51
#define TIM_CHANNEL_4
Definition: stm32f4xx_hal_tim.h:425
#define PIN_Z_STEP
Definition: hwio_pindef.h:29
#define TIM_OCNIDLESTATE_RESET
Definition: stm32f4xx_hal_tim.h:414
#define _DO_E_DIR
Definition: hwio_a3ides.h:24
TIM_TypeDef * Instance
Definition: stm32f4xx_hal_tim.h:289
#define _FAN_ID_MIN
Definition: hwio_a3ides_2209_02.c:93
#define TIM_COUNTERMODE_DOWN
Definition: stm32f4xx_hal_tim.h:340
#define TIM_CHANNEL_1
Definition: stm32f4xx_hal_tim.h:422
#define PIN_HEATER_BED
Definition: hwio_pindef.h:13
#define PIN_Y_STEP
Definition: hwio_pindef.h:24
const uint32_t _pwm_chan[]
Definition: hwio_a3ides_2209_02.c:113
int _tim3_period_us
Definition: hwio_a3ides_2209_02.c:103
const TIM_OC_InitTypeDef sConfigOC_default
Definition: hwio_a3ides_2209_02.c:138
#define PIN_Y_DIR
Definition: hwio_pindef.h:23
#define HWIO_PWM_FAN
Definition: hwio_a3ides.h:57
const uint8_t[]
Definition: 404_html.c:3
#define PIN_X_ENABLE
Definition: hwio_pindef.h:20
const int _dac_max[]
Definition: hwio_a3ides_2209_02.c:90
#define PIN_Y_ENABLE
Definition: hwio_pindef.h:25
uint32_t Prescaler
Definition: stm32f4xx_hal_tim.h:65
uint32_t _pwm_get_chan(int i_pwm)
Definition: hwio_a3ides_2209_02.c:363
#define _DO_X_ENABLE
Definition: hwio_a3ides.h:22
uint32_t Pulse
Definition: stm32f4xx_hal_tim.h:97
#define PIN_E_STEP
Definition: hwio_pindef.h:34
uint32_t OCMode
Definition: stm32f4xx_hal_tim.h:94
#define PIN_X_STEP
Definition: hwio_pindef.h:19
int _pwm_analogWrite_val[_PWM_CNT]
Definition: hwio_a3ides_2209_02.c:151
#define _FAN_ID_MAX
Definition: hwio_a3ides_2209_02.c:94
int hwio_pwm_get_max(int i_pwm)
Definition: hwio_a3ides_2209_02.c:276
#define PIN_THERM2
Definition: hwio_pindef.h:9
#define TIM_OCPOLARITY_HIGH
Definition: stm32f4xx_hal_tim.h:386
HAL_StatusTypeDef HAL_TIM_PWM_Stop(TIM_HandleTypeDef *htim, uint32_t Channel)
#define PIN_E_DIAG
Definition: hwio_pindef.h:36
uint32_t hwio_beeper_del
Definition: hwio_a3ides_2209_02.c:179
static void gpio_set(uint8_t pin8, int state)
Definition: gpio.h:98
#define TIM_OCPOLARITY_LOW
Definition: stm32f4xx_hal_tim.h:387
#define bsod(fmt,...)
Definition: bsod.h:20
TIM Time Base Handle Structure definition.
Definition: stm32f4xx_hal_tim.h:287
#define PIN_X_DIAG
Definition: hwio_pindef.h:21
#define _DO_Z_ENABLE
Definition: hwio_a3ides.h:21
#define _DAC_CNT
Definition: hwio_a3ides_2209_02.c:91
#define PIN_FAN1
Definition: hwio_pindef.h:38
TIM_HandleTypeDef htim3
Definition: main.c:87
TIM_Base_InitTypeDef Init
Definition: stm32f4xx_hal_tim.h:290
#define __HAL_TIM_GET_COMPARE(__HANDLE__, __CHANNEL__)
Gets the TIM Capture Compare Register value on runtime.
Definition: stm32f4xx_hal_tim.h:1132
#define _DO_E_STEP
Definition: hwio_a3ides.h:25
#define _ADC_TEMP_0
Definition: hwio_a3ides.h:37
int hwio_pwm_get_prescaler(int i_pwm)
Definition: hwio_a3ides_2209_02.c:327
#define HWIO_ERR_UNINI_DIG_RD
Definition: hwio_a3ides_2209_02.c:21
#define HWIO_ERR_UNINI_ANA_RD
Definition: hwio_a3ides_2209_02.c:23
const uint32_t _di_pin32[]
Definition: hwio_a3ides_2209_02.c:44
#define _ADC_TEMP_BED
Definition: hwio_a3ides.h:34
#define _DI_BTN_EN1
Definition: hwio_a3ides.h:15
#define PIN_Z_DIR
Definition: hwio_pindef.h:28
#define GEN_PERIOD_US(prescaler, period)
Definition: timer_defaults.h:16
#define __HAL_TIM_SET_PRESCALER(__HANDLE__, __PRESC__)
Set the TIM Prescaler on runtime.
Definition: stm32f4xx_hal_tim.h:1077
uint8_t adc_seq2idx(uint8_t seq)
Definition: hwio_a3ides_2209_02.c:554
uint32_t adc_sim_msk
Definition: adc.c:24
#define TIM_BASE_CLK_MHZ
Definition: timer_defaults.h:6
#define HWIO_ERR_UNINI_ANA_WR
Definition: hwio_a3ides_2209_02.c:24
#define HWIO_ERR_UNDEF_DIG_RD
Definition: hwio_a3ides_2209_02.c:25
TIM_HandleTypeDef * _pwm_get_htim(int i_pwm)
Definition: hwio_a3ides_2209_02.c:369
#define _DI_E_DIAG
Definition: hwio_a3ides.h:10
#define _DO_X_DIR
Definition: hwio_a3ides.h:19
#define PIN_BTN_ENC
Definition: hwio_pindef.h:40
#define _DO_E_ENABLE
Definition: hwio_a3ides.h:26
TIM_HandleTypeDef * _pwm_p_htim[]
Definition: hwio_a3ides_2209_02.c:120
const int _pwm_analogWrite_max[_PWM_CNT]
Definition: hwio_a3ides_2209_02.c:149
int *const _pwm_period_us[]
Definition: hwio_a3ides_2209_02.c:127
void hwio_beeper_set_vol(float vol)
Definition: hwio_a3ides_2209_02.c:483