Closed Adminius closed 6 years ago
for the first question, probably not likely we'll add it but feel free to fork and do yourself :) for the second question, the other pins are free and unused, you just can't use them for the SERCOM
@ladyada i've forked ;)
i made a new line in sercomTable:
&sercom4, SERCOM4, SERCOM4_DMAC_ID_TX, 22, 23, 24, SPI_PAD_0_SCK_3, SERCOM_RX_PAD_2, PIO_SERCOM_ALT, // pins 22 / 23 and the other stuff swapped.
i need it in this way and it works like a charm
i can make a PR for this line. but i think it's better to do it in flexible way, so power users can easier do it, without to add a new line until next library update...
i see this ways of doing it:
Adafruit_NeoPixel_ZeroDMA strip(NUM_PIXELS, &sercom5, SERCOM5, SERCOM5_DMAC_ID_TX, A5, 6, 7, SPI_PAD_0_SCK_3, SERCOM_RX_PAD_2, PIO_SERCOM_ALT, NEO_GRB);
or the normal Adafruit_NeoPixel_ZeroDMA strip(NUM_PIXELS, PIN, NEO_GRB);
but Adafruit_NeoPixel::begin(*sercom, *sercomBase, dmacID, mosi, miso, sck, padTX, padRX, pinFunc);
I think the second one is better. should i do a PR for it? what are you prefer? copy-paste whole begin function https://github.com/adafruit/Adafruit_NeoPixel_ZeroDMA/blob/master/Adafruit_NeoPixel_ZeroDMA.cpp#L114-L175 or make an internalBegin() for selected stuff so that we don't have a copy-paste code?
Hi, first of all, i know what you mean with:
SERCOM <> PIN-relations described here: https://learn.adafruit.com/using-atsamd21-sercom-to-add-more-spi-i2c-serial-ports/creating-a-new-spi
is it possible to add a new constructor(?) (for experienced user) with sercom and pin parameters, so user can define his own sercom/pin configuration?
e.g. instead of:
another possibility to define sercomTable[] in a user sketch instead of library and use it (pointer ?) for sercom-definition.
Another question: for example user uses A5 for MOSI, pins 6 and 7 are used for MISO and SCK, that also means, that user can't use pins 6 and 7 for other stuff (like digitalWrite), right?