diff options
author | Sonic Zhang <sonic.zhang@analog.com> | 2011-11-24 04:40:07 -0500 |
---|---|---|
committer | Bob Liu <lliubbo@gmail.com> | 2012-05-21 02:54:21 -0400 |
commit | c55c89e939f2a0a83d5c61462be554d5d2408178 (patch) | |
tree | f3fe0781b6bf66acb3fb1a321ff446c240afeb73 /arch/blackfin/include | |
parent | 2879bb30d788bb3841e2f1675ea7af5204eb171c (diff) |
blackfin: twi: move twi bit mask macro to twi head file
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Bob Liu <lliubbo@gmail.com>
Diffstat (limited to 'arch/blackfin/include')
-rw-r--r-- | arch/blackfin/include/asm/bfin_twi.h | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/arch/blackfin/include/asm/bfin_twi.h b/arch/blackfin/include/asm/bfin_twi.h index e767d649dfc..74d10237f70 100644 --- a/arch/blackfin/include/asm/bfin_twi.h +++ b/arch/blackfin/include/asm/bfin_twi.h | |||
@@ -42,4 +42,74 @@ struct bfin_twi_regs { | |||
42 | 42 | ||
43 | #undef __BFP | 43 | #undef __BFP |
44 | 44 | ||
45 | /* ******************** TWO-WIRE INTERFACE (TWI) MASKS ***********************/ | ||
46 | /* TWI_CLKDIV Macros (Use: *pTWI_CLKDIV = CLKLOW(x)|CLKHI(y); ) */ | ||
47 | #define CLKLOW(x) ((x) & 0xFF) /* Periods Clock Is Held Low */ | ||
48 | #define CLKHI(y) (((y)&0xFF)<<0x8) /* Periods Before New Clock Low */ | ||
49 | |||
50 | /* TWI_PRESCALE Masks */ | ||
51 | #define PRESCALE 0x007F /* SCLKs Per Internal Time Reference (10MHz) */ | ||
52 | #define TWI_ENA 0x0080 /* TWI Enable */ | ||
53 | #define SCCB 0x0200 /* SCCB Compatibility Enable */ | ||
54 | |||
55 | /* TWI_SLAVE_CTL Masks */ | ||
56 | #define SEN 0x0001 /* Slave Enable */ | ||
57 | #define SADD_LEN 0x0002 /* Slave Address Length */ | ||
58 | #define STDVAL 0x0004 /* Slave Transmit Data Valid */ | ||
59 | #define NAK 0x0008 /* NAK/ACK* Generated At Conclusion Of Transfer */ | ||
60 | #define GEN 0x0010 /* General Call Address Matching Enabled */ | ||
61 | |||
62 | /* TWI_SLAVE_STAT Masks */ | ||
63 | #define SDIR 0x0001 /* Slave Transfer Direction (Transmit/Receive*) */ | ||
64 | #define GCALL 0x0002 /* General Call Indicator */ | ||
65 | |||
66 | /* TWI_MASTER_CTL Masks */ | ||
67 | #define MEN 0x0001 /* Master Mode Enable */ | ||
68 | #define MADD_LEN 0x0002 /* Master Address Length */ | ||
69 | #define MDIR 0x0004 /* Master Transmit Direction (RX/TX*) */ | ||
70 | #define FAST 0x0008 /* Use Fast Mode Timing Specs */ | ||
71 | #define STOP 0x0010 /* Issue Stop Condition */ | ||
72 | #define RSTART 0x0020 /* Repeat Start or Stop* At End Of Transfer */ | ||
73 | #define DCNT 0x3FC0 /* Data Bytes To Transfer */ | ||
74 | #define SDAOVR 0x4000 /* Serial Data Override */ | ||
75 | #define SCLOVR 0x8000 /* Serial Clock Override */ | ||
76 | |||
77 | /* TWI_MASTER_STAT Masks */ | ||
78 | #define MPROG 0x0001 /* Master Transfer In Progress */ | ||
79 | #define LOSTARB 0x0002 /* Lost Arbitration Indicator (Xfer Aborted) */ | ||
80 | #define ANAK 0x0004 /* Address Not Acknowledged */ | ||
81 | #define DNAK 0x0008 /* Data Not Acknowledged */ | ||
82 | #define BUFRDERR 0x0010 /* Buffer Read Error */ | ||
83 | #define BUFWRERR 0x0020 /* Buffer Write Error */ | ||
84 | #define SDASEN 0x0040 /* Serial Data Sense */ | ||
85 | #define SCLSEN 0x0080 /* Serial Clock Sense */ | ||
86 | #define BUSBUSY 0x0100 /* Bus Busy Indicator */ | ||
87 | |||
88 | /* TWI_INT_SRC and TWI_INT_ENABLE Masks */ | ||
89 | #define SINIT 0x0001 /* Slave Transfer Initiated */ | ||
90 | #define SCOMP 0x0002 /* Slave Transfer Complete */ | ||
91 | #define SERR 0x0004 /* Slave Transfer Error */ | ||
92 | #define SOVF 0x0008 /* Slave Overflow */ | ||
93 | #define MCOMP 0x0010 /* Master Transfer Complete */ | ||
94 | #define MERR 0x0020 /* Master Transfer Error */ | ||
95 | #define XMTSERV 0x0040 /* Transmit FIFO Service */ | ||
96 | #define RCVSERV 0x0080 /* Receive FIFO Service */ | ||
97 | |||
98 | /* TWI_FIFO_CTRL Masks */ | ||
99 | #define XMTFLUSH 0x0001 /* Transmit Buffer Flush */ | ||
100 | #define RCVFLUSH 0x0002 /* Receive Buffer Flush */ | ||
101 | #define XMTINTLEN 0x0004 /* Transmit Buffer Interrupt Length */ | ||
102 | #define RCVINTLEN 0x0008 /* Receive Buffer Interrupt Length */ | ||
103 | |||
104 | /* TWI_FIFO_STAT Masks */ | ||
105 | #define XMTSTAT 0x0003 /* Transmit FIFO Status */ | ||
106 | #define XMT_EMPTY 0x0000 /* Transmit FIFO Empty */ | ||
107 | #define XMT_HALF 0x0001 /* Transmit FIFO Has 1 Byte To Write */ | ||
108 | #define XMT_FULL 0x0003 /* Transmit FIFO Full (2 Bytes To Write) */ | ||
109 | |||
110 | #define RCVSTAT 0x000C /* Receive FIFO Status */ | ||
111 | #define RCV_EMPTY 0x0000 /* Receive FIFO Empty */ | ||
112 | #define RCV_HALF 0x0004 /* Receive FIFO Has 1 Byte To Read */ | ||
113 | #define RCV_FULL 0x000C /* Receive FIFO Full (2 Bytes To Read) */ | ||
114 | |||
45 | #endif | 115 | #endif |