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

SPI peripheral/CS naming issues #1

Closed
1 of 2 tasks
catfact opened this issue Mar 24, 2016 · 2 comments
Closed
1 of 2 tasks

SPI peripheral/CS naming issues #1

catfact opened this issue Mar 24, 2016 · 2 comments
Assignees
Labels

Comments

@catfact
Copy link
Contributor

catfact commented Mar 24, 2016

encountered this discrepancy when refactoring aleph for building against libavr32

in aleph board conf header (https://github.com/tehn/aleph/blob/dev/avr32_lib/conf/aleph_board.h#L82)
we stick to the ASF conventions when defining the address of an SPI peripheral:

#define ADC_SPI (&AVR32_SPI1)

and defining a chip select index:

#define ADC_SPI_NPCS 0

in skeleton/system/libavr32, there is only one SPIperipheral definition, and ADC_SPIetc are defined as the chip select numbers and not as peripheral addresses. like so:
https://github.com/monome/libavr32/blob/master/conf/teletype/conf_board.h#L138

i can't see the reason for this change, which breaks all the drivers and muddies a perfectly clear naming convention.

i would like to:

  • change these names back. this is simple, but requires a simultaneous change to libavr32 and, alas, all the module repos (because there is no DAC driver, just pasted direct calls to SPI functions.) there might be other similar changes things so i'll come back to it at a later stage in aleph refactor, leaving this issue as a reminder (and in case someone wants to tell me why i shouldn't do this.)

and while i'm at it:

  • factor direct calls to DAC SPI out of module main code and into the lib, so changing details of board configuration doesn't impact modules in the future.
@catfact catfact self-assigned this Mar 24, 2016
@samdoshi
Copy link
Contributor

Both of these sound good to me.

Add a CHANGELOG.md file when you make the changes so that they can be tracked easily.

@catfact catfact changed the title SPI peierpheral/CS naming issues SPI peripheral/CS naming issues Mar 24, 2016
@catfact
Copy link
Contributor Author

catfact commented Apr 14, 2017

we kind of stalled out on the aleph refactor (it's basically done on a branch, but hasn't been properly tested)

but we did change the pin defines with PR #18 and related. i didn't bother refactoring TT code. closing this anyway since it's been over a year

@catfact catfact closed this as completed Apr 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants