https://github.com/tmbinc/xvcd
just replacement following function calls…
======== gipo.c ========
#include
#define GPIO_TDI 3 /// JTAG TDI pin
#define GPIO_TDO 12 /// JTAG TDO pin
#define GPIO_TCK 13 /// JTAG TCK pin
#define GPIO_TMS 14 /// JTAG TMS pin
{
if (wiringPiSetup() == -1)
return;
gpio_output(GPIO_TDI, 1);
gpio_output(GPIO_TMS, 1);
gpio_output(GPIO_TCK, 1);
gpio_output(GPIO_TDO, 0);
}
void gpio_close(void)
{
}
================
======== gipo_inline.h ========
static inline void gpio_output(int i, int dir)
{
if (dir)
pinMode (i, OUTPUT);
else
pinMode (i, INPUT);
}
static inline void gpio_set(int i, int val)
{
if (!val)
digitalWrite (i, 0) ; // Off
else
digitalWrite (i, 1) ; // On
}
static inline int gpio_get(int i)
{
return (digitalRead( i )!=0);
}
================
Tested with NetBeans IDE 8.1 + Raspberry Pi 1 & 2 + Xilinx XC3S400AN
沒有留言:
張貼留言