From 8506b6ad39878cd5a67a37cffed28792b24b5cfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kn=C3=BCttel?= Date: Wed, 10 Apr 2019 11:45:10 +0200 Subject: [PATCH] added driver for one inverting charge pump --- analogout.c | 13 +++++++++++++ analogout.h | 7 +++++++ 2 files changed, 20 insertions(+) create mode 100644 analogout.c create mode 100644 analogout.h diff --git a/analogout.c b/analogout.c new file mode 100644 index 0000000..f78a8eb --- /dev/null +++ b/analogout.c @@ -0,0 +1,13 @@ +#include "analogout.h" +#include + +void +analogout_init(void) +{ + DDRD |= _BV(PD5); + TCCR0A = _BV(COM0B1) | _BV(WGM01) | _BV(WGM00); + TCCR0B = _BV(CS00); + OCR0B = 0xff / 2; +} + + diff --git a/analogout.h b/analogout.h new file mode 100644 index 0000000..0fbcac9 --- /dev/null +++ b/analogout.h @@ -0,0 +1,7 @@ +#ifndef _ANALOGOUT_H_ +#define _ANALOGOUT_H_ + +void +analogout_init(void); + +#endif