OpenCores
URL https://opencores.org/ocsvn/adv_debug_sys/adv_debug_sys/trunk

Subversion Repositories adv_debug_sys

[/] [adv_debug_sys/] [trunk/] [Software/] [adv_jtag_bridge/] [cable_common.h] - Blame information for rev 55

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 21 nyawn
 
2
#ifndef _CABLE_COMMON_H_
3
#define _CABLE_COMMON_H_
4
 
5
#include <stdint.h>
6
 
7 55 nyawn
 
8
typedef struct {
9
  const char *name;
10
  int (*inout_func)(uint8_t, uint8_t *);
11
  int (*out_func)(uint8_t);
12
  int (*init_func)();
13
  int (*opt_func)(int, char *);
14
  int (*bit_out_func)(uint8_t);
15
  int (*bit_inout_func)(uint8_t, uint8_t *);
16
  int (*stream_out_func)(uint32_t *, int, int);
17
  int (*stream_inout_func)(uint32_t *, uint32_t *, int, int);
18
  int (*flush_func)();
19
  const char *opts;
20
  const char *help;
21
} jtag_cable_t;
22
 
23 21 nyawn
// Defines to use in the 'packet' args of cable_write_bit()
24
// and cable_read_write_bit().  Note that while TRST is 
25
// active low for JTAG hardware, here the TRST bit
26
// should be set when you want the TRST wire active
27
// (JTAG TAP to be reset).
28
#define TRST     (0x04)
29
#define TMS      (0x02)
30
#define TDO      (0x01)
31
 
32
// These should only be used in the cable_* files.
33
#define TCLK_BIT (0x01)
34
#define TRST_BIT (0x02)
35
#define TDI_BIT  (0x04)
36
#define TMS_BIT  (0x08)
37
#define TDO_BIT  (0x20)
38
 
39
// Cable subsystem / init routines
40 55 nyawn
void cable_setup(void);
41 21 nyawn
int cable_select(const char *cable);
42
int cable_init();
43
int cable_parse_opt(int c, char *str);
44
const char *cable_get_args();
45
void cable_print_help();
46
 
47
 
48
// Cable API routines
49
int cable_write_bit(uint8_t packet);
50
int cable_read_write_bit(uint8_t packet_out, uint8_t *bit_in);
51
int cable_write_stream(uint32_t *stream, int len_bits, int set_last_bit);
52
int cable_read_write_stream(uint32_t *outstream, uint32_t *instream, int len_bits, int set_last_bit);
53
int cable_flush(void);
54
 
55
// Common functions for lower-level drivers to use as desired
56
int cable_common_write_bit(uint8_t packet);
57
int cable_common_read_write_bit(uint8_t packet_out, uint8_t *bit_in);
58
int cable_common_write_stream(uint32_t *stream, int len_bits, int set_last_bit);
59
int cable_common_read_stream(uint32_t *outstream, uint32_t *instream, int len_bits, int set_last_bit);
60
 
61
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.