dbp.h
1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef __DBP_H__
#define __DBP_H__
/*************************************************************************
*
* File: dbp.h
*
* BB debug board parallel port host definitions and function prototypes
*/
#include <linux/parport.h>
#include <linux/ppdev.h>
#include "PR/bcp.h"
#include "jtag.h"
typedef enum { dbp_JTAG, dbp_TinyMon, dbp_Rmon, dbp_SIM, dbp_MUX } dbp_Protocol;
#define DBP_CTRL_READ 0
#define DBP_CTRL_WRITE 1
#define DBP_CTRL_SET_WR_PTR 0x80
#define DBP_CTRL_SET_RD_PTR 0xc0
#define DBP_CTRL_RESET_HOST 0x40
#define DBP_CTRL_SET_HOST_REQ 0x01
#define DBP_CTRL_SET_HOST_ACK 0x02
#define DBP_CTRL_CLR_BB_REQ 0x04
#define DBP_CTRL_CLR_BB_ACK 0x08
#define DBP_STATUS_HOST_REQ 0x01
#define DBP_STATUS_HOST_ACK 0x02
#define DBP_STATUS_BB_REQ 0x04
#define DBP_STATUS_BB_ACK 0x08
extern int dbp_verbose; /* default 0, can be set by lib clients */
extern int dbp_dont_negotiate; /* default 0, can be set by lib clients */
int dbp_open(dbp_Protocol protocol, const char* devname_or_null);
int dbp_close();
int dbp_cl(int);
int dbp_set_protocol(dbp_Protocol protocol); /* only valid for open dbp */
int dbp_ctrl(int wr, unsigned char* ctrl);
int dbp_set_wptr(int addr);
int dbp_set_rptr(int addr);
int dbp_write_data(const unsigned char* buf, int n);
int dbp_read_data(unsigned char* buf, int n);
#endif /* __DBP_H__ */