Hi,
I found this project that shows the Arducam library can run on a Photon: https://github.com/dmiddlecamp/particle_arducam
I was now trying to get this to work on the Argon, but I’m hitting the following compiler errors:
In file included from ArduCAM.cpp:106:0:
ArduCAM.h:201:38: error: 'NRF5x_Pin_Info {aka struct NRF5x_Pin_Info}' has no member named 'gpio_peripheral'
#define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRRL = PIN_MAP[_pin].gpio_pin)
and
ArduCAM.cpp: In constructor 'ArduCAM::ArduCAM(byte, int)':
ArduCAM.cpp:138:51: error: 'digitalPinToPort' was not declared in this scope
P_CS = portOutputRegister(digitalPinToPort(CS));
I think I can fix the first compiler error by replacing:
#define pinLO(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRRH = PIN_MAP[_pin].gpio_pin)
#define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRRL = PIN_MAP[_pin].gpio_pin)
with:
#define pinLO(_pin) pinResetFast(_pin)
#define pinHI(_pin) pinSetFast(_pin)
Would that be correct or am I missing something here?
Next, I currently don’t see how to fix the absence of digitalPinToPort
, digitalPinToBitMask
and portOutputRegister
on the Argon platform. I understood from other threads in this forum that these macros also should not exist for the Photon. However, the code does compile and work on the Photon, so why am I seeing these errors when I target the Argon?
I also suspect the port was a bit of a hack to make things work (I’m not intending this negatively!), and, by running over the code, I suspect these macro’s may actually have no purpose in the port to the Photon…
I also realize I’m just poking around here I don’t have experience diving into library implementations at this low level (yet), so any pointers to help me dive into the subject are appreciated as well.
thx
Johan