Skip to content

Allow STM32/STM32F1 pins to be set as Open Drain (OD) #27616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Marlin/src/HAL/STM32/fastio.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ void FastIO_init(); // Must be called before using fast io macros
#define SET_INPUT_PULLUP(IO) _SET_MODE(IO, INPUT_PULLUP) //!< Input with Pull-up activation
#define SET_INPUT_PULLDOWN(IO) _SET_MODE(IO, INPUT_PULLDOWN) //!< Input with Pull-down activation
#define SET_OUTPUT(IO) OUT_WRITE(IO, LOW)
#define SET_OUTPUT_OD(IO) OUT_WRITE_OD(IO, LOW)
#define SET_PWM(IO) _SET_MODE(IO, PWM)

#define IS_INPUT(IO)
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/HAL/STM32F1/fastio.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#define SET_INPUT_PULLUP(IO) _SET_MODE(IO, GPIO_INPUT_PU)
#define SET_INPUT_PULLDOWN(IO) _SET_MODE(IO, GPIO_INPUT_PD)
#define SET_OUTPUT(IO) OUT_WRITE(IO, LOW)
#define SET_OUTPUT_OD(IO) OUT_WRITE_OD(IO, LOW)
#define SET_PWM(IO) pinMode(IO, PWM) // do{ gpio_set_mode(PIN_MAP[pin].gpio_device, PIN_MAP[pin].gpio_bit, GPIO_AF_OUTPUT_PP); timer_set_mode(PIN_MAP[pin].timer_device, PIN_MAP[pin].timer_channel, TIMER_PWM); }while(0)
#define SET_PWM_OD(IO) pinMode(IO, PWM_OPEN_DRAIN)

Expand Down
Loading