.

Dependencies:   L432KC_SPI_Pey_Lal

protocol.h

Committer:
voltxd
Date:
2022-05-18
Revision:
114:c1f7be27aa5d
Parent:
110:a6d1d3525014
Child:
115:156b8234f2de

File content as of revision 114:c1f7be27aa5d:

#ifndef PROTOCOL_H
#define PROTOCOL_H

#include "mbed.h"

#define STATE_START_OF_FRAME 0
#define STATE_COMMAND_TYPE 1 
#define STATE_PAYLOAD 2
#define STATE_PROPULSION 1
#define STATE_DIRECTION 2
#define STATE_CHECKSUM 3

char calculateChecksum(uint32_t propulsion, uint32_t direction);
void decodeMessage(char c);
void getVerifiedPWMValues(uint32_t *pwmPropulsion, uint32_t *pwmDirection);
char isDataAvailable();

#endif