From b081feed4083d694f070a1d4f2108b1033f27743 Mon Sep 17 00:00:00 2001 From: SEEKFREE_BUDING <2289331269@qq.com> Date: Sat, 19 Nov 2022 11:03:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E9=87=8F=E6=9B=B4=E6=96=B0=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../E01_gpio_demo/libraries/doc/version.txt | 4 +- .../libraries/zf_driver/zf_driver_encoder.c | 44 +++++++++---------- .../E02_uart_demo/libraries/doc/version.txt | 4 +- .../libraries/zf_driver/zf_driver_encoder.c | 44 +++++++++---------- .../E03_adc_demo/libraries/doc/version.txt | 4 +- .../libraries/zf_driver/zf_driver_encoder.c | 44 +++++++++---------- .../E04_pwm_demo/libraries/doc/version.txt | 4 +- .../libraries/zf_driver/zf_driver_encoder.c | 44 +++++++++---------- .../E05_pit_demo/libraries/doc/version.txt | 4 +- .../libraries/zf_driver/zf_driver_encoder.c | 44 +++++++++---------- .../E06_exit_demo/libraries/doc/version.txt | 4 +- .../libraries/zf_driver/zf_driver_encoder.c | 44 +++++++++---------- .../libraries/doc/version.txt | 4 +- .../libraries/zf_driver/zf_driver_encoder.c | 44 +++++++++---------- .../E08_eeprom_demo/libraries/doc/version.txt | 4 +- .../libraries/zf_driver/zf_driver_encoder.c | 44 +++++++++---------- .../E09_timer_demo/libraries/doc/version.txt | 4 +- .../libraries/zf_driver/zf_driver_encoder.c | 44 +++++++++---------- .../libraries/doc/version.txt | 4 +- .../libraries/zf_driver/zf_driver_encoder.c | 44 +++++++++---------- .../libraries/doc/version.txt | 4 +- .../libraries/zf_driver/zf_driver_encoder.c | 44 +++++++++---------- .../libraries/doc/version.txt | 4 +- .../libraries/zf_driver/zf_driver_encoder.c | 44 +++++++++---------- .../libraries/doc/version.txt | 4 +- .../libraries/zf_driver/zf_driver_encoder.c | 44 +++++++++---------- .../libraries/doc/version.txt | 4 +- .../libraries/zf_driver/zf_driver_encoder.c | 44 +++++++++---------- .../libraries/doc/version.txt | 4 +- .../libraries/zf_driver/zf_driver_encoder.c | 44 +++++++++---------- .../user/cpu0_main.c | 2 - 31 files changed, 375 insertions(+), 347 deletions(-) diff --git a/Example/E01_gpio_demo/libraries/doc/version.txt b/Example/E01_gpio_demo/libraries/doc/version.txt index 4c656de..8858f7b 100644 --- a/Example/E01_gpio_demo/libraries/doc/version.txt +++ b/Example/E01_gpio_demo/libraries/doc/version.txt @@ -1,6 +1,8 @@ +V3.0.1 + 修复总钻风单独配置曝光度过慢的问题 V3.0.0 新命名风格开源库实现 - 增强了代码的可移植性 如果都使用V3库,那么用户将几乎无需更改任何代码即可在不同的单片机上实现相同的功能 + 增强了代码的可移植性 增加了部分公共层功能 V1.3.0 在icm20602的初始化中添加系数说明 diff --git a/Example/E01_gpio_demo/libraries/zf_driver/zf_driver_encoder.c b/Example/E01_gpio_demo/libraries/zf_driver/zf_driver_encoder.c index 1f99660..22160da 100644 --- a/Example/E01_gpio_demo/libraries/zf_driver/zf_driver_encoder.c +++ b/Example/E01_gpio_demo/libraries/zf_driver/zf_driver_encoder.c @@ -43,71 +43,71 @@ // 参数说明 count_pin 设置计数引脚 // 参数说明 dir_pin 设置计数方向引脚 // 返回参数 void -// 使用示例 encoder_mapping_set(gptn, count_pin, dir_pin); +// 使用示例 encoder_mapping_set(gptn, ch1_pin, ch2_pin); // 备注信息 //------------------------------------------------------------------------------------------------------------------- -static void encoder_mapping_set (encoder_index_enum encoder_n, encoder_channel1_enum count_pin, encoder_channel2_enum dir_pin) +static void encoder_mapping_set (encoder_index_enum encoder_n, encoder_channel1_enum ch1_pin, encoder_channel2_enum ch2_pin) { - IfxGpt12_TxIn_In *count; - IfxGpt12_TxEud_In *dir; + IfxGpt12_TxIn_In *ch1; + IfxGpt12_TxEud_In *ch2; switch(encoder_n) { case TIM2_ENCOEDER: { - if (TIM2_ENCOEDER_CH1_P00_7 == count_pin) count = &IfxGpt120_T2INA_P00_7_IN; - else if (TIM2_ENCOEDER_CH1_P33_7 == count_pin) count = &IfxGpt120_T2INB_P33_7_IN; + if (TIM2_ENCOEDER_CH1_P00_7 == ch1_pin) ch1 = &IfxGpt120_T2INA_P00_7_IN; + else if (TIM2_ENCOEDER_CH1_P33_7 == ch1_pin) ch1 = &IfxGpt120_T2INB_P33_7_IN; else zf_assert(FALSE); - if (TIM2_ENCOEDER_CH2_P00_8 == dir_pin) dir = &IfxGpt120_T2EUDA_P00_8_IN; - else if (TIM2_ENCOEDER_CH2_P33_6 == dir_pin) dir = &IfxGpt120_T2EUDB_P33_6_IN; + if (TIM2_ENCOEDER_CH2_P00_8 == ch2_pin) ch2 = &IfxGpt120_T2EUDA_P00_8_IN; + else if (TIM2_ENCOEDER_CH2_P33_6 == ch2_pin) ch2 = &IfxGpt120_T2EUDB_P33_6_IN; else zf_assert(FALSE); }break; case TIM3_ENCOEDER: { - if (TIM3_ENCOEDER_CH1_P02_6 == count_pin) count = &IfxGpt120_T3INA_P02_6_IN; + if (TIM3_ENCOEDER_CH1_P02_6 == ch1_pin) ch1 = &IfxGpt120_T3INA_P02_6_IN; else zf_assert(FALSE); - if (TIM3_ENCOEDER_CH2_P02_7 == dir_pin) dir = &IfxGpt120_T3EUDA_P02_7_IN; + if (TIM3_ENCOEDER_CH2_P02_7 == ch2_pin) ch2 = &IfxGpt120_T3EUDA_P02_7_IN; else zf_assert(FALSE); }break; case TIM4_ENCOEDER: { - if (TIM4_ENCOEDER_CH1_P02_8 == count_pin) count = &IfxGpt120_T4INA_P02_8_IN; + if (TIM4_ENCOEDER_CH1_P02_8 == ch1_pin) ch1 = &IfxGpt120_T4INA_P02_8_IN; else zf_assert(FALSE); - if (TIM4_ENCOEDER_CH2_P00_9 == dir_pin) dir = &IfxGpt120_T4EUDA_P00_9_IN; - else if (TIM4_ENCOEDER_CH2_P33_5 == dir_pin) dir = &IfxGpt120_T4EUDB_P33_5_IN; + if (TIM4_ENCOEDER_CH2_P00_9 == ch2_pin) ch2 = &IfxGpt120_T4EUDA_P00_9_IN; + else if (TIM4_ENCOEDER_CH2_P33_5 == ch2_pin) ch2 = &IfxGpt120_T4EUDB_P33_5_IN; else zf_assert(FALSE); }break; case TIM5_ENCOEDER: { - if (TIM5_ENCOEDER_CH1_P21_7 == count_pin) count = &IfxGpt120_T5INA_P21_7_IN; - else if (TIM5_ENCOEDER_CH1_P10_3 == count_pin) count = &IfxGpt120_T5INB_P10_3_IN; + if (TIM5_ENCOEDER_CH1_P21_7 == ch1_pin) ch1 = &IfxGpt120_T5INA_P21_7_IN; + else if (TIM5_ENCOEDER_CH1_P10_3 == ch1_pin) ch1 = &IfxGpt120_T5INB_P10_3_IN; else zf_assert(FALSE); - if (TIM5_ENCOEDER_CH2_P21_6 == dir_pin) dir = &IfxGpt120_T5EUDA_P21_6_IN; - else if (TIM5_ENCOEDER_CH2_P10_1 == dir_pin) dir = &IfxGpt120_T5EUDB_P10_1_IN; + if (TIM5_ENCOEDER_CH2_P21_6 == ch2_pin) ch2 = &IfxGpt120_T5EUDA_P21_6_IN; + else if (TIM5_ENCOEDER_CH2_P10_1 == ch2_pin) ch2 = &IfxGpt120_T5EUDB_P10_1_IN; else zf_assert(FALSE); }break; case TIM6_ENCOEDER: { - if (TIM6_ENCOEDER_CH1_P20_3 == count_pin) count = &IfxGpt120_T6INA_P20_3_IN; - else if (TIM6_ENCOEDER_CH1_P10_2 == count_pin) count = &IfxGpt120_T6INB_P10_2_IN; + if (TIM6_ENCOEDER_CH1_P20_3 == ch1_pin) ch1 = &IfxGpt120_T6INA_P20_3_IN; + else if (TIM6_ENCOEDER_CH1_P10_2 == ch1_pin) ch1 = &IfxGpt120_T6INB_P10_2_IN; else zf_assert(FALSE); - if (TIM6_ENCOEDER_CH2_P20_0 == dir_pin) dir = &IfxGpt120_T6EUDA_P20_0_IN; + if (TIM6_ENCOEDER_CH2_P20_0 == ch2_pin) ch2 = &IfxGpt120_T6EUDA_P20_0_IN; else zf_assert(FALSE); }break; } #pragma warning 507 - IfxGpt12_initTxInPinWithPadLevel(count, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); - IfxGpt12_initTxEudInPinWithPadLevel(dir, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); + IfxGpt12_initTxInPinWithPadLevel(ch1, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); + IfxGpt12_initTxEudInPinWithPadLevel(ch2, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); #pragma warning default } diff --git a/Example/E02_uart_demo/libraries/doc/version.txt b/Example/E02_uart_demo/libraries/doc/version.txt index 4c656de..8858f7b 100644 --- a/Example/E02_uart_demo/libraries/doc/version.txt +++ b/Example/E02_uart_demo/libraries/doc/version.txt @@ -1,6 +1,8 @@ +V3.0.1 + 修复总钻风单独配置曝光度过慢的问题 V3.0.0 新命名风格开源库实现 - 增强了代码的可移植性 如果都使用V3库,那么用户将几乎无需更改任何代码即可在不同的单片机上实现相同的功能 + 增强了代码的可移植性 增加了部分公共层功能 V1.3.0 在icm20602的初始化中添加系数说明 diff --git a/Example/E02_uart_demo/libraries/zf_driver/zf_driver_encoder.c b/Example/E02_uart_demo/libraries/zf_driver/zf_driver_encoder.c index 1f99660..22160da 100644 --- a/Example/E02_uart_demo/libraries/zf_driver/zf_driver_encoder.c +++ b/Example/E02_uart_demo/libraries/zf_driver/zf_driver_encoder.c @@ -43,71 +43,71 @@ // 参数说明 count_pin 设置计数引脚 // 参数说明 dir_pin 设置计数方向引脚 // 返回参数 void -// 使用示例 encoder_mapping_set(gptn, count_pin, dir_pin); +// 使用示例 encoder_mapping_set(gptn, ch1_pin, ch2_pin); // 备注信息 //------------------------------------------------------------------------------------------------------------------- -static void encoder_mapping_set (encoder_index_enum encoder_n, encoder_channel1_enum count_pin, encoder_channel2_enum dir_pin) +static void encoder_mapping_set (encoder_index_enum encoder_n, encoder_channel1_enum ch1_pin, encoder_channel2_enum ch2_pin) { - IfxGpt12_TxIn_In *count; - IfxGpt12_TxEud_In *dir; + IfxGpt12_TxIn_In *ch1; + IfxGpt12_TxEud_In *ch2; switch(encoder_n) { case TIM2_ENCOEDER: { - if (TIM2_ENCOEDER_CH1_P00_7 == count_pin) count = &IfxGpt120_T2INA_P00_7_IN; - else if (TIM2_ENCOEDER_CH1_P33_7 == count_pin) count = &IfxGpt120_T2INB_P33_7_IN; + if (TIM2_ENCOEDER_CH1_P00_7 == ch1_pin) ch1 = &IfxGpt120_T2INA_P00_7_IN; + else if (TIM2_ENCOEDER_CH1_P33_7 == ch1_pin) ch1 = &IfxGpt120_T2INB_P33_7_IN; else zf_assert(FALSE); - if (TIM2_ENCOEDER_CH2_P00_8 == dir_pin) dir = &IfxGpt120_T2EUDA_P00_8_IN; - else if (TIM2_ENCOEDER_CH2_P33_6 == dir_pin) dir = &IfxGpt120_T2EUDB_P33_6_IN; + if (TIM2_ENCOEDER_CH2_P00_8 == ch2_pin) ch2 = &IfxGpt120_T2EUDA_P00_8_IN; + else if (TIM2_ENCOEDER_CH2_P33_6 == ch2_pin) ch2 = &IfxGpt120_T2EUDB_P33_6_IN; else zf_assert(FALSE); }break; case TIM3_ENCOEDER: { - if (TIM3_ENCOEDER_CH1_P02_6 == count_pin) count = &IfxGpt120_T3INA_P02_6_IN; + if (TIM3_ENCOEDER_CH1_P02_6 == ch1_pin) ch1 = &IfxGpt120_T3INA_P02_6_IN; else zf_assert(FALSE); - if (TIM3_ENCOEDER_CH2_P02_7 == dir_pin) dir = &IfxGpt120_T3EUDA_P02_7_IN; + if (TIM3_ENCOEDER_CH2_P02_7 == ch2_pin) ch2 = &IfxGpt120_T3EUDA_P02_7_IN; else zf_assert(FALSE); }break; case TIM4_ENCOEDER: { - if (TIM4_ENCOEDER_CH1_P02_8 == count_pin) count = &IfxGpt120_T4INA_P02_8_IN; + if (TIM4_ENCOEDER_CH1_P02_8 == ch1_pin) ch1 = &IfxGpt120_T4INA_P02_8_IN; else zf_assert(FALSE); - if (TIM4_ENCOEDER_CH2_P00_9 == dir_pin) dir = &IfxGpt120_T4EUDA_P00_9_IN; - else if (TIM4_ENCOEDER_CH2_P33_5 == dir_pin) dir = &IfxGpt120_T4EUDB_P33_5_IN; + if (TIM4_ENCOEDER_CH2_P00_9 == ch2_pin) ch2 = &IfxGpt120_T4EUDA_P00_9_IN; + else if (TIM4_ENCOEDER_CH2_P33_5 == ch2_pin) ch2 = &IfxGpt120_T4EUDB_P33_5_IN; else zf_assert(FALSE); }break; case TIM5_ENCOEDER: { - if (TIM5_ENCOEDER_CH1_P21_7 == count_pin) count = &IfxGpt120_T5INA_P21_7_IN; - else if (TIM5_ENCOEDER_CH1_P10_3 == count_pin) count = &IfxGpt120_T5INB_P10_3_IN; + if (TIM5_ENCOEDER_CH1_P21_7 == ch1_pin) ch1 = &IfxGpt120_T5INA_P21_7_IN; + else if (TIM5_ENCOEDER_CH1_P10_3 == ch1_pin) ch1 = &IfxGpt120_T5INB_P10_3_IN; else zf_assert(FALSE); - if (TIM5_ENCOEDER_CH2_P21_6 == dir_pin) dir = &IfxGpt120_T5EUDA_P21_6_IN; - else if (TIM5_ENCOEDER_CH2_P10_1 == dir_pin) dir = &IfxGpt120_T5EUDB_P10_1_IN; + if (TIM5_ENCOEDER_CH2_P21_6 == ch2_pin) ch2 = &IfxGpt120_T5EUDA_P21_6_IN; + else if (TIM5_ENCOEDER_CH2_P10_1 == ch2_pin) ch2 = &IfxGpt120_T5EUDB_P10_1_IN; else zf_assert(FALSE); }break; case TIM6_ENCOEDER: { - if (TIM6_ENCOEDER_CH1_P20_3 == count_pin) count = &IfxGpt120_T6INA_P20_3_IN; - else if (TIM6_ENCOEDER_CH1_P10_2 == count_pin) count = &IfxGpt120_T6INB_P10_2_IN; + if (TIM6_ENCOEDER_CH1_P20_3 == ch1_pin) ch1 = &IfxGpt120_T6INA_P20_3_IN; + else if (TIM6_ENCOEDER_CH1_P10_2 == ch1_pin) ch1 = &IfxGpt120_T6INB_P10_2_IN; else zf_assert(FALSE); - if (TIM6_ENCOEDER_CH2_P20_0 == dir_pin) dir = &IfxGpt120_T6EUDA_P20_0_IN; + if (TIM6_ENCOEDER_CH2_P20_0 == ch2_pin) ch2 = &IfxGpt120_T6EUDA_P20_0_IN; else zf_assert(FALSE); }break; } #pragma warning 507 - IfxGpt12_initTxInPinWithPadLevel(count, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); - IfxGpt12_initTxEudInPinWithPadLevel(dir, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); + IfxGpt12_initTxInPinWithPadLevel(ch1, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); + IfxGpt12_initTxEudInPinWithPadLevel(ch2, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); #pragma warning default } diff --git a/Example/E03_adc_demo/libraries/doc/version.txt b/Example/E03_adc_demo/libraries/doc/version.txt index 4c656de..8858f7b 100644 --- a/Example/E03_adc_demo/libraries/doc/version.txt +++ b/Example/E03_adc_demo/libraries/doc/version.txt @@ -1,6 +1,8 @@ +V3.0.1 + 修复总钻风单独配置曝光度过慢的问题 V3.0.0 新命名风格开源库实现 - 增强了代码的可移植性 如果都使用V3库,那么用户将几乎无需更改任何代码即可在不同的单片机上实现相同的功能 + 增强了代码的可移植性 增加了部分公共层功能 V1.3.0 在icm20602的初始化中添加系数说明 diff --git a/Example/E03_adc_demo/libraries/zf_driver/zf_driver_encoder.c b/Example/E03_adc_demo/libraries/zf_driver/zf_driver_encoder.c index 1f99660..22160da 100644 --- a/Example/E03_adc_demo/libraries/zf_driver/zf_driver_encoder.c +++ b/Example/E03_adc_demo/libraries/zf_driver/zf_driver_encoder.c @@ -43,71 +43,71 @@ // 参数说明 count_pin 设置计数引脚 // 参数说明 dir_pin 设置计数方向引脚 // 返回参数 void -// 使用示例 encoder_mapping_set(gptn, count_pin, dir_pin); +// 使用示例 encoder_mapping_set(gptn, ch1_pin, ch2_pin); // 备注信息 //------------------------------------------------------------------------------------------------------------------- -static void encoder_mapping_set (encoder_index_enum encoder_n, encoder_channel1_enum count_pin, encoder_channel2_enum dir_pin) +static void encoder_mapping_set (encoder_index_enum encoder_n, encoder_channel1_enum ch1_pin, encoder_channel2_enum ch2_pin) { - IfxGpt12_TxIn_In *count; - IfxGpt12_TxEud_In *dir; + IfxGpt12_TxIn_In *ch1; + IfxGpt12_TxEud_In *ch2; switch(encoder_n) { case TIM2_ENCOEDER: { - if (TIM2_ENCOEDER_CH1_P00_7 == count_pin) count = &IfxGpt120_T2INA_P00_7_IN; - else if (TIM2_ENCOEDER_CH1_P33_7 == count_pin) count = &IfxGpt120_T2INB_P33_7_IN; + if (TIM2_ENCOEDER_CH1_P00_7 == ch1_pin) ch1 = &IfxGpt120_T2INA_P00_7_IN; + else if (TIM2_ENCOEDER_CH1_P33_7 == ch1_pin) ch1 = &IfxGpt120_T2INB_P33_7_IN; else zf_assert(FALSE); - if (TIM2_ENCOEDER_CH2_P00_8 == dir_pin) dir = &IfxGpt120_T2EUDA_P00_8_IN; - else if (TIM2_ENCOEDER_CH2_P33_6 == dir_pin) dir = &IfxGpt120_T2EUDB_P33_6_IN; + if (TIM2_ENCOEDER_CH2_P00_8 == ch2_pin) ch2 = &IfxGpt120_T2EUDA_P00_8_IN; + else if (TIM2_ENCOEDER_CH2_P33_6 == ch2_pin) ch2 = &IfxGpt120_T2EUDB_P33_6_IN; else zf_assert(FALSE); }break; case TIM3_ENCOEDER: { - if (TIM3_ENCOEDER_CH1_P02_6 == count_pin) count = &IfxGpt120_T3INA_P02_6_IN; + if (TIM3_ENCOEDER_CH1_P02_6 == ch1_pin) ch1 = &IfxGpt120_T3INA_P02_6_IN; else zf_assert(FALSE); - if (TIM3_ENCOEDER_CH2_P02_7 == dir_pin) dir = &IfxGpt120_T3EUDA_P02_7_IN; + if (TIM3_ENCOEDER_CH2_P02_7 == ch2_pin) ch2 = &IfxGpt120_T3EUDA_P02_7_IN; else zf_assert(FALSE); }break; case TIM4_ENCOEDER: { - if (TIM4_ENCOEDER_CH1_P02_8 == count_pin) count = &IfxGpt120_T4INA_P02_8_IN; + if (TIM4_ENCOEDER_CH1_P02_8 == ch1_pin) ch1 = &IfxGpt120_T4INA_P02_8_IN; else zf_assert(FALSE); - if (TIM4_ENCOEDER_CH2_P00_9 == dir_pin) dir = &IfxGpt120_T4EUDA_P00_9_IN; - else if (TIM4_ENCOEDER_CH2_P33_5 == dir_pin) dir = &IfxGpt120_T4EUDB_P33_5_IN; + if (TIM4_ENCOEDER_CH2_P00_9 == ch2_pin) ch2 = &IfxGpt120_T4EUDA_P00_9_IN; + else if (TIM4_ENCOEDER_CH2_P33_5 == ch2_pin) ch2 = &IfxGpt120_T4EUDB_P33_5_IN; else zf_assert(FALSE); }break; case TIM5_ENCOEDER: { - if (TIM5_ENCOEDER_CH1_P21_7 == count_pin) count = &IfxGpt120_T5INA_P21_7_IN; - else if (TIM5_ENCOEDER_CH1_P10_3 == count_pin) count = &IfxGpt120_T5INB_P10_3_IN; + if (TIM5_ENCOEDER_CH1_P21_7 == ch1_pin) ch1 = &IfxGpt120_T5INA_P21_7_IN; + else if (TIM5_ENCOEDER_CH1_P10_3 == ch1_pin) ch1 = &IfxGpt120_T5INB_P10_3_IN; else zf_assert(FALSE); - if (TIM5_ENCOEDER_CH2_P21_6 == dir_pin) dir = &IfxGpt120_T5EUDA_P21_6_IN; - else if (TIM5_ENCOEDER_CH2_P10_1 == dir_pin) dir = &IfxGpt120_T5EUDB_P10_1_IN; + if (TIM5_ENCOEDER_CH2_P21_6 == ch2_pin) ch2 = &IfxGpt120_T5EUDA_P21_6_IN; + else if (TIM5_ENCOEDER_CH2_P10_1 == ch2_pin) ch2 = &IfxGpt120_T5EUDB_P10_1_IN; else zf_assert(FALSE); }break; case TIM6_ENCOEDER: { - if (TIM6_ENCOEDER_CH1_P20_3 == count_pin) count = &IfxGpt120_T6INA_P20_3_IN; - else if (TIM6_ENCOEDER_CH1_P10_2 == count_pin) count = &IfxGpt120_T6INB_P10_2_IN; + if (TIM6_ENCOEDER_CH1_P20_3 == ch1_pin) ch1 = &IfxGpt120_T6INA_P20_3_IN; + else if (TIM6_ENCOEDER_CH1_P10_2 == ch1_pin) ch1 = &IfxGpt120_T6INB_P10_2_IN; else zf_assert(FALSE); - if (TIM6_ENCOEDER_CH2_P20_0 == dir_pin) dir = &IfxGpt120_T6EUDA_P20_0_IN; + if (TIM6_ENCOEDER_CH2_P20_0 == ch2_pin) ch2 = &IfxGpt120_T6EUDA_P20_0_IN; else zf_assert(FALSE); }break; } #pragma warning 507 - IfxGpt12_initTxInPinWithPadLevel(count, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); - IfxGpt12_initTxEudInPinWithPadLevel(dir, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); + IfxGpt12_initTxInPinWithPadLevel(ch1, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); + IfxGpt12_initTxEudInPinWithPadLevel(ch2, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); #pragma warning default } diff --git a/Example/E04_pwm_demo/libraries/doc/version.txt b/Example/E04_pwm_demo/libraries/doc/version.txt index 4c656de..8858f7b 100644 --- a/Example/E04_pwm_demo/libraries/doc/version.txt +++ b/Example/E04_pwm_demo/libraries/doc/version.txt @@ -1,6 +1,8 @@ +V3.0.1 + 修复总钻风单独配置曝光度过慢的问题 V3.0.0 新命名风格开源库实现 - 增强了代码的可移植性 如果都使用V3库,那么用户将几乎无需更改任何代码即可在不同的单片机上实现相同的功能 + 增强了代码的可移植性 增加了部分公共层功能 V1.3.0 在icm20602的初始化中添加系数说明 diff --git a/Example/E04_pwm_demo/libraries/zf_driver/zf_driver_encoder.c b/Example/E04_pwm_demo/libraries/zf_driver/zf_driver_encoder.c index 1f99660..22160da 100644 --- a/Example/E04_pwm_demo/libraries/zf_driver/zf_driver_encoder.c +++ b/Example/E04_pwm_demo/libraries/zf_driver/zf_driver_encoder.c @@ -43,71 +43,71 @@ // 参数说明 count_pin 设置计数引脚 // 参数说明 dir_pin 设置计数方向引脚 // 返回参数 void -// 使用示例 encoder_mapping_set(gptn, count_pin, dir_pin); +// 使用示例 encoder_mapping_set(gptn, ch1_pin, ch2_pin); // 备注信息 //------------------------------------------------------------------------------------------------------------------- -static void encoder_mapping_set (encoder_index_enum encoder_n, encoder_channel1_enum count_pin, encoder_channel2_enum dir_pin) +static void encoder_mapping_set (encoder_index_enum encoder_n, encoder_channel1_enum ch1_pin, encoder_channel2_enum ch2_pin) { - IfxGpt12_TxIn_In *count; - IfxGpt12_TxEud_In *dir; + IfxGpt12_TxIn_In *ch1; + IfxGpt12_TxEud_In *ch2; switch(encoder_n) { case TIM2_ENCOEDER: { - if (TIM2_ENCOEDER_CH1_P00_7 == count_pin) count = &IfxGpt120_T2INA_P00_7_IN; - else if (TIM2_ENCOEDER_CH1_P33_7 == count_pin) count = &IfxGpt120_T2INB_P33_7_IN; + if (TIM2_ENCOEDER_CH1_P00_7 == ch1_pin) ch1 = &IfxGpt120_T2INA_P00_7_IN; + else if (TIM2_ENCOEDER_CH1_P33_7 == ch1_pin) ch1 = &IfxGpt120_T2INB_P33_7_IN; else zf_assert(FALSE); - if (TIM2_ENCOEDER_CH2_P00_8 == dir_pin) dir = &IfxGpt120_T2EUDA_P00_8_IN; - else if (TIM2_ENCOEDER_CH2_P33_6 == dir_pin) dir = &IfxGpt120_T2EUDB_P33_6_IN; + if (TIM2_ENCOEDER_CH2_P00_8 == ch2_pin) ch2 = &IfxGpt120_T2EUDA_P00_8_IN; + else if (TIM2_ENCOEDER_CH2_P33_6 == ch2_pin) ch2 = &IfxGpt120_T2EUDB_P33_6_IN; else zf_assert(FALSE); }break; case TIM3_ENCOEDER: { - if (TIM3_ENCOEDER_CH1_P02_6 == count_pin) count = &IfxGpt120_T3INA_P02_6_IN; + if (TIM3_ENCOEDER_CH1_P02_6 == ch1_pin) ch1 = &IfxGpt120_T3INA_P02_6_IN; else zf_assert(FALSE); - if (TIM3_ENCOEDER_CH2_P02_7 == dir_pin) dir = &IfxGpt120_T3EUDA_P02_7_IN; + if (TIM3_ENCOEDER_CH2_P02_7 == ch2_pin) ch2 = &IfxGpt120_T3EUDA_P02_7_IN; else zf_assert(FALSE); }break; case TIM4_ENCOEDER: { - if (TIM4_ENCOEDER_CH1_P02_8 == count_pin) count = &IfxGpt120_T4INA_P02_8_IN; + if (TIM4_ENCOEDER_CH1_P02_8 == ch1_pin) ch1 = &IfxGpt120_T4INA_P02_8_IN; else zf_assert(FALSE); - if (TIM4_ENCOEDER_CH2_P00_9 == dir_pin) dir = &IfxGpt120_T4EUDA_P00_9_IN; - else if (TIM4_ENCOEDER_CH2_P33_5 == dir_pin) dir = &IfxGpt120_T4EUDB_P33_5_IN; + if (TIM4_ENCOEDER_CH2_P00_9 == ch2_pin) ch2 = &IfxGpt120_T4EUDA_P00_9_IN; + else if (TIM4_ENCOEDER_CH2_P33_5 == ch2_pin) ch2 = &IfxGpt120_T4EUDB_P33_5_IN; else zf_assert(FALSE); }break; case TIM5_ENCOEDER: { - if (TIM5_ENCOEDER_CH1_P21_7 == count_pin) count = &IfxGpt120_T5INA_P21_7_IN; - else if (TIM5_ENCOEDER_CH1_P10_3 == count_pin) count = &IfxGpt120_T5INB_P10_3_IN; + if (TIM5_ENCOEDER_CH1_P21_7 == ch1_pin) ch1 = &IfxGpt120_T5INA_P21_7_IN; + else if (TIM5_ENCOEDER_CH1_P10_3 == ch1_pin) ch1 = &IfxGpt120_T5INB_P10_3_IN; else zf_assert(FALSE); - if (TIM5_ENCOEDER_CH2_P21_6 == dir_pin) dir = &IfxGpt120_T5EUDA_P21_6_IN; - else if (TIM5_ENCOEDER_CH2_P10_1 == dir_pin) dir = &IfxGpt120_T5EUDB_P10_1_IN; + if (TIM5_ENCOEDER_CH2_P21_6 == ch2_pin) ch2 = &IfxGpt120_T5EUDA_P21_6_IN; + else if (TIM5_ENCOEDER_CH2_P10_1 == ch2_pin) ch2 = &IfxGpt120_T5EUDB_P10_1_IN; else zf_assert(FALSE); }break; case TIM6_ENCOEDER: { - if (TIM6_ENCOEDER_CH1_P20_3 == count_pin) count = &IfxGpt120_T6INA_P20_3_IN; - else if (TIM6_ENCOEDER_CH1_P10_2 == count_pin) count = &IfxGpt120_T6INB_P10_2_IN; + if (TIM6_ENCOEDER_CH1_P20_3 == ch1_pin) ch1 = &IfxGpt120_T6INA_P20_3_IN; + else if (TIM6_ENCOEDER_CH1_P10_2 == ch1_pin) ch1 = &IfxGpt120_T6INB_P10_2_IN; else zf_assert(FALSE); - if (TIM6_ENCOEDER_CH2_P20_0 == dir_pin) dir = &IfxGpt120_T6EUDA_P20_0_IN; + if (TIM6_ENCOEDER_CH2_P20_0 == ch2_pin) ch2 = &IfxGpt120_T6EUDA_P20_0_IN; else zf_assert(FALSE); }break; } #pragma warning 507 - IfxGpt12_initTxInPinWithPadLevel(count, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); - IfxGpt12_initTxEudInPinWithPadLevel(dir, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); + IfxGpt12_initTxInPinWithPadLevel(ch1, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); + IfxGpt12_initTxEudInPinWithPadLevel(ch2, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); #pragma warning default } diff --git a/Example/E05_pit_demo/libraries/doc/version.txt b/Example/E05_pit_demo/libraries/doc/version.txt index 4c656de..8858f7b 100644 --- a/Example/E05_pit_demo/libraries/doc/version.txt +++ b/Example/E05_pit_demo/libraries/doc/version.txt @@ -1,6 +1,8 @@ +V3.0.1 + 修复总钻风单独配置曝光度过慢的问题 V3.0.0 新命名风格开源库实现 - 增强了代码的可移植性 如果都使用V3库,那么用户将几乎无需更改任何代码即可在不同的单片机上实现相同的功能 + 增强了代码的可移植性 增加了部分公共层功能 V1.3.0 在icm20602的初始化中添加系数说明 diff --git a/Example/E05_pit_demo/libraries/zf_driver/zf_driver_encoder.c b/Example/E05_pit_demo/libraries/zf_driver/zf_driver_encoder.c index 1f99660..22160da 100644 --- a/Example/E05_pit_demo/libraries/zf_driver/zf_driver_encoder.c +++ b/Example/E05_pit_demo/libraries/zf_driver/zf_driver_encoder.c @@ -43,71 +43,71 @@ // 参数说明 count_pin 设置计数引脚 // 参数说明 dir_pin 设置计数方向引脚 // 返回参数 void -// 使用示例 encoder_mapping_set(gptn, count_pin, dir_pin); +// 使用示例 encoder_mapping_set(gptn, ch1_pin, ch2_pin); // 备注信息 //------------------------------------------------------------------------------------------------------------------- -static void encoder_mapping_set (encoder_index_enum encoder_n, encoder_channel1_enum count_pin, encoder_channel2_enum dir_pin) +static void encoder_mapping_set (encoder_index_enum encoder_n, encoder_channel1_enum ch1_pin, encoder_channel2_enum ch2_pin) { - IfxGpt12_TxIn_In *count; - IfxGpt12_TxEud_In *dir; + IfxGpt12_TxIn_In *ch1; + IfxGpt12_TxEud_In *ch2; switch(encoder_n) { case TIM2_ENCOEDER: { - if (TIM2_ENCOEDER_CH1_P00_7 == count_pin) count = &IfxGpt120_T2INA_P00_7_IN; - else if (TIM2_ENCOEDER_CH1_P33_7 == count_pin) count = &IfxGpt120_T2INB_P33_7_IN; + if (TIM2_ENCOEDER_CH1_P00_7 == ch1_pin) ch1 = &IfxGpt120_T2INA_P00_7_IN; + else if (TIM2_ENCOEDER_CH1_P33_7 == ch1_pin) ch1 = &IfxGpt120_T2INB_P33_7_IN; else zf_assert(FALSE); - if (TIM2_ENCOEDER_CH2_P00_8 == dir_pin) dir = &IfxGpt120_T2EUDA_P00_8_IN; - else if (TIM2_ENCOEDER_CH2_P33_6 == dir_pin) dir = &IfxGpt120_T2EUDB_P33_6_IN; + if (TIM2_ENCOEDER_CH2_P00_8 == ch2_pin) ch2 = &IfxGpt120_T2EUDA_P00_8_IN; + else if (TIM2_ENCOEDER_CH2_P33_6 == ch2_pin) ch2 = &IfxGpt120_T2EUDB_P33_6_IN; else zf_assert(FALSE); }break; case TIM3_ENCOEDER: { - if (TIM3_ENCOEDER_CH1_P02_6 == count_pin) count = &IfxGpt120_T3INA_P02_6_IN; + if (TIM3_ENCOEDER_CH1_P02_6 == ch1_pin) ch1 = &IfxGpt120_T3INA_P02_6_IN; else zf_assert(FALSE); - if (TIM3_ENCOEDER_CH2_P02_7 == dir_pin) dir = &IfxGpt120_T3EUDA_P02_7_IN; + if (TIM3_ENCOEDER_CH2_P02_7 == ch2_pin) ch2 = &IfxGpt120_T3EUDA_P02_7_IN; else zf_assert(FALSE); }break; case TIM4_ENCOEDER: { - if (TIM4_ENCOEDER_CH1_P02_8 == count_pin) count = &IfxGpt120_T4INA_P02_8_IN; + if (TIM4_ENCOEDER_CH1_P02_8 == ch1_pin) ch1 = &IfxGpt120_T4INA_P02_8_IN; else zf_assert(FALSE); - if (TIM4_ENCOEDER_CH2_P00_9 == dir_pin) dir = &IfxGpt120_T4EUDA_P00_9_IN; - else if (TIM4_ENCOEDER_CH2_P33_5 == dir_pin) dir = &IfxGpt120_T4EUDB_P33_5_IN; + if (TIM4_ENCOEDER_CH2_P00_9 == ch2_pin) ch2 = &IfxGpt120_T4EUDA_P00_9_IN; + else if (TIM4_ENCOEDER_CH2_P33_5 == ch2_pin) ch2 = &IfxGpt120_T4EUDB_P33_5_IN; else zf_assert(FALSE); }break; case TIM5_ENCOEDER: { - if (TIM5_ENCOEDER_CH1_P21_7 == count_pin) count = &IfxGpt120_T5INA_P21_7_IN; - else if (TIM5_ENCOEDER_CH1_P10_3 == count_pin) count = &IfxGpt120_T5INB_P10_3_IN; + if (TIM5_ENCOEDER_CH1_P21_7 == ch1_pin) ch1 = &IfxGpt120_T5INA_P21_7_IN; + else if (TIM5_ENCOEDER_CH1_P10_3 == ch1_pin) ch1 = &IfxGpt120_T5INB_P10_3_IN; else zf_assert(FALSE); - if (TIM5_ENCOEDER_CH2_P21_6 == dir_pin) dir = &IfxGpt120_T5EUDA_P21_6_IN; - else if (TIM5_ENCOEDER_CH2_P10_1 == dir_pin) dir = &IfxGpt120_T5EUDB_P10_1_IN; + if (TIM5_ENCOEDER_CH2_P21_6 == ch2_pin) ch2 = &IfxGpt120_T5EUDA_P21_6_IN; + else if (TIM5_ENCOEDER_CH2_P10_1 == ch2_pin) ch2 = &IfxGpt120_T5EUDB_P10_1_IN; else zf_assert(FALSE); }break; case TIM6_ENCOEDER: { - if (TIM6_ENCOEDER_CH1_P20_3 == count_pin) count = &IfxGpt120_T6INA_P20_3_IN; - else if (TIM6_ENCOEDER_CH1_P10_2 == count_pin) count = &IfxGpt120_T6INB_P10_2_IN; + if (TIM6_ENCOEDER_CH1_P20_3 == ch1_pin) ch1 = &IfxGpt120_T6INA_P20_3_IN; + else if (TIM6_ENCOEDER_CH1_P10_2 == ch1_pin) ch1 = &IfxGpt120_T6INB_P10_2_IN; else zf_assert(FALSE); - if (TIM6_ENCOEDER_CH2_P20_0 == dir_pin) dir = &IfxGpt120_T6EUDA_P20_0_IN; + if (TIM6_ENCOEDER_CH2_P20_0 == ch2_pin) ch2 = &IfxGpt120_T6EUDA_P20_0_IN; else zf_assert(FALSE); }break; } #pragma warning 507 - IfxGpt12_initTxInPinWithPadLevel(count, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); - IfxGpt12_initTxEudInPinWithPadLevel(dir, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); + IfxGpt12_initTxInPinWithPadLevel(ch1, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); + IfxGpt12_initTxEudInPinWithPadLevel(ch2, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); #pragma warning default } diff --git a/Example/E06_exit_demo/libraries/doc/version.txt b/Example/E06_exit_demo/libraries/doc/version.txt index 4c656de..8858f7b 100644 --- a/Example/E06_exit_demo/libraries/doc/version.txt +++ b/Example/E06_exit_demo/libraries/doc/version.txt @@ -1,6 +1,8 @@ +V3.0.1 + 修复总钻风单独配置曝光度过慢的问题 V3.0.0 新命名风格开源库实现 - 增强了代码的可移植性 如果都使用V3库,那么用户将几乎无需更改任何代码即可在不同的单片机上实现相同的功能 + 增强了代码的可移植性 增加了部分公共层功能 V1.3.0 在icm20602的初始化中添加系数说明 diff --git a/Example/E06_exit_demo/libraries/zf_driver/zf_driver_encoder.c b/Example/E06_exit_demo/libraries/zf_driver/zf_driver_encoder.c index 1f99660..22160da 100644 --- a/Example/E06_exit_demo/libraries/zf_driver/zf_driver_encoder.c +++ b/Example/E06_exit_demo/libraries/zf_driver/zf_driver_encoder.c @@ -43,71 +43,71 @@ // 参数说明 count_pin 设置计数引脚 // 参数说明 dir_pin 设置计数方向引脚 // 返回参数 void -// 使用示例 encoder_mapping_set(gptn, count_pin, dir_pin); +// 使用示例 encoder_mapping_set(gptn, ch1_pin, ch2_pin); // 备注信息 //------------------------------------------------------------------------------------------------------------------- -static void encoder_mapping_set (encoder_index_enum encoder_n, encoder_channel1_enum count_pin, encoder_channel2_enum dir_pin) +static void encoder_mapping_set (encoder_index_enum encoder_n, encoder_channel1_enum ch1_pin, encoder_channel2_enum ch2_pin) { - IfxGpt12_TxIn_In *count; - IfxGpt12_TxEud_In *dir; + IfxGpt12_TxIn_In *ch1; + IfxGpt12_TxEud_In *ch2; switch(encoder_n) { case TIM2_ENCOEDER: { - if (TIM2_ENCOEDER_CH1_P00_7 == count_pin) count = &IfxGpt120_T2INA_P00_7_IN; - else if (TIM2_ENCOEDER_CH1_P33_7 == count_pin) count = &IfxGpt120_T2INB_P33_7_IN; + if (TIM2_ENCOEDER_CH1_P00_7 == ch1_pin) ch1 = &IfxGpt120_T2INA_P00_7_IN; + else if (TIM2_ENCOEDER_CH1_P33_7 == ch1_pin) ch1 = &IfxGpt120_T2INB_P33_7_IN; else zf_assert(FALSE); - if (TIM2_ENCOEDER_CH2_P00_8 == dir_pin) dir = &IfxGpt120_T2EUDA_P00_8_IN; - else if (TIM2_ENCOEDER_CH2_P33_6 == dir_pin) dir = &IfxGpt120_T2EUDB_P33_6_IN; + if (TIM2_ENCOEDER_CH2_P00_8 == ch2_pin) ch2 = &IfxGpt120_T2EUDA_P00_8_IN; + else if (TIM2_ENCOEDER_CH2_P33_6 == ch2_pin) ch2 = &IfxGpt120_T2EUDB_P33_6_IN; else zf_assert(FALSE); }break; case TIM3_ENCOEDER: { - if (TIM3_ENCOEDER_CH1_P02_6 == count_pin) count = &IfxGpt120_T3INA_P02_6_IN; + if (TIM3_ENCOEDER_CH1_P02_6 == ch1_pin) ch1 = &IfxGpt120_T3INA_P02_6_IN; else zf_assert(FALSE); - if (TIM3_ENCOEDER_CH2_P02_7 == dir_pin) dir = &IfxGpt120_T3EUDA_P02_7_IN; + if (TIM3_ENCOEDER_CH2_P02_7 == ch2_pin) ch2 = &IfxGpt120_T3EUDA_P02_7_IN; else zf_assert(FALSE); }break; case TIM4_ENCOEDER: { - if (TIM4_ENCOEDER_CH1_P02_8 == count_pin) count = &IfxGpt120_T4INA_P02_8_IN; + if (TIM4_ENCOEDER_CH1_P02_8 == ch1_pin) ch1 = &IfxGpt120_T4INA_P02_8_IN; else zf_assert(FALSE); - if (TIM4_ENCOEDER_CH2_P00_9 == dir_pin) dir = &IfxGpt120_T4EUDA_P00_9_IN; - else if (TIM4_ENCOEDER_CH2_P33_5 == dir_pin) dir = &IfxGpt120_T4EUDB_P33_5_IN; + if (TIM4_ENCOEDER_CH2_P00_9 == ch2_pin) ch2 = &IfxGpt120_T4EUDA_P00_9_IN; + else if (TIM4_ENCOEDER_CH2_P33_5 == ch2_pin) ch2 = &IfxGpt120_T4EUDB_P33_5_IN; else zf_assert(FALSE); }break; case TIM5_ENCOEDER: { - if (TIM5_ENCOEDER_CH1_P21_7 == count_pin) count = &IfxGpt120_T5INA_P21_7_IN; - else if (TIM5_ENCOEDER_CH1_P10_3 == count_pin) count = &IfxGpt120_T5INB_P10_3_IN; + if (TIM5_ENCOEDER_CH1_P21_7 == ch1_pin) ch1 = &IfxGpt120_T5INA_P21_7_IN; + else if (TIM5_ENCOEDER_CH1_P10_3 == ch1_pin) ch1 = &IfxGpt120_T5INB_P10_3_IN; else zf_assert(FALSE); - if (TIM5_ENCOEDER_CH2_P21_6 == dir_pin) dir = &IfxGpt120_T5EUDA_P21_6_IN; - else if (TIM5_ENCOEDER_CH2_P10_1 == dir_pin) dir = &IfxGpt120_T5EUDB_P10_1_IN; + if (TIM5_ENCOEDER_CH2_P21_6 == ch2_pin) ch2 = &IfxGpt120_T5EUDA_P21_6_IN; + else if (TIM5_ENCOEDER_CH2_P10_1 == ch2_pin) ch2 = &IfxGpt120_T5EUDB_P10_1_IN; else zf_assert(FALSE); }break; case TIM6_ENCOEDER: { - if (TIM6_ENCOEDER_CH1_P20_3 == count_pin) count = &IfxGpt120_T6INA_P20_3_IN; - else if (TIM6_ENCOEDER_CH1_P10_2 == count_pin) count = &IfxGpt120_T6INB_P10_2_IN; + if (TIM6_ENCOEDER_CH1_P20_3 == ch1_pin) ch1 = &IfxGpt120_T6INA_P20_3_IN; + else if (TIM6_ENCOEDER_CH1_P10_2 == ch1_pin) ch1 = &IfxGpt120_T6INB_P10_2_IN; else zf_assert(FALSE); - if (TIM6_ENCOEDER_CH2_P20_0 == dir_pin) dir = &IfxGpt120_T6EUDA_P20_0_IN; + if (TIM6_ENCOEDER_CH2_P20_0 == ch2_pin) ch2 = &IfxGpt120_T6EUDA_P20_0_IN; else zf_assert(FALSE); }break; } #pragma warning 507 - IfxGpt12_initTxInPinWithPadLevel(count, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); - IfxGpt12_initTxEudInPinWithPadLevel(dir, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); + IfxGpt12_initTxInPinWithPadLevel(ch1, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); + IfxGpt12_initTxEudInPinWithPadLevel(ch2, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); #pragma warning default } diff --git a/Example/E07_encoder_demo/libraries/doc/version.txt b/Example/E07_encoder_demo/libraries/doc/version.txt index 4c656de..8858f7b 100644 --- a/Example/E07_encoder_demo/libraries/doc/version.txt +++ b/Example/E07_encoder_demo/libraries/doc/version.txt @@ -1,6 +1,8 @@ +V3.0.1 + 修复总钻风单独配置曝光度过慢的问题 V3.0.0 新命名风格开源库实现 - 增强了代码的可移植性 如果都使用V3库,那么用户将几乎无需更改任何代码即可在不同的单片机上实现相同的功能 + 增强了代码的可移植性 增加了部分公共层功能 V1.3.0 在icm20602的初始化中添加系数说明 diff --git a/Example/E07_encoder_demo/libraries/zf_driver/zf_driver_encoder.c b/Example/E07_encoder_demo/libraries/zf_driver/zf_driver_encoder.c index 1f99660..22160da 100644 --- a/Example/E07_encoder_demo/libraries/zf_driver/zf_driver_encoder.c +++ b/Example/E07_encoder_demo/libraries/zf_driver/zf_driver_encoder.c @@ -43,71 +43,71 @@ // 参数说明 count_pin 设置计数引脚 // 参数说明 dir_pin 设置计数方向引脚 // 返回参数 void -// 使用示例 encoder_mapping_set(gptn, count_pin, dir_pin); +// 使用示例 encoder_mapping_set(gptn, ch1_pin, ch2_pin); // 备注信息 //------------------------------------------------------------------------------------------------------------------- -static void encoder_mapping_set (encoder_index_enum encoder_n, encoder_channel1_enum count_pin, encoder_channel2_enum dir_pin) +static void encoder_mapping_set (encoder_index_enum encoder_n, encoder_channel1_enum ch1_pin, encoder_channel2_enum ch2_pin) { - IfxGpt12_TxIn_In *count; - IfxGpt12_TxEud_In *dir; + IfxGpt12_TxIn_In *ch1; + IfxGpt12_TxEud_In *ch2; switch(encoder_n) { case TIM2_ENCOEDER: { - if (TIM2_ENCOEDER_CH1_P00_7 == count_pin) count = &IfxGpt120_T2INA_P00_7_IN; - else if (TIM2_ENCOEDER_CH1_P33_7 == count_pin) count = &IfxGpt120_T2INB_P33_7_IN; + if (TIM2_ENCOEDER_CH1_P00_7 == ch1_pin) ch1 = &IfxGpt120_T2INA_P00_7_IN; + else if (TIM2_ENCOEDER_CH1_P33_7 == ch1_pin) ch1 = &IfxGpt120_T2INB_P33_7_IN; else zf_assert(FALSE); - if (TIM2_ENCOEDER_CH2_P00_8 == dir_pin) dir = &IfxGpt120_T2EUDA_P00_8_IN; - else if (TIM2_ENCOEDER_CH2_P33_6 == dir_pin) dir = &IfxGpt120_T2EUDB_P33_6_IN; + if (TIM2_ENCOEDER_CH2_P00_8 == ch2_pin) ch2 = &IfxGpt120_T2EUDA_P00_8_IN; + else if (TIM2_ENCOEDER_CH2_P33_6 == ch2_pin) ch2 = &IfxGpt120_T2EUDB_P33_6_IN; else zf_assert(FALSE); }break; case TIM3_ENCOEDER: { - if (TIM3_ENCOEDER_CH1_P02_6 == count_pin) count = &IfxGpt120_T3INA_P02_6_IN; + if (TIM3_ENCOEDER_CH1_P02_6 == ch1_pin) ch1 = &IfxGpt120_T3INA_P02_6_IN; else zf_assert(FALSE); - if (TIM3_ENCOEDER_CH2_P02_7 == dir_pin) dir = &IfxGpt120_T3EUDA_P02_7_IN; + if (TIM3_ENCOEDER_CH2_P02_7 == ch2_pin) ch2 = &IfxGpt120_T3EUDA_P02_7_IN; else zf_assert(FALSE); }break; case TIM4_ENCOEDER: { - if (TIM4_ENCOEDER_CH1_P02_8 == count_pin) count = &IfxGpt120_T4INA_P02_8_IN; + if (TIM4_ENCOEDER_CH1_P02_8 == ch1_pin) ch1 = &IfxGpt120_T4INA_P02_8_IN; else zf_assert(FALSE); - if (TIM4_ENCOEDER_CH2_P00_9 == dir_pin) dir = &IfxGpt120_T4EUDA_P00_9_IN; - else if (TIM4_ENCOEDER_CH2_P33_5 == dir_pin) dir = &IfxGpt120_T4EUDB_P33_5_IN; + if (TIM4_ENCOEDER_CH2_P00_9 == ch2_pin) ch2 = &IfxGpt120_T4EUDA_P00_9_IN; + else if (TIM4_ENCOEDER_CH2_P33_5 == ch2_pin) ch2 = &IfxGpt120_T4EUDB_P33_5_IN; else zf_assert(FALSE); }break; case TIM5_ENCOEDER: { - if (TIM5_ENCOEDER_CH1_P21_7 == count_pin) count = &IfxGpt120_T5INA_P21_7_IN; - else if (TIM5_ENCOEDER_CH1_P10_3 == count_pin) count = &IfxGpt120_T5INB_P10_3_IN; + if (TIM5_ENCOEDER_CH1_P21_7 == ch1_pin) ch1 = &IfxGpt120_T5INA_P21_7_IN; + else if (TIM5_ENCOEDER_CH1_P10_3 == ch1_pin) ch1 = &IfxGpt120_T5INB_P10_3_IN; else zf_assert(FALSE); - if (TIM5_ENCOEDER_CH2_P21_6 == dir_pin) dir = &IfxGpt120_T5EUDA_P21_6_IN; - else if (TIM5_ENCOEDER_CH2_P10_1 == dir_pin) dir = &IfxGpt120_T5EUDB_P10_1_IN; + if (TIM5_ENCOEDER_CH2_P21_6 == ch2_pin) ch2 = &IfxGpt120_T5EUDA_P21_6_IN; + else if (TIM5_ENCOEDER_CH2_P10_1 == ch2_pin) ch2 = &IfxGpt120_T5EUDB_P10_1_IN; else zf_assert(FALSE); }break; case TIM6_ENCOEDER: { - if (TIM6_ENCOEDER_CH1_P20_3 == count_pin) count = &IfxGpt120_T6INA_P20_3_IN; - else if (TIM6_ENCOEDER_CH1_P10_2 == count_pin) count = &IfxGpt120_T6INB_P10_2_IN; + if (TIM6_ENCOEDER_CH1_P20_3 == ch1_pin) ch1 = &IfxGpt120_T6INA_P20_3_IN; + else if (TIM6_ENCOEDER_CH1_P10_2 == ch1_pin) ch1 = &IfxGpt120_T6INB_P10_2_IN; else zf_assert(FALSE); - if (TIM6_ENCOEDER_CH2_P20_0 == dir_pin) dir = &IfxGpt120_T6EUDA_P20_0_IN; + if (TIM6_ENCOEDER_CH2_P20_0 == ch2_pin) ch2 = &IfxGpt120_T6EUDA_P20_0_IN; else zf_assert(FALSE); }break; } #pragma warning 507 - IfxGpt12_initTxInPinWithPadLevel(count, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); - IfxGpt12_initTxEudInPinWithPadLevel(dir, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); + IfxGpt12_initTxInPinWithPadLevel(ch1, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); + IfxGpt12_initTxEudInPinWithPadLevel(ch2, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); #pragma warning default } diff --git a/Example/E08_eeprom_demo/libraries/doc/version.txt b/Example/E08_eeprom_demo/libraries/doc/version.txt index 4c656de..8858f7b 100644 --- a/Example/E08_eeprom_demo/libraries/doc/version.txt +++ b/Example/E08_eeprom_demo/libraries/doc/version.txt @@ -1,6 +1,8 @@ +V3.0.1 + 修复总钻风单独配置曝光度过慢的问题 V3.0.0 新命名风格开源库实现 - 增强了代码的可移植性 如果都使用V3库,那么用户将几乎无需更改任何代码即可在不同的单片机上实现相同的功能 + 增强了代码的可移植性 增加了部分公共层功能 V1.3.0 在icm20602的初始化中添加系数说明 diff --git a/Example/E08_eeprom_demo/libraries/zf_driver/zf_driver_encoder.c b/Example/E08_eeprom_demo/libraries/zf_driver/zf_driver_encoder.c index 1f99660..22160da 100644 --- a/Example/E08_eeprom_demo/libraries/zf_driver/zf_driver_encoder.c +++ b/Example/E08_eeprom_demo/libraries/zf_driver/zf_driver_encoder.c @@ -43,71 +43,71 @@ // 参数说明 count_pin 设置计数引脚 // 参数说明 dir_pin 设置计数方向引脚 // 返回参数 void -// 使用示例 encoder_mapping_set(gptn, count_pin, dir_pin); +// 使用示例 encoder_mapping_set(gptn, ch1_pin, ch2_pin); // 备注信息 //------------------------------------------------------------------------------------------------------------------- -static void encoder_mapping_set (encoder_index_enum encoder_n, encoder_channel1_enum count_pin, encoder_channel2_enum dir_pin) +static void encoder_mapping_set (encoder_index_enum encoder_n, encoder_channel1_enum ch1_pin, encoder_channel2_enum ch2_pin) { - IfxGpt12_TxIn_In *count; - IfxGpt12_TxEud_In *dir; + IfxGpt12_TxIn_In *ch1; + IfxGpt12_TxEud_In *ch2; switch(encoder_n) { case TIM2_ENCOEDER: { - if (TIM2_ENCOEDER_CH1_P00_7 == count_pin) count = &IfxGpt120_T2INA_P00_7_IN; - else if (TIM2_ENCOEDER_CH1_P33_7 == count_pin) count = &IfxGpt120_T2INB_P33_7_IN; + if (TIM2_ENCOEDER_CH1_P00_7 == ch1_pin) ch1 = &IfxGpt120_T2INA_P00_7_IN; + else if (TIM2_ENCOEDER_CH1_P33_7 == ch1_pin) ch1 = &IfxGpt120_T2INB_P33_7_IN; else zf_assert(FALSE); - if (TIM2_ENCOEDER_CH2_P00_8 == dir_pin) dir = &IfxGpt120_T2EUDA_P00_8_IN; - else if (TIM2_ENCOEDER_CH2_P33_6 == dir_pin) dir = &IfxGpt120_T2EUDB_P33_6_IN; + if (TIM2_ENCOEDER_CH2_P00_8 == ch2_pin) ch2 = &IfxGpt120_T2EUDA_P00_8_IN; + else if (TIM2_ENCOEDER_CH2_P33_6 == ch2_pin) ch2 = &IfxGpt120_T2EUDB_P33_6_IN; else zf_assert(FALSE); }break; case TIM3_ENCOEDER: { - if (TIM3_ENCOEDER_CH1_P02_6 == count_pin) count = &IfxGpt120_T3INA_P02_6_IN; + if (TIM3_ENCOEDER_CH1_P02_6 == ch1_pin) ch1 = &IfxGpt120_T3INA_P02_6_IN; else zf_assert(FALSE); - if (TIM3_ENCOEDER_CH2_P02_7 == dir_pin) dir = &IfxGpt120_T3EUDA_P02_7_IN; + if (TIM3_ENCOEDER_CH2_P02_7 == ch2_pin) ch2 = &IfxGpt120_T3EUDA_P02_7_IN; else zf_assert(FALSE); }break; case TIM4_ENCOEDER: { - if (TIM4_ENCOEDER_CH1_P02_8 == count_pin) count = &IfxGpt120_T4INA_P02_8_IN; + if (TIM4_ENCOEDER_CH1_P02_8 == ch1_pin) ch1 = &IfxGpt120_T4INA_P02_8_IN; else zf_assert(FALSE); - if (TIM4_ENCOEDER_CH2_P00_9 == dir_pin) dir = &IfxGpt120_T4EUDA_P00_9_IN; - else if (TIM4_ENCOEDER_CH2_P33_5 == dir_pin) dir = &IfxGpt120_T4EUDB_P33_5_IN; + if (TIM4_ENCOEDER_CH2_P00_9 == ch2_pin) ch2 = &IfxGpt120_T4EUDA_P00_9_IN; + else if (TIM4_ENCOEDER_CH2_P33_5 == ch2_pin) ch2 = &IfxGpt120_T4EUDB_P33_5_IN; else zf_assert(FALSE); }break; case TIM5_ENCOEDER: { - if (TIM5_ENCOEDER_CH1_P21_7 == count_pin) count = &IfxGpt120_T5INA_P21_7_IN; - else if (TIM5_ENCOEDER_CH1_P10_3 == count_pin) count = &IfxGpt120_T5INB_P10_3_IN; + if (TIM5_ENCOEDER_CH1_P21_7 == ch1_pin) ch1 = &IfxGpt120_T5INA_P21_7_IN; + else if (TIM5_ENCOEDER_CH1_P10_3 == ch1_pin) ch1 = &IfxGpt120_T5INB_P10_3_IN; else zf_assert(FALSE); - if (TIM5_ENCOEDER_CH2_P21_6 == dir_pin) dir = &IfxGpt120_T5EUDA_P21_6_IN; - else if (TIM5_ENCOEDER_CH2_P10_1 == dir_pin) dir = &IfxGpt120_T5EUDB_P10_1_IN; + if (TIM5_ENCOEDER_CH2_P21_6 == ch2_pin) ch2 = &IfxGpt120_T5EUDA_P21_6_IN; + else if (TIM5_ENCOEDER_CH2_P10_1 == ch2_pin) ch2 = &IfxGpt120_T5EUDB_P10_1_IN; else zf_assert(FALSE); }break; case TIM6_ENCOEDER: { - if (TIM6_ENCOEDER_CH1_P20_3 == count_pin) count = &IfxGpt120_T6INA_P20_3_IN; - else if (TIM6_ENCOEDER_CH1_P10_2 == count_pin) count = &IfxGpt120_T6INB_P10_2_IN; + if (TIM6_ENCOEDER_CH1_P20_3 == ch1_pin) ch1 = &IfxGpt120_T6INA_P20_3_IN; + else if (TIM6_ENCOEDER_CH1_P10_2 == ch1_pin) ch1 = &IfxGpt120_T6INB_P10_2_IN; else zf_assert(FALSE); - if (TIM6_ENCOEDER_CH2_P20_0 == dir_pin) dir = &IfxGpt120_T6EUDA_P20_0_IN; + if (TIM6_ENCOEDER_CH2_P20_0 == ch2_pin) ch2 = &IfxGpt120_T6EUDA_P20_0_IN; else zf_assert(FALSE); }break; } #pragma warning 507 - IfxGpt12_initTxInPinWithPadLevel(count, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); - IfxGpt12_initTxEudInPinWithPadLevel(dir, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); + IfxGpt12_initTxInPinWithPadLevel(ch1, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); + IfxGpt12_initTxEudInPinWithPadLevel(ch2, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); #pragma warning default } diff --git a/Example/E09_timer_demo/libraries/doc/version.txt b/Example/E09_timer_demo/libraries/doc/version.txt index 4c656de..8858f7b 100644 --- a/Example/E09_timer_demo/libraries/doc/version.txt +++ b/Example/E09_timer_demo/libraries/doc/version.txt @@ -1,6 +1,8 @@ +V3.0.1 + 修复总钻风单独配置曝光度过慢的问题 V3.0.0 新命名风格开源库实现 - 增强了代码的可移植性 如果都使用V3库,那么用户将几乎无需更改任何代码即可在不同的单片机上实现相同的功能 + 增强了代码的可移植性 增加了部分公共层功能 V1.3.0 在icm20602的初始化中添加系数说明 diff --git a/Example/E09_timer_demo/libraries/zf_driver/zf_driver_encoder.c b/Example/E09_timer_demo/libraries/zf_driver/zf_driver_encoder.c index 1f99660..22160da 100644 --- a/Example/E09_timer_demo/libraries/zf_driver/zf_driver_encoder.c +++ b/Example/E09_timer_demo/libraries/zf_driver/zf_driver_encoder.c @@ -43,71 +43,71 @@ // 参数说明 count_pin 设置计数引脚 // 参数说明 dir_pin 设置计数方向引脚 // 返回参数 void -// 使用示例 encoder_mapping_set(gptn, count_pin, dir_pin); +// 使用示例 encoder_mapping_set(gptn, ch1_pin, ch2_pin); // 备注信息 //------------------------------------------------------------------------------------------------------------------- -static void encoder_mapping_set (encoder_index_enum encoder_n, encoder_channel1_enum count_pin, encoder_channel2_enum dir_pin) +static void encoder_mapping_set (encoder_index_enum encoder_n, encoder_channel1_enum ch1_pin, encoder_channel2_enum ch2_pin) { - IfxGpt12_TxIn_In *count; - IfxGpt12_TxEud_In *dir; + IfxGpt12_TxIn_In *ch1; + IfxGpt12_TxEud_In *ch2; switch(encoder_n) { case TIM2_ENCOEDER: { - if (TIM2_ENCOEDER_CH1_P00_7 == count_pin) count = &IfxGpt120_T2INA_P00_7_IN; - else if (TIM2_ENCOEDER_CH1_P33_7 == count_pin) count = &IfxGpt120_T2INB_P33_7_IN; + if (TIM2_ENCOEDER_CH1_P00_7 == ch1_pin) ch1 = &IfxGpt120_T2INA_P00_7_IN; + else if (TIM2_ENCOEDER_CH1_P33_7 == ch1_pin) ch1 = &IfxGpt120_T2INB_P33_7_IN; else zf_assert(FALSE); - if (TIM2_ENCOEDER_CH2_P00_8 == dir_pin) dir = &IfxGpt120_T2EUDA_P00_8_IN; - else if (TIM2_ENCOEDER_CH2_P33_6 == dir_pin) dir = &IfxGpt120_T2EUDB_P33_6_IN; + if (TIM2_ENCOEDER_CH2_P00_8 == ch2_pin) ch2 = &IfxGpt120_T2EUDA_P00_8_IN; + else if (TIM2_ENCOEDER_CH2_P33_6 == ch2_pin) ch2 = &IfxGpt120_T2EUDB_P33_6_IN; else zf_assert(FALSE); }break; case TIM3_ENCOEDER: { - if (TIM3_ENCOEDER_CH1_P02_6 == count_pin) count = &IfxGpt120_T3INA_P02_6_IN; + if (TIM3_ENCOEDER_CH1_P02_6 == ch1_pin) ch1 = &IfxGpt120_T3INA_P02_6_IN; else zf_assert(FALSE); - if (TIM3_ENCOEDER_CH2_P02_7 == dir_pin) dir = &IfxGpt120_T3EUDA_P02_7_IN; + if (TIM3_ENCOEDER_CH2_P02_7 == ch2_pin) ch2 = &IfxGpt120_T3EUDA_P02_7_IN; else zf_assert(FALSE); }break; case TIM4_ENCOEDER: { - if (TIM4_ENCOEDER_CH1_P02_8 == count_pin) count = &IfxGpt120_T4INA_P02_8_IN; + if (TIM4_ENCOEDER_CH1_P02_8 == ch1_pin) ch1 = &IfxGpt120_T4INA_P02_8_IN; else zf_assert(FALSE); - if (TIM4_ENCOEDER_CH2_P00_9 == dir_pin) dir = &IfxGpt120_T4EUDA_P00_9_IN; - else if (TIM4_ENCOEDER_CH2_P33_5 == dir_pin) dir = &IfxGpt120_T4EUDB_P33_5_IN; + if (TIM4_ENCOEDER_CH2_P00_9 == ch2_pin) ch2 = &IfxGpt120_T4EUDA_P00_9_IN; + else if (TIM4_ENCOEDER_CH2_P33_5 == ch2_pin) ch2 = &IfxGpt120_T4EUDB_P33_5_IN; else zf_assert(FALSE); }break; case TIM5_ENCOEDER: { - if (TIM5_ENCOEDER_CH1_P21_7 == count_pin) count = &IfxGpt120_T5INA_P21_7_IN; - else if (TIM5_ENCOEDER_CH1_P10_3 == count_pin) count = &IfxGpt120_T5INB_P10_3_IN; + if (TIM5_ENCOEDER_CH1_P21_7 == ch1_pin) ch1 = &IfxGpt120_T5INA_P21_7_IN; + else if (TIM5_ENCOEDER_CH1_P10_3 == ch1_pin) ch1 = &IfxGpt120_T5INB_P10_3_IN; else zf_assert(FALSE); - if (TIM5_ENCOEDER_CH2_P21_6 == dir_pin) dir = &IfxGpt120_T5EUDA_P21_6_IN; - else if (TIM5_ENCOEDER_CH2_P10_1 == dir_pin) dir = &IfxGpt120_T5EUDB_P10_1_IN; + if (TIM5_ENCOEDER_CH2_P21_6 == ch2_pin) ch2 = &IfxGpt120_T5EUDA_P21_6_IN; + else if (TIM5_ENCOEDER_CH2_P10_1 == ch2_pin) ch2 = &IfxGpt120_T5EUDB_P10_1_IN; else zf_assert(FALSE); }break; case TIM6_ENCOEDER: { - if (TIM6_ENCOEDER_CH1_P20_3 == count_pin) count = &IfxGpt120_T6INA_P20_3_IN; - else if (TIM6_ENCOEDER_CH1_P10_2 == count_pin) count = &IfxGpt120_T6INB_P10_2_IN; + if (TIM6_ENCOEDER_CH1_P20_3 == ch1_pin) ch1 = &IfxGpt120_T6INA_P20_3_IN; + else if (TIM6_ENCOEDER_CH1_P10_2 == ch1_pin) ch1 = &IfxGpt120_T6INB_P10_2_IN; else zf_assert(FALSE); - if (TIM6_ENCOEDER_CH2_P20_0 == dir_pin) dir = &IfxGpt120_T6EUDA_P20_0_IN; + if (TIM6_ENCOEDER_CH2_P20_0 == ch2_pin) ch2 = &IfxGpt120_T6EUDA_P20_0_IN; else zf_assert(FALSE); }break; } #pragma warning 507 - IfxGpt12_initTxInPinWithPadLevel(count, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); - IfxGpt12_initTxEudInPinWithPadLevel(dir, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); + IfxGpt12_initTxInPinWithPadLevel(ch1, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); + IfxGpt12_initTxEudInPinWithPadLevel(ch2, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); #pragma warning default } diff --git a/Example/E10_printf_debug_log_demo/libraries/doc/version.txt b/Example/E10_printf_debug_log_demo/libraries/doc/version.txt index 4c656de..8858f7b 100644 --- a/Example/E10_printf_debug_log_demo/libraries/doc/version.txt +++ b/Example/E10_printf_debug_log_demo/libraries/doc/version.txt @@ -1,6 +1,8 @@ +V3.0.1 + 修复总钻风单独配置曝光度过慢的问题 V3.0.0 新命名风格开源库实现 - 增强了代码的可移植性 如果都使用V3库,那么用户将几乎无需更改任何代码即可在不同的单片机上实现相同的功能 + 增强了代码的可移植性 增加了部分公共层功能 V1.3.0 在icm20602的初始化中添加系数说明 diff --git a/Example/E10_printf_debug_log_demo/libraries/zf_driver/zf_driver_encoder.c b/Example/E10_printf_debug_log_demo/libraries/zf_driver/zf_driver_encoder.c index 1f99660..22160da 100644 --- a/Example/E10_printf_debug_log_demo/libraries/zf_driver/zf_driver_encoder.c +++ b/Example/E10_printf_debug_log_demo/libraries/zf_driver/zf_driver_encoder.c @@ -43,71 +43,71 @@ // 参数说明 count_pin 设置计数引脚 // 参数说明 dir_pin 设置计数方向引脚 // 返回参数 void -// 使用示例 encoder_mapping_set(gptn, count_pin, dir_pin); +// 使用示例 encoder_mapping_set(gptn, ch1_pin, ch2_pin); // 备注信息 //------------------------------------------------------------------------------------------------------------------- -static void encoder_mapping_set (encoder_index_enum encoder_n, encoder_channel1_enum count_pin, encoder_channel2_enum dir_pin) +static void encoder_mapping_set (encoder_index_enum encoder_n, encoder_channel1_enum ch1_pin, encoder_channel2_enum ch2_pin) { - IfxGpt12_TxIn_In *count; - IfxGpt12_TxEud_In *dir; + IfxGpt12_TxIn_In *ch1; + IfxGpt12_TxEud_In *ch2; switch(encoder_n) { case TIM2_ENCOEDER: { - if (TIM2_ENCOEDER_CH1_P00_7 == count_pin) count = &IfxGpt120_T2INA_P00_7_IN; - else if (TIM2_ENCOEDER_CH1_P33_7 == count_pin) count = &IfxGpt120_T2INB_P33_7_IN; + if (TIM2_ENCOEDER_CH1_P00_7 == ch1_pin) ch1 = &IfxGpt120_T2INA_P00_7_IN; + else if (TIM2_ENCOEDER_CH1_P33_7 == ch1_pin) ch1 = &IfxGpt120_T2INB_P33_7_IN; else zf_assert(FALSE); - if (TIM2_ENCOEDER_CH2_P00_8 == dir_pin) dir = &IfxGpt120_T2EUDA_P00_8_IN; - else if (TIM2_ENCOEDER_CH2_P33_6 == dir_pin) dir = &IfxGpt120_T2EUDB_P33_6_IN; + if (TIM2_ENCOEDER_CH2_P00_8 == ch2_pin) ch2 = &IfxGpt120_T2EUDA_P00_8_IN; + else if (TIM2_ENCOEDER_CH2_P33_6 == ch2_pin) ch2 = &IfxGpt120_T2EUDB_P33_6_IN; else zf_assert(FALSE); }break; case TIM3_ENCOEDER: { - if (TIM3_ENCOEDER_CH1_P02_6 == count_pin) count = &IfxGpt120_T3INA_P02_6_IN; + if (TIM3_ENCOEDER_CH1_P02_6 == ch1_pin) ch1 = &IfxGpt120_T3INA_P02_6_IN; else zf_assert(FALSE); - if (TIM3_ENCOEDER_CH2_P02_7 == dir_pin) dir = &IfxGpt120_T3EUDA_P02_7_IN; + if (TIM3_ENCOEDER_CH2_P02_7 == ch2_pin) ch2 = &IfxGpt120_T3EUDA_P02_7_IN; else zf_assert(FALSE); }break; case TIM4_ENCOEDER: { - if (TIM4_ENCOEDER_CH1_P02_8 == count_pin) count = &IfxGpt120_T4INA_P02_8_IN; + if (TIM4_ENCOEDER_CH1_P02_8 == ch1_pin) ch1 = &IfxGpt120_T4INA_P02_8_IN; else zf_assert(FALSE); - if (TIM4_ENCOEDER_CH2_P00_9 == dir_pin) dir = &IfxGpt120_T4EUDA_P00_9_IN; - else if (TIM4_ENCOEDER_CH2_P33_5 == dir_pin) dir = &IfxGpt120_T4EUDB_P33_5_IN; + if (TIM4_ENCOEDER_CH2_P00_9 == ch2_pin) ch2 = &IfxGpt120_T4EUDA_P00_9_IN; + else if (TIM4_ENCOEDER_CH2_P33_5 == ch2_pin) ch2 = &IfxGpt120_T4EUDB_P33_5_IN; else zf_assert(FALSE); }break; case TIM5_ENCOEDER: { - if (TIM5_ENCOEDER_CH1_P21_7 == count_pin) count = &IfxGpt120_T5INA_P21_7_IN; - else if (TIM5_ENCOEDER_CH1_P10_3 == count_pin) count = &IfxGpt120_T5INB_P10_3_IN; + if (TIM5_ENCOEDER_CH1_P21_7 == ch1_pin) ch1 = &IfxGpt120_T5INA_P21_7_IN; + else if (TIM5_ENCOEDER_CH1_P10_3 == ch1_pin) ch1 = &IfxGpt120_T5INB_P10_3_IN; else zf_assert(FALSE); - if (TIM5_ENCOEDER_CH2_P21_6 == dir_pin) dir = &IfxGpt120_T5EUDA_P21_6_IN; - else if (TIM5_ENCOEDER_CH2_P10_1 == dir_pin) dir = &IfxGpt120_T5EUDB_P10_1_IN; + if (TIM5_ENCOEDER_CH2_P21_6 == ch2_pin) ch2 = &IfxGpt120_T5EUDA_P21_6_IN; + else if (TIM5_ENCOEDER_CH2_P10_1 == ch2_pin) ch2 = &IfxGpt120_T5EUDB_P10_1_IN; else zf_assert(FALSE); }break; case TIM6_ENCOEDER: { - if (TIM6_ENCOEDER_CH1_P20_3 == count_pin) count = &IfxGpt120_T6INA_P20_3_IN; - else if (TIM6_ENCOEDER_CH1_P10_2 == count_pin) count = &IfxGpt120_T6INB_P10_2_IN; + if (TIM6_ENCOEDER_CH1_P20_3 == ch1_pin) ch1 = &IfxGpt120_T6INA_P20_3_IN; + else if (TIM6_ENCOEDER_CH1_P10_2 == ch1_pin) ch1 = &IfxGpt120_T6INB_P10_2_IN; else zf_assert(FALSE); - if (TIM6_ENCOEDER_CH2_P20_0 == dir_pin) dir = &IfxGpt120_T6EUDA_P20_0_IN; + if (TIM6_ENCOEDER_CH2_P20_0 == ch2_pin) ch2 = &IfxGpt120_T6EUDA_P20_0_IN; else zf_assert(FALSE); }break; } #pragma warning 507 - IfxGpt12_initTxInPinWithPadLevel(count, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); - IfxGpt12_initTxEudInPinWithPadLevel(dir, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); + IfxGpt12_initTxInPinWithPadLevel(ch1, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); + IfxGpt12_initTxEudInPinWithPadLevel(ch2, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); #pragma warning default } diff --git a/Example/E11_interrupt_priority_set_demo/libraries/doc/version.txt b/Example/E11_interrupt_priority_set_demo/libraries/doc/version.txt index 4c656de..8858f7b 100644 --- a/Example/E11_interrupt_priority_set_demo/libraries/doc/version.txt +++ b/Example/E11_interrupt_priority_set_demo/libraries/doc/version.txt @@ -1,6 +1,8 @@ +V3.0.1 + 修复总钻风单独配置曝光度过慢的问题 V3.0.0 新命名风格开源库实现 - 增强了代码的可移植性 如果都使用V3库,那么用户将几乎无需更改任何代码即可在不同的单片机上实现相同的功能 + 增强了代码的可移植性 增加了部分公共层功能 V1.3.0 在icm20602的初始化中添加系数说明 diff --git a/Example/E11_interrupt_priority_set_demo/libraries/zf_driver/zf_driver_encoder.c b/Example/E11_interrupt_priority_set_demo/libraries/zf_driver/zf_driver_encoder.c index 1f99660..22160da 100644 --- a/Example/E11_interrupt_priority_set_demo/libraries/zf_driver/zf_driver_encoder.c +++ b/Example/E11_interrupt_priority_set_demo/libraries/zf_driver/zf_driver_encoder.c @@ -43,71 +43,71 @@ // 参数说明 count_pin 设置计数引脚 // 参数说明 dir_pin 设置计数方向引脚 // 返回参数 void -// 使用示例 encoder_mapping_set(gptn, count_pin, dir_pin); +// 使用示例 encoder_mapping_set(gptn, ch1_pin, ch2_pin); // 备注信息 //------------------------------------------------------------------------------------------------------------------- -static void encoder_mapping_set (encoder_index_enum encoder_n, encoder_channel1_enum count_pin, encoder_channel2_enum dir_pin) +static void encoder_mapping_set (encoder_index_enum encoder_n, encoder_channel1_enum ch1_pin, encoder_channel2_enum ch2_pin) { - IfxGpt12_TxIn_In *count; - IfxGpt12_TxEud_In *dir; + IfxGpt12_TxIn_In *ch1; + IfxGpt12_TxEud_In *ch2; switch(encoder_n) { case TIM2_ENCOEDER: { - if (TIM2_ENCOEDER_CH1_P00_7 == count_pin) count = &IfxGpt120_T2INA_P00_7_IN; - else if (TIM2_ENCOEDER_CH1_P33_7 == count_pin) count = &IfxGpt120_T2INB_P33_7_IN; + if (TIM2_ENCOEDER_CH1_P00_7 == ch1_pin) ch1 = &IfxGpt120_T2INA_P00_7_IN; + else if (TIM2_ENCOEDER_CH1_P33_7 == ch1_pin) ch1 = &IfxGpt120_T2INB_P33_7_IN; else zf_assert(FALSE); - if (TIM2_ENCOEDER_CH2_P00_8 == dir_pin) dir = &IfxGpt120_T2EUDA_P00_8_IN; - else if (TIM2_ENCOEDER_CH2_P33_6 == dir_pin) dir = &IfxGpt120_T2EUDB_P33_6_IN; + if (TIM2_ENCOEDER_CH2_P00_8 == ch2_pin) ch2 = &IfxGpt120_T2EUDA_P00_8_IN; + else if (TIM2_ENCOEDER_CH2_P33_6 == ch2_pin) ch2 = &IfxGpt120_T2EUDB_P33_6_IN; else zf_assert(FALSE); }break; case TIM3_ENCOEDER: { - if (TIM3_ENCOEDER_CH1_P02_6 == count_pin) count = &IfxGpt120_T3INA_P02_6_IN; + if (TIM3_ENCOEDER_CH1_P02_6 == ch1_pin) ch1 = &IfxGpt120_T3INA_P02_6_IN; else zf_assert(FALSE); - if (TIM3_ENCOEDER_CH2_P02_7 == dir_pin) dir = &IfxGpt120_T3EUDA_P02_7_IN; + if (TIM3_ENCOEDER_CH2_P02_7 == ch2_pin) ch2 = &IfxGpt120_T3EUDA_P02_7_IN; else zf_assert(FALSE); }break; case TIM4_ENCOEDER: { - if (TIM4_ENCOEDER_CH1_P02_8 == count_pin) count = &IfxGpt120_T4INA_P02_8_IN; + if (TIM4_ENCOEDER_CH1_P02_8 == ch1_pin) ch1 = &IfxGpt120_T4INA_P02_8_IN; else zf_assert(FALSE); - if (TIM4_ENCOEDER_CH2_P00_9 == dir_pin) dir = &IfxGpt120_T4EUDA_P00_9_IN; - else if (TIM4_ENCOEDER_CH2_P33_5 == dir_pin) dir = &IfxGpt120_T4EUDB_P33_5_IN; + if (TIM4_ENCOEDER_CH2_P00_9 == ch2_pin) ch2 = &IfxGpt120_T4EUDA_P00_9_IN; + else if (TIM4_ENCOEDER_CH2_P33_5 == ch2_pin) ch2 = &IfxGpt120_T4EUDB_P33_5_IN; else zf_assert(FALSE); }break; case TIM5_ENCOEDER: { - if (TIM5_ENCOEDER_CH1_P21_7 == count_pin) count = &IfxGpt120_T5INA_P21_7_IN; - else if (TIM5_ENCOEDER_CH1_P10_3 == count_pin) count = &IfxGpt120_T5INB_P10_3_IN; + if (TIM5_ENCOEDER_CH1_P21_7 == ch1_pin) ch1 = &IfxGpt120_T5INA_P21_7_IN; + else if (TIM5_ENCOEDER_CH1_P10_3 == ch1_pin) ch1 = &IfxGpt120_T5INB_P10_3_IN; else zf_assert(FALSE); - if (TIM5_ENCOEDER_CH2_P21_6 == dir_pin) dir = &IfxGpt120_T5EUDA_P21_6_IN; - else if (TIM5_ENCOEDER_CH2_P10_1 == dir_pin) dir = &IfxGpt120_T5EUDB_P10_1_IN; + if (TIM5_ENCOEDER_CH2_P21_6 == ch2_pin) ch2 = &IfxGpt120_T5EUDA_P21_6_IN; + else if (TIM5_ENCOEDER_CH2_P10_1 == ch2_pin) ch2 = &IfxGpt120_T5EUDB_P10_1_IN; else zf_assert(FALSE); }break; case TIM6_ENCOEDER: { - if (TIM6_ENCOEDER_CH1_P20_3 == count_pin) count = &IfxGpt120_T6INA_P20_3_IN; - else if (TIM6_ENCOEDER_CH1_P10_2 == count_pin) count = &IfxGpt120_T6INB_P10_2_IN; + if (TIM6_ENCOEDER_CH1_P20_3 == ch1_pin) ch1 = &IfxGpt120_T6INA_P20_3_IN; + else if (TIM6_ENCOEDER_CH1_P10_2 == ch1_pin) ch1 = &IfxGpt120_T6INB_P10_2_IN; else zf_assert(FALSE); - if (TIM6_ENCOEDER_CH2_P20_0 == dir_pin) dir = &IfxGpt120_T6EUDA_P20_0_IN; + if (TIM6_ENCOEDER_CH2_P20_0 == ch2_pin) ch2 = &IfxGpt120_T6EUDA_P20_0_IN; else zf_assert(FALSE); }break; } #pragma warning 507 - IfxGpt12_initTxInPinWithPadLevel(count, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); - IfxGpt12_initTxEudInPinWithPadLevel(dir, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); + IfxGpt12_initTxInPinWithPadLevel(ch1, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); + IfxGpt12_initTxEudInPinWithPadLevel(ch2, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); #pragma warning default } diff --git a/Example/E12_cpu1_handles_interrupts_demo/libraries/doc/version.txt b/Example/E12_cpu1_handles_interrupts_demo/libraries/doc/version.txt index 4c656de..8858f7b 100644 --- a/Example/E12_cpu1_handles_interrupts_demo/libraries/doc/version.txt +++ b/Example/E12_cpu1_handles_interrupts_demo/libraries/doc/version.txt @@ -1,6 +1,8 @@ +V3.0.1 + 修复总钻风单独配置曝光度过慢的问题 V3.0.0 新命名风格开源库实现 - 增强了代码的可移植性 如果都使用V3库,那么用户将几乎无需更改任何代码即可在不同的单片机上实现相同的功能 + 增强了代码的可移植性 增加了部分公共层功能 V1.3.0 在icm20602的初始化中添加系数说明 diff --git a/Example/E12_cpu1_handles_interrupts_demo/libraries/zf_driver/zf_driver_encoder.c b/Example/E12_cpu1_handles_interrupts_demo/libraries/zf_driver/zf_driver_encoder.c index 1f99660..22160da 100644 --- a/Example/E12_cpu1_handles_interrupts_demo/libraries/zf_driver/zf_driver_encoder.c +++ b/Example/E12_cpu1_handles_interrupts_demo/libraries/zf_driver/zf_driver_encoder.c @@ -43,71 +43,71 @@ // 参数说明 count_pin 设置计数引脚 // 参数说明 dir_pin 设置计数方向引脚 // 返回参数 void -// 使用示例 encoder_mapping_set(gptn, count_pin, dir_pin); +// 使用示例 encoder_mapping_set(gptn, ch1_pin, ch2_pin); // 备注信息 //------------------------------------------------------------------------------------------------------------------- -static void encoder_mapping_set (encoder_index_enum encoder_n, encoder_channel1_enum count_pin, encoder_channel2_enum dir_pin) +static void encoder_mapping_set (encoder_index_enum encoder_n, encoder_channel1_enum ch1_pin, encoder_channel2_enum ch2_pin) { - IfxGpt12_TxIn_In *count; - IfxGpt12_TxEud_In *dir; + IfxGpt12_TxIn_In *ch1; + IfxGpt12_TxEud_In *ch2; switch(encoder_n) { case TIM2_ENCOEDER: { - if (TIM2_ENCOEDER_CH1_P00_7 == count_pin) count = &IfxGpt120_T2INA_P00_7_IN; - else if (TIM2_ENCOEDER_CH1_P33_7 == count_pin) count = &IfxGpt120_T2INB_P33_7_IN; + if (TIM2_ENCOEDER_CH1_P00_7 == ch1_pin) ch1 = &IfxGpt120_T2INA_P00_7_IN; + else if (TIM2_ENCOEDER_CH1_P33_7 == ch1_pin) ch1 = &IfxGpt120_T2INB_P33_7_IN; else zf_assert(FALSE); - if (TIM2_ENCOEDER_CH2_P00_8 == dir_pin) dir = &IfxGpt120_T2EUDA_P00_8_IN; - else if (TIM2_ENCOEDER_CH2_P33_6 == dir_pin) dir = &IfxGpt120_T2EUDB_P33_6_IN; + if (TIM2_ENCOEDER_CH2_P00_8 == ch2_pin) ch2 = &IfxGpt120_T2EUDA_P00_8_IN; + else if (TIM2_ENCOEDER_CH2_P33_6 == ch2_pin) ch2 = &IfxGpt120_T2EUDB_P33_6_IN; else zf_assert(FALSE); }break; case TIM3_ENCOEDER: { - if (TIM3_ENCOEDER_CH1_P02_6 == count_pin) count = &IfxGpt120_T3INA_P02_6_IN; + if (TIM3_ENCOEDER_CH1_P02_6 == ch1_pin) ch1 = &IfxGpt120_T3INA_P02_6_IN; else zf_assert(FALSE); - if (TIM3_ENCOEDER_CH2_P02_7 == dir_pin) dir = &IfxGpt120_T3EUDA_P02_7_IN; + if (TIM3_ENCOEDER_CH2_P02_7 == ch2_pin) ch2 = &IfxGpt120_T3EUDA_P02_7_IN; else zf_assert(FALSE); }break; case TIM4_ENCOEDER: { - if (TIM4_ENCOEDER_CH1_P02_8 == count_pin) count = &IfxGpt120_T4INA_P02_8_IN; + if (TIM4_ENCOEDER_CH1_P02_8 == ch1_pin) ch1 = &IfxGpt120_T4INA_P02_8_IN; else zf_assert(FALSE); - if (TIM4_ENCOEDER_CH2_P00_9 == dir_pin) dir = &IfxGpt120_T4EUDA_P00_9_IN; - else if (TIM4_ENCOEDER_CH2_P33_5 == dir_pin) dir = &IfxGpt120_T4EUDB_P33_5_IN; + if (TIM4_ENCOEDER_CH2_P00_9 == ch2_pin) ch2 = &IfxGpt120_T4EUDA_P00_9_IN; + else if (TIM4_ENCOEDER_CH2_P33_5 == ch2_pin) ch2 = &IfxGpt120_T4EUDB_P33_5_IN; else zf_assert(FALSE); }break; case TIM5_ENCOEDER: { - if (TIM5_ENCOEDER_CH1_P21_7 == count_pin) count = &IfxGpt120_T5INA_P21_7_IN; - else if (TIM5_ENCOEDER_CH1_P10_3 == count_pin) count = &IfxGpt120_T5INB_P10_3_IN; + if (TIM5_ENCOEDER_CH1_P21_7 == ch1_pin) ch1 = &IfxGpt120_T5INA_P21_7_IN; + else if (TIM5_ENCOEDER_CH1_P10_3 == ch1_pin) ch1 = &IfxGpt120_T5INB_P10_3_IN; else zf_assert(FALSE); - if (TIM5_ENCOEDER_CH2_P21_6 == dir_pin) dir = &IfxGpt120_T5EUDA_P21_6_IN; - else if (TIM5_ENCOEDER_CH2_P10_1 == dir_pin) dir = &IfxGpt120_T5EUDB_P10_1_IN; + if (TIM5_ENCOEDER_CH2_P21_6 == ch2_pin) ch2 = &IfxGpt120_T5EUDA_P21_6_IN; + else if (TIM5_ENCOEDER_CH2_P10_1 == ch2_pin) ch2 = &IfxGpt120_T5EUDB_P10_1_IN; else zf_assert(FALSE); }break; case TIM6_ENCOEDER: { - if (TIM6_ENCOEDER_CH1_P20_3 == count_pin) count = &IfxGpt120_T6INA_P20_3_IN; - else if (TIM6_ENCOEDER_CH1_P10_2 == count_pin) count = &IfxGpt120_T6INB_P10_2_IN; + if (TIM6_ENCOEDER_CH1_P20_3 == ch1_pin) ch1 = &IfxGpt120_T6INA_P20_3_IN; + else if (TIM6_ENCOEDER_CH1_P10_2 == ch1_pin) ch1 = &IfxGpt120_T6INB_P10_2_IN; else zf_assert(FALSE); - if (TIM6_ENCOEDER_CH2_P20_0 == dir_pin) dir = &IfxGpt120_T6EUDA_P20_0_IN; + if (TIM6_ENCOEDER_CH2_P20_0 == ch2_pin) ch2 = &IfxGpt120_T6EUDA_P20_0_IN; else zf_assert(FALSE); }break; } #pragma warning 507 - IfxGpt12_initTxInPinWithPadLevel(count, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); - IfxGpt12_initTxEudInPinWithPadLevel(dir, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); + IfxGpt12_initTxInPinWithPadLevel(ch1, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); + IfxGpt12_initTxEudInPinWithPadLevel(ch2, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); #pragma warning default } diff --git a/Example/E13_dual_core_demo/libraries/doc/version.txt b/Example/E13_dual_core_demo/libraries/doc/version.txt index 4c656de..8858f7b 100644 --- a/Example/E13_dual_core_demo/libraries/doc/version.txt +++ b/Example/E13_dual_core_demo/libraries/doc/version.txt @@ -1,6 +1,8 @@ +V3.0.1 + 修复总钻风单独配置曝光度过慢的问题 V3.0.0 新命名风格开源库实现 - 增强了代码的可移植性 如果都使用V3库,那么用户将几乎无需更改任何代码即可在不同的单片机上实现相同的功能 + 增强了代码的可移植性 增加了部分公共层功能 V1.3.0 在icm20602的初始化中添加系数说明 diff --git a/Example/E13_dual_core_demo/libraries/zf_driver/zf_driver_encoder.c b/Example/E13_dual_core_demo/libraries/zf_driver/zf_driver_encoder.c index 1f99660..22160da 100644 --- a/Example/E13_dual_core_demo/libraries/zf_driver/zf_driver_encoder.c +++ b/Example/E13_dual_core_demo/libraries/zf_driver/zf_driver_encoder.c @@ -43,71 +43,71 @@ // 参数说明 count_pin 设置计数引脚 // 参数说明 dir_pin 设置计数方向引脚 // 返回参数 void -// 使用示例 encoder_mapping_set(gptn, count_pin, dir_pin); +// 使用示例 encoder_mapping_set(gptn, ch1_pin, ch2_pin); // 备注信息 //------------------------------------------------------------------------------------------------------------------- -static void encoder_mapping_set (encoder_index_enum encoder_n, encoder_channel1_enum count_pin, encoder_channel2_enum dir_pin) +static void encoder_mapping_set (encoder_index_enum encoder_n, encoder_channel1_enum ch1_pin, encoder_channel2_enum ch2_pin) { - IfxGpt12_TxIn_In *count; - IfxGpt12_TxEud_In *dir; + IfxGpt12_TxIn_In *ch1; + IfxGpt12_TxEud_In *ch2; switch(encoder_n) { case TIM2_ENCOEDER: { - if (TIM2_ENCOEDER_CH1_P00_7 == count_pin) count = &IfxGpt120_T2INA_P00_7_IN; - else if (TIM2_ENCOEDER_CH1_P33_7 == count_pin) count = &IfxGpt120_T2INB_P33_7_IN; + if (TIM2_ENCOEDER_CH1_P00_7 == ch1_pin) ch1 = &IfxGpt120_T2INA_P00_7_IN; + else if (TIM2_ENCOEDER_CH1_P33_7 == ch1_pin) ch1 = &IfxGpt120_T2INB_P33_7_IN; else zf_assert(FALSE); - if (TIM2_ENCOEDER_CH2_P00_8 == dir_pin) dir = &IfxGpt120_T2EUDA_P00_8_IN; - else if (TIM2_ENCOEDER_CH2_P33_6 == dir_pin) dir = &IfxGpt120_T2EUDB_P33_6_IN; + if (TIM2_ENCOEDER_CH2_P00_8 == ch2_pin) ch2 = &IfxGpt120_T2EUDA_P00_8_IN; + else if (TIM2_ENCOEDER_CH2_P33_6 == ch2_pin) ch2 = &IfxGpt120_T2EUDB_P33_6_IN; else zf_assert(FALSE); }break; case TIM3_ENCOEDER: { - if (TIM3_ENCOEDER_CH1_P02_6 == count_pin) count = &IfxGpt120_T3INA_P02_6_IN; + if (TIM3_ENCOEDER_CH1_P02_6 == ch1_pin) ch1 = &IfxGpt120_T3INA_P02_6_IN; else zf_assert(FALSE); - if (TIM3_ENCOEDER_CH2_P02_7 == dir_pin) dir = &IfxGpt120_T3EUDA_P02_7_IN; + if (TIM3_ENCOEDER_CH2_P02_7 == ch2_pin) ch2 = &IfxGpt120_T3EUDA_P02_7_IN; else zf_assert(FALSE); }break; case TIM4_ENCOEDER: { - if (TIM4_ENCOEDER_CH1_P02_8 == count_pin) count = &IfxGpt120_T4INA_P02_8_IN; + if (TIM4_ENCOEDER_CH1_P02_8 == ch1_pin) ch1 = &IfxGpt120_T4INA_P02_8_IN; else zf_assert(FALSE); - if (TIM4_ENCOEDER_CH2_P00_9 == dir_pin) dir = &IfxGpt120_T4EUDA_P00_9_IN; - else if (TIM4_ENCOEDER_CH2_P33_5 == dir_pin) dir = &IfxGpt120_T4EUDB_P33_5_IN; + if (TIM4_ENCOEDER_CH2_P00_9 == ch2_pin) ch2 = &IfxGpt120_T4EUDA_P00_9_IN; + else if (TIM4_ENCOEDER_CH2_P33_5 == ch2_pin) ch2 = &IfxGpt120_T4EUDB_P33_5_IN; else zf_assert(FALSE); }break; case TIM5_ENCOEDER: { - if (TIM5_ENCOEDER_CH1_P21_7 == count_pin) count = &IfxGpt120_T5INA_P21_7_IN; - else if (TIM5_ENCOEDER_CH1_P10_3 == count_pin) count = &IfxGpt120_T5INB_P10_3_IN; + if (TIM5_ENCOEDER_CH1_P21_7 == ch1_pin) ch1 = &IfxGpt120_T5INA_P21_7_IN; + else if (TIM5_ENCOEDER_CH1_P10_3 == ch1_pin) ch1 = &IfxGpt120_T5INB_P10_3_IN; else zf_assert(FALSE); - if (TIM5_ENCOEDER_CH2_P21_6 == dir_pin) dir = &IfxGpt120_T5EUDA_P21_6_IN; - else if (TIM5_ENCOEDER_CH2_P10_1 == dir_pin) dir = &IfxGpt120_T5EUDB_P10_1_IN; + if (TIM5_ENCOEDER_CH2_P21_6 == ch2_pin) ch2 = &IfxGpt120_T5EUDA_P21_6_IN; + else if (TIM5_ENCOEDER_CH2_P10_1 == ch2_pin) ch2 = &IfxGpt120_T5EUDB_P10_1_IN; else zf_assert(FALSE); }break; case TIM6_ENCOEDER: { - if (TIM6_ENCOEDER_CH1_P20_3 == count_pin) count = &IfxGpt120_T6INA_P20_3_IN; - else if (TIM6_ENCOEDER_CH1_P10_2 == count_pin) count = &IfxGpt120_T6INB_P10_2_IN; + if (TIM6_ENCOEDER_CH1_P20_3 == ch1_pin) ch1 = &IfxGpt120_T6INA_P20_3_IN; + else if (TIM6_ENCOEDER_CH1_P10_2 == ch1_pin) ch1 = &IfxGpt120_T6INB_P10_2_IN; else zf_assert(FALSE); - if (TIM6_ENCOEDER_CH2_P20_0 == dir_pin) dir = &IfxGpt120_T6EUDA_P20_0_IN; + if (TIM6_ENCOEDER_CH2_P20_0 == ch2_pin) ch2 = &IfxGpt120_T6EUDA_P20_0_IN; else zf_assert(FALSE); }break; } #pragma warning 507 - IfxGpt12_initTxInPinWithPadLevel(count, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); - IfxGpt12_initTxEudInPinWithPadLevel(dir, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); + IfxGpt12_initTxInPinWithPadLevel(ch1, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); + IfxGpt12_initTxEudInPinWithPadLevel(ch2, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); #pragma warning default } diff --git a/Example/E14_specifies_variable_or_code_location_demo/libraries/doc/version.txt b/Example/E14_specifies_variable_or_code_location_demo/libraries/doc/version.txt index 4c656de..8858f7b 100644 --- a/Example/E14_specifies_variable_or_code_location_demo/libraries/doc/version.txt +++ b/Example/E14_specifies_variable_or_code_location_demo/libraries/doc/version.txt @@ -1,6 +1,8 @@ +V3.0.1 + 修复总钻风单独配置曝光度过慢的问题 V3.0.0 新命名风格开源库实现 - 增强了代码的可移植性 如果都使用V3库,那么用户将几乎无需更改任何代码即可在不同的单片机上实现相同的功能 + 增强了代码的可移植性 增加了部分公共层功能 V1.3.0 在icm20602的初始化中添加系数说明 diff --git a/Example/E14_specifies_variable_or_code_location_demo/libraries/zf_driver/zf_driver_encoder.c b/Example/E14_specifies_variable_or_code_location_demo/libraries/zf_driver/zf_driver_encoder.c index 1f99660..22160da 100644 --- a/Example/E14_specifies_variable_or_code_location_demo/libraries/zf_driver/zf_driver_encoder.c +++ b/Example/E14_specifies_variable_or_code_location_demo/libraries/zf_driver/zf_driver_encoder.c @@ -43,71 +43,71 @@ // 参数说明 count_pin 设置计数引脚 // 参数说明 dir_pin 设置计数方向引脚 // 返回参数 void -// 使用示例 encoder_mapping_set(gptn, count_pin, dir_pin); +// 使用示例 encoder_mapping_set(gptn, ch1_pin, ch2_pin); // 备注信息 //------------------------------------------------------------------------------------------------------------------- -static void encoder_mapping_set (encoder_index_enum encoder_n, encoder_channel1_enum count_pin, encoder_channel2_enum dir_pin) +static void encoder_mapping_set (encoder_index_enum encoder_n, encoder_channel1_enum ch1_pin, encoder_channel2_enum ch2_pin) { - IfxGpt12_TxIn_In *count; - IfxGpt12_TxEud_In *dir; + IfxGpt12_TxIn_In *ch1; + IfxGpt12_TxEud_In *ch2; switch(encoder_n) { case TIM2_ENCOEDER: { - if (TIM2_ENCOEDER_CH1_P00_7 == count_pin) count = &IfxGpt120_T2INA_P00_7_IN; - else if (TIM2_ENCOEDER_CH1_P33_7 == count_pin) count = &IfxGpt120_T2INB_P33_7_IN; + if (TIM2_ENCOEDER_CH1_P00_7 == ch1_pin) ch1 = &IfxGpt120_T2INA_P00_7_IN; + else if (TIM2_ENCOEDER_CH1_P33_7 == ch1_pin) ch1 = &IfxGpt120_T2INB_P33_7_IN; else zf_assert(FALSE); - if (TIM2_ENCOEDER_CH2_P00_8 == dir_pin) dir = &IfxGpt120_T2EUDA_P00_8_IN; - else if (TIM2_ENCOEDER_CH2_P33_6 == dir_pin) dir = &IfxGpt120_T2EUDB_P33_6_IN; + if (TIM2_ENCOEDER_CH2_P00_8 == ch2_pin) ch2 = &IfxGpt120_T2EUDA_P00_8_IN; + else if (TIM2_ENCOEDER_CH2_P33_6 == ch2_pin) ch2 = &IfxGpt120_T2EUDB_P33_6_IN; else zf_assert(FALSE); }break; case TIM3_ENCOEDER: { - if (TIM3_ENCOEDER_CH1_P02_6 == count_pin) count = &IfxGpt120_T3INA_P02_6_IN; + if (TIM3_ENCOEDER_CH1_P02_6 == ch1_pin) ch1 = &IfxGpt120_T3INA_P02_6_IN; else zf_assert(FALSE); - if (TIM3_ENCOEDER_CH2_P02_7 == dir_pin) dir = &IfxGpt120_T3EUDA_P02_7_IN; + if (TIM3_ENCOEDER_CH2_P02_7 == ch2_pin) ch2 = &IfxGpt120_T3EUDA_P02_7_IN; else zf_assert(FALSE); }break; case TIM4_ENCOEDER: { - if (TIM4_ENCOEDER_CH1_P02_8 == count_pin) count = &IfxGpt120_T4INA_P02_8_IN; + if (TIM4_ENCOEDER_CH1_P02_8 == ch1_pin) ch1 = &IfxGpt120_T4INA_P02_8_IN; else zf_assert(FALSE); - if (TIM4_ENCOEDER_CH2_P00_9 == dir_pin) dir = &IfxGpt120_T4EUDA_P00_9_IN; - else if (TIM4_ENCOEDER_CH2_P33_5 == dir_pin) dir = &IfxGpt120_T4EUDB_P33_5_IN; + if (TIM4_ENCOEDER_CH2_P00_9 == ch2_pin) ch2 = &IfxGpt120_T4EUDA_P00_9_IN; + else if (TIM4_ENCOEDER_CH2_P33_5 == ch2_pin) ch2 = &IfxGpt120_T4EUDB_P33_5_IN; else zf_assert(FALSE); }break; case TIM5_ENCOEDER: { - if (TIM5_ENCOEDER_CH1_P21_7 == count_pin) count = &IfxGpt120_T5INA_P21_7_IN; - else if (TIM5_ENCOEDER_CH1_P10_3 == count_pin) count = &IfxGpt120_T5INB_P10_3_IN; + if (TIM5_ENCOEDER_CH1_P21_7 == ch1_pin) ch1 = &IfxGpt120_T5INA_P21_7_IN; + else if (TIM5_ENCOEDER_CH1_P10_3 == ch1_pin) ch1 = &IfxGpt120_T5INB_P10_3_IN; else zf_assert(FALSE); - if (TIM5_ENCOEDER_CH2_P21_6 == dir_pin) dir = &IfxGpt120_T5EUDA_P21_6_IN; - else if (TIM5_ENCOEDER_CH2_P10_1 == dir_pin) dir = &IfxGpt120_T5EUDB_P10_1_IN; + if (TIM5_ENCOEDER_CH2_P21_6 == ch2_pin) ch2 = &IfxGpt120_T5EUDA_P21_6_IN; + else if (TIM5_ENCOEDER_CH2_P10_1 == ch2_pin) ch2 = &IfxGpt120_T5EUDB_P10_1_IN; else zf_assert(FALSE); }break; case TIM6_ENCOEDER: { - if (TIM6_ENCOEDER_CH1_P20_3 == count_pin) count = &IfxGpt120_T6INA_P20_3_IN; - else if (TIM6_ENCOEDER_CH1_P10_2 == count_pin) count = &IfxGpt120_T6INB_P10_2_IN; + if (TIM6_ENCOEDER_CH1_P20_3 == ch1_pin) ch1 = &IfxGpt120_T6INA_P20_3_IN; + else if (TIM6_ENCOEDER_CH1_P10_2 == ch1_pin) ch1 = &IfxGpt120_T6INB_P10_2_IN; else zf_assert(FALSE); - if (TIM6_ENCOEDER_CH2_P20_0 == dir_pin) dir = &IfxGpt120_T6EUDA_P20_0_IN; + if (TIM6_ENCOEDER_CH2_P20_0 == ch2_pin) ch2 = &IfxGpt120_T6EUDA_P20_0_IN; else zf_assert(FALSE); }break; } #pragma warning 507 - IfxGpt12_initTxInPinWithPadLevel(count, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); - IfxGpt12_initTxEudInPinWithPadLevel(dir, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); + IfxGpt12_initTxInPinWithPadLevel(ch1, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); + IfxGpt12_initTxEudInPinWithPadLevel(ch2, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); #pragma warning default } diff --git a/Seekfree_TC264_Opensource_Library/libraries/doc/version.txt b/Seekfree_TC264_Opensource_Library/libraries/doc/version.txt index 4c656de..8858f7b 100644 --- a/Seekfree_TC264_Opensource_Library/libraries/doc/version.txt +++ b/Seekfree_TC264_Opensource_Library/libraries/doc/version.txt @@ -1,6 +1,8 @@ +V3.0.1 + 修复总钻风单独配置曝光度过慢的问题 V3.0.0 新命名风格开源库实现 - 增强了代码的可移植性 如果都使用V3库,那么用户将几乎无需更改任何代码即可在不同的单片机上实现相同的功能 + 增强了代码的可移植性 增加了部分公共层功能 V1.3.0 在icm20602的初始化中添加系数说明 diff --git a/Seekfree_TC264_Opensource_Library/libraries/zf_driver/zf_driver_encoder.c b/Seekfree_TC264_Opensource_Library/libraries/zf_driver/zf_driver_encoder.c index 1f99660..22160da 100644 --- a/Seekfree_TC264_Opensource_Library/libraries/zf_driver/zf_driver_encoder.c +++ b/Seekfree_TC264_Opensource_Library/libraries/zf_driver/zf_driver_encoder.c @@ -43,71 +43,71 @@ // 参数说明 count_pin 设置计数引脚 // 参数说明 dir_pin 设置计数方向引脚 // 返回参数 void -// 使用示例 encoder_mapping_set(gptn, count_pin, dir_pin); +// 使用示例 encoder_mapping_set(gptn, ch1_pin, ch2_pin); // 备注信息 //------------------------------------------------------------------------------------------------------------------- -static void encoder_mapping_set (encoder_index_enum encoder_n, encoder_channel1_enum count_pin, encoder_channel2_enum dir_pin) +static void encoder_mapping_set (encoder_index_enum encoder_n, encoder_channel1_enum ch1_pin, encoder_channel2_enum ch2_pin) { - IfxGpt12_TxIn_In *count; - IfxGpt12_TxEud_In *dir; + IfxGpt12_TxIn_In *ch1; + IfxGpt12_TxEud_In *ch2; switch(encoder_n) { case TIM2_ENCOEDER: { - if (TIM2_ENCOEDER_CH1_P00_7 == count_pin) count = &IfxGpt120_T2INA_P00_7_IN; - else if (TIM2_ENCOEDER_CH1_P33_7 == count_pin) count = &IfxGpt120_T2INB_P33_7_IN; + if (TIM2_ENCOEDER_CH1_P00_7 == ch1_pin) ch1 = &IfxGpt120_T2INA_P00_7_IN; + else if (TIM2_ENCOEDER_CH1_P33_7 == ch1_pin) ch1 = &IfxGpt120_T2INB_P33_7_IN; else zf_assert(FALSE); - if (TIM2_ENCOEDER_CH2_P00_8 == dir_pin) dir = &IfxGpt120_T2EUDA_P00_8_IN; - else if (TIM2_ENCOEDER_CH2_P33_6 == dir_pin) dir = &IfxGpt120_T2EUDB_P33_6_IN; + if (TIM2_ENCOEDER_CH2_P00_8 == ch2_pin) ch2 = &IfxGpt120_T2EUDA_P00_8_IN; + else if (TIM2_ENCOEDER_CH2_P33_6 == ch2_pin) ch2 = &IfxGpt120_T2EUDB_P33_6_IN; else zf_assert(FALSE); }break; case TIM3_ENCOEDER: { - if (TIM3_ENCOEDER_CH1_P02_6 == count_pin) count = &IfxGpt120_T3INA_P02_6_IN; + if (TIM3_ENCOEDER_CH1_P02_6 == ch1_pin) ch1 = &IfxGpt120_T3INA_P02_6_IN; else zf_assert(FALSE); - if (TIM3_ENCOEDER_CH2_P02_7 == dir_pin) dir = &IfxGpt120_T3EUDA_P02_7_IN; + if (TIM3_ENCOEDER_CH2_P02_7 == ch2_pin) ch2 = &IfxGpt120_T3EUDA_P02_7_IN; else zf_assert(FALSE); }break; case TIM4_ENCOEDER: { - if (TIM4_ENCOEDER_CH1_P02_8 == count_pin) count = &IfxGpt120_T4INA_P02_8_IN; + if (TIM4_ENCOEDER_CH1_P02_8 == ch1_pin) ch1 = &IfxGpt120_T4INA_P02_8_IN; else zf_assert(FALSE); - if (TIM4_ENCOEDER_CH2_P00_9 == dir_pin) dir = &IfxGpt120_T4EUDA_P00_9_IN; - else if (TIM4_ENCOEDER_CH2_P33_5 == dir_pin) dir = &IfxGpt120_T4EUDB_P33_5_IN; + if (TIM4_ENCOEDER_CH2_P00_9 == ch2_pin) ch2 = &IfxGpt120_T4EUDA_P00_9_IN; + else if (TIM4_ENCOEDER_CH2_P33_5 == ch2_pin) ch2 = &IfxGpt120_T4EUDB_P33_5_IN; else zf_assert(FALSE); }break; case TIM5_ENCOEDER: { - if (TIM5_ENCOEDER_CH1_P21_7 == count_pin) count = &IfxGpt120_T5INA_P21_7_IN; - else if (TIM5_ENCOEDER_CH1_P10_3 == count_pin) count = &IfxGpt120_T5INB_P10_3_IN; + if (TIM5_ENCOEDER_CH1_P21_7 == ch1_pin) ch1 = &IfxGpt120_T5INA_P21_7_IN; + else if (TIM5_ENCOEDER_CH1_P10_3 == ch1_pin) ch1 = &IfxGpt120_T5INB_P10_3_IN; else zf_assert(FALSE); - if (TIM5_ENCOEDER_CH2_P21_6 == dir_pin) dir = &IfxGpt120_T5EUDA_P21_6_IN; - else if (TIM5_ENCOEDER_CH2_P10_1 == dir_pin) dir = &IfxGpt120_T5EUDB_P10_1_IN; + if (TIM5_ENCOEDER_CH2_P21_6 == ch2_pin) ch2 = &IfxGpt120_T5EUDA_P21_6_IN; + else if (TIM5_ENCOEDER_CH2_P10_1 == ch2_pin) ch2 = &IfxGpt120_T5EUDB_P10_1_IN; else zf_assert(FALSE); }break; case TIM6_ENCOEDER: { - if (TIM6_ENCOEDER_CH1_P20_3 == count_pin) count = &IfxGpt120_T6INA_P20_3_IN; - else if (TIM6_ENCOEDER_CH1_P10_2 == count_pin) count = &IfxGpt120_T6INB_P10_2_IN; + if (TIM6_ENCOEDER_CH1_P20_3 == ch1_pin) ch1 = &IfxGpt120_T6INA_P20_3_IN; + else if (TIM6_ENCOEDER_CH1_P10_2 == ch1_pin) ch1 = &IfxGpt120_T6INB_P10_2_IN; else zf_assert(FALSE); - if (TIM6_ENCOEDER_CH2_P20_0 == dir_pin) dir = &IfxGpt120_T6EUDA_P20_0_IN; + if (TIM6_ENCOEDER_CH2_P20_0 == ch2_pin) ch2 = &IfxGpt120_T6EUDA_P20_0_IN; else zf_assert(FALSE); }break; } #pragma warning 507 - IfxGpt12_initTxInPinWithPadLevel(count, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); - IfxGpt12_initTxEudInPinWithPadLevel(dir, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); + IfxGpt12_initTxInPinWithPadLevel(ch1, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); + IfxGpt12_initTxEudInPinWithPadLevel(ch2, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1); #pragma warning default } diff --git a/Seekfree_TC264_Opensource_Library/user/cpu0_main.c b/Seekfree_TC264_Opensource_Library/user/cpu0_main.c index 24956f1..f1833aa 100644 --- a/Seekfree_TC264_Opensource_Library/user/cpu0_main.c +++ b/Seekfree_TC264_Opensource_Library/user/cpu0_main.c @@ -58,8 +58,6 @@ int core0_main(void) - - // 此处编写用户代码 例如外设初始化代码等 cpu_wait_event_ready(); // 等待所有核心初始化完毕 while (TRUE)