RobOmega - PSL RoboCup / Mbed OS nRF24L01P_L432KC_CarteBlanche

Dependencies:   nRF24L01P_Hello_World nRF24L01P

Revision:
3:f8b9397e9272
Child:
4:5caf9e1dc16c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.h	Fri Dec 18 11:02:44 2020 +0000
@@ -0,0 +1,36 @@
+#ifndef MAIN_H
+#define MAIN_H
+
+//Pins du module RF
+#define SPI3_MOSI D11
+#define SPI3_MISO D12
+#define SPI3_SCLK D13
+#define CSN A3
+#define CE D8
+#define IRQ A0
+
+//Taille de la trame envoyé
+#define TRANSFER_SIZE 4
+#define PAYLOAD_MAX_LENGTH 128
+
+//Etats de receptions
+#define WAITING 0
+#define FUNCTION_MSB 1
+#define FUNCTION_LSB 2
+#define LENGTH_MSB 3
+#define LENGTH_LSB 4
+#define PAYLOAD 5
+#define CHECKSUM 6
+
+//Numéro des fonctions
+//#define
+
+//Taille des trames pour chaque fonctions 
+//#define
+
+
+int encodeMessage(int msgFunction, int msgPayloadLength, char* msgPayload, char* msg);
+char calculateChecksum(int msgFunction, int msgPayloadLength, char* msgPayload);
+void decodeMessage(char receivedByte);
+
+#endif
\ No newline at end of file