During integration of my IIC_MIDI hardware module I run into an issue of using the RI_N_PINs.
Just some simple questions:
To which PORT and PINs are this inputs assigned ?
On the old STM32F0x based PCB
On my current LPC17 based PCB
On the new STM32F4 based PCB
In the mios32_config.h there only seems to be mentioned the old STM32F0x scheme,
which uses the J5C for RI0..RI3 and J5A for RI4..7.
If these Port Pins would actually used as Inputs for signalling in case a MIDI Message was received the _ENABLED flag should be set to:
3 = interface enabled, check RI_N pin instead of polling receive status
The RI_N support for IIC_MIDI is in a bad state - actually I never adapted to LPC17 because the way how the port & pin is specified doesn’t work for a LPC17, and I haven’t adapted for STM32F4 because I knew that this configuration needs to be changed.
I think that some generic MIOS32_* functions are required to configure IO pins, so that the IIC_MIDI driver could just pass the port “number” and pin number
What are the Port and Pin Names ?
The intention was to make this free configurable.
It’s a very app specific configuration, because there are no dedicated pins for the RI_N signals, so that the app developer has to decide which spare pins could be used for that purpose.
MIOS32_SYS_LPC_FIODIR() with the MIOS32_SYS_LPC_PINDIR() macro
and replaced
MIOS32_SYS_LPC_FIOGET() with the MIOS32_SYS_LPC_PINGET() macro
The app at Mios32\apps\troubleshooting\iic_midi compiled and linked successfully afterwards!
The related Port (J10 on the LPC17 booard) was also found. It is defined in:
Mios32\include\mios32\mios32_iic_midi.h, where Port J10 D0..7 relates to RI_N ICC 1..8
I Modified the Mios32\apps\troubleshooting\iic_midi\mios32_config.h:
....
#define MIOS32_IIC_MIDI0_ENABLED 3
and connected the IIC_MIDI Module with your firmware and RI PIN connected and i t behaves correctly as with simple IIC Port polling!