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/can_message.h

100 lines
2.0 KiB
C
Raw Permalink Normal View History

2023-08-25 12:13:51 +00:00
/**
* @author R<EFBFBD>mi Heredero
* @version 1.0.0
* @date August 2023
* @file can_message.h
*/
#ifndef CAN_MESSAGE_H
#define CAN_MESSAGE_H
2023-08-27 19:35:19 +00:00
#include <stdint.h> // usage of standard types
#include <stdbool.h> // usage of boolean types
#include "../mcc_generated_files/mcc.h"
2023-08-25 12:13:51 +00:00
2023-08-30 13:37:53 +00:00
/**
* Process an incoming message
* @param idSender id of the sender
* @param idMsg is of the message
* @param data data of the message
*/
2023-09-04 06:43:14 +00:00
void CM_processIncome(uint8_t idSender, uint8_t idMsg, bool rtr, uint32_t data);
2023-08-30 13:37:53 +00:00
/**
* Send alive message from controller
* @param p have to be NULL
*/
2023-08-25 16:23:36 +00:00
void CM_CONTROLLER_ALIVE(void* p);
2023-08-30 13:37:53 +00:00
/**
* Send setup to the joystick (settings from memory)
* @param p have to be NULL
*/
2023-08-25 16:23:36 +00:00
void CM_JOY_SETUP(void* p);
2023-08-30 13:37:53 +00:00
/**
* Send setup to the display (settings from memory)
* @param p have to be NULL
*/
2023-08-25 16:23:36 +00:00
void CM_DISPLAY_SETUP(void* p);
2023-08-30 13:37:53 +00:00
/**
* Send speed to display
* @param p the speed in 100m/h (max 255 m/h)
*/
2023-08-25 16:23:36 +00:00
void CM_DISPLAY_SPEED(void* p);
2023-08-30 13:37:53 +00:00
/**
* Send direction of the steering wheel
* 0 is straight forward
* positive value is going right
* negative value is going left
* @param p the direction (int 8)
*/
2023-08-25 16:23:36 +00:00
void CM_DISPLAY_DIRECTION(void* p);
2023-08-30 13:37:53 +00:00
/**
* Send setup to the drive
* use with reset in parameter
* other settings from memory
* @param p 1 if reset/init 0 else
*/
2023-08-25 16:23:36 +00:00
void CM_DRIVE_SETUP(void* p);
2023-08-30 13:37:53 +00:00
2023-08-31 11:42:31 +00:00
/**
* Send power to the drive
* @param p the torque (int16_t*)
*/
2023-08-25 16:23:36 +00:00
void CM_DRIVE_POWER(void* p);
2023-08-30 13:37:53 +00:00
/**
* Send setup to the steering
* can be use for reset (1), homing (2) and setCenter (3)
* @param p 0 for setup, 1 for reset, 2 for homing, 3 for setCenter
*/
2023-08-25 16:23:36 +00:00
void CM_STEERING_SETUP(void* p);
2023-08-30 13:37:53 +00:00
/**
* Send position for steering
* no negative value because 0 is home (sensor)
* @param p the position (uint32_t*)
*/
2023-08-25 16:23:36 +00:00
void CM_STEERING_SET(void* p);
2023-08-30 13:37:53 +00:00
/**
* Send setup to the supply (settings from memory)
* @param p have to be NULL
*/
void CM_SUPPLY_SETUP(void* p);
2023-08-25 16:23:36 +00:00
2023-09-07 12:18:29 +00:00
/**
* Send headlights on or off
* @param p true if on, false if off;
*/
void CM_HEADLIGHTS(void* p);
2023-08-25 12:13:51 +00:00
#endif /* CAN_MESSAGE_H */