source:
rtems/c/src/lib/libcpu/bfin/serial/twi.h
@
30abd24
Last change on this file since 30abd24 was 30abd24, checked in by Joel Sherrill <joel.sherrill@…>, on 08/15/08 at 20:18:41 | |
---|---|
|
|
File size: 1.9 KB |
Line | |
---|---|
1 | /* not yet implemented */ |
2 | |
3 | /* |
4 | * RTEMS driver for Blackfin TWI (I2C) |
5 | * |
6 | * COPYRIGHT (c) 2008 Kallisti Labs, Los Gatos, CA, USA |
7 | * written by Allan Hessenflow <allanh@kallisti.com> |
8 | * |
9 | * The license and distribution terms for this file may be |
10 | * found in the file LICENSE in this distribution or at |
11 | * http://www.rtems.com/license/LICENSE. |
12 | * |
13 | * $Id$ |
14 | */ |
15 | |
16 | #ifndef _twi_h_ |
17 | #define _twi_h_ |
18 | |
19 | |
20 | #ifdef __cplusplus |
21 | extern "C" { |
22 | #endif |
23 | |
24 | |
25 | typedef struct { |
26 | uint32_t sclk; |
27 | void *base; |
28 | boolean fast; |
29 | int8_t slave_address; |
30 | } bfin_twi_config_t; |
31 | |
32 | typedef struct bfin_twi_request_s { |
33 | boolean write; |
34 | int count; |
35 | void *data; |
36 | /* Chained requests are done with repeated start conditions in between. |
37 | These are useful for atomic address write/data read transactions |
38 | (which can be important in multi-master configurations), and for |
39 | doing 10-bit addressing. */ |
40 | struct bfin_twi_request_s *next; |
41 | } bfin_twi_request_t; |
42 | |
43 | typedef rtems_status_code (*bfin_twi_callback_t)(int channel, |
44 | void *arg, |
45 | boolean general_call, |
46 | boolean write, |
47 | boolean done, |
48 | int read_count, |
49 | uint8_t *data); |
50 | |
51 | |
52 | rtems_status_code bfin_twi_init(int channel, bfin_twi_config_t *config); |
53 | |
54 | rtems_status_code bfin_twi_register_callback(int channel, |
55 | bfin_twi_callback_t callback, |
56 | void *arg); |
57 | |
58 | void bfin_twi_isr(int source); |
59 | |
60 | rtems_status_code bfin_twi_request(int channel, uint8_t address, |
61 | bfin_twi_request_t *request, |
62 | rtems_interval timeout); |
63 | |
64 | |
65 | #ifdef __cplusplus |
66 | } |
67 | #endif |
68 | |
69 | #endif /* _twi_h_ */ |
70 |
Note: See TracBrowser
for help on using the repository browser.