source: rtems/c/src/lib/libcpu/bfin/serial/twi.h @ 1c6926c1

5
Last change on this file since 1c6926c1 was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
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.org/license/LICENSE.
12 */
13
14#ifndef _twi_h_
15#define _twi_h_
16
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22
23typedef struct {
24  uint32_t sclk;
25  void *base;
26  bool fast;
27  int8_t slave_address;
28} bfin_twi_config_t;
29
30typedef struct bfin_twi_request_s {
31  bool write;
32  int count;
33  void *data;
34  /* Chained requests are done with repeated start conditions in between.
35     These are useful for atomic address write/data read transactions
36     (which can be important in multi-master configurations), and for
37     doing 10-bit addressing. */
38  struct bfin_twi_request_s *next;
39} bfin_twi_request_t;
40
41typedef rtems_status_code (*bfin_twi_callback_t)(int channel,
42                                                 void *arg,
43                                                 bool general_call,
44                                                 bool write,
45                                                 bool done,
46                                                 int read_count,
47                                                 uint8_t *data);
48
49
50rtems_status_code bfin_twi_init(int channel, bfin_twi_config_t *config);
51
52rtems_status_code bfin_twi_register_callback(int channel,
53                                             bfin_twi_callback_t callback,
54                                             void *arg);
55
56void bfin_twi_isr(int source);
57
58rtems_status_code bfin_twi_request(int channel, uint8_t address,
59                                   bfin_twi_request_t *request,
60                                   rtems_interval timeout);
61
62
63#ifdef __cplusplus
64}
65#endif
66
67#endif /* _twi_h_ */
68
Note: See TracBrowser for help on using the repository browser.