The CP-IO19R is an IO relay board accessory for the ComfilePi consisting of 11 inputs, 8 relay outputs, screw terminals, and corresponding indicator LEDs. It can be mounted to the rear panel of the ComfilePi.
The following is an example project illustrating how to program the CP-IO19R in C# using the Mono Framework.
This example PInvoke's the pigpio library. For more information see the PInvoke documentation and the pigpiod C interface documentation
The CP-IO19R's pins are connected to the ComfilePi's GPIO header as shown below.
Inputs: GPIO 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16
Outputs: GPIO 17, 18, 19, 20, 21, 22, 23, 24
It may be necessary to modify the ComfilePi's initial GPIO output state to prevent the ComfilePi from turning the outputs ON when the ComfilePi boots.
/boot/dt-blog.bin
file.cp /boot/dt-blob.bin dt-blob-backup.bin
/boot/dt-blog.bin
file.sudo dtc -I dtb -O dts -o dt-blob.dts /boot/dt-blob.bin
dt-blob.dts
file in a text editor and navigate to the pins_cm3 { pin_config { …
node.pins_cm3 { pin_config { …
node: pin@p17 { function = "output"; termination = "no_pulling"; polarity = "active_low"; startup_state = "active"; }; // GPIO17 pin@p18 { function = "output"; termination = "no_pulling"; polarity = "active_low"; startup_state = "active"; }; // GPIO18 pin@p19 { function = "output"; termination = "no_pulling"; polarity = "active_low"; startup_state = "active"; }; // GPIO19 pin@p20 { function = "output"; termination = "no_pulling"; polarity = "active_low"; startup_state = "active"; }; // GPIO20 pin@p21 { function = "output"; termination = "no_pulling"; polarity = "active_low"; startup_state = "active"; }; // GPIO21 pin@p22 { function = "output"; termination = "no_pulling"; polarity = "active_low"; startup_state = "active"; }; // GPIO22 pin@p23 { function = "output"; termination = "no_pulling"; polarity = "active_low"; startup_state = "active"; }; // GPIO23 pin@p24 { function = "output"; termination = "no_pulling"; polarity = "active_low"; startup_state = "active"; }; // GPIO24
dt-blob.dts
file replacing the existing /boot/dt-blob.bin
file.sudo dtc -I dts -O dtb -o /boot/dt-blob.bin dt-blob.dts