This repository has been archived on 2024-01-25. You can view files and clone it, but cannot push or open issues or pull requests.
SummerSchool2-Controller/306-controller_interface.X/app/car.h
2023-08-24 15:26:12 +02:00

62 lines
2.0 KiB
C

/**
* @author Rémi Heredero
* @version. 0.0.0
* @date August 2023
* @file car.h
*/
#ifndef CAR_H
#define CAR_H
/*************
* MODULE ID *
*************/
#define ID_CONTROL 1 // Control the three-wheeler
#define ID_JOYSTICK 2 // Inform control avout current joystick state
#define ID_DISPLAY 3 // User interface to display informations
#define ID_DRIVE 4 // Drive power motor of the three-wheeler
#define ID_STEERING 5 // Drive the direction motor og the three-wheeler
#define ID_SUPPLY 6 // Information about batteries, current, ...
#define ID_BROADCAST 0 // Message to and from any module
#define ID_DEBUG 0 // Message to and from any module
/*******************
* MEMORY ADRESSES *
*******************/
#define MEMADD_CONTROL_STEERING_MODE 0x00
#define MEMADD_CONTROL_ALIVE_TIME 0x01
#define MEMADD_CONTROL_SPEED_FACTOR 0x02
#define MEMADD_CONTROL_POWER_FACTOR 0x06
#define MEMADD_CONTROL_STEERING_FACTOR 0x0A
#define MEMADD_CONTROL_MAX_SPEED_FW 0x0E
#define MEMADD_CONTROL_MAX_SPEED_BW 0x0F
#define MEMADD_JOYSTICK_ALIVE_TIME 0x10
#define MEMADD_DISPLAY_ALIVE_TIME 0x11
#define MEMADD_DRIVE_SPEED_TIME 0x12
#define MEMADD_DRIVE_STOP_TIME 0x13
#define MEMADD_DRIVE_ALIVE_TIME 0x14
#define MEMADD_STEERING_ALIVE_TIME 0x15
#define MEMADD_BATTERY_ALIVE_TIME 0x16
typedef struct {
uint8_t CONTROL_STEERING_MODE;
uint8_t CONTROL_ALIVE_TIME;
uint32_t CONTROL_SPEED_FACTOR;
uint32_t CONTROL_POWER_FACTOR;
uint32_t CONTROL_STEERING_FACTOR;
uint8_t CONTROL_MAX_SPEED_FW;
uint8_t CONTROL_MAX_SPEED_BW;
uint8_t JOYSTICK_ALIVE_TIME;
uint8_t DISPLAY_ALIVE_TIME;
uint8_t DRIVE_SPEED_TIME;
uint8_t DRIVE_STOP_TIME;
uint8_t DRIVE_ALIVE_TIME;
uint8_t STEERING_ALIVE_TIME;
uint8_t BATTERY_ALIVE_TIME;
} CAR_CST_TYPE;
CAR_CST_TYPE CAR_CST;
#endif /* CAR_H */