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

Add configuration and functions for CTMU to the core. RFC #360

Open
majenkotech opened this issue Jul 15, 2017 · 1 comment
Open

Add configuration and functions for CTMU to the core. RFC #360

majenkotech opened this issue Jul 15, 2017 · 1 comment

Comments

@majenkotech
Copy link
Member

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?

@majenkotech majenkotech changed the title RFC: Add configuration and functions for CTMU to the core Add configuration and functions for CTMU to the core. RFC Jul 15, 2017
@EmbeddedMan
Copy link
Member

EmbeddedMan commented Jul 16, 2017 via email

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

No branches or pull requests

2 participants