/* */ /* V 1.0 07/2004 */ #ifndef _CBUS_H #define _CBUS_H // à modifier en fonction du hard // (à mettre plutôt hardware.h) #ifndef CBUS_IRQN #define CBUS_IRQN RB0 // /IRQ #define CBUS_TRIS_IRQN TRISB0 #endif #ifndef CBUS_CSN #define CBUS_CSN RB1 // /CS #define CBUS_TRIS_CSN TRISB1 #endif #ifndef CBUS_CLK #define CBUS_CLK RB2 // CLOCK #define CBUS_TRIS_CLK TRISB2 #endif #ifndef CBUS_CMD #define CBUS_CMD RB3 // CMD DATA #define CBUS_TRIS_CMD TRISB3 #endif #ifndef CBUS_REPLY #define CBUS_REPLY RA4 // RELPY DATA #define CBUS_TRIS_REPLY TRISA4 #endif // temp en us pour le cbus #define CBUS_T_NXT 4 // temps mini entre deux octets #define CBUS_T_CLK 2 // temps mini d'horloge #define CBUS_T_LAST_CLK_CSN 4 //temps mini entre le dernier //transfert et la remontée de //CS void CBUS_init(void); unsigned char CBUS_PutByte(unsigned char byte); void CBUS_SendCommand(unsigned char address, unsigned char data); void CBUS_SendCommand2Bytes(unsigned char address, unsigned char dataMSB,unsigned char dataLSB); void CBUS_SendCommandWord(unsigned char address, unsigned int dataWord ); #endif