File nut/include/dev/spibus.h


Included Files


Preprocessor definitions

#define _DEV_SPIBUS_H_

#define SPI_CURRENT_MODE

#define SPI_MODE_CPHA 0x0001

#define SPI_MODE_CPOL 0x0002

#define SPI_MODE_FAULT 0x0004

#define SPI_MODE_LOOPBACK 0x0400

#define SPI_MODE_SLAVE 0x0800

#define SPI_MODE_CSKEEP 0x1000

#define SPI_MODE_CSDEC 0x2000

#define SPI_MODE_CSHIGH 0x4000

#define SPI_MODE_UPDATE 0x8000

#define SPI_MODE_0 0x0000

#define SPI_MODE_1 SPI_MODE_CPHA

#define SPI_MODE_2 SPI_MODE_CPOL

#define SPI_MODE_3

#define SPI_CURRENT_RATE

#define SPI_CURRENT_BITS


Typedef NUTSPIBUS

typedef struct _NUTSPIBUS NUTSPIBUS
See: Type struct _NUTSPIBUS

Typedef NUTSPINODE

typedef struct _NUTSPINODE NUTSPINODE
See: Type struct _NUTSPINODE

Type struct _NUTSPIBUS

struct _NUTSPIBUS
struct _NUTSPIBUS  
   {  
      HANDLE bus_mutex;  
      HANDLE bus_ready;  
      uintptr_t bus_base;  
      IRQ_HANDLER* bus_sig;  
      int (*bus_initnode)(NUTSPINODE*);  
      int (*bus_alloc)(NUTSPINODE*,uint32_t);  
      int (*bus_release)(NUTSPINODE*);  
      int (*bus_transfer)(NUTSPINODE*,const void*,void*,int);  
      int (*bus_wait)(NUTSPINODE*,uint32_t);  
      uint_fast16_t (*bus_set_mode)(NUTSPINODE*,uint_fast16_t);  
      uint_fast32_t (*bus_set_rate)(NUTSPINODE*,uint_fast32_t);  
      uint_fast8_t (*bus_set_bits)(NUTSPINODE*,uint_fast8_t);  
   }  

Type struct _NUTSPINODE

struct _NUTSPINODE
struct _NUTSPINODE  
   {  
      NUTSPIBUS* node_bus;  
      void* node_stat;  
      uint_fast32_t node_rate;  
      uint_fast16_t node_mode;  
      uint_fast8_t node_bits;  
      uint_fast8_t node_cs;  
      void* node_dcb;  
   }