Prusa MINI Firmware overview
|
Go to the documentation of this file.
7 #define PIN_HW_IDENTIFY PA3
8 #define PIN_TEMP_BED PA4
10 #define PIN_TEMP_HEATBREAK PA6
13 #define PIN_HEATER_BED PB0
14 #define PIN_HEATER_0 PB1
16 #define PIN_TEMP_0 PC0
19 #define PIN_X_STEP PD1
20 #define PIN_X_ENABLE PD3
21 #define PIN_X_DIAG PE2
23 #define PIN_Y_DIR PD12
24 #define PIN_Y_STEP PD13
25 #define PIN_Y_ENABLE PD14
26 #define PIN_Y_DIAG PE1
28 #define PIN_Z_DIR PD15
29 #define PIN_Z_STEP PD4
30 #define PIN_Z_ENABLE PD2
31 #define PIN_Z_DIAG PE3
34 #define PIN_E_STEP PD9
35 #define PIN_E_ENABLE PD10
36 #define PIN_E_DIAG PA15
40 #define PIN_BTN_ENC PE12
41 #define PIN_BTN_EN1 PE13
42 #define PIN_BTN_EN2 PE15
44 #define PIN_FSENSOR PB4
46 #endif //_HWIO_PINDEF_H
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
int hwio_adc_get_cnt(void)
Definition: hwio_a3ides_2209_02.c:239
#define _DI_BTN_ENC
Definition: hwio_a3ides.h:14
int * _fan_val
Definition: hwio_a3ides_2209_02.c:156
#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
int * _heater_val
Definition: hwio_a3ides_2209_02.c:161
#define HWIO_PWM_HEATER_0
Definition: hwio_a3ides.h:55
void hwio_pwm_set_prescaler_exp2(int i_pwm, int exp)
Definition: hwio_a3ides_2209_02.c:343
#define TIM_OCNPOLARITY_HIGH
Definition: stm32f4xx_hal_tim.h:395
const int * _heater_max
Definition: hwio_a3ides_2209_02.c:159
int _adc_val[]
Definition: hwio_a3ides_2209_02.c:85
HAL_StatusTypeDef HAL_TIM_Base_Init(TIM_HandleTypeDef *htim)
void hwio_beeper_notone(void)
Definition: hwio_a3ides_2209_02.c:535
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_arduino_digitalToggle(uint32_t ulPin)
Definition: hwio_a3ides_2209_02.c:774
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
int hwio_adc_get_max(int i_adc)
Definition: hwio_a3ides_2209_02.c:242
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
#define HWIO_ERR_UNDEF_ANA_RD
Definition: hwio_a3ides_2209_02.c:27
uint32_t ClockDivision
Definition: stm32f4xx_hal_tim.h:75
void hwio_fan_set_pwm(int i_fan, int val)
Definition: hwio_a3ides_2209_02.c:447
#define PIN_HEATER_0
Definition: hwio_pindef.h:14
#define _HEATER_ID_MAX
Definition: hwio_a3ides_2209_02.c:98
void hwio_update_1ms(void)
Definition: hwio_a3ides_2209_02.c:539
#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
int hwio_dac_get_cnt(void)
Definition: hwio_a3ides_2209_02.c:256
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
int hwio_pwm_get_period_us(int i_pwm)
Definition: hwio_a3ides_2209_02.c:300
void hwio_heater_set_pwm(int i_heater, int val)
Definition: hwio_a3ides_2209_02.c:459
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
void hwio_dac_set_val(int i_dac, int val)
Definition: hwio_a3ides_2209_02.c:262
#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
void adc_ready(uint8_t index)
Definition: hwio_a3ides_2209_02.c:548
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
void hwio_beeper_tone2(float frq, uint32_t del, float vol)
Definition: hwio_a3ides_2209_02.c:530
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
int hwio_pwm_get_prescaler_log2(int i_pwm)
Definition: hwio_a3ides_2209_02.c:349
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
void hwio_jogwheel_disable(void)
Definition: hwio_a3ides_2209_02.c:472
#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
void hwio_pwm_set_period_us(int i_pwm, int T_us)
Definition: hwio_a3ides_2209_02.c:285
#define PIN_Z_STEP
Definition: hwio_pindef.h:29
int hwio_di_get_cnt(void)
Definition: hwio_a3ides_2209_02.c:193
#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 TIM3_default_Period
Definition: timer_defaults.h:13
int hwio_dac_get_max(int i_dac)
Definition: hwio_a3ides_2209_02.c:259
int hwio_heater_get_cnt(void)
Definition: hwio_a3ides_2209_02.c:456
#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
const uint32_t _dac_pin32[]
Definition: hwio_a3ides_2209_02.c:88
#define TIM1_default_Period
Definition: timer_defaults.h:11
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
#define TIM3_default_Prescaler
Definition: timer_defaults.h:12
uint32_t OCMode
Definition: stm32f4xx_hal_tim.h:94
float hwio_beeper_get_vol(void)
Definition: hwio_a3ides_2209_02.c:479
#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
void hwio_arduino_analogWrite(uint32_t ulPin, uint32_t ulValue)
Definition: hwio_a3ides_2209_02.c:796
int hwio_pwm_get_max(int i_pwm)
Definition: hwio_a3ides_2209_02.c:276
void hwio_arduino_pinMode(uint32_t ulPin, uint32_t ulMode)
Definition: hwio_a3ides_2209_02.c:820
This file contains all the functions prototypes for the HAL module driver.
#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
int hwio_fan_get_cnt(void)
Definition: hwio_a3ides_2209_02.c:444
#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
const int * _fan_max
Definition: hwio_a3ides_2209_02.c:154
#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
int hwio_pwm_get_cnt(void)
Definition: hwio_a3ides_2209_02.c:273
#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
const uint32_t _adc_pin32[]
Definition: hwio_a3ides_2209_02.c:74
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 TIM1_default_Prescaler
Definition: timer_defaults.h:10
#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
Header of cmsis_os.c A new set of APIs are added in addition to existing ones, these APIs are specifi...
void hwio_jogwheel_enable(void)
Definition: hwio_a3ides_2209_02.c:468
#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 hwio_do_get_cnt(void)
Definition: hwio_a3ides_2209_02.c:213
uint32_t hwio_arduino_analogRead(uint32_t ulPin)
Definition: hwio_a3ides_2209_02.c:779
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
const uint32_t _pwm_pin32[]
Definition: hwio_a3ides_2209_02.c:106