GlobLib
HAL and API libraries for MCUs and hardware.
|
This module contains low level functions modifying clock parameters. More...
Files | |
file | attiny13a_clock.h |
Header file for attiny13a CLOCK. | |
Macros | |
#define | CLOCK_BASE 9.6e6 |
Maximum clock speed for internal RC oscillator. | |
#define | CLOCK_DIV_64 F_CPU/64 |
Clock speed divided by 64. | |
#define | CLOCK_DIV_1024 F_CPU/1024 |
Clock speed divided by 1024. | |
Functions | |
uint32_t | CLOCK_getSpeed (void) |
Get the current clock speed of the device. More... | |
uint8_t | CLOCK_getSpeedAlternate (void) |
Get the current clock divisor. More... | |
This module contains low level functions modifying clock parameters.
There are four options for clock speeds on the ATTiny13A using the internal RC oscillator. This speed is set by CLOCK parameter in the ** Makefile **. Although it is possible to adjust the clock speed using software. This module doesn't include this function.
The four available clock speeds are
Note that lower clock speeds result in lower power consumption.
Clock speeds have effects on the following modules:
Their documentation details the effects.
uint32_t CLOCK_getSpeed | ( | void | ) |
Get the current clock speed of the device.
Definition at line 19 of file attiny13a_clock.c.
uint8_t CLOCK_getSpeedAlternate | ( | void | ) |
Get the current clock divisor.
This can be used to return the clock divisor for division in the main application.
A sample usage of this application is in delayms() of attiny13a_core.h
Definition at line 26 of file attiny13a_clock.c.