Prusa-MMU-Private
PrusaMultiMaterialUpgradev3firmwareforMK3SMK4
src
hal
timers.h
Go to the documentation of this file.
1
#pragma once
3
#include <avr/io.h>
4
5
#define TIMER0 ((hal::timers::Tim8bit_TypeDef *)&TCCR0A)
6
namespace
hal {
7
9
namespace
timers {
10
11
// void ConfigureTimer(uint8_t timer /* some config struct */);
12
// void StartTimer(uint8_t timer);
13
// void StopTimer(uint8_t timer);
14
15
struct
Tim8bit_TypeDef
{
16
volatile
uint8_t TCCRxA;
17
volatile
uint8_t TCCRxB;
18
volatile
uint8_t TCNTx;
19
volatile
uint8_t OCRxA;
20
volatile
uint8_t OCRxB;
21
};
22
23
static
volatile
uint8_t *
const
TIFR = &TIFR0;
24
static
volatile
uint8_t *
const
TIMSK = &TIMSK0;
25
26
struct
Tim8bit_CTC_config
{
27
uint8_t cs : 3;
28
uint8_t
ocra
;
29
};
30
31
void
Configure_CTC8(
const
uint8_t timer,
Tim8bit_TypeDef
*
const
htim8,
Tim8bit_CTC_config
*
const
conf);
32
33
}
// namespace cpu
34
}
// namespace hal
hal::timers::Tim8bit_CTC_config
Definition:
timers.h:26
hal::timers::Tim8bit_CTC_config::ocra
uint8_t ocra
clock source as per datasheet. It is not consistent between timer types
Definition:
timers.h:28
hal::timers::Tim8bit_TypeDef
Definition:
timers.h:15
Generated by
1.9.1