GitHub | 您所在的位置:网站首页 › halpp意思 › GitHub |
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 #include #include int main() { hal::init(); hal::afio.enable(); #if defined(STM32F407) hal::port.enable(); hal::port.enable(); auto pin = hal::port.get_pin(1); auto int_pin = hal::port.get_pin(4); #else hal::port.enable(); auto pin = hal::port.get_pin(0); auto int_pin = hal::port.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); } |
CopyRight 2018-2019 实验室设备网 版权所有 |