📄 identificateur_pgbot.h
字号:
/*-------------------------------------------------------
Fichier Identificateur_PGBot.h
-> Regroupe tous les sidentifiants et commandes des
cartes utilis閑s par PG'Bot
-> A utiliser avec la librairie CAN_MCP2515
-> Exemple la cam閞a demande au robot d'avancer d'1m :
#define CAMERA
...
void main(void)
{
...
MCP2515_envoie(BUFFER_T0, ID_DEPLACEMENT|TRANSLATION, 100, 2);
...
}
-------------------------------------------------------*/
#ifndef _ID_PGBOT_H_
#define _ID_PGBOT_H_
#include "carte.h"
/*************************************
************ ID DE CARTE *************
*************************************/
#define ID_DEPLACEMENT 0x11
#define ID_BALISE 0x22
#define ID_CAMERA 0x33
#define ID_PINCE 0x44
#define ID_BATTERIE 0x55
#define ID_AFFICHAGE 0x66
/*************************************
************* COMMANDES **************
*************************************/
//TOUS
#define ERREUR 0x01
#define STOP 0x02
#define START 0x04
#define ACK 0x08
#define OK 0x0A
//ID MESSAGES
#define DEP_PINCE 0x14
#define PINCE_DEP 0x18
#define BAL_DEP 0x24
#define DEP_BAL 0x28
#define BAL_PINCE 0x34
#define PINCE_BAL 0x38
//TYPE DE MESSAGE
#define STRING 0x01
#define DOUBLE 0x02
#define DOUBLE2 0x03
/*************************************
********* FILTRES ET MASQUES *********
*************************************/
//DEPLACEMENT
#ifdef DEPLACEMENT
#define MASQUE0 0x000000FF
#define FILTRE0 0x00000001 //ERREUR
#define FILTRE1 0x00000002 //STOP
#define FILTRE2 0x00000004 //START
#define MASQUE1 0x000000FC
#define FILTRE3 0x00000018 //Message provenant de PINCE
#define FILTRE4 0x00000024 //Message provenant de BALISE
#define FILTRE5 0x0000FFFF
#define FILTRE6 0x0000FFFF
#define FILTRE7 0x0000FFFF
#define FILTRE8 0x0000FFFF
#endif
//REPERAGE
#ifdef BALISE
#define MASQUE0 0x000000FF
#define FILTRE0 0x00000001 //ERREUR
#define FILTRE1 0x00000002 //STOP
#define FILTRE2 0x00000004 //START
#define MASQUE1 0x000000FC
#define FILTRE3 0x00000028 //Message provenant de DEPLACEMENT
#define FILTRE4 0x00000038 //Message provenant de PINCE
#define FILTRE5 0x0000FFFF
#define FILTRE6 0x0000FFFF
#define FILTRE7 0x0000FFFF
#define FILTRE8 0x0000FFFF
#endif
//PINCE
#ifdef PINCE
#define MASQUE0 0x000000FF
#define FILTRE0 0x00000001 //ERREUR
#define FILTRE1 0x00000002 //STOP
#define FILTRE2 0x00000004 //START
#define MASQUE1 0x000000FC
#define FILTRE3 0x00000014 //Message provenant de DEPLACEMENT
#define FILTRE4 0x00000034 //Message provenant de BALISE
#define FILTRE5 0x0000FFFF
#define FILTRE6 0x0000FFFF
#define FILTRE7 0x0000FFFF
#define FILTRE8 0x0000FFFF
#endif
//BATTERIE
#ifdef BATTERIE
#define MASQUE0 0x000000FF
#define FILTRE0 0x00000001 //ERREUR
#define FILTRE1 0x00000008 //ACK
#define FILTRE2 0x0000FFFF
#define FILTRE3 0x0000FFFF
#define MASQUE1 0x000000FC
#define FILTRE4 0x0000FFFF
#define FILTRE5 0x0000FFFF
#define FILTRE6 0x0000FFFF
#define FILTRE7 0x0000FFFF
#define FILTRE8 0x0000FFFF
#endif
//AFFICHAGE
#ifdef AFFICHAGE
#define MASQUE0 0x000000FF
#define FILTRE0 0x00000001 //ERREUR
#define FILTRE1 0x00000002 //STOP
#define FILTRE2 0x00000004 //START
#define MASQUE1 0x000000FC
#define FILTRE3 0x00000014 //Message provenant de DEPLACEMENT vers PINCE
#define FILTRE4 0x00000018 //Message provenant de PINCE vers DEPLACEMENT
#define FILTRE5 0x00000024 //Message provenant de BALISE vers DEPLACEMENT
#define FILTRE6 0x00000028 //Message provenant de DEPLACEMENT vers BALISE
#define FILTRE7 0x00000034 //Message provenant de BALISE ver PINCE
#define FILTRE8 0x00000038 //Message provenant de PINCE vers BALISE
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -