Prusa MINI Firmware overview
|
Go to the documentation of this file.
29 #ifdef BOARD_NR_GPIO_PINS // Only in STM32GENERIC (Maple)
32 #include "../HAL_STM32F1/fastio.h"
33 #elif defined(STM32F4) || defined(STM32F7)
34 #include "../HAL_STM32_F4_F7/fastio.h"
39 extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS];
41 #define NUM_DIGITAL_PINS BOARD_NR_GPIO_PINS
42 #define NUMBER_PINS_TOTAL BOARD_NR_GPIO_PINS
43 #define VALID_PIN(pin) (pin >= 0 && pin < BOARD_NR_GPIO_PINS)
44 #define GET_ARRAY_PIN(p) pin_t(pin_array[p].pin)
45 #define pwm_status(pin) PWM_PIN(pin)
46 #define digitalRead_mod(p) extDigitalRead(p)
47 #define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3hd "), int16_t(p)); SERIAL_ECHO(buffer); }while(0)
48 #define PRINT_PORT(p) print_port(p)
49 #define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
50 #define MULTI_NAME_PAD 21 // space needed to be pretty if not first name assigned to a pin
53 #ifndef M43_NEVER_TOUCH
54 #define M43_NEVER_TOUCH(Q) (Q >= 9 && Q <= 12) // SERIAL/USB pins PA9(TX) PA10(RX)
63 int8_t adc_channel = int8_t(PIN_MAP[pin].adc_channel);
64 #ifdef NUM_ANALOG_INPUTS
67 return pin_t(adc_channel);
72 if (PIN_MAP[pin].adc_channel != ADCx) {
73 #ifdef NUM_ANALOG_INPUTS
94 #include "../../inc/MarlinConfig.h"
98 timer_dev *
const tdev = PIN_MAP[pin].timer_device;
99 const uint8_t channel = PIN_MAP[pin].timer_channel;
101 #if defined(STM32_HIGH_DENSITY) || defined(STM32_XL_DENSITY)
102 tdev == &timer8 ?
'8' :
103 tdev == &timer5 ?
'5' :
105 tdev == &timer4 ?
'4' :
106 tdev == &timer3 ?
'3' :
107 tdev == &timer2 ?
'2' :
108 tdev == &timer1 ?
'1' :
'?'
111 sprintf_P(buffer,
PSTR(
" TIM%c CH%c"), num, (
'0' + channel));
117 const char port =
'A' + char(pin >> 4);
118 const int16_t gbit = PIN_MAP[pin].gpio_bit;
125 #endif // BOARD_NR_GPIO_PINS
#define SERIAL_CHAR(x)
Definition: serial.h:69
#define SERIAL_ECHO(x)
Definition: serial.h:70
int8_t get_pin_mode(pin_t pin)
Definition: pinsDebug.h:44
#define IS_ANALOG(P)
Definition: pinsDebug.h:59
void pwm_details(int32_t pin)
Definition: pinsDebug.h:47
int8_t DIGITAL_PIN_TO_ANALOG_PIN(const pin_t p)
#define sprintf_P(s,...)
Definition: pgmspace.h:72
bool PWM_PIN(const pin_t p)
int8_t pin_t
Definition: HAL.h:65
#define PSTR(str)
Definition: pgmspace.h:31
bool GET_PINMODE(int8_t pin)
Definition: pinsDebug.h:49
#define M43_NEVER_TOUCH(Q)
Definition: pinsDebug.h:39
const uint8_t[]
Definition: 404_html.c:3
constexpr uint8_t NUM_ANALOG_INPUTS
Definition: pinmapping.h:33
#define IS_INPUT(IO)
Definition: fastio.h:105
bool VALID_PIN(const pin_t p)
#define _GET_MODE(IO)
Definition: fastio.h:64
void print_port(int8_t pin)
Definition: pinsDebug.h:362
#define GET_ARRAY_PIN(p)
Definition: pinsDebug.h:61
bool GET_ARRAY_IS_DIGITAL(pin_t pin)
Definition: pinsDebug.h:57