Closed sl1pkn07 closed 4 years ago
Hmmm, I am 100% certain that I commented on this one before. While it is always a good idea to support more boards, the proposed changes in this case are not necessary and there is a much simpler solution. At least in the context of this code the SAMD51P20A and the SAME51J19A are exactly the same. Unfortunately there are no family defines declared like SAMx5x or SAMC2x.
So you can just add more controllers in the same family to the existing block:
#include "sam.h"
#define EVE_CS_PORT 0
#define EVE_CS PORT_PA05
#define EVE_PDN_PORT 0
#define EVE_PDN PORT_PA03
#define EVE_SPI SERCOM0
#define EVE_SPI_DMA_TRIGGER SERCOM0_DMAC_ID_TX
#define EVE_DMA_CHANNEL 0
#define EVE_DMA
#define EVE_DELAY_1MS 8000 // ~1ms at 48MHz Core-Clock
The SAMD51J19A is on the Metro M4. Or well, just replace the SAME51J19A with any other from that family tree. Like SAMD51G18A or SAME54N20A.
That there are two blocks of settings right now in EVE_target.h is out of conveniance for me since I am using two boards to test with.
It gets a little more complicated in EVE_target.c since DMA is a little different between SAMC2x and SAMD5x/SAME5x. But then this also is just like this:
void EVE_init_dma(void)
Btw. I did some some cleanup and measured the timing for the SAME51 again. The correct value for EVE_DELAY_1MS is 20000 with a core clock of 120MHz and activated cache.
Add support for test the library with Adafruit Grand Central M4 board (SAMD51P20A) with EVE_Test_Arduino_PlatformIO example