Skip to content

Add pin mapping code. #310

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

Merged
merged 1 commit into from
Feb 19, 2014
Merged

Add pin mapping code. #310

merged 1 commit into from
Feb 19, 2014

Conversation

dhylands
Copy link
Contributor

This commit also introduces board directories and moves board
specific config into the appropriate board directory.

boards/stm32f4xx-af.csv was extracted from the STM32F4xx datasheet
and hand-tweaked.

make-pins.py takes boards/stm32f4xx-af.csv, boards/stm32f4xx-prefix.c,
and boards/BOARD-NAME/pins.csv as input and generates the file
build/pins_BOARD_NAME.c

The generated pin file for PYBOARD4 looks like this:
https://gist.github.com/dhylands/9063231

The generated pins file includes all of the supported alternate
functions, and includes upsupported alternate functions as comments.

See the commnet block at the top of stm/pin_map.c for details on
how to use the pin mapper.

I also went ahead and modified stm/gpio.c to use the pin mapper.

This commit also introduces board directories and moves board
specific config into the appropriate board directory.

boards/stm32f4xx-af.csv was extracted from the STM32F4xx datasheet
and hand-tweaked.

make-pins.py takes boards/stm32f4xx-af.csv, boards/stm32f4xx-prefix.c,
and boards/BOARD-NAME/pins.csv as input and generates the file
build/pins_BOARD_NAME.c

The generated pin file for PYBOARD4 looks like this:
https://gist.github.com/dhylands/9063231

The generated pins file includes all of the supported alternate
functions, and includes upsupported alternate functions as comments.

See the commnet block at the top of stm/pin_map.c for details on
how to use the pin mapper.

I also went ahead and modified stm/gpio.c to use the pin mapper.
@torwag
Copy link
Contributor

torwag commented Feb 18, 2014

Hi,

is there already a consensus how we are going to deal with all those
different uC and on top of this all those different boards (featuring the
same or very similar controller)?

Once there was the discussion how to make sure that people do not start to
copy over (possibly old and never updated) code into a new folder and work
redundant on the same feature sets.
I would suggest to add something to the dev-wiki as soon as we have an
consensus here.

On one hand its nice to have (at least the most popular boards) in once
place (one repro different folders). On the other hand git is made for
forking and branching. We could have a micropython-base which gets forked
by micropython-stm (and regular resynced) which gets branches like
pyboard, discovery, netduino, etc.
However, that would require people to deal with git, forking and branches
which many may don't like.

Other projects separate into core/stable, testing, experimental but I it
would need some tweak to fit into the micropython environment.

Any ideas?

On 18 February 2014 03:11, Dave Hylands notifications@github.com wrote:

This commit also introduces board directories and moves board
specific config into the appropriate board directory.

boards/stm32f4xx-af.csv was extracted from the STM32F4xx datasheet
and hand-tweaked.

make-pins.py takes boards/stm32f4xx-af.csv, boards/stm32f4xx-prefix.c,
and boards/BOARD-NAME/pins.csv as input and generates the file
build/pins_BOARD_NAME.c

The generated pin file for PYBOARD4 looks like this:
https://gist.github.com/dhylands/9063231

The generated pins file includes all of the supported alternate
functions, and includes upsupported alternate functions as comments.

See the commnet block at the top of stm/pin_map.c for details on
how to use the pin mapper.

I also went ahead and modified stm/gpio.c to use the pin mapper.

You can merge this Pull Request by running

git pull https://github.com/dhylands/micropython pin_map

Or view, comment on, or merge it at:

#310
Commit Summary

  • Add pin mapping code.

File Changes

Patch Links:

Reply to this email directly or view it on GitHubhttps://github.com//pull/310
.

@royemmerich
Copy link

Oooh @dhylands, this is a biggie! Good job for getting it done.

@torwag I do believe this topic has been discussed in the following two threads:

@royemmerich
Copy link

This thread is also relevant:

dpgeorge added a commit that referenced this pull request Feb 19, 2014
@dpgeorge dpgeorge merged commit 948a58d into micropython:master Feb 19, 2014
@dpgeorge
Copy link
Member

Kudos! Thank you @dhylands.

@dhylands dhylands deleted the pin_map branch November 8, 2015 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants