Hi,
I was trying to understand the configuration in mios32_spi.c and I am wondering if I don’t understand it right or there is a small mistake…
From line 76 to 79 there is the initalization of the IO-Pins:
// Push-Pull Config
#define MIOS32_SPI0_PP_INIT { LPC_PINCON->PINMODE_OD1 &= ~((1 << 24) | (1 << 23) | (1 << 22) | (1 << 21) | (1 << 20)); }
// Open-Drain Config – NOTE: unfortunately it has no effect on SCLK and MOSI pin! This isn’t documented in the LPC17xx user manual
#define MIOS32_SPI0_OD_INIT { LPC_PINCON->PINMODE_OD1 |= ((1 << 24) | (1 << 23) | (1 << 22) | (1 << 21) | (1 << 20)); }
The macro MIOS32_SPI0_PP_INIT calls PINMODE_OD1 to set the resistor configuration but instead it clears the open drain mode and the next macro sets them again.
Or why is the headline Push-Pull Config?
Can somebody help?
Best,
braintu
EDIT:
Sorry for bothering. I understood the push/pull comment wrong. It refers to the output which push/pull-s not to the resistors…