Subversion Repositories FlightCtrl

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1388 Arthur 1
/*############################################################################
2
############################################################################*/
3
4
#ifndef _I2C_MASTER_H
5
#define _I2C_MASTER_H
6
7
//############################################################################
8
9
// I2C Konstanten
10
#define SCL_CLOCK  200000L
11
#define I2C_TIMEOUT 30000
12
#define I2C_START          0x08
13
#define I2C_REPEATED_START 0x10
14
#define I2C_TX_SLA_ACK     0x18
15
#define I2C_TX_DATA_ACK    0x28
16
#define I2C_RX_SLA_ACK     0x40
17
#define I2C_RX_DATA_ACK    0x50
18
19
//############################################################################
20
21
extern volatile unsigned char twi_state;
22
extern unsigned char motor,MissingMotor;
23
extern unsigned char motorread;
24
extern unsigned char motor_rx[];
25
extern unsigned char MotorPresent[];
26
extern unsigned char MotorError[];
27
28
void i2c_reset(void);
29
extern void i2c_init (void); // I2C initialisieren
30
extern void i2c_start (void); // Start I2C
31
extern void i2c_stop (void); // Stop I2C
32
extern void i2c_write_byte (char byte); // 1 Byte schreiben
33
extern void i2c_reset(void);
34
35
#endif