bldc/applications/app.h

74 lines
2.3 KiB
C
Raw Normal View History

2014-04-13 22:10:01 -07:00
/*
2016-11-04 07:18:34 -07:00
Copyright 2016 Benjamin Vedder benjamin@vedder.se
2014-04-13 22:10:01 -07: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-04-13 22:10:01 -07: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-04-13 22:10:01 -07: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 APP_H_
#define APP_H_
2014-04-13 22:10:01 -07:00
2014-04-14 14:02:45 -07:00
#include "conf_general.h"
2014-04-13 22:10:01 -07:00
// Functions
const app_configuration* app_get_configuration(void);
void app_set_configuration(app_configuration *conf);
2019-02-18 10:30:19 -08:00
void app_disable_output(int time_ms);
bool app_is_output_disabled(void);
// Standard apps
void app_ppm_start(void);
2016-11-04 07:18:34 -07:00
void app_ppm_stop(void);
float app_ppm_get_decoded_level(void);
void app_ppm_configure(ppm_config *conf);
2016-11-04 07:18:34 -07:00
void app_adc_start(bool use_rx_tx);
2016-11-04 07:18:34 -07:00
void app_adc_stop(void);
void app_adc_configure(adc_config *conf);
float app_adc_get_decoded_level(void);
float app_adc_get_voltage(void);
2016-02-02 07:28:55 -08:00
float app_adc_get_decoded_level2(void);
float app_adc_get_voltage2(void);
2016-11-04 07:18:34 -07:00
void app_uartcomm_start(void);
2019-02-18 10:30:19 -08:00
void app_uartcomm_start_permanent(void);
2016-11-04 07:18:34 -07:00
void app_uartcomm_stop(void);
void app_uartcomm_configure(uint32_t baudrate, bool permanent_enabled);
2019-02-18 10:30:19 -08:00
void app_uartcomm_send_packet(unsigned char *data, unsigned int len);
2016-11-04 07:18:34 -07:00
void app_nunchuk_start(void);
2016-11-04 07:18:34 -07:00
void app_nunchuk_stop(void);
void app_nunchuk_configure(chuk_config *conf);
float app_nunchuk_get_decoded_chuk(void);
2015-04-11 01:07:36 -07:00
void app_nunchuk_update_output(chuck_data *data);
2014-04-13 22:10:01 -07:00
2019-07-27 21:25:56 -07:00
void app_balance_start(void);
void app_balance_stop(void);
void app_balance_configure(balance_config *conf);
2019-07-29 00:31:48 -07:00
float app_balance_get_pid_output(void);
2019-09-08 22:23:31 -07:00
float app_balance_get_m_angle(void);
float app_balance_get_c_angle(void);
2019-08-07 00:22:51 -07:00
uint32_t app_balance_get_diff_time(void);
2019-07-29 00:31:48 -07:00
float app_balance_get_motor_current(void);
2019-07-30 00:27:23 -07:00
float app_balance_get_motor_position(void);
2019-08-09 20:55:58 -07:00
uint16_t app_balance_get_state(void);
2019-07-27 21:25:56 -07:00
// Custom apps
void app_custom_start(void);
void app_custom_stop(void);
void app_custom_configure(app_configuration *conf);
#endif /* APP_H_ */