source: rtems/c/src/lib/libcpu/bfin/serial/spi.c @ 359e537

4.104.11
Last change on this file since 359e537 was 359e537, checked in by Ralf Corsepius <ralf.corsepius@…>, on Nov 30, 2009 at 5:09:41 AM

Whitespace removal.

  • Property mode set to 100644
File size: 2.4 KB
Line 
1/* placeholder (just a shell) */
2
3/*  SPI driver for Blackfin
4 *
5 *  Copyright (c) 2008 Kallisti Labs, Los Gatos, CA, USA
6 *             written by Allan Hessenflow <allanh@kallisti.com>
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.com/license/LICENSE.
11 *
12 *  $Id$
13 */
14
15
16#include <stdlib.h>
17#include <rtems.h>
18#include <rtems/libi2c.h>
19
20#include <libcpu/spiRegs.h>
21#include "spi.h"
22
23
24static rtems_status_code spiInit(rtems_libi2c_bus_t *bus) {
25  bfin_spi_softc_t *softc;
26  rtems_status_code status;
27
28  softc = &(((bfin_spi_desc_t *)(bus))->softc);
29
30  status = rtems_semaphore_create(rtems_build_name('s','p','i','s'),
31                                  0,
32                                  RTEMS_FIFO | RTEMS_SIMPLE_BINARY_SEMAPHORE,
33                                  0,
34                                  &softc->irq_sema_id);
35
36  return status;
37}
38
39static rtems_status_code spiSendStart(rtems_libi2c_bus_t *bus) {
40  bfin_spi_softc_t *softc;
41  rtems_status_code status;
42
43  status = RTEMS_SUCCESSFUL;
44  softc = &(((bfin_spi_desc_t *)(bus))->softc);
45
46  return status;
47}
48
49static rtems_status_code spiSendStop(rtems_libi2c_bus_t *bus) {
50  bfin_spi_softc_t *softc;
51  rtems_status_code status;
52
53  status = RTEMS_SUCCESSFUL;
54  softc = &(((bfin_spi_desc_t *)(bus))->softc);
55
56  return status;
57}
58
59static rtems_status_code spiSendAddr(rtems_libi2c_bus_t *bus,
60                                     uint32_t addr, int rw) {
61  bfin_spi_softc_t *softc;
62  rtems_status_code status;
63
64  status = RTEMS_SUCCESSFUL;
65  softc = &(((bfin_spi_desc_t *)(bus))->softc);
66
67  return status;
68}
69
70static int spiReadBytes(rtems_libi2c_bus_t *bus,
71                        unsigned char *buf, int len) {
72  bfin_spi_softc_t *softc;
73
74  softc = &(((bfin_spi_desc_t *)(bus))->softc);
75
76  return 0;
77}
78
79static int spiWriteBytes(rtems_libi2c_bus_t *bus,
80                         unsigned char *buf, int len) {
81  bfin_spi_softc_t *softc;
82
83  softc = &(((bfin_spi_desc_t *)(bus))->softc);
84
85  return 0;
86}
87
88static int spiIoctl(rtems_libi2c_bus_t *bus, int cmd, void *arg) {
89  bfin_spi_softc_t *softc;
90
91  softc = &(((bfin_spi_desc_t *)(bus))->softc);
92
93
94  return 0;
95}
96
97void bfin_spi_isr(int source) {
98}
99
100rtems_libi2c_bus_ops_t bfin_spi_libi2c_bus_ops = {
101  init: spiInit,
102  send_start: spiSendStart,
103  send_stop: spiSendStop,
104  send_addr: spiSendAddr,
105  read_bytes: spiReadBytes,
106  write_bytes: spiWriteBytes,
107  ioctl: spiIoctl
108};
109
Note: See TracBrowser for help on using the repository browser.