free-pdk / pdk-includes

Device Include files for Padauk MCUs
GNU General Public License v2.0
10 stars 8 forks source link

How to add a new device? #12

Closed silbe closed 1 year ago

silbe commented 1 year ago

I'm considering adding support for PFC161. For peripherals this should be straightforward; I can look up the register definitions in the datasheet, add them to the device-specific header and if necessary modify the common peripheral headers. But what about code options? Where do you find the values for those?

Also is there anything else to consider when adding support for a new device?

serisman commented 1 year ago

Unfortunately, there isn't an easy way to add new devices. It involves a lot of comparing of datasheets and Padauk .INC files.

I did start working on a ripper a while ago (https://github.com/serisman/pdk-device-json) that might make it easier to auto-generate these files in the future, but so far it only creates .json files from Padauk .INC files.

I'll take a stab at adding support for the PFC161 for you later today.

serisman commented 1 year ago

I added preliminary support for PFC161 to the new-ics branch. (It doesn't have the touch peripheral yet).

I don't have any of these ICs to test and make sure things are working, so you're on your own there.

I would appreciate if someone could read a blank/unprogrammed IC and report back the values from 0x7E0 - 0x7FF. This would help allow me to verify the default value for USE and that the values I used for FACTORY_IHRCR_ADDR and FACTORY_BGTR_ADDR seem correct.

serisman commented 1 year ago

I have added a Touch peripheral now as well.

serisman commented 1 year ago

Support for this (PFC161) will get merged up along with Pull Request: https://github.com/free-pdk/pdk-includes/pull/13

serisman commented 1 year ago

@silbe - were you able to pull down the new-ics branch and see if these new include files work for you?

serisman commented 1 year ago

I merged PR #13, so support for PFC161 should be there now.