Skip to content
/ halpp Public

C++ hardware abstraction library for stm32

Notifications You must be signed in to change notification settings

E63T/halpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

halpp

Just another C++ hardware abstraction Layer 😅

⚠️ Needs adaptation to std::hardware design and Silica

⚠️ Experimental, use at your own risk.

Feature status

  • ❌ - Broken or not implemented
  • ❓ - Not tested
  • ✅ - Works
Target F030 F042 F103 F401 F405 F407 F429 ATmega328p
Compiles
Blinks LED
Delay works
Interrupts

Example

#include <halpp/gpio.hpp>
#include <halpp/systick.hpp>
#include <halpp/interrupt.hpp>


int main()
{
   hal::init();
   hal::afio.enable();
   #if defined(STM32F407)
      hal::port<'D'>.enable();
      hal::port<'E'>.enable();
      auto pin = hal::port<'D'>.get_pin(1);
      auto int_pin = hal::port<'E'>.get_pin(4);
   #else
      hal::port<'A'>.enable();
      auto pin = hal::port<'A'>.get_pin(0);
      auto int_pin = hal::port<'A'>.get_pin(5);
   #endif

   pin->mode(hal::pin_mode::OUTPUT_50M);
   pin->reset();
   int_pin->mode(hal::pin_mode::INPUT);
   int_pin->interrupt(hal::FALLING, [&pin](){
      pin->toggle();
   });

   while(1);
}

About

C++ hardware abstraction library for stm32

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages