source: rtems/c/src/lib/libcpu/bfin/serial/spi.h @ f3b29236

5
Last change on this file since f3b29236 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.1 KB
Line 
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
19typedef 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
30typedef 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
38rtems_status_code bfin_spi_init(rtems_libi2c_bus_t *bus);
39
40rtems_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 */
Note: See TracBrowser for help on using the repository browser.