ME 507 Romi++
Cylindrical Differential Drive Robot created for ME 507 at Cal Poly in Spring 2025
|
Utility functions for microsecond-level timing. More...
#include <stm32f4xx_hal.h>
#include <stdint.h>
Go to the source code of this file.
Functions | |
uint32_t | micros (void) |
Returns the number of microseconds since the timer started. | |
void | delay_us (uint32_t us) |
Delays execution for a specified number of microseconds. |
Utility functions for microsecond-level timing.
Provides lightweight timing utilities based on hardware timers, useful for precise control loop execution and delay functions.
void delay_us | ( | uint32_t | us | ) |
Delays execution for a specified number of microseconds.
us | Delay duration in microseconds. |
Delays execution for a specified number of microseconds.
us | Number of microseconds to delay. |
Uses a busy-wait loop based on the micros() counter.
uint32_t micros | ( | void | ) |
Returns the number of microseconds since the timer started.
Returns the number of microseconds since the timer started.
Reads the current counter value from the TIM2 peripheral.