Comments (2)
I'm working on this, soon to release first mwp pr.
from modm.
For any AVR timer code you would implement a new lbuild module in modm/src/modm/platform/timer/avr/
similar (but less complicated) to the existing stm32 timer implementation including Timer instances as submodules (modm:platform:timer:1
etc).
You will want to check the modm-devices AVR data for device specific instances and type of peripheral.
You would limit the module to AVR platforms only, or even further to only the few devices that you want to support, by returning True or False in the module’s prepare step:
def prepare(module, options):
device = options[":target"]
if not device.has_driver("tc:tc*"):
return False
if device.identifier.string not in ["atmega328p", "atmega32u4", "atmega2560"]:
return False
return True
Make sure to provide at least one example for these devices using this timer, otherwise your code may never be compiled on the CI.
As far as the actual C++ API is concerned, modm doesn’t have an interface for Timers, since we’ve always used them for motor control and that application has always been very specific to the hardware. So for the STM32 timers we’ve created a STM32-specific abstraction, which may not be very useful for AVRs. So don’t feel like you need to provide the same interface, if you’ve found something better. For simple use-cases like PWM an architecture interface would be nice to have though.
Just open a PR and we and the CI can guide you along.
from modm.
Related Issues (20)
- [fiber] multi stack size ? HOT 5
- SAMD51/SAME5x cache not enabled? HOT 5
- STM32G0B1 currently black listed HOT 2
- Placement of data section in wrong memory for STM32H7 HOT 1
- Segmentation fault when building documentation files HOT 3
- Heap not implemented. HOT 6
- Most UART drivers don't implement the full `modm::Uart` interface
- External interrupt causes immediate reset on Arduino Mega 2560 HOT 1
- STM32H7 Flash Support? HOT 5
- vscode json generation HOT 2
- CI docs all job is broken
- Docs Page, Search Function is Intermittent? HOT 6
- OpenOCD cannot configure TPIU/SWO on STM32H7 HOT 5
- Error when trying to compile example on M1 mac HOT 2
- Using SPI on Linux/Darwin target HOT 3
- CMake usage in recommended project structure HOT 3
- lbuild fails when relative paths are on different Windows drives HOT 1
- Fibers not implemented on ARM64
- CI Failling in a apprently nor related point HOT 2
- Documentation / example for "safely" accessible flash HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modm.