00001
00019 #ifndef _PCC_H
00020 #define _PCC_H
00021
00022 #define LEFT 0
00023 #define RIGHT 1
00024
00025
00026 typedef struct
00027 {
00028 uint32_t *time;
00029 int16_t *encoder[2];
00030 int16_t *sollwert[2];
00031 int16_t *istwert[2];
00032 }pcc_t;
00033
00035 typedef union{
00036 uint8_t y;
00037 struct{
00038 unsigned length:3;
00039 unsigned cmdid:5;
00040 };
00041 }tunHeader;
00042
00044 typedef struct {
00045 tunHeader header;
00046 uint8_t message[8];
00047 } tstMessage;
00048
00049
00050 #define PCC_SYNC 00
00051
00052 #define PCC_BOARD_GET 01
00053 #define PCC_BOARD_SET 02
00054 #define PCC_BOARD_AKKU 03
00055 #define PCC_BOARD_I2C 04
00056 #define PCC_BOARD_TIME 05
00057 // MOTOR LINKS
00058 #define PCC_MOT_L_ENC 10
00059 #define PCC_MOT_L_CUR 11
00060 #define PCC_MOT_L_ACS 12
00061 #define PCC_MOT_L_SRS 13
00062 #define PCC_MOT_L_TMP 14
00063 //MOTOR RECHTS
00064 #define PCC_MOT_R_ENC 16
00065 #define PCC_MOT_R_CUR 17
00066 #define PCC_MOT_R_ACS 18
00067 #define PCC_MOT_R_SRS 19
00068 #define PCC_MOT_R_TMP 20
00069 // SENSOREN
00070 #define PCC_SENS_IR1 21
00071 #define PCC_SENS_IR2 22
00072 #define PCC_SENS_ACC 23
00073 #define PCC_SENS_ORI 24
00074 // AKTION
00075 #define PCC_ACTION_MOVE 31
00076 #define PCC_ACTION_TURN 30
00079 #define MAX_BUF 100 // maximal 255 zeichen speichern
00080
00081 extern void pcc_init(const pcc_t *daten);
00082 extern void pcc_rx(uint8_t buf);
00083 extern void pcc(void);
00084 extern void pcc_send(tstMessage *message);
00085 #endif