Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:40

0001 /*
0002  *  RTEMS driver for Blackfin SPI
0003  *
0004  *  COPYRIGHT (c) 2010 Kallisti Labs, Los Gatos, CA, USA
0005  *            written by Allan Hessenflow <allanh@kallisti.com>
0006  *
0007  *  The license and distribution terms for this file may be
0008  *  found in the file LICENSE in this distribution or at
0009  *  http://www.rtems.org/license/LICENSE.
0010  */
0011 
0012 #ifndef _spi_h
0013 #define _spi_h
0014 
0015 #ifdef __cplusplus
0016 extern "C" {
0017 #endif
0018 
0019 typedef struct {
0020   void *base;
0021   /* remaining entries are for internal use */
0022   rtems_id sem;
0023   int bytes_per_word;
0024   uint16_t idle_pattern;
0025   uint8_t *rd_ptr;
0026   const uint8_t *wr_ptr;
0027   int len;
0028 } bfin_spi_state_t;
0029 
0030 typedef struct {
0031   rtems_libi2c_bus_t bus;
0032   bfin_spi_state_t p;
0033 } bfin_spi_bus_t;
0034 
0035 
0036 void bfin_spi_isr(int v);
0037 
0038 rtems_status_code bfin_spi_init(rtems_libi2c_bus_t *bus);
0039 
0040 rtems_status_code bfin_spi_send_start(rtems_libi2c_bus_t *bus);
0041 
0042 int bfin_spi_read_bytes(rtems_libi2c_bus_t *bus, unsigned char *buf, int len);
0043 
0044 int bfin_spi_write_bytes(rtems_libi2c_bus_t *bus, unsigned char *buf, int len);
0045 
0046 int bfin_spi_ioctl(rtems_libi2c_bus_t *bus, int cmd, void *arg);
0047 
0048 #ifdef __cplusplus
0049 }
0050 #endif
0051 
0052 
0053 #endif /* _spi_h */