0% found this document useful (0 votes)
150 views

Sendcommand H

This document defines constants and functions for sending commands in three states: WaitSendCommand, SendBytes, and WaitFor2MS. It includes typedefs for the states, defines flags for status values, prototypes functions for running and starting the state machine, querying the current state, and getting values like positions, statuses, and laps remaining.

Uploaded by

api-272643960
Copyright
© © All Rights Reserved
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
150 views

Sendcommand H

This document defines constants and functions for sending commands in three states: WaitSendCommand, SendBytes, and WaitFor2MS. It includes typedefs for the states, defines flags for status values, prototypes functions for running and starting the state machine, querying the current state, and getting values like positions, statuses, and laps remaining.

Uploaded by

api-272643960
Copyright
© © All Rights Reserved
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 1

#ifndef SendCommand_H

#define SendCommand_H
// typedefs for the states
// State definitions for use with the query function
typedef enum { WaitSendCommand, SendBytes, WaitFor2MS } SendCommandState_t;
#define WaitForStartFlag 0x00
#define FlagDropped 0x01
#define CautionFlag 0x02
#define RaceOverFlag 0x03
// Public Function Prototypes
ES_Event RunSendCommandSM( ES_Event CurrentEvent );
void StartSendCommandSM ( ES_Event CurrentEvent );
SendCommandState_t QuerySendCommandSM ( void );
//query functions
uint16_t GetX1(void);
uint16_t GetX2(void);
uint16_t GetX3(void);
uint16_t GetY1(void);
uint16_t GetY2(void);
uint16_t GetY3(void);
int16_t GetO1(void);
int16_t GetO2(void);
int16_t GetO3(void);
uint8_t
uint8_t
uint8_t
uint8_t

GetTargetStatus(void);
GetObstacleStatus(void);
GetNumLapsLeft(void);
GetFlagDroppedStatus (void);

uint16_t GetKartX(void);
uint16_t GetKartY(void);
void SetKartNumber (uint8_t N);
#endif /*SHMTemplate_H */

You might also like