Open majenkotech opened 7 years ago
Seems like a good idea to me - any centralization we can do of information like this is a good thing (if library authors use it).
*Brian
On Sat, Jul 15, 2017 at 5:32 PM, Majenko Technologies < notifications@github.com> wrote:
Normally this kind of thing would be relegated to a library, but to make things simple for users I propose adding it as core functions and data.
- Add a table to each board that maps digital pins to CTMU channels, including a "NOT_CTMU_PIN" macro. For instance for the Lenny you would have:
const uint8_t digital_pin_to_ctmu_PGM[] = { NOT_CTMU_PIN, 7, 3, NOT_CTMU_PIN, NOT_CTMU_PIN, NOT_CTMU_PIN, NOT_CTMU_PIN, NOT_CTMU_PIN,
NOT_CTMU_PIN, NOT_CTMU_PIN, NOT_CTMU_PIN, NOT_CTMU_PIN, 12, 5, 2, NOT_CTMU_PIN, NOT_CTMU_PIN, NOT_CTMU_PIN, 13, NOT_CTMU_PIN, 1, NOT_CTMU_PIN, NOT_CTMU_PIN, NOT_CTMU_PIN, NOT_CTMU_PIN, 9, 6, NOT_CTMU_PIN, 4, 10
};
- Add the stubs for functions to the defs file:
extern const uint8_t digital_pin_to_ctmu_PGM[];
ifdef digitalPinToCTMU
undef digialPinToCTMU
endif
define digitalPinToCTMU(P) ( digital_pin_to_ctmu_PGM[(P)] )
- Write functions similar to analogRead(pin) etc for controlling and retrieving CTMU values (ctmuRead(pin) or analogReadCTMU(pin) or capSenseRead(pin) or something like that)
Since we would be needing to add the tables to the boards it may as well have the rest put in the core anyway rather than a library.
Comments? Go/No-go?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/chipKIT32/chipKIT-core/issues/360, or mute the thread https://github.com/notifications/unsubscribe-auth/AAbeCBeK8tM_yHwW7OhNVh4b8J-Sk5dZks5sOT3fgaJpZM4OZJKC .
Normally this kind of thing would be relegated to a library, but to make things simple for users I propose adding it as core functions and data.
analogRead(pin)
etc for controlling and retrieving CTMU values (ctmuRead(pin)
oranalogReadCTMU(pin)
orcapSenseRead(pin)
or something like that)Since we would be needing to add the tables to the boards it may as well have the rest put in the core anyway rather than a library.
Comments? Go/No-go?