Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Peripheral register definitions #7

Closed
esaulenka opened this issue Jun 10, 2019 · 2 comments
Closed

Peripheral register definitions #7

esaulenka opened this issue Jun 10, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@esaulenka
Copy link

esaulenka commented Jun 10, 2019

Please add register definitions for supported MCUs.

For example, it can be converted from XML files (I found it here: https://github.com/Hailong89/K2SAR_EMS/tree/master/02_Build/01_Compile/01_Tasking_4p3/cpcp/include/sfr ) with this simplest script:

#!/usr/bin/python

import xml.etree.ElementTree as ET

# output
#       <!-- I2C Registers -->
#           <symbol name = "I2CIFG"  address = "RAM:0051"    entry = "false"/>

root = ET.parse('regtc1724.xml').getroot()

for group in root.iter('{http://www.tasking.com/schema/sfrfile/v1.0}group'):
    group_name = group.get('name')
    group_desc = group.get('description')
    if not group_desc: group_desc = ''

    # print group.tag, group.attrib, group_name
    print '\t\t<!-- %s %s -->' % (group_name, group_desc)

    for sfr in group.iter('{http://www.tasking.com/schema/sfrfile/v1.0}sfr'):
        # print sfr.tag, sfr.attrib
        name = sfr.get('name')
        addr = sfr.get('address')
        desc = sfr.get('description')

        print '\t\t\t<symbol name = "%s"\taddress = "%s"\tentry = "false"/>' % (name, addr)

@esaulenka esaulenka added the enhancement New feature or request label Jun 10, 2019
@esaulenka esaulenka changed the title Peritheral register definitions Peripheral register definitions Jun 10, 2019
@mumbel
Copy link
Owner

mumbel commented Jun 10, 2019

That's awesome, will look into it soon

@mumbel
Copy link
Owner

mumbel commented Jun 10, 2019

@esaulenka I didnt add the low address values since those are in the .sinc file, may need to look into that later. but for now hopefully this is what you were looking for, those files are great, thanks for the link to them.
cde75b5

@mumbel mumbel closed this as completed Jun 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants