1
0
Fork 0
mirror of https://github.com/RobotechLille/cdf2018-principal synced 2024-07-03 16:18:15 +02:00
cdf2018-principal/arduino/ACsignals.h

70 lines
1.3 KiB
C
Raw Normal View History

2018-02-14 18:07:10 +01:00
/*
* Définition des signaux échagés entre l'Arduino et le chef
*/
#ifndef __ACSIGNALS_H_
#define __ACSIGNALS_H_
#define AC_BAUDRATE 9600UL
2018-02-14 18:27:04 +01:00
// Structures used everywhere
struct __attribute__ ((packed)) position {
2018-02-14 18:27:04 +01:00
float x;
float y;
float o;
};
// D: Direct
// Sens naturel : Envoi de donnée
// Sens inverse : Accusé de réception
// I: Indirect
// Sens inverse : Demande de donnée
// Sens naturel : Envoi de donnée
// T: Trigger
// Sens inverse : Paramètrage du trigger
// Sens naturel : Envoi de trigger
// Chef → Arduino
// Pour le debug
2018-02-14 18:07:10 +01:00
#define C2AD_PING 'P'
// Arrête tous les actionneurs
2018-02-14 18:07:10 +01:00
#define C2AD_STOP 'S'
2018-02-16 22:13:24 +01:00
// Stoppe les roues
#define C2AD_BRAKE 'B'
// Laisse les roues libres
#define C2AD_FREE 'F'
// Donne une destination
2018-02-14 18:07:10 +01:00
#define C2AD_GOTO 'G'
2018-02-14 18:27:04 +01:00
#define C2AD_GOTOs position
// Peut-être o à NaN ou autre valeur spécifique si indifférent
// Arduino → Chef
2018-02-14 18:07:10 +01:00
// Erreur quelconque
#define A2CD_ERR 'E'
struct __attribute__ ((packed)) A2CD_ERRs {
2018-02-14 18:07:10 +01:00
unsigned char code;
};
#define ERR_UNKNOWN_CODE 'C'
#define ERR_UNKNOWN_CODE_FPGA 'c'
2018-02-14 18:07:10 +01:00
// Envoie les infos de debug
#define A2CI_DBG 'D'
struct __attribute__ ((packed)) A2CI_DBGs {
2018-02-14 18:27:04 +01:00
struct position actuel;
struct position destination;
unsigned char movement;
2018-02-14 18:07:10 +01:00
// ...
};
#endif