source: rtems/c/src/lib/libcpu/bfin/serial/twi.h @ 30abd24

4.104.114.95
Last change on this file since 30abd24 was 30abd24, checked in by Joel Sherrill <joel.sherrill@…>, on 08/15/08 at 20:18:41

2008-08-15 Allan Hessenflow <allanh@…>

  • ChangeLog?, Makefile.am, README, configure.ac, preinstall.am, cache/cache.c, cache/cache_.h, clock/clock.c, clock/rtc.c, clock/tod.h, include/bf533.h, include/bf537.h, include/cecRegs.h, include/coreTimerRegs.h, include/dmaRegs.h, include/ebiuRegs.h, include/ethernetRegs.h, include/gpioRegs.h, include/memoryRegs.h, include/mmuRegs.h, include/ppiRegs.h, include/rtcRegs.h, include/sicRegs.h, include/spiRegs.h, include/sportRegs.h, include/timerRegs.h, include/twiRegs.h, include/uartRegs.h, include/wdogRegs.h, interrupt/interrupt.c, interrupt/interrupt.h, mmu/mmu.c, mmu/mmu.h, network/ethernet.c, network/ethernet.h, serial/spi.c, serial/spi.h, serial/sport.c, serial/sport.h, serial/twi.c, serial/twi.h, serial/uart.c, serial/uart.h, timer/timer.c: New files.
  • 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.com/license/LICENSE.
12 *
13 *  $Id$
14 */
15
16#ifndef _twi_h_
17#define _twi_h_
18
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24
25typedef struct {
26  uint32_t sclk;
27  void *base;
28  boolean fast;
29  int8_t slave_address;
30} bfin_twi_config_t;
31
32typedef 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
43typedef 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
52rtems_status_code bfin_twi_init(int channel, bfin_twi_config_t *config);
53
54rtems_status_code bfin_twi_register_callback(int channel,
55                                             bfin_twi_callback_t callback,
56                                             void *arg);
57
58void bfin_twi_isr(int source);
59
60rtems_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.