So my goal is to set up the photon as an SPI slave. From what I understand this can’t be done with the provided firmware.
I looked up the datasheet for the Cortex M3 and found the addresses mapped to the SPI registers. I thought the easiest course of action would be to simply interact with these registers from my code. The problem is, I’m not sure how to define my own “register variables” that can be read and written to. In Arduino they are usually pre-defined such as PORTB etc. How do I define my own using the memory addresses? Are the addresses from the Cortex M3 datasheet the right ones to use? Is there a simpler way to implement an SPI slave?
REG_SPI0_CR = 0x40008000 // (SPI0) Control Register
REG_SPI0_MR = 0x40008004 // (SPI0) Mode Register
REG_SPI0_RDR = 0x40008008 // (SPI0) Receive Data Register
REG_SPI0_TDR = 0x4000800C // (SPI0) Transmit Data Register
REG_SPI0_SR = 0x40008010 // (SPI0) Status Register
I appreciate any and all help.