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

4.104.11
Last change on this file since fe83cef6 was fe83cef6, checked in by Joel Sherrill <joel.sherrill@…>, on Jan 11, 2010 at 4:14:47 PM

2010-01-11 Allan Hessenflow <allanh@…>

  • serial/spi.c, serial/spi.h: Fill in skeleton with functional SPI master code.
  • include/spiRegs.h: Correct spi shadow register declaration.
  • 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.com/license/LICENSE.
10 *
11 *  $Id$
12 */
13
14#ifndef _spi_h
15#define _spi_h
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21typedef struct {
22  void *base;
23  /* remaining entries are for internal use */
24  rtems_id sem;
25  int bytes_per_word;
26  uint16_t idle_pattern;
27  uint8_t *rd_ptr;
28  const uint8_t *wr_ptr;
29  int len;
30} bfin_spi_state_t;
31
32typedef struct {
33  rtems_libi2c_bus_t bus;
34  bfin_spi_state_t p;
35} bfin_spi_bus_t;
36
37
38void bfin_spi_isr(int v);
39
40rtems_status_code bfin_spi_init(rtems_libi2c_bus_t *bus);
41
42rtems_status_code bfin_spi_send_start(rtems_libi2c_bus_t *bus);
43
44int bfin_spi_read_bytes(rtems_libi2c_bus_t *bus, unsigned char *buf, int len);
45
46int bfin_spi_write_bytes(rtems_libi2c_bus_t *bus, unsigned char *buf, int len);
47
48int bfin_spi_ioctl(rtems_libi2c_bus_t *bus, int cmd, void *arg);
49
50#ifdef __cplusplus
51}
52#endif
53
54
55#endif /* _spi_h */
Note: See TracBrowser for help on using the repository browser.