sipo.h
Go to the documentation of this file.00001 00050 #ifndef DRV_SIPO_H 00051 #define DRV_SIPO_H 00052 00053 #include "hw/hw_sipo.h" 00054 00055 #include <kern/kfile.h> 00056 00057 #define SIPO_DATAORDER_START_LSB 1 00058 #define SIPO_DATAORDER_START_MSB 0x80 00059 00063 typedef enum SipoBitOrder 00064 { 00065 SIPO_DATAORDER_MSB = 0, 00066 SIPO_DATAORDER_LSB = 1 00067 } SipoBitOrder; 00068 00072 typedef enum SipoClockPol 00073 { 00074 SIPO_START_LOW = 0, 00075 SIPO_START_HIGH = 1 00076 00077 } SipoClkPol; 00078 00082 typedef enum SipoLoadPol 00083 { 00084 SIPO_LOW_TO_HIGH = 0, 00085 SIPO_HIGH_TO_LOW = 1 00086 00087 } SipoLoadPol; 00088 00092 typedef struct Sipo 00093 { 00094 KFile fd; 00095 SipoMap load_device; 00096 SipoLoadPol load_pol; 00097 SipoClkPol clock_pol; 00098 SipoBitOrder bit_order; 00099 00100 } Sipo; 00101 00105 #define KFT_SIPO MAKE_ID('S', 'I', 'P', 'O') 00106 00110 INLINE Sipo * SIPO_CAST(KFile *fd) 00111 { 00112 ASSERT(fd->_type == KFT_SIPO); 00113 return (Sipo *)fd; 00114 } 00115 00116 void sipo_init(Sipo *fd); 00117 00118 #endif // DRV_SIPO_H 00119
