From 383986ad3cf18ec7a86c50e1421793919d15eb7c Mon Sep 17 00:00:00 2001 From: Benjamin Vedder Date: Wed, 8 Nov 2023 14:27:18 +0100 Subject: [PATCH] Added baud rate parameter, documentation fixes --- conf_general.h | 2 +- lispBM/README.md | 47 ++++++++++++++++++++------------- lispBM/lispif_vesc_extensions.c | 8 ++++++ 3 files changed, 37 insertions(+), 20 deletions(-) diff --git a/conf_general.h b/conf_general.h index 54750a99..dbd4f5ad 100755 --- a/conf_general.h +++ b/conf_general.h @@ -24,7 +24,7 @@ #define FW_VERSION_MAJOR 6 #define FW_VERSION_MINOR 05 // Set to 0 for building a release and iterate during beta test builds -#define FW_TEST_VERSION_NUMBER 22 +#define FW_TEST_VERSION_NUMBER 23 #include "datatypes.h" diff --git a/lispBM/README.md b/lispBM/README.md index 0a8db6c5..12df1939 100644 --- a/lispBM/README.md +++ b/lispBM/README.md @@ -2870,7 +2870,7 @@ The following selection of app and motor parameters can be read and set from Lis 'si-battery-ah ; Battery amp hours (Added in FW 6.05) 'foc-current-kp ; FOC current controller KP 'foc-current-ki ; FOC current controller KI -'foc-f-zv ; Zero Vector Frequency in Hz +'foc-f-zv ; Zero Vector Frequency in Hz (Added in FW 6.05) 'foc-motor-l ; Motor inductance in microHenry 'foc-motor-ld-lq-diff ; D and Q axis inductance difference in microHenry 'foc-motor-r ; Motor resistance in milliOhm @@ -2914,6 +2914,16 @@ The following selection of app and motor parameters can be read and set from Lis ; 9: APP_PAS ; 10: APP_ADC_PAS 'controller-id ; VESC CAN ID +'can-baud-rate ; CAN-bus baud rate (Added in FW 6.05) + ; 0: 125K + ; 1: 250K + ; 2: 500K + ; 3: 1M + ; 4: 10K + ; 5: 20K + ; 6: 50K + ; 7: 75K + ; 8: 100K 'ppm-ctrl-type ; PPM Control Type ; 0: PPM_CTRL_TYPE_NONE ; 1: PPM_CTRL_TYPE_CURRENT @@ -2958,8 +2968,8 @@ The following selection of app and motor parameters can be read and set from Lis 'pas-current-scaling ; PAS current scaling (Added in FW 6.05) ; Express settings (Added in 6.05) -'controller_id ; VESC CAN ID -'can_baud_rate ; CAN-bus baud rate +'controller-id ; VESC CAN ID +'can-baud-rate ; CAN-bus baud rate ; 0: 125K ; 1: 250K ; 2: 500K @@ -2967,28 +2977,27 @@ The following selection of app and motor parameters can be read and set from Lis ; 4: 10K ; 5: 20K ; 6: 50K - ; 7: 75K -'can_status_rate_hz ; CAN status message rate -'wifi_mode ; Wifi mode +'can-status-rate-hz ; CAN status message rate +'wifi-mode ; Wifi mode ; 0: Disabled ; 1: Station ; 2: Access Point -'wifi_sta_ssid ; Wifi station SSID -'wifi_sta_key ; Wifi station Key -'wifi_ap_ssid ; Wifi access point SSID -'wifi_ap_key ; Wifi access point key -'use_tcp_local ; Use local TCP server -'use_tcp_hub ; Connecto to TCP hub -'tcp_hub_url ; TCP hub URL -'tcp_hub_port ; TCP hub port -'tcp_hub_id ; TCP hub connection ID -'tcp_hub_pass ; TCP hub password -'ble_mode ; BLE mode +'wifi-sta-ssid ; Wifi station SSID +'wifi-sta-key ; Wifi station Key +'wifi-ap-ssid ; Wifi access point SSID +'wifi-ap-key ; Wifi access point key +'use-tcp-local ; Use local TCP server +'use-tcp-hub ; Connecto to TCP hub +'tcp-hub-url ; TCP hub URL +'tcp-hub-port ; TCP hub port +'tcp-hub-id ; TCP hub connection ID +'tcp-hub-pass ; TCP hub password +'ble-mode ; BLE mode ; 0: Disabled ; 1: Enabled ; 2: Enabled and encrypted with pin -'ble_name ; Device name (also the name that shows up in VESC Tool) -'ble_pin ; BLE pin code +'ble-name ; Device name (also the name that shows up in VESC Tool) +'ble-pin ; BLE pin code ``` --- diff --git a/lispBM/lispif_vesc_extensions.c b/lispBM/lispif_vesc_extensions.c index 7b1d6bf4..07c8a323 100644 --- a/lispBM/lispif_vesc_extensions.c +++ b/lispBM/lispif_vesc_extensions.c @@ -169,6 +169,7 @@ typedef struct { lbm_uint min_speed; lbm_uint max_speed; lbm_uint controller_id; + lbm_uint can_baud_rate; lbm_uint app_to_use; lbm_uint ppm_ctrl_type; lbm_uint ppm_pulse_start; @@ -452,6 +453,8 @@ static bool compare_symbol(lbm_uint sym, lbm_uint *comp) { get_add_symbol("max-speed", comp); } else if (comp == &syms_vesc.controller_id) { get_add_symbol("controller-id", comp); + } else if (comp == &syms_vesc.can_baud_rate) { + get_add_symbol("can-baud-rate", comp); } else if (comp == &syms_vesc.app_to_use) { get_add_symbol("app-to-use", comp); } else if (comp == &syms_vesc.ppm_ctrl_type) { @@ -3015,6 +3018,9 @@ static lbm_value ext_conf_set(lbm_value *args, lbm_uint argn) { } else if (compare_symbol(name, &syms_vesc.foc_fw_duty_start)) { mcconf->foc_fw_duty_start = lbm_dec_as_float(args[1]); changed_mc = 2; + } else if (compare_symbol(name, &syms_vesc.can_baud_rate)) { + appconf->can_baud_rate = lbm_dec_as_i32(args[1]); + changed_app = 2; } else if (compare_symbol(name, &syms_vesc.app_to_use)) { appconf->app_to_use = lbm_dec_as_i32(args[1]); changed_app = 2; @@ -3315,6 +3321,8 @@ static lbm_value ext_conf_get(lbm_value *args, lbm_uint argn) { res = lbm_enc_float(mcconf->l_max_erpm / speed_fact); } else if (compare_symbol(name, &syms_vesc.controller_id)) { res = lbm_enc_i(appconf->controller_id); + } else if (compare_symbol(name, &syms_vesc.can_baud_rate)) { + res = lbm_enc_i(appconf->can_baud_rate); } else if (compare_symbol(name, &syms_vesc.app_to_use)) { res = lbm_enc_i(appconf->app_to_use); } else if (compare_symbol(name, &syms_vesc.ppm_ctrl_type)) {