Subversion Repositories FlightCtrl

Rev

Rev 1662 | Rev 1666 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1662 Rev 1665
Line 77... Line 77...
77
extern volatile uint16_t I2CTimeout;
77
extern volatile uint16_t I2CTimeout;
78
 
78
 
79
void I2C_Init (void); // Initialize I2C
79
void I2C_Init (void); // Initialize I2C
80
#define I2C_Start(start_state) {twi_state = start_state; BLFlags &= ~BLFLAG_TX_COMPLETE; TWCR = (1<<TWSTA) | (1<<TWEN) | (1<<TWINT) | (1<<TWIE);}
80
#define I2C_Start(start_state) {twi_state = start_state; BLFlags &= ~BLFLAG_TX_COMPLETE; TWCR = (1<<TWSTA) | (1<<TWEN) | (1<<TWINT) | (1<<TWIE);}
-
 
81
#define I2C_Stop(start_state)  {twi_state = start_state; TWCR = (1<<TWEN) | (1<<TWSTO) | (1<<TWINT);}
-
 
82
void I2C_Reset(void); // Reset I2C
-
 
83
 
-
 
84
#define BLCONFIG_SUCCESS                             0
-
 
85
#define BLCONFIG_ERR_MOTOR_RUNNING       1
-
 
86
#define BLCONFIG_ERR_MOTOR_NOT_EXIST     2
-
 
87
#define BLCONFIG_ERR_HW_NOT_COMPATIBLE   3
-
 
88
#define BLCONFIG_ERR_SW_NOT_COMPATIBLE   4
81
#define I2C_Stop(start_state)  {twi_state = start_state; TWCR = (1<<TWEN) | (1<<TWSTO) | (1<<TWINT);}
89
#define BLCONFIG_ERR_CHECKSUM            5
82
void I2C_Reset(void); // Reset I2C
90
 
Line 83... Line 91...
83
uint8_t I2C_WriteBLConfig(uint8_t motor);
91
uint8_t I2C_WriteBLConfig(uint8_t motor);