GlobLib
HAL and API libraries for MCUs and hardware.
|
Header file for attiny13a timers. More...
#include "attiny13a_gpio.h"
#include "attiny13a_debug.h"
#include "attiny13a_clock.h"
#include <stdint.h>
Go to the source code of this file.
Macros | |
#define | IC_PIN PIN4 |
Pin used for input capture. | |
Enumerations |
Functions | |
mcu_error | TIMER_setupCount (timer_main timerNumber, uint16_t frequency, void(*handler)(void)) |
Initialize given timer for standard count with interrupt trigging the function handler on timeout. More... | |
mcu_error | TIMER_setupIC (timer_main timerNumber, timer_channel timerChannel) |
Initialize given timer for input capture. More... | |
mcu_error | TIMER_setupPWM (timer_main timerNumber, timer_channel timerChannel, uint16_t frequency, uint8_t duty) |
Initialize given timer for PWM mode. More... | |
mcu_error | TIMER_setupPulse (timer_main timerNumber, timer_channel timerChannel, uint16_t frequency, uint16_t pulse) |
Initialize given timer for Pulse mode. More... | |
mcu_error | TIMER_setPeriod (timer_main timerNumber, uint32_t period) |
Set the period for the timer. (in microseconds) More... | |
mcu_error | TIMER_setFrequency (timer_main timerNumber, uint16_t frequency) |
Set the frequency for the timer. (in hertz) More... | |
mcu_error | TIMER_setDuty (timer_main timerNumber, timer_channel channel, uint8_t duty) |
Set the duty cycle for the waveform (PWM only, 0 - 100%). More... | |
mcu_error | TIMER_setPulse (timer_main timerNumber, timer_channel channel, uint16_t pulse) |
Set the pulse width for the output. (in milliseconds) More... | |
uint8_t | TIMER_getCount (timer_main timerNumber) |
Get the current value of a running timer. More... | |
mcu_error | TIMER_setCount (timer_main timerNumber, uint8_t count) |
Set the current value of a running timer. More... | |
uint16_t | TIMER_getIC (timer_main timerNumber, timer_channel channel) |
Get the last input capture time from a channel of a timer. More... | |
mcu_error | TIMER_enableISR (timer_main timerNumber, void(*handler)(void)) |
Set the ISR target for timeout. More... | |
mcu_error | TIMER_disableISR (timer_main timerNumber) |
Disable the timeout IRQ. More... | |
mcu_error | TIMER_pause (timer_main timerNumber) |
Pause an already running timer. More... | |
mcu_error | TIMER_resume (timer_main timerNumber) |
Resume a paused timer. More... | |
Header file for attiny13a timers.
Definition in file attiny13a_timer.h.