Search found 2 matches

by dusan82
Tue Nov 07, 2023 9:51 am
Forum: General discussion
Topic: What is the fastest way to change pin mode from INPUT_PULLUP to OUTPUT and back
Replies: 3
Views: 4110

What is the fastest way to change pin mode from INPUT_PULLUP to OUTPUT and back

I need to change pin mode on PB6 and PB7 fast on STM32F103. Originally I was using: pinMode(PB6, INPUT_PULLUP); ... pinMode(PB6, OUTPUT); Then I extracted minimal code from pinMode function: void pin_function_fast(PinName pin, int function) { uint32_t mode = function == INPUT ? 0 : 1; // STM_PIN_FUN...

Go to advanced search