From fc533effc7dcd1e583b7b639a68e7a6d256f02d1 Mon Sep 17 00:00:00 2001 From: michinarikake Date: Mon, 13 May 2024 15:32:51 +0900 Subject: [PATCH 1/8] add ds init cmd --- .../DriverInstances/di_nanossoc_d60.c | 39 +++++++++++++++++++ .../DriverInstances/di_nanossoc_d60.h | 4 ++ .../Applications/DriverInstances/di_sagitta.c | 27 +++++++++++++ .../Applications/DriverInstances/di_sagitta.h | 4 ++ src/src_user/Drivers/Aocs/nanossoc_d60.c | 12 ++++++ src/src_user/Drivers/Aocs/nanossoc_d60.h | 8 ++++ src/src_user/Drivers/Aocs/sagitta.c | 10 +++++ src/src_user/Drivers/Aocs/sagitta.h | 7 ++++ .../nbc_nanossoc_d60.c | 6 +++ .../nbc_sagitta.c | 12 +++++- 10 files changed, 127 insertions(+), 2 deletions(-) diff --git a/src/src_user/Applications/DriverInstances/di_nanossoc_d60.c b/src/src_user/Applications/DriverInstances/di_nanossoc_d60.c index 5ccf0e22..b83f3d36 100644 --- a/src/src_user/Applications/DriverInstances/di_nanossoc_d60.c +++ b/src/src_user/Applications/DriverInstances/di_nanossoc_d60.c @@ -163,4 +163,43 @@ CCP_CmdRet Cmd_DI_NANOSSOC_D60_SET_FRAME_TRANSFORMATION_QUATERNION_C2B(const Com return CCP_make_cmd_ret_without_err_code(CCP_EXEC_SUCCESS); } +CCP_CmdRet Cmd_DI_NANOSSOC_D60_DS_INIT(const CommonCmdPacket* packet) +{ + (void)packet; + uint8_t i; + DS_INIT_ERR_CODE ret = DS_ERR_CODE_OK; + + for (i = 0; i < NANOSSOC_D60_PARAMETERS_NUMBER_OF_MOUNTED_SENSOR; ++i) + { + ret |= NANOSSOC_D60_DS_init(&nanossoc_d60_driver_[i], &DI_NANOSSOC_D60_rx_buffer_[i]); + } + + if (ret != DS_ERR_CODE_OK) + { + return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_CONTEXT); + } + return CCP_make_cmd_ret_without_err_code(CCP_EXEC_SUCCESS); +} + +CCP_CmdRet Cmd_DI_NANOSSOC_D60_DS_INIT_STREAM_REC_BUFFER(const CommonCmdPacket* packet) +{ + (void)packet; + uint8_t i; + DS_ERR_CODE ret = DS_ERR_CODE_OK; + + for (i = 0; i < NANOSSOC_D60_PARAMETERS_NUMBER_OF_MOUNTED_SENSOR; ++i) + { + ret |= DS_init_stream_rec_buffer(&DI_NANOSSOC_D60_rx_buffer_[i], + DI_NANOSSOC_D60_rx_buffer_allocation_[i], + sizeof(DI_NANOSSOC_D60_rx_buffer_allocation_[i])); + } + + if (ret != DS_ERR_CODE_OK) + { + return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_CONTEXT); + } + return CCP_make_cmd_ret_without_err_code(CCP_EXEC_SUCCESS); + +} + #pragma section diff --git a/src/src_user/Applications/DriverInstances/di_nanossoc_d60.h b/src/src_user/Applications/DriverInstances/di_nanossoc_d60.h index 0cafcc6a..07e0d28f 100644 --- a/src/src_user/Applications/DriverInstances/di_nanossoc_d60.h +++ b/src/src_user/Applications/DriverInstances/di_nanossoc_d60.h @@ -49,4 +49,8 @@ AppInfo DI_NANOSSOC_D60_update(void); CCP_CmdRet Cmd_DI_NANOSSOC_D60_SET_FRAME_TRANSFORMATION_QUATERNION_C2B(const CommonCmdPacket* packet); +CCP_CmdRet Cmd_DI_NANOSSOC_D60_DS_INIT(const CommonCmdPacket* packet); + +CCP_CmdRet Cmd_DI_NANOSSOC_D60_DS_INIT_STREAM_REC_BUFFER(const CommonCmdPacket* packet); + #endif diff --git a/src/src_user/Applications/DriverInstances/di_sagitta.c b/src/src_user/Applications/DriverInstances/di_sagitta.c index 0a3fb034..6d2f98ef 100644 --- a/src/src_user/Applications/DriverInstances/di_sagitta.c +++ b/src/src_user/Applications/DriverInstances/di_sagitta.c @@ -302,4 +302,31 @@ CCP_CmdRet Cmd_DI_SAGITTA_SET_FRAME_TRANSFORMATION_QUATERNION_C2B(const CommonCm return CCP_make_cmd_ret_without_err_code(CCP_EXEC_SUCCESS); } +CCP_CmdRet Cmd_DI_SAGITTA_DS_INIT(const CommonCmdPacket* packet) +{ + (void)packet; + DS_INIT_ERR_CODE ret; + ret = SAGITTA_DS_init(&sagitta_driver_[SAGITTA_IDX_IN_UNIT], &DI_SAGITTA_rx_buffer_); + + if (ret != DS_ERR_CODE_OK) + { + return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_CONTEXT); + } + return CCP_make_cmd_ret_without_err_code(CCP_EXEC_SUCCESS); +} + +CCP_CmdRet Cmd_DI_SAGITTA_DS_INIT_STREAM_REC_BUFFER(const CommonCmdPacket* packet) +{ + (void)packet; + DS_ERR_CODE ret; + ret = DS_init_stream_rec_buffer(&DI_SAGITTA_rx_buffer_, + DI_SAGITTA_rx_buffer_allocation_, + sizeof(DI_SAGITTA_rx_buffer_allocation_)); + if (ret != DS_ERR_CODE_OK) + { + return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_CONTEXT); + } + return CCP_make_cmd_ret_without_err_code(CCP_EXEC_SUCCESS); +} + #pragma section diff --git a/src/src_user/Applications/DriverInstances/di_sagitta.h b/src/src_user/Applications/DriverInstances/di_sagitta.h index 6d8b23d3..1a237744 100644 --- a/src/src_user/Applications/DriverInstances/di_sagitta.h +++ b/src/src_user/Applications/DriverInstances/di_sagitta.h @@ -56,4 +56,8 @@ CCP_CmdRet Cmd_DI_SAGITTA_REQUEST_SYNCHRONOUS_TELEMETRY(const CommonCmdPacket* p CCP_CmdRet Cmd_DI_SAGITTA_SET_FRAME_TRANSFORMATION_QUATERNION_C2B(const CommonCmdPacket* packet); +CCP_CmdRet Cmd_DI_SAGITTA_DS_INIT(const CommonCmdPacket* packet); + +CCP_CmdRet Cmd_DI_SAGITTA_DS_INIT_STREAM_REC_BUFFER(const CommonCmdPacket* packet); + #endif diff --git a/src/src_user/Drivers/Aocs/nanossoc_d60.c b/src/src_user/Drivers/Aocs/nanossoc_d60.c index 315521c6..c36c7878 100644 --- a/src/src_user/Drivers/Aocs/nanossoc_d60.c +++ b/src/src_user/Drivers/Aocs/nanossoc_d60.c @@ -54,6 +54,18 @@ DS_INIT_ERR_CODE NANOSSOC_D60_init(NANOSSOC_D60_Driver* nanossoc_d60_driver, uin return DS_INIT_OK; } +DS_INIT_ERR_CODE NANOSSOC_D60_DS_init(NANOSSOC_D60_Driver* nanossoc_d60_driver, DS_StreamRecBuffer* rx_buffer) +{ + DS_ERR_CODE ret; + + ret = DS_init(&(nanossoc_d60_driver->driver.super), + &(nanossoc_d60_driver->driver.i2c_config), + rx_buffer, + NANOSSOC_D60_load_driver_super_init_settings_); + + return ret; +} + static DS_ERR_CODE NANOSSOC_D60_load_driver_super_init_settings_(DriverSuper* super) { DS_StreamConfig* stream_config; diff --git a/src/src_user/Drivers/Aocs/nanossoc_d60.h b/src/src_user/Drivers/Aocs/nanossoc_d60.h index f20c3835..cdf01835 100644 --- a/src/src_user/Drivers/Aocs/nanossoc_d60.h +++ b/src/src_user/Drivers/Aocs/nanossoc_d60.h @@ -94,6 +94,14 @@ typedef struct */ DS_INIT_ERR_CODE NANOSSOC_D60_init(NANOSSOC_D60_Driver* nanossoc_d60_driver, uint8_t ch, uint8_t i2c_address, DS_StreamRecBuffer* rx_buffer); +/** + * @brief NANOSSOC_D60のDriver_Super初期化 + * @param nanossoc_d60_driver : 初期化するNANOSSOC_D60_Driver構造体へのポインタ + * @param rx_buffer: 受信バッファ + * @return DS_INIT_ERR_CODE + */ +DS_INIT_ERR_CODE NANOSSOC_D60_DS_init(NANOSSOC_D60_Driver* nanossoc_d60_driver, DS_StreamRecBuffer* rx_buffer); + /** * @brief NANOSSOC_D60観測 * diff --git a/src/src_user/Drivers/Aocs/sagitta.c b/src/src_user/Drivers/Aocs/sagitta.c index 725445a9..f42cd629 100644 --- a/src/src_user/Drivers/Aocs/sagitta.c +++ b/src/src_user/Drivers/Aocs/sagitta.c @@ -221,6 +221,16 @@ DS_INIT_ERR_CODE SAGITTA_init(SAGITTA_Driver* sagitta_driver, uint8_t ch, DS_Str return DS_INIT_OK; } +DS_INIT_ERR_CODE SAGITTA_DS_init(SAGITTA_Driver* sagitta_driver, DS_StreamRecBuffer* rx_buffer) +{ + DS_ERR_CODE ret; + ret = DS_init(&(sagitta_driver->driver.super), + &(sagitta_driver->driver.uart_config), + rx_buffer, + SAGITTA_load_driver_super_init_settings_); + return ret; +} + // ---------- UART Telemetry ---------- DS_REC_ERR_CODE SAGITTA_rec(SAGITTA_Driver* sagitta_driver) { diff --git a/src/src_user/Drivers/Aocs/sagitta.h b/src/src_user/Drivers/Aocs/sagitta.h index ede9bf8e..6cd8a1ab 100644 --- a/src/src_user/Drivers/Aocs/sagitta.h +++ b/src/src_user/Drivers/Aocs/sagitta.h @@ -481,6 +481,13 @@ typedef struct */ DS_INIT_ERR_CODE SAGITTA_init(SAGITTA_Driver* sagitta_driver, uint8_t ch, DS_StreamRecBuffer* rx_buffer); +/** + * @brief SAGITTAのDriver_Super初期化 + * @param sagitta_driver : 初期化するSAGITTA_Driver構造体へのポインタ + * @param rx_buffer: 受信バッファ + * @return DS_INIT_ERR_CODE + */ +DS_INIT_ERR_CODE SAGITTA_DS_init(SAGITTA_Driver* sagitta_driver, DS_StreamRecBuffer* rx_buffer); /** * @brief SAGITTA受信 * @param sagitta_driver : SAGITTA_Driver構造体へのポインタ diff --git a/src/src_user/TlmCmd/NormalBlockCommandDefinition/nbc_nanossoc_d60.c b/src/src_user/TlmCmd/NormalBlockCommandDefinition/nbc_nanossoc_d60.c index e53fd46b..1c443e24 100644 --- a/src/src_user/TlmCmd/NormalBlockCommandDefinition/nbc_nanossoc_d60.c +++ b/src/src_user/TlmCmd/NormalBlockCommandDefinition/nbc_nanossoc_d60.c @@ -145,6 +145,12 @@ void BCL_load_reset_nanossoc_d60(void) bc_cycle += OBCT_sec2cycle(5); BCL_tool_register_deploy(bc_cycle, BC_POWER_ON_NANOSSOC_D60, TLCD_ID_DEPLOY_BC); + bc_cycle += OBCT_sec2cycle(5); + + BCL_tool_register_cmd(bc_cycle, Cmd_CODE_DI_SAGITTA_DS_INIT); + bc_cycle++; + + BCL_tool_register_cmd(bc_cycle, Cmd_CODE_DI_SAGITTA_DS_INIT_STREAM_REC_BUFFER); } void BCL_load_activate_nanossoc_d60_eh(void) diff --git a/src/src_user/TlmCmd/NormalBlockCommandDefinition/nbc_sagitta.c b/src/src_user/TlmCmd/NormalBlockCommandDefinition/nbc_sagitta.c index 6d8b6b10..6499505f 100644 --- a/src/src_user/TlmCmd/NormalBlockCommandDefinition/nbc_sagitta.c +++ b/src/src_user/TlmCmd/NormalBlockCommandDefinition/nbc_sagitta.c @@ -124,9 +124,17 @@ void BCL_load_power_off_sagitta(void) void BCL_load_reset_sagitta(void) { - BCL_tool_register_deploy(OBCT_sec2cycle(1), BC_POWER_OFF_SAGITTA, TLCD_ID_DEPLOY_BC); + cycle_t bc_cycle = 1; + BCL_tool_register_deploy(bc_cycle, BC_POWER_OFF_SAGITTA, TLCD_ID_DEPLOY_BC); + bc_cycle += OBCT_sec2cycle(5); + + BCL_tool_register_deploy(bc_cycle, BC_POWER_ON_SAGITTA, TLCD_ID_DEPLOY_BC); + bc_cycle += OBCT_sec2cycle(5); + + BCL_tool_register_cmd(bc_cycle, Cmd_CODE_DI_SAGITTA_DS_INIT); + bc_cycle++; - BCL_tool_register_deploy(OBCT_sec2cycle(6), BC_POWER_ON_SAGITTA, TLCD_ID_DEPLOY_BC); + BCL_tool_register_cmd(bc_cycle, Cmd_CODE_DI_SAGITTA_DS_INIT_STREAM_REC_BUFFER); } void BCL_set_sagitta_parameter(void) From 1ce9ee0599ee41adccf30403324a449d4c3ffa52 Mon Sep 17 00:00:00 2001 From: michinarikake Date: Mon, 13 May 2024 15:48:42 +0900 Subject: [PATCH 2/8] edit csv and GenerateC2ACode --- database/CMD_DB/AOBC_CMD_DB_CMD_DB.csv | 68 ++++++++++--------- .../TlmCmd/block_command_definitions.h | 2 +- src/src_user/TlmCmd/command_definitions.c | 4 ++ src/src_user/TlmCmd/command_definitions.h | 68 ++++++++++--------- 4 files changed, 77 insertions(+), 65 deletions(-) diff --git a/database/CMD_DB/AOBC_CMD_DB_CMD_DB.csv b/database/CMD_DB/AOBC_CMD_DB_CMD_DB.csv index f5db9559..3e3af3a8 100644 --- a/database/CMD_DB/AOBC_CMD_DB_CMD_DB.csv +++ b/database/CMD_DB/AOBC_CMD_DB_CMD_DB.csv @@ -206,50 +206,54 @@ Comment,,,,,Type,Description,Type,Description,Type,Description,Type,Description, ,DI_SAGITTA_SET_PARAMETER,AOBC,0x0090,1,uint8_t,PARAMETER_ID,,,,,,,,,,,,,SAGITTAにパラメータ設定コマンドを送る, ,DI_SAGITTA_CHANGE_PARAMETER,AOBC,0x0091,3,uint8_t,PARAMETER_ID,uint8_t,PARAMETER_IDX,float,value,,,,,,,,,SAGITTAドライバ内のパラメータを変更する, ,DI_SAGITTA_READ_PARAMETER,AOBC,0x0092,1,uint8_t,PARAMETER_ID,,,,,,,,,,,,,SAGITTAのパラメータを読み取る, +,DI_SAGITTA_DS_INIT,AOBC,0x0093,0,,,,,,,,,,,,,,,SAGITTAのDriver Superを初期化, +,DI_SAGITTA_DS_INIT_STREAM_REC_BUFFER,AOBC,0x0094,0,,,,,,,,,,,,,,,SAGITTAのstream_rec_bufferを初期化, +,DI_NANOSSOC_D60_DS_INIT,AOBC,0x0095,0,,,,,,,,,,,,,,,NANOSSOC_D60のDriver Superを初期化, +,DI_NANOSSOC_D60_DS_INIT_STREAM_REC_BUFFER,AOBC,0x0096,0,,,,,,,,,,,,,,,NANOSSOC_D60のstream_rec_bufferを初期化, **,座標変換,,,,,,,,,,,,,,,,,,, -,DI_RM3100_SET_FRAME_TRANSFORMATION_QUATERNION_C2B,AOBC,0x0093,5,uint8_t,0=AOBC; 1=EXT,float,q_c2b_vec_0,float,q_c2b_vec_1,float,q_c2b_vec_2,float,q_c2b_scalar,,,,,RM3100の座標変換Quaternion_c2bを設定する, -,DI_MPU9250_SET_FRAME_TRANSFORMATION_QUATERNION_C2B,AOBC,0x0094,5,uint8_t,0=AOBC,float,q_c2b_vec_0,float,q_c2b_vec_1,float,q_c2b_vec_2,float,q_c2b_scalar,,,,,MPU9250の座標変換Quaternion_c2bを設定する, -,DI_NANOSSOC_D60_SET_FRAME_TRANSFORMATION_QUATERNION_C2B,AOBC,0x0095,5,uint8_t,IDX = 0 to max 5,float,q_c2b_vec_0,float,q_c2b_vec_1,float,q_c2b_vec_2,float,q_c2b_scalar,,,,,NanoSSOC-D60の座標変換Quaternion_c2bを設定する, -,DI_STIM210_SET_FRAME_TRANSFORMATION_QUATERNION_C2B,AOBC,0x0096,5,uint8_t,0=IN UNIT,float,q_c2b_vec_0,float,q_c2b_vec_1,float,q_c2b_vec_2,float,q_c2b_scalar,,,,,STIM210の座標変換Quaternion_c2bを設定する, -,DI_SAGITTA_SET_FRAME_TRANSFORMATION_QUATERNION_C2B,AOBC,0x0097,5,uint8_t,0=IN UNIT,float,q_c2b_vec_0,float,q_c2b_vec_1,float,q_c2b_vec_2,float,q_c2b_scalar,,,,,SAGITTAの座標変換Quaternion_c2bを設定する, -,DI_RW0003_SET_ROTATION_DIRECTION_VECTOR,AOBC,0x0098,4,uint8_t,RWX=0; RWY; RWZ,float,body_x,float,body_y,float,body_z,,,,,,,RW回転方向ベクトルを設定する, -,DI_MTQ_SEIREN_SET_MAGNETIC_MOMENT_DIRECTION_VECTOR,AOBC,0x0099,4,uint8_t,MTQ_X=0; MTQ_Y; MTQ_Z,float,body_x,float,body_y,float,body_z,,,,,,,MTQ磁気モーメント方向を設定する, +,DI_RM3100_SET_FRAME_TRANSFORMATION_QUATERNION_C2B,AOBC,0x0097,5,uint8_t,0=AOBC; 1=EXT,float,q_c2b_vec_0,float,q_c2b_vec_1,float,q_c2b_vec_2,float,q_c2b_scalar,,,,,RM3100の座標変換Quaternion_c2bを設定する, +,DI_MPU9250_SET_FRAME_TRANSFORMATION_QUATERNION_C2B,AOBC,0x0098,5,uint8_t,0=AOBC,float,q_c2b_vec_0,float,q_c2b_vec_1,float,q_c2b_vec_2,float,q_c2b_scalar,,,,,MPU9250の座標変換Quaternion_c2bを設定する, +,DI_NANOSSOC_D60_SET_FRAME_TRANSFORMATION_QUATERNION_C2B,AOBC,0x0099,5,uint8_t,IDX = 0 to max 5,float,q_c2b_vec_0,float,q_c2b_vec_1,float,q_c2b_vec_2,float,q_c2b_scalar,,,,,NanoSSOC-D60の座標変換Quaternion_c2bを設定する, +,DI_STIM210_SET_FRAME_TRANSFORMATION_QUATERNION_C2B,AOBC,0x009A,5,uint8_t,0=IN UNIT,float,q_c2b_vec_0,float,q_c2b_vec_1,float,q_c2b_vec_2,float,q_c2b_scalar,,,,,STIM210の座標変換Quaternion_c2bを設定する, +,DI_SAGITTA_SET_FRAME_TRANSFORMATION_QUATERNION_C2B,AOBC,0x009B,5,uint8_t,0=IN UNIT,float,q_c2b_vec_0,float,q_c2b_vec_1,float,q_c2b_vec_2,float,q_c2b_scalar,,,,,SAGITTAの座標変換Quaternion_c2bを設定する, +,DI_RW0003_SET_ROTATION_DIRECTION_VECTOR,AOBC,0x009C,4,uint8_t,RWX=0; RWY; RWZ,float,body_x,float,body_y,float,body_z,,,,,,,RW回転方向ベクトルを設定する, +,DI_MTQ_SEIREN_SET_MAGNETIC_MOMENT_DIRECTION_VECTOR,AOBC,0x009D,4,uint8_t,MTQ_X=0; MTQ_Y; MTQ_Z,float,body_x,float,body_y,float,body_z,,,,,,,MTQ磁気モーメント方向を設定する, **,バイアス補正,,,,,,,,,,,,,,,,,,, -,DI_MPU9250_SET_ANG_VEL_BIAS_COMPO_RAD_S,AOBC,0x009A,4,uint8_t,0=AOBC,float,compo_x_rad_s,float,compo_y_rad_s,float,compo_z_rad_s,,,,,,,MPU9250角速度バイアス誤差を設定する, -,DI_MPU9250_SET_MAG_BIAS_COMPO_NT,AOBC,0x009B,5,uint8_t,0=AOBC,float,compo_x_nT,float,compo_y_nT,float,compo_z_nT,uint8_t,0=set; 1=add,,,,,MPU9250磁場バイアス誤差を設定する, -,DI_RM3100_SET_MAG_BIAS_COMPO_NT,AOBC,0x009C,5,uint8_t,0=AOBC; 1=EXT,float,compo_x_nT,float,compo_y_nT,float,compo_z_nT,uint8_t,0=set; 1=add; 2=default,,,,,RM3100磁場バイアス誤差を設定する, -,DI_STIM210_SET_ANG_VEL_BIAS_COMPO_RAD_S,AOBC,0x009D,4,uint8_t,0=IN UNIT,float,compo_x_rad_s,float,compo_y_rad_s,float,compo_z_rad_s,,,,,,,STIM210角速度バイアス誤差を設定する, +,DI_MPU9250_SET_ANG_VEL_BIAS_COMPO_RAD_S,AOBC,0x009E,4,uint8_t,0=AOBC,float,compo_x_rad_s,float,compo_y_rad_s,float,compo_z_rad_s,,,,,,,MPU9250角速度バイアス誤差を設定する, +,DI_MPU9250_SET_MAG_BIAS_COMPO_NT,AOBC,0x009F,5,uint8_t,0=AOBC,float,compo_x_nT,float,compo_y_nT,float,compo_z_nT,uint8_t,0=set; 1=add,,,,,MPU9250磁場バイアス誤差を設定する, +,DI_RM3100_SET_MAG_BIAS_COMPO_NT,AOBC,0x00A0,5,uint8_t,0=AOBC; 1=EXT,float,compo_x_nT,float,compo_y_nT,float,compo_z_nT,uint8_t,0=set; 1=add; 2=default,,,,,RM3100磁場バイアス誤差を設定する, +,DI_STIM210_SET_ANG_VEL_BIAS_COMPO_RAD_S,AOBC,0x00A1,4,uint8_t,0=IN UNIT,float,compo_x_rad_s,float,compo_y_rad_s,float,compo_z_rad_s,,,,,,,STIM210角速度バイアス誤差を設定する, **,温度補正,,,,,,,,,,,,,,,,,,, -,DI_MPU9250_SET_ANG_VEL_BIAS_TEMP_CALIB,AOBC,0x009E,5,uint8_t,X=0; Y; Z,float,range_low_degC,float,range_high_degC,float,coeff_0,float,coeff_1,,,,,MPU角速度バイアス温度補正値の設定, -,DI_MPU9250_SET_ANG_VEL_SF_TEMP_CALIB,AOBC,0x009F,5,uint8_t,X=0; Y; Z,float,range_low_degC,float,range_high_degC,float,coeff_0,float,coeff_1,,,,,MPU角速度SF温度補正値の設定, -,DI_STIM210_SET_ANG_VEL_BIAS_TEMP_CALIB,AOBC,0x00A0,5,uint8_t,X=0; Y; Z,float,range_low_degC,float,range_high_degC,float,coeff_0,float,coeff_1,,,,,STIM角速度バイアス温度補正値の設定, -,DI_STIM210_SET_ANG_VEL_SF_TEMP_CALIB,AOBC,0x00A1,5,uint8_t,X=0; Y; Z,float,range_low_degC,float,range_high_degC,float,coeff_0,float,coeff_1,,,,,STIM角速度SF温度補正値の設定, +,DI_MPU9250_SET_ANG_VEL_BIAS_TEMP_CALIB,AOBC,0x00A2,5,uint8_t,X=0; Y; Z,float,range_low_degC,float,range_high_degC,float,coeff_0,float,coeff_1,,,,,MPU角速度バイアス温度補正値の設定, +,DI_MPU9250_SET_ANG_VEL_SF_TEMP_CALIB,AOBC,0x00A3,5,uint8_t,X=0; Y; Z,float,range_low_degC,float,range_high_degC,float,coeff_0,float,coeff_1,,,,,MPU角速度SF温度補正値の設定, +,DI_STIM210_SET_ANG_VEL_BIAS_TEMP_CALIB,AOBC,0x00A4,5,uint8_t,X=0; Y; Z,float,range_low_degC,float,range_high_degC,float,coeff_0,float,coeff_1,,,,,STIM角速度バイアス温度補正値の設定, +,DI_STIM210_SET_ANG_VEL_SF_TEMP_CALIB,AOBC,0x00A5,5,uint8_t,X=0; Y; Z,float,range_low_degC,float,range_high_degC,float,coeff_0,float,coeff_1,,,,,STIM角速度SF温度補正値の設定, **,セレクター,,,,,,,,,,,,,,,,,,, -,APP_MAG_SELECTOR_SET_STATE,AOBC,0x00A2,1,uint8_t,RM_AOBC=0; RM_EXT; MPU; FUSION,,,,,,,,,,,,,使う磁気センサを選択する, -,APP_GYRO_SELECTOR_SET_STATE,AOBC,0x00A3,1,uint8_t,MPU=0; STIM; FUSION,,,,,,,,,,,,,使うジャイロセンサを選択する, -,SUN_SENSOR_SELECTOR_SET_INTENSITY_THRESHOLD,AOBC,0x00A4,2,float,lower_threshold_percent,float,upper_threshold_percent,,,,,,,,,,,サンセンサが使用可能であると判定する太陽強度閾値設定, +,APP_MAG_SELECTOR_SET_STATE,AOBC,0x00A6,1,uint8_t,RM_AOBC=0; RM_EXT; MPU; FUSION,,,,,,,,,,,,,使う磁気センサを選択する, +,APP_GYRO_SELECTOR_SET_STATE,AOBC,0x00A7,1,uint8_t,MPU=0; STIM; FUSION,,,,,,,,,,,,,使うジャイロセンサを選択する, +,SUN_SENSOR_SELECTOR_SET_INTENSITY_THRESHOLD,AOBC,0x00A8,2,float,lower_threshold_percent,float,upper_threshold_percent,,,,,,,,,,,サンセンサが使用可能であると判定する太陽強度閾値設定, **,アノマリー,,,,,,,,,,,,,,,,,,, -,APP_TEMPERATURE_ANOMALY_SET_THRESHOLD,AOBC,0x00A5,3,uint8_t,0=PIC; RW_DCDC; ROUGH_GYRO; FINE_GYRO_X; Y; Z; STT_MCU; STT_CMOS; RW_X; Y; Z; GPSR,float,upper_degC,float,lower_degC,,,,,,,,,温度アノマリ閾値設定, +,APP_TEMPERATURE_ANOMALY_SET_THRESHOLD,AOBC,0x00A9,3,uint8_t,0=PIC; RW_DCDC; ROUGH_GYRO; FINE_GYRO_X; Y; Z; STT_MCU; STT_CMOS; RW_X; Y; Z; GPSR,float,upper_degC,float,lower_degC,,,,,,,,,温度アノマリ閾値設定, **,磁気排他制御,,,,,,,,,,,,,,,,,,, -,APP_MAGNETIC_EXCLUSIVE_CONTROL_TIMER_SET_ENABLE,AOBC,0x00A6,1,uint8_t,is_enable,,,,,,,,,,,,,磁気排他制御の有効・無効設定(0=無効・1=有効), -,APP_MAGNETIC_EXCLUSIVE_CONTROL_TIMER_SET_DURATION,AOBC,0x00A7,3,uint16_t,observe_duration[ms],uint16_t,control_duration[ms],uint16_t,standby_duration[ms],,,,,,,,,磁気排他制御に関する時間コンフィグ設定, -,APP_MTQ_SEIREN_CONTROLLER_SET_OUTPUT_RATIO,AOBC,0x00A8,2,uint8_t,X=0; Y; Z,int8_t,output ratio,,,,,,,,,,,MTQの出力時間比を[-100@@ +100](単位:%)の範囲で手動で設定する, +,APP_MAGNETIC_EXCLUSIVE_CONTROL_TIMER_SET_ENABLE,AOBC,0x00AA,1,uint8_t,is_enable,,,,,,,,,,,,,磁気排他制御の有効・無効設定(0=無効・1=有効), +,APP_MAGNETIC_EXCLUSIVE_CONTROL_TIMER_SET_DURATION,AOBC,0x00AB,3,uint16_t,observe_duration[ms],uint16_t,control_duration[ms],uint16_t,standby_duration[ms],,,,,,,,,磁気排他制御に関する時間コンフィグ設定, +,APP_MTQ_SEIREN_CONTROLLER_SET_OUTPUT_RATIO,AOBC,0x00AC,2,uint8_t,X=0; Y; Z,int8_t,output ratio,,,,,,,,,,,MTQの出力時間比を[-100@@ +100](単位:%)の範囲で手動で設定する, * FILTER,センサフィルター関連,,,,,,,,,,,,,,,,,,, -,APP_MPU9250_FILTER_SET_ZFILTER_PARAM,AOBC,0x00A8,4,uint8_t,MAG=0; GYRO=1,uint8_t,X=0; Y; Z,float,sampling_freq_Hz,float,cut_off_feq_Hz,,,,,,,MPU9250のSW-LPF設定, +,APP_MPU9250_FILTER_SET_ZFILTER_PARAM,AOBC,0x00AD,4,uint8_t,MAG=0; GYRO=1,uint8_t,X=0; Y; Z,float,sampling_freq_Hz,float,cut_off_feq_Hz,,,,,,,MPU9250のSW-LPF設定, *,APP_MPU9250_FILTER_RESET_ZFILTER,AOBC,,2,uint8_t,MAG=0; GYRO=1,uint8_t,X=0; Y; Z,,,,,,,,,,,MPU9250のSW-LPFリセット, -,APP_MPU9250_FILTER_SET_SPIKE_FILTER_PARAM,AOBC,0x00A9,6,uint8_t,MAG=0; GYRO=1,uint8_t,X=0; Y; Z,uint8_t,count_limit_to_accept,uint8_t,count_limit_to_reject_continued_warning,float,reject_threshold,float,amplitude_limit_to_accept_as_step,,,MPU9250のSpike除去フィルタ設定, +,APP_MPU9250_FILTER_SET_SPIKE_FILTER_PARAM,AOBC,0x00AE,6,uint8_t,MAG=0; GYRO=1,uint8_t,X=0; Y; Z,uint8_t,count_limit_to_accept,uint8_t,count_limit_to_reject_continued_warning,float,reject_threshold,float,amplitude_limit_to_accept_as_step,,,MPU9250のSpike除去フィルタ設定, *,APP_MPU9250_FILTER_RESET_SPIKE_FILTER,AOBC,,2,uint8_t,MAG=0; GYRO=1,uint8_t,X=0; Y; Z,,,,,,,,,,,MPU9250のSpike除去フィルタリセット, -,APP_STIM210_FILTER_SET_ZFILTER_PARAM,AOBC,0x00AA,4,uint8_t,0=IN UNIT,uint8_t,X=0; Y; Z,float,sampling_freq_Hz,float,cut_off_feq_Hz,,,,,,,STIM210のSW-LPF設定, +,APP_STIM210_FILTER_SET_ZFILTER_PARAM,AOBC,0x00AF,4,uint8_t,0=IN UNIT,uint8_t,X=0; Y; Z,float,sampling_freq_Hz,float,cut_off_feq_Hz,,,,,,,STIM210のSW-LPF設定, *,APP_STIM210_FILTER_RESET_ZFILTER,AOBC,,2,uint8_t,0=IN UNIT,uint8_t,X=0; Y; Z,,,,,,,,,,,STIM210のSW-LPFリセット, -,APP_STIM210_FILTER_SET_SPIKE_FILTER_PARAM,AOBC,0x00AB,6,uint8_t,0=IN UNIT,uint8_t,X=0; Y; Z,uint8_t,count_limit_to_accept,uint8_t,count_limit_to_reject_continued_warning,float,reject_threshold,float,amplitude_limit_to_accept_as_step,,,STIM210のSpike除去フィルタ設定, +,APP_STIM210_FILTER_SET_SPIKE_FILTER_PARAM,AOBC,0x00B0,6,uint8_t,0=IN UNIT,uint8_t,X=0; Y; Z,uint8_t,count_limit_to_accept,uint8_t,count_limit_to_reject_continued_warning,float,reject_threshold,float,amplitude_limit_to_accept_as_step,,,STIM210のSpike除去フィルタ設定, *,APP_STIM210_FILTER_RESET_SPIKE_FILTER,AOBC,,2,uint8_t,0=IN UNIT,uint8_t,X=0; Y; Z,,,,,,,,,,,STIM210のSpike除去フィルタリセット, -,APP_RM3100_FILTER_SET_ZFILTER_PARAM,AOBC,0x00AC,4,uint8_t,ON AOBC=0; EXTERNAL=1,uint8_t,X=0; Y; Z,float,sampling_freq_Hz,float,cut_off_feq_Hz,,,,,,,RM3100のSW-LPF設定, -,APP_RM3100_FILTER_SET_SPIKE_FILTER_PARAM,AOBC,0x00AD,6,uint8_t,ON AOBC=0; EXTERNAL=1,uint8_t,X=0; Y; Z,uint8_t,count_limit_to_accept,uint8_t,count_limit_to_reject_continued_warning,float,reject_threshold,float,amplitude_limit_to_accept_as_step,,,RM3100のSpike除去フィルタ設定, -,APP_RW0003_FILTER_SET_SPIKE_FILTER_PARAM,AOBC,0x00AE,5,uint8_t,X=0; Y; Z,uint8_t,count_limit_to_accept,uint8_t,count_limit_to_reject_continued_warning,float,reject_threshold,float,amplitude_limit_to_accept_as_step,,,,,RW0003のSpike除去フィルタ設定, +,APP_RM3100_FILTER_SET_ZFILTER_PARAM,AOBC,0x00B1,4,uint8_t,ON AOBC=0; EXTERNAL=1,uint8_t,X=0; Y; Z,float,sampling_freq_Hz,float,cut_off_feq_Hz,,,,,,,RM3100のSW-LPF設定, +,APP_RM3100_FILTER_SET_SPIKE_FILTER_PARAM,AOBC,0x00B2,6,uint8_t,ON AOBC=0; EXTERNAL=1,uint8_t,X=0; Y; Z,uint8_t,count_limit_to_accept,uint8_t,count_limit_to_reject_continued_warning,float,reject_threshold,float,amplitude_limit_to_accept_as_step,,,RM3100のSpike除去フィルタ設定, +,APP_RW0003_FILTER_SET_SPIKE_FILTER_PARAM,AOBC,0x00B3,5,uint8_t,X=0; Y; Z,uint8_t,count_limit_to_accept,uint8_t,count_limit_to_reject_continued_warning,float,reject_threshold,float,amplitude_limit_to_accept_as_step,,,,,RW0003のSpike除去フィルタ設定, *,APP_RW0003_FILTER_RESET_SPIKE_FILTER,AOBC,,1,uint8_t,uint8_t,,,,,,,,,,,,,RW0003のSpike除去フィルタリセット, -,APP_OEM7600_FILTER_SET_SPIKE_FILTER_PARAM,AOBC,0x00AF,6,uint8_t,oem_id,uint8_t,Xp=0; Yp; Zp; Xv; Yv; Zv,uint8_t,count_limit_to_accept,uint8_t,count_limit_to_reject_continued_warning,float,reject_threshold,float,amplitude_limit_to_accept_as_step,,,OEM7600のSpike除去フィルタ設定,第2引数の値は位置XYZ~速度XYZが0~5に対応 -,APP_SAGITTA_FILTER_SET_SPIKE_FILTER_PARAM,AOBC,0x00B0,5,uint8_t,sagitta_id,uint8_t,count_limit_to_accept,uint8_t,count_limit_to_reject_continued_warning,float,reject_threshold,float,amplitude_limit_to_accept_as_step,,,,,SagittaのSpike除去フィルタ設定, -,APP_NANOSSOC_D60_FILTER_SET_SPIKE_FILTER_PARAM,AOBC,0x00B1,4,uint8_t,count_limit_to_accept,uint8_t,count_limit_to_reject_continued_warning,float,reject_threshold,float,amplitude_limit_to_accept_as_step,,,,,,,太陽センサのSpike除去フィルタ設定, +,APP_OEM7600_FILTER_SET_SPIKE_FILTER_PARAM,AOBC,0x00B4,6,uint8_t,oem_id,uint8_t,Xp=0; Yp; Zp; Xv; Yv; Zv,uint8_t,count_limit_to_accept,uint8_t,count_limit_to_reject_continued_warning,float,reject_threshold,float,amplitude_limit_to_accept_as_step,,,OEM7600のSpike除去フィルタ設定,第2引数の値は位置XYZ~速度XYZが0~5に対応 +,APP_SAGITTA_FILTER_SET_SPIKE_FILTER_PARAM,AOBC,0x00B5,5,uint8_t,sagitta_id,uint8_t,count_limit_to_accept,uint8_t,count_limit_to_reject_continued_warning,float,reject_threshold,float,amplitude_limit_to_accept_as_step,,,,,SagittaのSpike除去フィルタ設定, +,APP_NANOSSOC_D60_FILTER_SET_SPIKE_FILTER_PARAM,AOBC,0x00B6,4,uint8_t,count_limit_to_accept,uint8_t,count_limit_to_reject_continued_warning,float,reject_threshold,float,amplitude_limit_to_accept_as_step,,,,,,,太陽センサのSpike除去フィルタ設定, * ALGORITHM,姿勢制御アルゴリズム関連,,,,,,,,,,,,,,,,,,, **,自動モード遷移,,,,,,,,,,,,,,,,,,, ,APP_AOCS_MM_SET_AUTO_MODE_TRANSITION,AOBC,0x00B7,1,uint8_t,0=disable; 1=enable,,,,,,,,,,,,,自動モード遷移 Enable/Disable設定, diff --git a/src/src_user/TlmCmd/block_command_definitions.h b/src/src_user/TlmCmd/block_command_definitions.h index 51a39a0e..00a04e19 100644 --- a/src/src_user/TlmCmd/block_command_definitions.h +++ b/src/src_user/TlmCmd/block_command_definitions.h @@ -113,7 +113,7 @@ typedef enum // others 全体のテレメとかを登録 // システム試験TLM: - // BCT MAX : 80 + // BCT MAX : 90 BC_ID_MAX // BCT 自体のサイズは BCT_MAX_BLOCKS で規定 } BC_DEFAULT_ID; diff --git a/src/src_user/TlmCmd/command_definitions.c b/src/src_user/TlmCmd/command_definitions.c index 7d01948e..053bbe2c 100644 --- a/src/src_user/TlmCmd/command_definitions.c +++ b/src/src_user/TlmCmd/command_definitions.c @@ -150,6 +150,10 @@ void CA_load_cmd_table(CA_CmdInfo cmd_table[CA_MAX_CMDS]) cmd_table[Cmd_CODE_DI_SAGITTA_SET_PARAMETER].cmd_func = Cmd_DI_SAGITTA_SET_PARAMETER; cmd_table[Cmd_CODE_DI_SAGITTA_CHANGE_PARAMETER].cmd_func = Cmd_DI_SAGITTA_CHANGE_PARAMETER; cmd_table[Cmd_CODE_DI_SAGITTA_READ_PARAMETER].cmd_func = Cmd_DI_SAGITTA_READ_PARAMETER; + cmd_table[Cmd_CODE_DI_SAGITTA_DS_INIT].cmd_func = Cmd_DI_SAGITTA_DS_INIT; + cmd_table[Cmd_CODE_DI_SAGITTA_DS_INIT_STREAM_REC_BUFFER].cmd_func = Cmd_DI_SAGITTA_DS_INIT_STREAM_REC_BUFFER; + cmd_table[Cmd_CODE_DI_NANOSSOC_D60_DS_INIT].cmd_func = Cmd_DI_NANOSSOC_D60_DS_INIT; + cmd_table[Cmd_CODE_DI_NANOSSOC_D60_DS_INIT_STREAM_REC_BUFFER].cmd_func = Cmd_DI_NANOSSOC_D60_DS_INIT_STREAM_REC_BUFFER; cmd_table[Cmd_CODE_DI_RM3100_SET_FRAME_TRANSFORMATION_QUATERNION_C2B].cmd_func = Cmd_DI_RM3100_SET_FRAME_TRANSFORMATION_QUATERNION_C2B; cmd_table[Cmd_CODE_DI_MPU9250_SET_FRAME_TRANSFORMATION_QUATERNION_C2B].cmd_func = Cmd_DI_MPU9250_SET_FRAME_TRANSFORMATION_QUATERNION_C2B; cmd_table[Cmd_CODE_DI_NANOSSOC_D60_SET_FRAME_TRANSFORMATION_QUATERNION_C2B].cmd_func = Cmd_DI_NANOSSOC_D60_SET_FRAME_TRANSFORMATION_QUATERNION_C2B; diff --git a/src/src_user/TlmCmd/command_definitions.h b/src/src_user/TlmCmd/command_definitions.h index ad05a335..51dea42b 100644 --- a/src/src_user/TlmCmd/command_definitions.h +++ b/src/src_user/TlmCmd/command_definitions.h @@ -148,38 +148,42 @@ typedef enum Cmd_CODE_DI_SAGITTA_SET_PARAMETER = 0x0090, Cmd_CODE_DI_SAGITTA_CHANGE_PARAMETER = 0x0091, Cmd_CODE_DI_SAGITTA_READ_PARAMETER = 0x0092, - Cmd_CODE_DI_RM3100_SET_FRAME_TRANSFORMATION_QUATERNION_C2B = 0x0093, - Cmd_CODE_DI_MPU9250_SET_FRAME_TRANSFORMATION_QUATERNION_C2B = 0x0094, - Cmd_CODE_DI_NANOSSOC_D60_SET_FRAME_TRANSFORMATION_QUATERNION_C2B = 0x0095, - Cmd_CODE_DI_STIM210_SET_FRAME_TRANSFORMATION_QUATERNION_C2B = 0x0096, - Cmd_CODE_DI_SAGITTA_SET_FRAME_TRANSFORMATION_QUATERNION_C2B = 0x0097, - Cmd_CODE_DI_RW0003_SET_ROTATION_DIRECTION_VECTOR = 0x0098, - Cmd_CODE_DI_MTQ_SEIREN_SET_MAGNETIC_MOMENT_DIRECTION_VECTOR = 0x0099, - Cmd_CODE_DI_MPU9250_SET_ANG_VEL_BIAS_COMPO_RAD_S = 0x009A, - Cmd_CODE_DI_MPU9250_SET_MAG_BIAS_COMPO_NT = 0x009B, - Cmd_CODE_DI_RM3100_SET_MAG_BIAS_COMPO_NT = 0x009C, - Cmd_CODE_DI_STIM210_SET_ANG_VEL_BIAS_COMPO_RAD_S = 0x009D, - Cmd_CODE_DI_MPU9250_SET_ANG_VEL_BIAS_TEMP_CALIB = 0x009E, - Cmd_CODE_DI_MPU9250_SET_ANG_VEL_SF_TEMP_CALIB = 0x009F, - Cmd_CODE_DI_STIM210_SET_ANG_VEL_BIAS_TEMP_CALIB = 0x00A0, - Cmd_CODE_DI_STIM210_SET_ANG_VEL_SF_TEMP_CALIB = 0x00A1, - Cmd_CODE_APP_MAG_SELECTOR_SET_STATE = 0x00A2, - Cmd_CODE_APP_GYRO_SELECTOR_SET_STATE = 0x00A3, - Cmd_CODE_SUN_SENSOR_SELECTOR_SET_INTENSITY_THRESHOLD = 0x00A4, - Cmd_CODE_APP_TEMPERATURE_ANOMALY_SET_THRESHOLD = 0x00A5, - Cmd_CODE_APP_MAGNETIC_EXCLUSIVE_CONTROL_TIMER_SET_ENABLE = 0x00A6, - Cmd_CODE_APP_MAGNETIC_EXCLUSIVE_CONTROL_TIMER_SET_DURATION = 0x00A7, - Cmd_CODE_APP_MTQ_SEIREN_CONTROLLER_SET_OUTPUT_RATIO = 0x00A8, - Cmd_CODE_APP_MPU9250_FILTER_SET_ZFILTER_PARAM = 0x00A8, - Cmd_CODE_APP_MPU9250_FILTER_SET_SPIKE_FILTER_PARAM = 0x00A9, - Cmd_CODE_APP_STIM210_FILTER_SET_ZFILTER_PARAM = 0x00AA, - Cmd_CODE_APP_STIM210_FILTER_SET_SPIKE_FILTER_PARAM = 0x00AB, - Cmd_CODE_APP_RM3100_FILTER_SET_ZFILTER_PARAM = 0x00AC, - Cmd_CODE_APP_RM3100_FILTER_SET_SPIKE_FILTER_PARAM = 0x00AD, - Cmd_CODE_APP_RW0003_FILTER_SET_SPIKE_FILTER_PARAM = 0x00AE, - Cmd_CODE_APP_OEM7600_FILTER_SET_SPIKE_FILTER_PARAM = 0x00AF, - Cmd_CODE_APP_SAGITTA_FILTER_SET_SPIKE_FILTER_PARAM = 0x00B0, - Cmd_CODE_APP_NANOSSOC_D60_FILTER_SET_SPIKE_FILTER_PARAM = 0x00B1, + Cmd_CODE_DI_SAGITTA_DS_INIT = 0x0093, + Cmd_CODE_DI_SAGITTA_DS_INIT_STREAM_REC_BUFFER = 0x0094, + Cmd_CODE_DI_NANOSSOC_D60_DS_INIT = 0x0095, + Cmd_CODE_DI_NANOSSOC_D60_DS_INIT_STREAM_REC_BUFFER = 0x0096, + Cmd_CODE_DI_RM3100_SET_FRAME_TRANSFORMATION_QUATERNION_C2B = 0x0097, + Cmd_CODE_DI_MPU9250_SET_FRAME_TRANSFORMATION_QUATERNION_C2B = 0x0098, + Cmd_CODE_DI_NANOSSOC_D60_SET_FRAME_TRANSFORMATION_QUATERNION_C2B = 0x0099, + Cmd_CODE_DI_STIM210_SET_FRAME_TRANSFORMATION_QUATERNION_C2B = 0x009A, + Cmd_CODE_DI_SAGITTA_SET_FRAME_TRANSFORMATION_QUATERNION_C2B = 0x009B, + Cmd_CODE_DI_RW0003_SET_ROTATION_DIRECTION_VECTOR = 0x009C, + Cmd_CODE_DI_MTQ_SEIREN_SET_MAGNETIC_MOMENT_DIRECTION_VECTOR = 0x009D, + Cmd_CODE_DI_MPU9250_SET_ANG_VEL_BIAS_COMPO_RAD_S = 0x009E, + Cmd_CODE_DI_MPU9250_SET_MAG_BIAS_COMPO_NT = 0x009F, + Cmd_CODE_DI_RM3100_SET_MAG_BIAS_COMPO_NT = 0x00A0, + Cmd_CODE_DI_STIM210_SET_ANG_VEL_BIAS_COMPO_RAD_S = 0x00A1, + Cmd_CODE_DI_MPU9250_SET_ANG_VEL_BIAS_TEMP_CALIB = 0x00A2, + Cmd_CODE_DI_MPU9250_SET_ANG_VEL_SF_TEMP_CALIB = 0x00A3, + Cmd_CODE_DI_STIM210_SET_ANG_VEL_BIAS_TEMP_CALIB = 0x00A4, + Cmd_CODE_DI_STIM210_SET_ANG_VEL_SF_TEMP_CALIB = 0x00A5, + Cmd_CODE_APP_MAG_SELECTOR_SET_STATE = 0x00A6, + Cmd_CODE_APP_GYRO_SELECTOR_SET_STATE = 0x00A7, + Cmd_CODE_SUN_SENSOR_SELECTOR_SET_INTENSITY_THRESHOLD = 0x00A8, + Cmd_CODE_APP_TEMPERATURE_ANOMALY_SET_THRESHOLD = 0x00A9, + Cmd_CODE_APP_MAGNETIC_EXCLUSIVE_CONTROL_TIMER_SET_ENABLE = 0x00AA, + Cmd_CODE_APP_MAGNETIC_EXCLUSIVE_CONTROL_TIMER_SET_DURATION = 0x00AB, + Cmd_CODE_APP_MTQ_SEIREN_CONTROLLER_SET_OUTPUT_RATIO = 0x00AC, + Cmd_CODE_APP_MPU9250_FILTER_SET_ZFILTER_PARAM = 0x00AD, + Cmd_CODE_APP_MPU9250_FILTER_SET_SPIKE_FILTER_PARAM = 0x00AE, + Cmd_CODE_APP_STIM210_FILTER_SET_ZFILTER_PARAM = 0x00AF, + Cmd_CODE_APP_STIM210_FILTER_SET_SPIKE_FILTER_PARAM = 0x00B0, + Cmd_CODE_APP_RM3100_FILTER_SET_ZFILTER_PARAM = 0x00B1, + Cmd_CODE_APP_RM3100_FILTER_SET_SPIKE_FILTER_PARAM = 0x00B2, + Cmd_CODE_APP_RW0003_FILTER_SET_SPIKE_FILTER_PARAM = 0x00B3, + Cmd_CODE_APP_OEM7600_FILTER_SET_SPIKE_FILTER_PARAM = 0x00B4, + Cmd_CODE_APP_SAGITTA_FILTER_SET_SPIKE_FILTER_PARAM = 0x00B5, + Cmd_CODE_APP_NANOSSOC_D60_FILTER_SET_SPIKE_FILTER_PARAM = 0x00B6, Cmd_CODE_APP_AOCS_MM_SET_AUTO_MODE_TRANSITION = 0x00B7, Cmd_CODE_APP_AOCS_MM_SET_ANG_VEL_THRESHOLD = 0x00B8, Cmd_CODE_APP_AOCS_MM_SET_SUN_ANGLE_THRESHOLD = 0x00B9, From 480c396102310b9cb5457f111a7ffebedc07447a Mon Sep 17 00:00:00 2001 From: michinarikake Date: Mon, 13 May 2024 15:59:19 +0900 Subject: [PATCH 3/8] change cmd order in bc --- .../NormalBlockCommandDefinition/nbc_nanossoc_d60.c | 8 ++++---- .../TlmCmd/NormalBlockCommandDefinition/nbc_sagitta.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/src_user/TlmCmd/NormalBlockCommandDefinition/nbc_nanossoc_d60.c b/src/src_user/TlmCmd/NormalBlockCommandDefinition/nbc_nanossoc_d60.c index 1c443e24..c2b46212 100644 --- a/src/src_user/TlmCmd/NormalBlockCommandDefinition/nbc_nanossoc_d60.c +++ b/src/src_user/TlmCmd/NormalBlockCommandDefinition/nbc_nanossoc_d60.c @@ -144,13 +144,13 @@ void BCL_load_reset_nanossoc_d60(void) BCL_tool_register_deploy(bc_cycle, BC_POWER_OFF_NANOSSOC_D60, TLCD_ID_DEPLOY_BC); // 4.5sec bc_cycle += OBCT_sec2cycle(5); - BCL_tool_register_deploy(bc_cycle, BC_POWER_ON_NANOSSOC_D60, TLCD_ID_DEPLOY_BC); - bc_cycle += OBCT_sec2cycle(5); - BCL_tool_register_cmd(bc_cycle, Cmd_CODE_DI_SAGITTA_DS_INIT); bc_cycle++; - + BCL_tool_register_cmd(bc_cycle, Cmd_CODE_DI_SAGITTA_DS_INIT_STREAM_REC_BUFFER); + bc_cycle++; + + BCL_tool_register_deploy(bc_cycle, BC_POWER_ON_NANOSSOC_D60, TLCD_ID_DEPLOY_BC); } void BCL_load_activate_nanossoc_d60_eh(void) diff --git a/src/src_user/TlmCmd/NormalBlockCommandDefinition/nbc_sagitta.c b/src/src_user/TlmCmd/NormalBlockCommandDefinition/nbc_sagitta.c index 6499505f..38a6c797 100644 --- a/src/src_user/TlmCmd/NormalBlockCommandDefinition/nbc_sagitta.c +++ b/src/src_user/TlmCmd/NormalBlockCommandDefinition/nbc_sagitta.c @@ -128,13 +128,13 @@ void BCL_load_reset_sagitta(void) BCL_tool_register_deploy(bc_cycle, BC_POWER_OFF_SAGITTA, TLCD_ID_DEPLOY_BC); bc_cycle += OBCT_sec2cycle(5); - BCL_tool_register_deploy(bc_cycle, BC_POWER_ON_SAGITTA, TLCD_ID_DEPLOY_BC); - bc_cycle += OBCT_sec2cycle(5); - BCL_tool_register_cmd(bc_cycle, Cmd_CODE_DI_SAGITTA_DS_INIT); bc_cycle++; BCL_tool_register_cmd(bc_cycle, Cmd_CODE_DI_SAGITTA_DS_INIT_STREAM_REC_BUFFER); + bc_cycle++; + + BCL_tool_register_deploy(bc_cycle, BC_POWER_ON_SAGITTA, TLCD_ID_DEPLOY_BC); } void BCL_set_sagitta_parameter(void) From e65dfb81850a997416b7338b65ca6208d0c99ae7 Mon Sep 17 00:00:00 2001 From: michinarikake Date: Mon, 13 May 2024 16:17:27 +0900 Subject: [PATCH 4/8] fix type of ret --- .../DriverInstances/di_nanossoc_d60.c | 16 ++++++++++------ .../Applications/DriverInstances/di_sagitta.c | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/src_user/Applications/DriverInstances/di_nanossoc_d60.c b/src/src_user/Applications/DriverInstances/di_nanossoc_d60.c index b83f3d36..6f3e49a7 100644 --- a/src/src_user/Applications/DriverInstances/di_nanossoc_d60.c +++ b/src/src_user/Applications/DriverInstances/di_nanossoc_d60.c @@ -167,14 +167,16 @@ CCP_CmdRet Cmd_DI_NANOSSOC_D60_DS_INIT(const CommonCmdPacket* packet) { (void)packet; uint8_t i; - DS_INIT_ERR_CODE ret = DS_ERR_CODE_OK; + uint8_t is_ok; + DS_INIT_ERR_CODE ret; for (i = 0; i < NANOSSOC_D60_PARAMETERS_NUMBER_OF_MOUNTED_SENSOR; ++i) { - ret |= NANOSSOC_D60_DS_init(&nanossoc_d60_driver_[i], &DI_NANOSSOC_D60_rx_buffer_[i]); + ret = NANOSSOC_D60_DS_init(&nanossoc_d60_driver_[i], &DI_NANOSSOC_D60_rx_buffer_[i]); + is_ok |= (ret == DS_INIT_OK); } - if (ret != DS_ERR_CODE_OK) + if (!is_ok) { return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_CONTEXT); } @@ -185,16 +187,18 @@ CCP_CmdRet Cmd_DI_NANOSSOC_D60_DS_INIT_STREAM_REC_BUFFER(const CommonCmdPacket* { (void)packet; uint8_t i; - DS_ERR_CODE ret = DS_ERR_CODE_OK; + uint8_t is_ok; + DS_ERR_CODE ret; for (i = 0; i < NANOSSOC_D60_PARAMETERS_NUMBER_OF_MOUNTED_SENSOR; ++i) { - ret |= DS_init_stream_rec_buffer(&DI_NANOSSOC_D60_rx_buffer_[i], + ret = DS_init_stream_rec_buffer(&DI_NANOSSOC_D60_rx_buffer_[i], DI_NANOSSOC_D60_rx_buffer_allocation_[i], sizeof(DI_NANOSSOC_D60_rx_buffer_allocation_[i])); + is_ok |= (ret == DS_ERR_CODE_OK); } - if (ret != DS_ERR_CODE_OK) + if (!is_ok) { return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_CONTEXT); } diff --git a/src/src_user/Applications/DriverInstances/di_sagitta.c b/src/src_user/Applications/DriverInstances/di_sagitta.c index 6d2f98ef..f12d7840 100644 --- a/src/src_user/Applications/DriverInstances/di_sagitta.c +++ b/src/src_user/Applications/DriverInstances/di_sagitta.c @@ -308,7 +308,7 @@ CCP_CmdRet Cmd_DI_SAGITTA_DS_INIT(const CommonCmdPacket* packet) DS_INIT_ERR_CODE ret; ret = SAGITTA_DS_init(&sagitta_driver_[SAGITTA_IDX_IN_UNIT], &DI_SAGITTA_rx_buffer_); - if (ret != DS_ERR_CODE_OK) + if (ret != DS_INIT_OK) { return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_CONTEXT); } From 08ff26a7b3a8bacb3b95696c52e9cb54eeddcdd4 Mon Sep 17 00:00:00 2001 From: michinarikake Date: Mon, 13 May 2024 16:21:47 +0900 Subject: [PATCH 5/8] fix type of ret --- src/src_user/Applications/DriverInstances/di_nanossoc_d60.c | 1 - src/src_user/Drivers/Aocs/nanossoc_d60.c | 2 +- src/src_user/Drivers/Aocs/sagitta.c | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/src_user/Applications/DriverInstances/di_nanossoc_d60.c b/src/src_user/Applications/DriverInstances/di_nanossoc_d60.c index 6f3e49a7..0e4c005b 100644 --- a/src/src_user/Applications/DriverInstances/di_nanossoc_d60.c +++ b/src/src_user/Applications/DriverInstances/di_nanossoc_d60.c @@ -203,7 +203,6 @@ CCP_CmdRet Cmd_DI_NANOSSOC_D60_DS_INIT_STREAM_REC_BUFFER(const CommonCmdPacket* return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_CONTEXT); } return CCP_make_cmd_ret_without_err_code(CCP_EXEC_SUCCESS); - } #pragma section diff --git a/src/src_user/Drivers/Aocs/nanossoc_d60.c b/src/src_user/Drivers/Aocs/nanossoc_d60.c index c36c7878..bb626f9d 100644 --- a/src/src_user/Drivers/Aocs/nanossoc_d60.c +++ b/src/src_user/Drivers/Aocs/nanossoc_d60.c @@ -56,7 +56,7 @@ DS_INIT_ERR_CODE NANOSSOC_D60_init(NANOSSOC_D60_Driver* nanossoc_d60_driver, uin DS_INIT_ERR_CODE NANOSSOC_D60_DS_init(NANOSSOC_D60_Driver* nanossoc_d60_driver, DS_StreamRecBuffer* rx_buffer) { - DS_ERR_CODE ret; + DS_INIT_ERR_CODE ret; ret = DS_init(&(nanossoc_d60_driver->driver.super), &(nanossoc_d60_driver->driver.i2c_config), diff --git a/src/src_user/Drivers/Aocs/sagitta.c b/src/src_user/Drivers/Aocs/sagitta.c index f42cd629..0c3df73f 100644 --- a/src/src_user/Drivers/Aocs/sagitta.c +++ b/src/src_user/Drivers/Aocs/sagitta.c @@ -223,7 +223,7 @@ DS_INIT_ERR_CODE SAGITTA_init(SAGITTA_Driver* sagitta_driver, uint8_t ch, DS_Str DS_INIT_ERR_CODE SAGITTA_DS_init(SAGITTA_Driver* sagitta_driver, DS_StreamRecBuffer* rx_buffer) { - DS_ERR_CODE ret; + DS_INIT_ERR_CODE ret; ret = DS_init(&(sagitta_driver->driver.super), &(sagitta_driver->driver.uart_config), rx_buffer, From a24ed4e23fb62afc7927a13ecca5b7d0889a3742 Mon Sep 17 00:00:00 2001 From: michinarikake Date: Mon, 13 May 2024 16:26:19 +0900 Subject: [PATCH 6/8] fix type of ret --- src/src_user/Applications/DriverInstances/di_nanossoc_d60.c | 2 +- src/src_user/Applications/DriverInstances/di_sagitta.c | 2 +- src/src_user/Drivers/Aocs/nanossoc_d60.c | 4 ++-- src/src_user/Drivers/Aocs/nanossoc_d60.h | 2 +- src/src_user/Drivers/Aocs/sagitta.c | 4 ++-- src/src_user/Drivers/Aocs/sagitta.h | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/src_user/Applications/DriverInstances/di_nanossoc_d60.c b/src/src_user/Applications/DriverInstances/di_nanossoc_d60.c index 0e4c005b..fe1e9498 100644 --- a/src/src_user/Applications/DriverInstances/di_nanossoc_d60.c +++ b/src/src_user/Applications/DriverInstances/di_nanossoc_d60.c @@ -168,7 +168,7 @@ CCP_CmdRet Cmd_DI_NANOSSOC_D60_DS_INIT(const CommonCmdPacket* packet) (void)packet; uint8_t i; uint8_t is_ok; - DS_INIT_ERR_CODE ret; + DS_ERR_CODE ret; for (i = 0; i < NANOSSOC_D60_PARAMETERS_NUMBER_OF_MOUNTED_SENSOR; ++i) { diff --git a/src/src_user/Applications/DriverInstances/di_sagitta.c b/src/src_user/Applications/DriverInstances/di_sagitta.c index f12d7840..42965d61 100644 --- a/src/src_user/Applications/DriverInstances/di_sagitta.c +++ b/src/src_user/Applications/DriverInstances/di_sagitta.c @@ -305,7 +305,7 @@ CCP_CmdRet Cmd_DI_SAGITTA_SET_FRAME_TRANSFORMATION_QUATERNION_C2B(const CommonCm CCP_CmdRet Cmd_DI_SAGITTA_DS_INIT(const CommonCmdPacket* packet) { (void)packet; - DS_INIT_ERR_CODE ret; + DS_ERR_CODE ret; ret = SAGITTA_DS_init(&sagitta_driver_[SAGITTA_IDX_IN_UNIT], &DI_SAGITTA_rx_buffer_); if (ret != DS_INIT_OK) diff --git a/src/src_user/Drivers/Aocs/nanossoc_d60.c b/src/src_user/Drivers/Aocs/nanossoc_d60.c index bb626f9d..71d5ca93 100644 --- a/src/src_user/Drivers/Aocs/nanossoc_d60.c +++ b/src/src_user/Drivers/Aocs/nanossoc_d60.c @@ -54,9 +54,9 @@ DS_INIT_ERR_CODE NANOSSOC_D60_init(NANOSSOC_D60_Driver* nanossoc_d60_driver, uin return DS_INIT_OK; } -DS_INIT_ERR_CODE NANOSSOC_D60_DS_init(NANOSSOC_D60_Driver* nanossoc_d60_driver, DS_StreamRecBuffer* rx_buffer) +DS_ERR_CODE NANOSSOC_D60_DS_init(NANOSSOC_D60_Driver* nanossoc_d60_driver, DS_StreamRecBuffer* rx_buffer) { - DS_INIT_ERR_CODE ret; + DS_ERR_CODE ret; ret = DS_init(&(nanossoc_d60_driver->driver.super), &(nanossoc_d60_driver->driver.i2c_config), diff --git a/src/src_user/Drivers/Aocs/nanossoc_d60.h b/src/src_user/Drivers/Aocs/nanossoc_d60.h index cdf01835..0f5ebfb7 100644 --- a/src/src_user/Drivers/Aocs/nanossoc_d60.h +++ b/src/src_user/Drivers/Aocs/nanossoc_d60.h @@ -100,7 +100,7 @@ DS_INIT_ERR_CODE NANOSSOC_D60_init(NANOSSOC_D60_Driver* nanossoc_d60_driver, uin * @param rx_buffer: 受信バッファ * @return DS_INIT_ERR_CODE */ -DS_INIT_ERR_CODE NANOSSOC_D60_DS_init(NANOSSOC_D60_Driver* nanossoc_d60_driver, DS_StreamRecBuffer* rx_buffer); +DS_ERR_CODE NANOSSOC_D60_DS_init(NANOSSOC_D60_Driver* nanossoc_d60_driver, DS_StreamRecBuffer* rx_buffer); /** * @brief NANOSSOC_D60観測 diff --git a/src/src_user/Drivers/Aocs/sagitta.c b/src/src_user/Drivers/Aocs/sagitta.c index 0c3df73f..01cbb5d0 100644 --- a/src/src_user/Drivers/Aocs/sagitta.c +++ b/src/src_user/Drivers/Aocs/sagitta.c @@ -221,9 +221,9 @@ DS_INIT_ERR_CODE SAGITTA_init(SAGITTA_Driver* sagitta_driver, uint8_t ch, DS_Str return DS_INIT_OK; } -DS_INIT_ERR_CODE SAGITTA_DS_init(SAGITTA_Driver* sagitta_driver, DS_StreamRecBuffer* rx_buffer) +DS_ERR_CODE SAGITTA_DS_init(SAGITTA_Driver* sagitta_driver, DS_StreamRecBuffer* rx_buffer) { - DS_INIT_ERR_CODE ret; + DS_ERR_CODE ret; ret = DS_init(&(sagitta_driver->driver.super), &(sagitta_driver->driver.uart_config), rx_buffer, diff --git a/src/src_user/Drivers/Aocs/sagitta.h b/src/src_user/Drivers/Aocs/sagitta.h index 6cd8a1ab..6851f3e1 100644 --- a/src/src_user/Drivers/Aocs/sagitta.h +++ b/src/src_user/Drivers/Aocs/sagitta.h @@ -487,7 +487,7 @@ DS_INIT_ERR_CODE SAGITTA_init(SAGITTA_Driver* sagitta_driver, uint8_t ch, DS_Str * @param rx_buffer: 受信バッファ * @return DS_INIT_ERR_CODE */ -DS_INIT_ERR_CODE SAGITTA_DS_init(SAGITTA_Driver* sagitta_driver, DS_StreamRecBuffer* rx_buffer); +DS_ERR_CODE SAGITTA_DS_init(SAGITTA_Driver* sagitta_driver, DS_StreamRecBuffer* rx_buffer); /** * @brief SAGITTA受信 * @param sagitta_driver : SAGITTA_Driver構造体へのポインタ From b2882ca8b9954d5ca78e4ba0158b466a068ab623 Mon Sep 17 00:00:00 2001 From: michinarikake <> Date: Sat, 18 May 2024 01:46:48 +0900 Subject: [PATCH 7/8] fix is_ok flag --- .../Applications/DriverInstances/di_nanossoc_d60.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/src_user/Applications/DriverInstances/di_nanossoc_d60.c b/src/src_user/Applications/DriverInstances/di_nanossoc_d60.c index fe1e9498..0403adfe 100644 --- a/src/src_user/Applications/DriverInstances/di_nanossoc_d60.c +++ b/src/src_user/Applications/DriverInstances/di_nanossoc_d60.c @@ -167,13 +167,13 @@ CCP_CmdRet Cmd_DI_NANOSSOC_D60_DS_INIT(const CommonCmdPacket* packet) { (void)packet; uint8_t i; - uint8_t is_ok; DS_ERR_CODE ret; + uint8_t is_ok = 1; for (i = 0; i < NANOSSOC_D60_PARAMETERS_NUMBER_OF_MOUNTED_SENSOR; ++i) { ret = NANOSSOC_D60_DS_init(&nanossoc_d60_driver_[i], &DI_NANOSSOC_D60_rx_buffer_[i]); - is_ok |= (ret == DS_INIT_OK); + is_ok &= (ret == DS_INIT_OK); } if (!is_ok) @@ -187,15 +187,15 @@ CCP_CmdRet Cmd_DI_NANOSSOC_D60_DS_INIT_STREAM_REC_BUFFER(const CommonCmdPacket* { (void)packet; uint8_t i; - uint8_t is_ok; DS_ERR_CODE ret; + uint8_t is_ok = 1; for (i = 0; i < NANOSSOC_D60_PARAMETERS_NUMBER_OF_MOUNTED_SENSOR; ++i) { ret = DS_init_stream_rec_buffer(&DI_NANOSSOC_D60_rx_buffer_[i], DI_NANOSSOC_D60_rx_buffer_allocation_[i], sizeof(DI_NANOSSOC_D60_rx_buffer_allocation_[i])); - is_ok |= (ret == DS_ERR_CODE_OK); + is_ok &= (ret == DS_ERR_CODE_OK); } if (!is_ok) From d7b1707a0d3f53a8c4526d04ab2b7baa56682c58 Mon Sep 17 00:00:00 2001 From: michinarikake <99639660+michinarikake@users.noreply.github.com> Date: Mon, 20 May 2024 11:13:20 +0900 Subject: [PATCH 8/8] fix SS reset BC Co-authored-by: Toshihiro Suzuki <93800108+suzuki-toshihir0@users.noreply.github.com> --- .../TlmCmd/NormalBlockCommandDefinition/nbc_nanossoc_d60.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/src_user/TlmCmd/NormalBlockCommandDefinition/nbc_nanossoc_d60.c b/src/src_user/TlmCmd/NormalBlockCommandDefinition/nbc_nanossoc_d60.c index c2b46212..b99c266c 100644 --- a/src/src_user/TlmCmd/NormalBlockCommandDefinition/nbc_nanossoc_d60.c +++ b/src/src_user/TlmCmd/NormalBlockCommandDefinition/nbc_nanossoc_d60.c @@ -144,10 +144,10 @@ void BCL_load_reset_nanossoc_d60(void) BCL_tool_register_deploy(bc_cycle, BC_POWER_OFF_NANOSSOC_D60, TLCD_ID_DEPLOY_BC); // 4.5sec bc_cycle += OBCT_sec2cycle(5); - BCL_tool_register_cmd(bc_cycle, Cmd_CODE_DI_SAGITTA_DS_INIT); + BCL_tool_register_cmd(bc_cycle, Cmd_CODE_DI_NANOSSOC_D60_DS_INIT); bc_cycle++; - BCL_tool_register_cmd(bc_cycle, Cmd_CODE_DI_SAGITTA_DS_INIT_STREAM_REC_BUFFER); + BCL_tool_register_cmd(bc_cycle, Cmd_CODE_DI_NANOSSOC_D60_DS_INIT_STREAM_REC_BUFFER); bc_cycle++; BCL_tool_register_deploy(bc_cycle, BC_POWER_ON_NANOSSOC_D60, TLCD_ID_DEPLOY_BC);