iC880A-SPI QuickStart Guide - QuickStart Guide
Open Source Driver on Github
confidential
iC880A-SPI_QuickStartGuide.docx, Wireless Solutions, V0.1
page 10 of 17
2.2.2.1.1
Possibility A: Control the GPIO pin via a shell script
A small shell script can be written to reset the iC880A-SPI before the LoRa driver can access the
hardware. The content of the shell script can look like the following example (which assumes
that the GPIO 17 (pin 11) of the Raspberry Pi is connected to the reset pin of the iC880A-SPI):
#!/bin/bash
echo "17" > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio17/direction
echo "1" > /sys/class/gpio/gpio17/value
sleep 5
echo "0" > /sys/class/gpio/gpio17/value
sleep 1
echo "0" > /sys/class/gpio/gpio17/value
These lines can be stored in a file called “iC880-SPI_reset.sh”. The user must call this script
once after every boot up in order to get the concentrator IC in a clean state.
2.2.2.1.2
Possibility B: Control the GPIO pin via a compiled C-Tool / library
If the host system is a Raspberry Pi the user can write a small C-Tool to reset set the iC880A-SPI.
In order to access the GPIO pins of the Raspberry Pi there is a library called “wiringPi” that takes
care of the low level details. The library can be downloaded from
. Please
refer to this site to get installation and usage instructions. The content of the iC880-SPI_reset.c
file can look like the following:
#include <wiringPi.h>
#include <unistd.h>
#define GPIO_RESET_PIN 0 // see wiringPi mapping!
int main() {
wiringPiSetup();
pinMode(GPIO_RESET_PIN, OUTPUT);
digitalWrite(GPIO_RESET_PIN, HIGH);
sleep(5);
digitalWrite(GPIO_RESET_PIN, LOW);
return;
}
The user must call this tool once after every boot up in order to get the concentrator IC in a
clean state.