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