From 2490b24a1ced7372e4462c60802748e426901da1 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Tue, 8 May 2018 16:21:33 +0200 Subject: Add notes, rename gpio class to gpio_pin and rename led variables --- hal/hwconfig.cpp | 24 ++++++++++++++++++++++-- hal/pin.hpp | 10 ++++++---- 2 files changed, 28 insertions(+), 6 deletions(-) (limited to 'hal') diff --git a/hal/hwconfig.cpp b/hal/hwconfig.cpp index f443f59..1f4cdff 100644 --- a/hal/hwconfig.cpp +++ b/hal/hwconfig.cpp @@ -24,12 +24,32 @@ void hw::regunlock() void osc::initialize() { hw::regunlock(); - // CF no clock failure; COSC FRCDIV; PLLODIV DIV_256; UFRCEN disabled; PBDIVRDY disabled; SLOCK out of lock; FRCDIV FRC/1; SLPEN Idle on WAIT instruction; NOSC FRCDIV; PLLMULT MUL_24; SOSCEN disabled; PBDIV DIV_8; CLKLOCK unlocked; OSWEN Switch is Complete; SOSCRDY disabled; + // CF no clock failure; + // COSC FRCDIV; + // PLLODIV DIV_256; + // UFRCEN disabled; + // PBDIVRDY disabled; + // SLOCK out of lock; + // FRCDIV FRC/1; + // SLPEN Idle on WAIT instruction; + // NOSC FRCDIV; PLLMULT MUL_24; + // SOSCEN disabled; + // PBDIV DIV_8; + // CLKLOCK unlocked; + // OSWEN Switch is Complete; + // SOSCRDY disabled; OSCCON = 0x381F7700; hw::reglock(); // TUN Center Frequency; OSCTUN = 0x0; - // DIVSWEN disabled; RSLP disabled; ACTIVE Active; ROSEL SYSCLK; OE Not Driven out on REFCLKO pin; SIDL disabled; RODIV 0; ON disabled; + // DIVSWEN disabled; + // RSLP disabled; + // ACTIVE Active; + // ROSEL SYSCLK; + // OE Not Driven out on REFCLKO pin; + // SIDL disabled; + // RODIV 0; + // ON disabled; REFOCON = 0x100; // ROTRIM 0; REFOTRIM = 0x0; diff --git a/hal/pin.hpp b/hal/pin.hpp index ab9d3ad..13e9a52 100644 --- a/hal/pin.hpp +++ b/hal/pin.hpp @@ -8,14 +8,16 @@ #ifndef PIN_HPP #define PIN_HPP +#include + extern "C" { #include } -class gpio +class gpio_pin { public: - virtual ~gpio() {} + virtual ~gpio_pin() {} // digital mode methods virtual void set_mode(unsigned m) = 0; @@ -31,11 +33,11 @@ public: // TODO: analog mode methods protected: - gpio() {} + gpio_pin() {} }; template -class io_pin : public gpio { +class io_pin : public gpio_pin { public: enum class mode : unsigned { INPUT = 1, OUTPUT = 0 }; -- cgit v1.2.1