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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [drivers/] [char/] [mbus.h] - Blame information for rev 1777

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1626 jcastillo
/************************************************************************/
2
/*                                                                      */
3
/*  mbus.h -   definitions for the mbus driver                          */
4
/*                                                                      */
5
/*                                                                      */
6
/*  (C) Copyright 1999, Martin Floeer (mfloeer@axcent.de)               */      /*                                                                      */
7
/*                                                                      */
8
/************************************************************************/
9
 
10
 
11
 
12
#ifndef __MBUS_H__
13
#define __MBUS_H__
14
 
15
#include <linux/ioctl.h>
16
 
17
 
18
 
19
#ifndef MBUS_MAJOR
20
#define MBUS_MAJOR 127          /*static definition of major nr.*/
21
#endif
22
 
23
#ifndef MBUS_NR_DEVS
24
#define MBUS_NR_DEVS 1
25
#endif
26
 
27
#define count_t int
28
#define read_write_t int
29
 
30
 
31
#define MBUS_TRANSMIT 0x1
32
#define MBUS_RECEIVE 0x0
33
 
34
#define MBUS_MASTER 0x1
35
#define MBUS_SLAVE 0x0
36
 
37
 
38
 
39
volatile int            MBUS_STATE;             /*  1 = mbus busy */
40
                                                /*  0 = mbus idle no errror */
41
                                                /* -1 = mbus idle at last transfer arbitration lost */
42
                                                /* -2 = mbus idle at last transfer no acknowledge receive */
43
#define MBUS_STATE_BUSY                                 1
44
#define MBUS_STATE_IDLE                                 0
45
#define MBUS_STATE_ARBITRATION_LOST             -1
46
#define MBUS_STATE_NO_ACKNOWLEDGE               -2
47
 
48
volatile unsigned char                  MBUS_MODE;                      /* true = tranceive : false = receive */
49
volatile unsigned char                          MBUS_DEST_ADDRESS_BUFFER;       /* Buffer for the slave_address */
50
volatile unsigned char                  *MBUS_DATA;                             /* Pointer to data */
51
volatile int                            MBUS_DATA_COUNT;                /* counter for data bytes */
52
volatile int                            MBUS_DATA_NUMBER;
53
 
54
void mbus_start(unsigned char address,unsigned char clock,char IRQ_LEVEL);
55
/*
56
slave_address: slave address
57
dest_address: dest address
58
*/
59
extern void mbus_interrupt(int irq, void *dev_id, struct pt_regs *regs);
60
 
61
extern void mbus_putchar(unsigned char slave_address, unsigned char dest_address, char *data);
62
 
63
extern void mbus_getchar(unsigned char slave_address, unsigned char dest_address, char *data);
64
 
65
extern void mbus_putchars(unsigned char slave_address, unsigned char dest_address, char *data, int number);
66
 
67
 
68
typedef struct Mbus_Dev
69
{
70
        struct Mbus_Dev *next;
71
        char *name;
72
        unsigned int usage;
73
} Mbus_Dev;
74
 
75
extern int mbus_major;
76
extern int mbus_nr_devs;
77
 
78
extern struct file_operations mbus_fops;
79
 
80
read_write_t mbus_read(struct inode *inode, struct file *filp, char *buf,
81
count_t count);
82
read_write_t mbus_write(struct inode *inode, struct file *filp, char *buf,
83
count_t count);
84
 
85
#define MBUS_BUSY mbus_busy_event()
86
extern unsigned char mbus_busy_event(void);
87
 
88
 
89
#endif /* __MBUS_H__ */
90
 

powered by: WebSVN 2.1.0

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