Ignore:
Timestamp:
Jan 11, 2010, 4:14:47 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
29a3d72
Parents:
04a82e9c
Message:

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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libcpu/bfin/serial/spi.h

    r04a82e9c rfe83cef6  
    1 /* placeholder (just a shell) */
    2 
    31/*
    42 *  RTEMS driver for Blackfin SPI
    53 *
    6  *  COPYRIGHT (c) 2008 Kallisti Labs, Los Gatos, CA, USA
     4 *  COPYRIGHT (c) 2010 Kallisti Labs, Los Gatos, CA, USA
    75 *            written by Allan Hessenflow <allanh@kallisti.com>
    86 *
     
    1412 */
    1513
    16 
    17 #ifndef _spi_h_
    18 #define _spi_h_
    19 
     14#ifndef _spi_h
     15#define _spi_h
    2016
    2117#ifdef __cplusplus
     
    2319#endif
    2420
    25 
    2621typedef struct {
    27   /* parameters provided by bsp */
    28   uint32_t freq;
    29   void    *base;
    30   bool     fast;
    31   /* internal use */
    32   rtems_id irq_sema_id;
    33 } bfin_spi_softc_t;
     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;
    3431
    3532typedef struct {
    3633  rtems_libi2c_bus_t bus;
    37   bfin_spi_softc_t softc;
    38 } bfin_spi_desc_t;
     34  bfin_spi_state_t p;
     35} bfin_spi_bus_t;
    3936
    4037
    41 extern rtems_libi2c_bus_ops_t bfin_spi_libi2c_bus_ops;
     38void bfin_spi_isr(int v);
    4239
     40rtems_status_code bfin_spi_init(rtems_libi2c_bus_t *bus);
    4341
    44 void bfin_spi_isr(int source);
     42rtems_status_code bfin_spi_send_start(rtems_libi2c_bus_t *bus);
    4543
     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);
    4649
    4750#ifdef __cplusplus
     
    4952#endif
    5053
    51 #endif /* _spi_h_ */
    5254
     55#endif /* _spi_h */
Note: See TracChangeset for help on using the changeset viewer.