2016年4月26日 星期二

Xilinx Virtual Download Cable using Raspberry Pi

based on this project below…( Thanks this great project )
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

void gpio_init(void)
{
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



沒有留言:

VirtualBox 空間減肥

sdelete64 -z c: VBoxManage  modifymedium  disk  "/Users/fellow/VirtualBox VMs/Win10/Win10.vdi"  --compact *.vdi 路徑可以在 VirtualBox 儲...