Rahix / avr-device

Register access crate for AVR microcontrollers
Apache License 2.0
170 stars 66 forks source link

Add support for more devices #68

Closed MarkuBu closed 3 years ago

MarkuBu commented 3 years ago

Hi, because I want to use avr-device and avr-hal for some projects I need more supported devices. I want to add devices, beginning with "classic" ATmegas like ATmega16 and 32, ATmega2561 and some others.

Any requirements, guidelines or suggestions before I start?

Rahix commented 3 years ago

Well, I don't have much to say ... There is a guide for adding new MCUs here: https://github.com/Rahix/avr-device#adding-a-new-chip

If you have any questions, please don't hesitate asking!

kolbma commented 3 years ago

@Rahix I try to add support for ATmega169P. What I don't understand at the moment is when/why do I have to patch anything? I see that maybe the enum values needs a rustified name. Can you point out the other problems? Or is there already some documentation about this? Thx

Rahix commented 3 years ago

Patching is necessary because the ATDF files often contain low-quality or plainly wrong information. As a few examples:

Just look through the patches in patch/common/ to get an idea.

I should note that of course we don't need to get everything right from the get-go. Ideally, when adding initial support, look through the common patches and apply all of them which are relevant for your new MCU as well. Anything else can be fixed later, when it comes up during HAL implementation.

Rahix commented 3 years ago

Going to close this issue as there is no clear actionable task here. Please open new issues (or even better: pull requests) for specific chips to be supported.