RTEMS: bsps/bfin/include/libcpu/spi.h Source File

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
spi.h
1/*
2 * RTEMS driver for Blackfin SPI
3 *
4 * COPYRIGHT (c) 2010 Kallisti Labs, Los Gatos, CA, USA
5 * written by Allan Hessenflow <allanh@kallisti.com>
6 *
7 * The license and distribution terms for this file may be
8 * found in the file LICENSE in this distribution or at
9 * http://www.rtems.org/license/LICENSE.
10 */
11
12#ifndef _spi_h
13#define _spi_h
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19 typedef struct {
20 void *base;
21 /* remaining entries are for internal use */
22 rtems_id sem;
23 int bytes_per_word;
24 uint16_t idle_pattern;
25 uint8_t *rd_ptr;
26 const uint8_t *wr_ptr;
27 int len;
28} bfin_spi_state_t;
29
30 typedef struct {
31 rtems_libi2c_bus_t bus;
32 bfin_spi_state_t p;
33} bfin_spi_bus_t;
34
35
36void bfin_spi_isr(int v);
37
38 rtems_status_code bfin_spi_init(rtems_libi2c_bus_t *bus);
39
40 rtems_status_code bfin_spi_send_start(rtems_libi2c_bus_t *bus);
41
42int bfin_spi_read_bytes(rtems_libi2c_bus_t *bus, unsigned char *buf, int len);
43
44int bfin_spi_write_bytes(rtems_libi2c_bus_t *bus, unsigned char *buf, int len);
45
46int bfin_spi_ioctl(rtems_libi2c_bus_t *bus, int cmd, void *arg);
47
48#ifdef __cplusplus
49}
50#endif
51
52
53#endif /* _spi_h */
rtems_status_code
rtems_status_code
Classic API Status.
Definition: status.h:43
rtems_id
Objects_Id rtems_id
Used to manage and manipulate RTEMS object identifiers.
Definition: types.h:83
bfin_spi_bus_t
Definition: spi.h:30
bfin_spi_state_t
Definition: spi.h:19
rtems_libi2c_bus_t_
Definition: libi2c.h:163
p
unsigned p
Definition: tte.h:17