RTEMS 5.2
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
twi.h
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;
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;
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
rtems_status_code
Classic API Status.
Definition: status.h:43
Watchdog_Interval rtems_interval
Used to manage and manipulate intervals specified by clock ticks.
Definition: types.h:127
ssize_t write(int fd, const void *buffer, size_t count)
Definition: write.c:30
Definition: twi.h:23
Definition: twi.h:30
Definition: deflate.c:115