Module atmega_hal::clock
source · Expand description
Core clock speed management
AVR microcontrollers support different core clock speeds. Peripheral drivers need to know about this speed to calculate timing parameters. To make this as efficient as possible, the clock speed is tracked as a compile-time constant. This means peripheral drivers can do compile-time calculation of timing parameters.
§How To Use
If you are using arduino-hal
, there is nothing you need to do - the core clock speed is
defined in arduino-hal
as arduino_hal::DefaultClock
and the const-generic parameters of all
peripheral drivers are preset to this value.
If you are using a MCU HAL like atmega-hal
or attiny-hal
, you need to take care of clock
speed management manually. The best way to do this is as follows:
Structs§
- 1 MHz Clock
- 8 MHz Clock
- 10 MHz Clock
- 12 MHz Clock
- 16 MHz Clock
- 20 MHz Clock
- 24 MHz Clock
Traits§
- A clock speed