2014-12-06 19:30:25 -08:00
|
|
|
/*
|
2016-11-04 07:18:34 -07:00
|
|
|
Copyright 2016 Benjamin Vedder benjamin@vedder.se
|
2014-12-06 19:30:25 -08:00
|
|
|
|
2016-11-04 07:18:34 -07:00
|
|
|
This file is part of the VESC firmware.
|
|
|
|
|
|
|
|
The VESC firmware is free software: you can redistribute it and/or modify
|
2014-12-06 19:30:25 -08:00
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
2016-11-04 07:18:34 -07:00
|
|
|
The VESC firmware is distributed in the hope that it will be useful,
|
2014-12-06 19:30:25 -08:00
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef COMM_CAN_H_
|
|
|
|
#define COMM_CAN_H_
|
|
|
|
|
|
|
|
#include "conf_general.h"
|
|
|
|
|
2015-02-19 12:20:07 -08:00
|
|
|
// Settings
|
|
|
|
#define CAN_STATUS_MSG_INT_MS 1
|
|
|
|
#define CAN_STATUS_MSGS_TO_STORE 10
|
|
|
|
|
2014-12-06 19:30:25 -08:00
|
|
|
// Functions
|
|
|
|
void comm_can_init(void);
|
2017-11-08 05:07:35 -08:00
|
|
|
void comm_can_set_baud(CAN_BAUD baud);
|
2017-09-04 12:12:43 -07:00
|
|
|
void comm_can_transmit_eid(uint32_t id, uint8_t *data, uint8_t len);
|
2017-10-28 02:06:21 -07:00
|
|
|
void comm_can_transmit_sid(uint32_t id, uint8_t *data, uint8_t len);
|
2018-04-04 14:08:55 -07:00
|
|
|
void comm_can_set_sid_rx_callback(void (*p_func)(uint32_t id, uint8_t *data, uint8_t len));
|
2015-05-20 07:13:48 -07:00
|
|
|
void comm_can_send_buffer(uint8_t controller_id, uint8_t *data, unsigned int len, bool send);
|
2014-12-06 19:30:25 -08:00
|
|
|
void comm_can_set_duty(uint8_t controller_id, float duty);
|
|
|
|
void comm_can_set_current(uint8_t controller_id, float current);
|
|
|
|
void comm_can_set_current_brake(uint8_t controller_id, float current);
|
|
|
|
void comm_can_set_rpm(uint8_t controller_id, float rpm);
|
2015-04-26 15:02:32 -07:00
|
|
|
void comm_can_set_pos(uint8_t controller_id, float pos);
|
2017-09-04 12:12:43 -07:00
|
|
|
void comm_can_set_current_rel(uint8_t controller_id, float current_rel);
|
|
|
|
void comm_can_set_current_brake_rel(uint8_t controller_id, float current_rel);
|
2015-02-19 12:20:07 -08:00
|
|
|
can_status_msg *comm_can_get_status_msg_index(int index);
|
|
|
|
can_status_msg *comm_can_get_status_msg_id(int id);
|
2014-12-06 19:30:25 -08:00
|
|
|
|
|
|
|
#endif /* COMM_CAN_H_ */
|