Root/Software/xc3sprog/sakcXCProgrammer.cpp

1/* JTAG GNU/Linux parport device io
2
3Copyright (C) 2005 Andres Calderon
4
5This program is free software; you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by
7the Free Software Foundation; either version 2 of the License, or
8(at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program; if not, write to the Free Software
17Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
18
19#include <stdio.h>
20#include <fcntl.h>
21#include <unistd.h>
22#include <sys/types.h>
23#include <sys/ioctl.h>
24#include <sys/mman.h>
25
26#include "sakcXCProgrammer.h"
27
28using namespace std;
29
30/*
31WE1 TDI PC24
32SDA TMS PD23
33SCK TDO PD24
34    TCK PD28
35*/
36
37sakcXCProgrammer::sakcXCProgrammer() : IOBase()
38{
39  JZ_PIO * pio = jz_gpio_map ();
40
41  jz_gpio_as_input (JZ_GPIO_PORT_D, TDO);
42  jz_gpio_as_output (JZ_GPIO_PORT_D, TCK);
43  jz_gpio_as_output (JZ_GPIO_PORT_C, TDI);
44  jz_gpio_as_output (JZ_GPIO_PORT_D, TMS);
45  
46  error = (pio) ? false : true;
47}
48
49sakcXCProgrammer::~sakcXCProgrammer()
50{
51}
52

Archive Download this file

Branches:
master



interactive