diff --git a/Example/1-ADC_Demo/Libraries/doc/version.txt b/Example/1-ADC_Demo/Libraries/doc/version.txt index bb8abf2..1fdbd92 100644 --- a/Example/1-ADC_Demo/Libraries/doc/version.txt +++ b/Example/1-ADC_Demo/Libraries/doc/version.txt @@ -59,4 +59,9 @@ V1.0.7 修复使用systick_getval计时,当计时时间超过4秒左右会出现时间测量错误的问题。 对部分代码加入#pragma warning,避免提高优化等级时出现警告 修改1.8寸TFT屏幕初始化中关于屏幕方向选择部分的代码 - \ No newline at end of file + +V1.0.8 + 修复CCU61 通道1中断设置错误的问题 + 修复CCU6在线调试的时候定时器不能自动停止,导致在线调试时持续进中断的问题 + 对CCU6增加pit_close与pit_start函数用于控制定时器的开始与停止 + 对CCU6增加pit_disable_interrupt与pit_enable_interrupt函数用于控制中断开关 \ No newline at end of file diff --git a/Example/1-ADC_Demo/Libraries/seekfree_libraries/common/common.c b/Example/1-ADC_Demo/Libraries/seekfree_libraries/common/common.c index 6ecd4c9..4f8606b 100644 --- a/Example/1-ADC_Demo/Libraries/seekfree_libraries/common/common.c +++ b/Example/1-ADC_Demo/Libraries/seekfree_libraries/common/common.c @@ -24,7 +24,6 @@ uint8 camera_type; //摄像头型号 1:总钻风 2:凌瞳(暂未支持)3:小钻风 -uint32 te; App_Cpu0 g_AppCpu0; //频率信息变量 void get_clk(void) @@ -41,5 +40,4 @@ void get_clk(void) g_AppCpu0.info.sysFreq = IfxScuCcu_getSpbFrequency(); g_AppCpu0.info.stmFreq = IfxStm_getFrequency(&MODULE_STM0); - te = IfxScuCcu_getSriFrequency(); } diff --git a/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c b/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c index e81100f..169c8df 100644 --- a/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c +++ b/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c @@ -40,7 +40,6 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) volatile Ifx_CCU6 *module; uint64 timer_input_clk; IfxCcu6_Timer g_Ccu6Timer; - IfxCcu6_TimerId timer_id; IfxCcu6_Timer_Config timerConfig; uint32 timer_period; @@ -90,15 +89,15 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) } else { - timerConfig.interrupt1.typeOfService = CCU6_1_CH1_INT_SERVICE; - timerConfig.interrupt1.priority = CCU6_1_CH1_ISR_PRIORITY; + timerConfig.interrupt2.typeOfService = CCU6_1_CH1_INT_SERVICE; + timerConfig.interrupt2.priority = CCU6_1_CH1_ISR_PRIORITY; } }break; } if(PIT_CH0 == pit_ch) { - timer_id = IfxCcu6_TimerId_t12; + timerConfig.timer = IfxCcu6_TimerId_t12; timerConfig.interrupt1.source = IfxCcu6_InterruptSource_t12PeriodMatch; timerConfig.interrupt1.serviceRequest = IfxCcu6_ServiceRequest_1; timerConfig.base.t12Period = timer_period; @@ -107,17 +106,13 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) } else { - timer_id = IfxCcu6_TimerId_t13; + timerConfig.timer = IfxCcu6_TimerId_t13; timerConfig.interrupt2.source = IfxCcu6_InterruptSource_t13PeriodMatch; timerConfig.interrupt2.serviceRequest = IfxCcu6_ServiceRequest_2; timerConfig.base.t13Period = timer_period; timerConfig.base.t13Frequency = (float)timer_input_clk; timerConfig.clock.t13countingInputMode = IfxCcu6_CountingInputMode_internal; } - - - timerConfig.timer = timer_id; - timerConfig.timer12.counterValue = 0; timerConfig.timer13.counterValue = 0; timerConfig.trigger.t13InSyncWithT12 = FALSE; @@ -126,5 +121,78 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) restoreInterrupts(interrupt_state); + IfxCcu6_setSuspendMode(module, IfxCcu6_SuspendMode_hard); IfxCcu6_Timer_start(&g_Ccu6Timer); } + +//------------------------------------------------------------------------------------------------------------------- +// @brief pit关闭 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_close(CCU6_0, PIT_CH0); //关闭CCU60 通道0的计时器 +//------------------------------------------------------------------------------------------------------------------- +void pit_close(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + IfxCcu6_Timer g_Ccu6Timer; + + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + + g_Ccu6Timer.ccu6 = module; + g_Ccu6Timer.timer = (IfxCcu6_TimerId)(pit_ch); + + IfxCcu6_Timer_stop(&g_Ccu6Timer); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief pit开始 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_start(CCU6_0, PIT_CH0); //打开CCU60 通道0的计时器 +//------------------------------------------------------------------------------------------------------------------- +void pit_start(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + IfxCcu6_Timer g_Ccu6Timer; + + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + + g_Ccu6Timer.ccu6 = module; + g_Ccu6Timer.timer = (IfxCcu6_TimerId)(pit_ch); + + IfxCcu6_Timer_start(&g_Ccu6Timer); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief 禁止pit中断 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_disable_interrupt(CCU6_0, PIT_CH0); //禁止CCU60 通道0的中断 +//------------------------------------------------------------------------------------------------------------------- +void pit_disable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + IfxCcu6_disableInterrupt(module, pit_ch * 2 + 7); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief 使能pit中断 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_enable_interrupt(CCU6_0, PIT_CH0); //开启CCU60 通道0的中断 +//------------------------------------------------------------------------------------------------------------------- +void pit_enable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + IfxCcu6_enableInterrupt(module, pit_ch * 2 + 7); +} diff --git a/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h b/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h index 97994ea..22a3a79 100644 --- a/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h +++ b/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h @@ -46,7 +46,10 @@ typedef enum //枚 void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time); - +void pit_close(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_start(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_disable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_enable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); //------------------------------------以下代码用于PIT中断------------------------------------ diff --git a/Example/1-ADC_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c b/Example/1-ADC_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c index 96692b7..1640b41 100644 --- a/Example/1-ADC_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c +++ b/Example/1-ADC_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c @@ -196,7 +196,7 @@ void rda5807_init(float freq) //复位 rad5807m_simiic_write(FM_ADDRESS,dat,2); - systick_delay_ms(STM0, 600); + systick_delay_ms(STM0, 50); while(rda5807_read_reg[8] != 0x58) { diff --git a/Example/1-ADC_Demo/鎺ㄨ崘IO鍒嗛厤.txt b/Example/1-ADC_Demo/鎺ㄨ崘IO鍒嗛厤.txt index df0fa4f..199fe87 100644 --- a/Example/1-ADC_Demo/鎺ㄨ崘IO鍒嗛厤.txt +++ b/Example/1-ADC_Demo/鎺ㄨ崘IO鍒嗛厤.txt @@ -3,6 +3,7 @@ 数据口:00_0 00_1 00_2 00_3 00_4 00_5 00_6 00_7 配置串口:摄像头RX:02_2 摄像头TX:02_3 VSY:02_0 + HREF:程序不需要,所以不接 PCLK:02_1 四路运放 A0 A1 A2 A3 等 diff --git a/Example/10-Interrupt_Priority_Set_Demo/Libraries/doc/version.txt b/Example/10-Interrupt_Priority_Set_Demo/Libraries/doc/version.txt index bb8abf2..1fdbd92 100644 --- a/Example/10-Interrupt_Priority_Set_Demo/Libraries/doc/version.txt +++ b/Example/10-Interrupt_Priority_Set_Demo/Libraries/doc/version.txt @@ -59,4 +59,9 @@ V1.0.7 修复使用systick_getval计时,当计时时间超过4秒左右会出现时间测量错误的问题。 对部分代码加入#pragma warning,避免提高优化等级时出现警告 修改1.8寸TFT屏幕初始化中关于屏幕方向选择部分的代码 - \ No newline at end of file + +V1.0.8 + 修复CCU61 通道1中断设置错误的问题 + 修复CCU6在线调试的时候定时器不能自动停止,导致在线调试时持续进中断的问题 + 对CCU6增加pit_close与pit_start函数用于控制定时器的开始与停止 + 对CCU6增加pit_disable_interrupt与pit_enable_interrupt函数用于控制中断开关 \ No newline at end of file diff --git a/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/common/common.c b/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/common/common.c index 6ecd4c9..4f8606b 100644 --- a/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/common/common.c +++ b/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/common/common.c @@ -24,7 +24,6 @@ uint8 camera_type; //摄像头型号 1:总钻风 2:凌瞳(暂未支持)3:小钻风 -uint32 te; App_Cpu0 g_AppCpu0; //频率信息变量 void get_clk(void) @@ -41,5 +40,4 @@ void get_clk(void) g_AppCpu0.info.sysFreq = IfxScuCcu_getSpbFrequency(); g_AppCpu0.info.stmFreq = IfxStm_getFrequency(&MODULE_STM0); - te = IfxScuCcu_getSriFrequency(); } diff --git a/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c b/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c index e81100f..169c8df 100644 --- a/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c +++ b/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c @@ -40,7 +40,6 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) volatile Ifx_CCU6 *module; uint64 timer_input_clk; IfxCcu6_Timer g_Ccu6Timer; - IfxCcu6_TimerId timer_id; IfxCcu6_Timer_Config timerConfig; uint32 timer_period; @@ -90,15 +89,15 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) } else { - timerConfig.interrupt1.typeOfService = CCU6_1_CH1_INT_SERVICE; - timerConfig.interrupt1.priority = CCU6_1_CH1_ISR_PRIORITY; + timerConfig.interrupt2.typeOfService = CCU6_1_CH1_INT_SERVICE; + timerConfig.interrupt2.priority = CCU6_1_CH1_ISR_PRIORITY; } }break; } if(PIT_CH0 == pit_ch) { - timer_id = IfxCcu6_TimerId_t12; + timerConfig.timer = IfxCcu6_TimerId_t12; timerConfig.interrupt1.source = IfxCcu6_InterruptSource_t12PeriodMatch; timerConfig.interrupt1.serviceRequest = IfxCcu6_ServiceRequest_1; timerConfig.base.t12Period = timer_period; @@ -107,17 +106,13 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) } else { - timer_id = IfxCcu6_TimerId_t13; + timerConfig.timer = IfxCcu6_TimerId_t13; timerConfig.interrupt2.source = IfxCcu6_InterruptSource_t13PeriodMatch; timerConfig.interrupt2.serviceRequest = IfxCcu6_ServiceRequest_2; timerConfig.base.t13Period = timer_period; timerConfig.base.t13Frequency = (float)timer_input_clk; timerConfig.clock.t13countingInputMode = IfxCcu6_CountingInputMode_internal; } - - - timerConfig.timer = timer_id; - timerConfig.timer12.counterValue = 0; timerConfig.timer13.counterValue = 0; timerConfig.trigger.t13InSyncWithT12 = FALSE; @@ -126,5 +121,78 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) restoreInterrupts(interrupt_state); + IfxCcu6_setSuspendMode(module, IfxCcu6_SuspendMode_hard); IfxCcu6_Timer_start(&g_Ccu6Timer); } + +//------------------------------------------------------------------------------------------------------------------- +// @brief pit关闭 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_close(CCU6_0, PIT_CH0); //关闭CCU60 通道0的计时器 +//------------------------------------------------------------------------------------------------------------------- +void pit_close(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + IfxCcu6_Timer g_Ccu6Timer; + + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + + g_Ccu6Timer.ccu6 = module; + g_Ccu6Timer.timer = (IfxCcu6_TimerId)(pit_ch); + + IfxCcu6_Timer_stop(&g_Ccu6Timer); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief pit开始 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_start(CCU6_0, PIT_CH0); //打开CCU60 通道0的计时器 +//------------------------------------------------------------------------------------------------------------------- +void pit_start(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + IfxCcu6_Timer g_Ccu6Timer; + + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + + g_Ccu6Timer.ccu6 = module; + g_Ccu6Timer.timer = (IfxCcu6_TimerId)(pit_ch); + + IfxCcu6_Timer_start(&g_Ccu6Timer); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief 禁止pit中断 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_disable_interrupt(CCU6_0, PIT_CH0); //禁止CCU60 通道0的中断 +//------------------------------------------------------------------------------------------------------------------- +void pit_disable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + IfxCcu6_disableInterrupt(module, pit_ch * 2 + 7); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief 使能pit中断 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_enable_interrupt(CCU6_0, PIT_CH0); //开启CCU60 通道0的中断 +//------------------------------------------------------------------------------------------------------------------- +void pit_enable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + IfxCcu6_enableInterrupt(module, pit_ch * 2 + 7); +} diff --git a/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h b/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h index 97994ea..22a3a79 100644 --- a/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h +++ b/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h @@ -46,7 +46,10 @@ typedef enum //枚 void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time); - +void pit_close(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_start(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_disable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_enable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); //------------------------------------以下代码用于PIT中断------------------------------------ diff --git a/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c b/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c index 96692b7..1640b41 100644 --- a/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c +++ b/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c @@ -196,7 +196,7 @@ void rda5807_init(float freq) //复位 rad5807m_simiic_write(FM_ADDRESS,dat,2); - systick_delay_ms(STM0, 600); + systick_delay_ms(STM0, 50); while(rda5807_read_reg[8] != 0x58) { diff --git a/Example/10-Interrupt_Priority_Set_Demo/鎺ㄨ崘IO鍒嗛厤.txt b/Example/10-Interrupt_Priority_Set_Demo/鎺ㄨ崘IO鍒嗛厤.txt index df0fa4f..199fe87 100644 --- a/Example/10-Interrupt_Priority_Set_Demo/鎺ㄨ崘IO鍒嗛厤.txt +++ b/Example/10-Interrupt_Priority_Set_Demo/鎺ㄨ崘IO鍒嗛厤.txt @@ -3,6 +3,7 @@ 数据口:00_0 00_1 00_2 00_3 00_4 00_5 00_6 00_7 配置串口:摄像头RX:02_2 摄像头TX:02_3 VSY:02_0 + HREF:程序不需要,所以不接 PCLK:02_1 四路运放 A0 A1 A2 A3 等 diff --git a/Example/11-Systick_Demo/Libraries/doc/version.txt b/Example/11-Systick_Demo/Libraries/doc/version.txt index bb8abf2..1fdbd92 100644 --- a/Example/11-Systick_Demo/Libraries/doc/version.txt +++ b/Example/11-Systick_Demo/Libraries/doc/version.txt @@ -59,4 +59,9 @@ V1.0.7 修复使用systick_getval计时,当计时时间超过4秒左右会出现时间测量错误的问题。 对部分代码加入#pragma warning,避免提高优化等级时出现警告 修改1.8寸TFT屏幕初始化中关于屏幕方向选择部分的代码 - \ No newline at end of file + +V1.0.8 + 修复CCU61 通道1中断设置错误的问题 + 修复CCU6在线调试的时候定时器不能自动停止,导致在线调试时持续进中断的问题 + 对CCU6增加pit_close与pit_start函数用于控制定时器的开始与停止 + 对CCU6增加pit_disable_interrupt与pit_enable_interrupt函数用于控制中断开关 \ No newline at end of file diff --git a/Example/11-Systick_Demo/Libraries/seekfree_libraries/common/common.c b/Example/11-Systick_Demo/Libraries/seekfree_libraries/common/common.c index 6ecd4c9..4f8606b 100644 --- a/Example/11-Systick_Demo/Libraries/seekfree_libraries/common/common.c +++ b/Example/11-Systick_Demo/Libraries/seekfree_libraries/common/common.c @@ -24,7 +24,6 @@ uint8 camera_type; //摄像头型号 1:总钻风 2:凌瞳(暂未支持)3:小钻风 -uint32 te; App_Cpu0 g_AppCpu0; //频率信息变量 void get_clk(void) @@ -41,5 +40,4 @@ void get_clk(void) g_AppCpu0.info.sysFreq = IfxScuCcu_getSpbFrequency(); g_AppCpu0.info.stmFreq = IfxStm_getFrequency(&MODULE_STM0); - te = IfxScuCcu_getSriFrequency(); } diff --git a/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c b/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c index e81100f..169c8df 100644 --- a/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c +++ b/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c @@ -40,7 +40,6 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) volatile Ifx_CCU6 *module; uint64 timer_input_clk; IfxCcu6_Timer g_Ccu6Timer; - IfxCcu6_TimerId timer_id; IfxCcu6_Timer_Config timerConfig; uint32 timer_period; @@ -90,15 +89,15 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) } else { - timerConfig.interrupt1.typeOfService = CCU6_1_CH1_INT_SERVICE; - timerConfig.interrupt1.priority = CCU6_1_CH1_ISR_PRIORITY; + timerConfig.interrupt2.typeOfService = CCU6_1_CH1_INT_SERVICE; + timerConfig.interrupt2.priority = CCU6_1_CH1_ISR_PRIORITY; } }break; } if(PIT_CH0 == pit_ch) { - timer_id = IfxCcu6_TimerId_t12; + timerConfig.timer = IfxCcu6_TimerId_t12; timerConfig.interrupt1.source = IfxCcu6_InterruptSource_t12PeriodMatch; timerConfig.interrupt1.serviceRequest = IfxCcu6_ServiceRequest_1; timerConfig.base.t12Period = timer_period; @@ -107,17 +106,13 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) } else { - timer_id = IfxCcu6_TimerId_t13; + timerConfig.timer = IfxCcu6_TimerId_t13; timerConfig.interrupt2.source = IfxCcu6_InterruptSource_t13PeriodMatch; timerConfig.interrupt2.serviceRequest = IfxCcu6_ServiceRequest_2; timerConfig.base.t13Period = timer_period; timerConfig.base.t13Frequency = (float)timer_input_clk; timerConfig.clock.t13countingInputMode = IfxCcu6_CountingInputMode_internal; } - - - timerConfig.timer = timer_id; - timerConfig.timer12.counterValue = 0; timerConfig.timer13.counterValue = 0; timerConfig.trigger.t13InSyncWithT12 = FALSE; @@ -126,5 +121,78 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) restoreInterrupts(interrupt_state); + IfxCcu6_setSuspendMode(module, IfxCcu6_SuspendMode_hard); IfxCcu6_Timer_start(&g_Ccu6Timer); } + +//------------------------------------------------------------------------------------------------------------------- +// @brief pit关闭 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_close(CCU6_0, PIT_CH0); //关闭CCU60 通道0的计时器 +//------------------------------------------------------------------------------------------------------------------- +void pit_close(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + IfxCcu6_Timer g_Ccu6Timer; + + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + + g_Ccu6Timer.ccu6 = module; + g_Ccu6Timer.timer = (IfxCcu6_TimerId)(pit_ch); + + IfxCcu6_Timer_stop(&g_Ccu6Timer); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief pit开始 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_start(CCU6_0, PIT_CH0); //打开CCU60 通道0的计时器 +//------------------------------------------------------------------------------------------------------------------- +void pit_start(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + IfxCcu6_Timer g_Ccu6Timer; + + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + + g_Ccu6Timer.ccu6 = module; + g_Ccu6Timer.timer = (IfxCcu6_TimerId)(pit_ch); + + IfxCcu6_Timer_start(&g_Ccu6Timer); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief 禁止pit中断 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_disable_interrupt(CCU6_0, PIT_CH0); //禁止CCU60 通道0的中断 +//------------------------------------------------------------------------------------------------------------------- +void pit_disable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + IfxCcu6_disableInterrupt(module, pit_ch * 2 + 7); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief 使能pit中断 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_enable_interrupt(CCU6_0, PIT_CH0); //开启CCU60 通道0的中断 +//------------------------------------------------------------------------------------------------------------------- +void pit_enable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + IfxCcu6_enableInterrupt(module, pit_ch * 2 + 7); +} diff --git a/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h b/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h index 97994ea..22a3a79 100644 --- a/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h +++ b/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h @@ -46,7 +46,10 @@ typedef enum //枚 void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time); - +void pit_close(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_start(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_disable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_enable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); //------------------------------------以下代码用于PIT中断------------------------------------ diff --git a/Example/11-Systick_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c b/Example/11-Systick_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c index 96692b7..1640b41 100644 --- a/Example/11-Systick_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c +++ b/Example/11-Systick_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c @@ -196,7 +196,7 @@ void rda5807_init(float freq) //复位 rad5807m_simiic_write(FM_ADDRESS,dat,2); - systick_delay_ms(STM0, 600); + systick_delay_ms(STM0, 50); while(rda5807_read_reg[8] != 0x58) { diff --git a/Example/11-Systick_Demo/鎺ㄨ崘IO鍒嗛厤.txt b/Example/11-Systick_Demo/鎺ㄨ崘IO鍒嗛厤.txt index df0fa4f..199fe87 100644 --- a/Example/11-Systick_Demo/鎺ㄨ崘IO鍒嗛厤.txt +++ b/Example/11-Systick_Demo/鎺ㄨ崘IO鍒嗛厤.txt @@ -3,6 +3,7 @@ 数据口:00_0 00_1 00_2 00_3 00_4 00_5 00_6 00_7 配置串口:摄像头RX:02_2 摄像头TX:02_3 VSY:02_0 + HREF:程序不需要,所以不接 PCLK:02_1 四路运放 A0 A1 A2 A3 等 diff --git a/Example/12-Dual_Core_Demo/Libraries/doc/version.txt b/Example/12-Dual_Core_Demo/Libraries/doc/version.txt index bb8abf2..1fdbd92 100644 --- a/Example/12-Dual_Core_Demo/Libraries/doc/version.txt +++ b/Example/12-Dual_Core_Demo/Libraries/doc/version.txt @@ -59,4 +59,9 @@ V1.0.7 修复使用systick_getval计时,当计时时间超过4秒左右会出现时间测量错误的问题。 对部分代码加入#pragma warning,避免提高优化等级时出现警告 修改1.8寸TFT屏幕初始化中关于屏幕方向选择部分的代码 - \ No newline at end of file + +V1.0.8 + 修复CCU61 通道1中断设置错误的问题 + 修复CCU6在线调试的时候定时器不能自动停止,导致在线调试时持续进中断的问题 + 对CCU6增加pit_close与pit_start函数用于控制定时器的开始与停止 + 对CCU6增加pit_disable_interrupt与pit_enable_interrupt函数用于控制中断开关 \ No newline at end of file diff --git a/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/common/common.c b/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/common/common.c index 6ecd4c9..4f8606b 100644 --- a/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/common/common.c +++ b/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/common/common.c @@ -24,7 +24,6 @@ uint8 camera_type; //摄像头型号 1:总钻风 2:凌瞳(暂未支持)3:小钻风 -uint32 te; App_Cpu0 g_AppCpu0; //频率信息变量 void get_clk(void) @@ -41,5 +40,4 @@ void get_clk(void) g_AppCpu0.info.sysFreq = IfxScuCcu_getSpbFrequency(); g_AppCpu0.info.stmFreq = IfxStm_getFrequency(&MODULE_STM0); - te = IfxScuCcu_getSriFrequency(); } diff --git a/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c b/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c index e81100f..169c8df 100644 --- a/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c +++ b/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c @@ -40,7 +40,6 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) volatile Ifx_CCU6 *module; uint64 timer_input_clk; IfxCcu6_Timer g_Ccu6Timer; - IfxCcu6_TimerId timer_id; IfxCcu6_Timer_Config timerConfig; uint32 timer_period; @@ -90,15 +89,15 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) } else { - timerConfig.interrupt1.typeOfService = CCU6_1_CH1_INT_SERVICE; - timerConfig.interrupt1.priority = CCU6_1_CH1_ISR_PRIORITY; + timerConfig.interrupt2.typeOfService = CCU6_1_CH1_INT_SERVICE; + timerConfig.interrupt2.priority = CCU6_1_CH1_ISR_PRIORITY; } }break; } if(PIT_CH0 == pit_ch) { - timer_id = IfxCcu6_TimerId_t12; + timerConfig.timer = IfxCcu6_TimerId_t12; timerConfig.interrupt1.source = IfxCcu6_InterruptSource_t12PeriodMatch; timerConfig.interrupt1.serviceRequest = IfxCcu6_ServiceRequest_1; timerConfig.base.t12Period = timer_period; @@ -107,17 +106,13 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) } else { - timer_id = IfxCcu6_TimerId_t13; + timerConfig.timer = IfxCcu6_TimerId_t13; timerConfig.interrupt2.source = IfxCcu6_InterruptSource_t13PeriodMatch; timerConfig.interrupt2.serviceRequest = IfxCcu6_ServiceRequest_2; timerConfig.base.t13Period = timer_period; timerConfig.base.t13Frequency = (float)timer_input_clk; timerConfig.clock.t13countingInputMode = IfxCcu6_CountingInputMode_internal; } - - - timerConfig.timer = timer_id; - timerConfig.timer12.counterValue = 0; timerConfig.timer13.counterValue = 0; timerConfig.trigger.t13InSyncWithT12 = FALSE; @@ -126,5 +121,78 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) restoreInterrupts(interrupt_state); + IfxCcu6_setSuspendMode(module, IfxCcu6_SuspendMode_hard); IfxCcu6_Timer_start(&g_Ccu6Timer); } + +//------------------------------------------------------------------------------------------------------------------- +// @brief pit关闭 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_close(CCU6_0, PIT_CH0); //关闭CCU60 通道0的计时器 +//------------------------------------------------------------------------------------------------------------------- +void pit_close(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + IfxCcu6_Timer g_Ccu6Timer; + + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + + g_Ccu6Timer.ccu6 = module; + g_Ccu6Timer.timer = (IfxCcu6_TimerId)(pit_ch); + + IfxCcu6_Timer_stop(&g_Ccu6Timer); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief pit开始 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_start(CCU6_0, PIT_CH0); //打开CCU60 通道0的计时器 +//------------------------------------------------------------------------------------------------------------------- +void pit_start(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + IfxCcu6_Timer g_Ccu6Timer; + + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + + g_Ccu6Timer.ccu6 = module; + g_Ccu6Timer.timer = (IfxCcu6_TimerId)(pit_ch); + + IfxCcu6_Timer_start(&g_Ccu6Timer); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief 禁止pit中断 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_disable_interrupt(CCU6_0, PIT_CH0); //禁止CCU60 通道0的中断 +//------------------------------------------------------------------------------------------------------------------- +void pit_disable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + IfxCcu6_disableInterrupt(module, pit_ch * 2 + 7); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief 使能pit中断 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_enable_interrupt(CCU6_0, PIT_CH0); //开启CCU60 通道0的中断 +//------------------------------------------------------------------------------------------------------------------- +void pit_enable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + IfxCcu6_enableInterrupt(module, pit_ch * 2 + 7); +} diff --git a/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h b/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h index 97994ea..22a3a79 100644 --- a/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h +++ b/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h @@ -46,7 +46,10 @@ typedef enum //枚 void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time); - +void pit_close(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_start(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_disable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_enable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); //------------------------------------以下代码用于PIT中断------------------------------------ diff --git a/Example/12-Dual_Core_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c b/Example/12-Dual_Core_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c index 96692b7..1640b41 100644 --- a/Example/12-Dual_Core_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c +++ b/Example/12-Dual_Core_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c @@ -196,7 +196,7 @@ void rda5807_init(float freq) //复位 rad5807m_simiic_write(FM_ADDRESS,dat,2); - systick_delay_ms(STM0, 600); + systick_delay_ms(STM0, 50); while(rda5807_read_reg[8] != 0x58) { diff --git a/Example/12-Dual_Core_Demo/鎺ㄨ崘IO鍒嗛厤.txt b/Example/12-Dual_Core_Demo/鎺ㄨ崘IO鍒嗛厤.txt index df0fa4f..199fe87 100644 --- a/Example/12-Dual_Core_Demo/鎺ㄨ崘IO鍒嗛厤.txt +++ b/Example/12-Dual_Core_Demo/鎺ㄨ崘IO鍒嗛厤.txt @@ -3,6 +3,7 @@ 数据口:00_0 00_1 00_2 00_3 00_4 00_5 00_6 00_7 配置串口:摄像头RX:02_2 摄像头TX:02_3 VSY:02_0 + HREF:程序不需要,所以不接 PCLK:02_1 四路运放 A0 A1 A2 A3 等 diff --git a/Example/13-FFT_Demo/Libraries/doc/version.txt b/Example/13-FFT_Demo/Libraries/doc/version.txt index bb8abf2..1fdbd92 100644 --- a/Example/13-FFT_Demo/Libraries/doc/version.txt +++ b/Example/13-FFT_Demo/Libraries/doc/version.txt @@ -59,4 +59,9 @@ V1.0.7 修复使用systick_getval计时,当计时时间超过4秒左右会出现时间测量错误的问题。 对部分代码加入#pragma warning,避免提高优化等级时出现警告 修改1.8寸TFT屏幕初始化中关于屏幕方向选择部分的代码 - \ No newline at end of file + +V1.0.8 + 修复CCU61 通道1中断设置错误的问题 + 修复CCU6在线调试的时候定时器不能自动停止,导致在线调试时持续进中断的问题 + 对CCU6增加pit_close与pit_start函数用于控制定时器的开始与停止 + 对CCU6增加pit_disable_interrupt与pit_enable_interrupt函数用于控制中断开关 \ No newline at end of file diff --git a/Example/13-FFT_Demo/Libraries/seekfree_libraries/common/common.c b/Example/13-FFT_Demo/Libraries/seekfree_libraries/common/common.c index 6ecd4c9..4f8606b 100644 --- a/Example/13-FFT_Demo/Libraries/seekfree_libraries/common/common.c +++ b/Example/13-FFT_Demo/Libraries/seekfree_libraries/common/common.c @@ -24,7 +24,6 @@ uint8 camera_type; //摄像头型号 1:总钻风 2:凌瞳(暂未支持)3:小钻风 -uint32 te; App_Cpu0 g_AppCpu0; //频率信息变量 void get_clk(void) @@ -41,5 +40,4 @@ void get_clk(void) g_AppCpu0.info.sysFreq = IfxScuCcu_getSpbFrequency(); g_AppCpu0.info.stmFreq = IfxStm_getFrequency(&MODULE_STM0); - te = IfxScuCcu_getSriFrequency(); } diff --git a/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c b/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c index e81100f..169c8df 100644 --- a/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c +++ b/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c @@ -40,7 +40,6 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) volatile Ifx_CCU6 *module; uint64 timer_input_clk; IfxCcu6_Timer g_Ccu6Timer; - IfxCcu6_TimerId timer_id; IfxCcu6_Timer_Config timerConfig; uint32 timer_period; @@ -90,15 +89,15 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) } else { - timerConfig.interrupt1.typeOfService = CCU6_1_CH1_INT_SERVICE; - timerConfig.interrupt1.priority = CCU6_1_CH1_ISR_PRIORITY; + timerConfig.interrupt2.typeOfService = CCU6_1_CH1_INT_SERVICE; + timerConfig.interrupt2.priority = CCU6_1_CH1_ISR_PRIORITY; } }break; } if(PIT_CH0 == pit_ch) { - timer_id = IfxCcu6_TimerId_t12; + timerConfig.timer = IfxCcu6_TimerId_t12; timerConfig.interrupt1.source = IfxCcu6_InterruptSource_t12PeriodMatch; timerConfig.interrupt1.serviceRequest = IfxCcu6_ServiceRequest_1; timerConfig.base.t12Period = timer_period; @@ -107,17 +106,13 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) } else { - timer_id = IfxCcu6_TimerId_t13; + timerConfig.timer = IfxCcu6_TimerId_t13; timerConfig.interrupt2.source = IfxCcu6_InterruptSource_t13PeriodMatch; timerConfig.interrupt2.serviceRequest = IfxCcu6_ServiceRequest_2; timerConfig.base.t13Period = timer_period; timerConfig.base.t13Frequency = (float)timer_input_clk; timerConfig.clock.t13countingInputMode = IfxCcu6_CountingInputMode_internal; } - - - timerConfig.timer = timer_id; - timerConfig.timer12.counterValue = 0; timerConfig.timer13.counterValue = 0; timerConfig.trigger.t13InSyncWithT12 = FALSE; @@ -126,5 +121,78 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) restoreInterrupts(interrupt_state); + IfxCcu6_setSuspendMode(module, IfxCcu6_SuspendMode_hard); IfxCcu6_Timer_start(&g_Ccu6Timer); } + +//------------------------------------------------------------------------------------------------------------------- +// @brief pit关闭 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_close(CCU6_0, PIT_CH0); //关闭CCU60 通道0的计时器 +//------------------------------------------------------------------------------------------------------------------- +void pit_close(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + IfxCcu6_Timer g_Ccu6Timer; + + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + + g_Ccu6Timer.ccu6 = module; + g_Ccu6Timer.timer = (IfxCcu6_TimerId)(pit_ch); + + IfxCcu6_Timer_stop(&g_Ccu6Timer); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief pit开始 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_start(CCU6_0, PIT_CH0); //打开CCU60 通道0的计时器 +//------------------------------------------------------------------------------------------------------------------- +void pit_start(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + IfxCcu6_Timer g_Ccu6Timer; + + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + + g_Ccu6Timer.ccu6 = module; + g_Ccu6Timer.timer = (IfxCcu6_TimerId)(pit_ch); + + IfxCcu6_Timer_start(&g_Ccu6Timer); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief 禁止pit中断 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_disable_interrupt(CCU6_0, PIT_CH0); //禁止CCU60 通道0的中断 +//------------------------------------------------------------------------------------------------------------------- +void pit_disable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + IfxCcu6_disableInterrupt(module, pit_ch * 2 + 7); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief 使能pit中断 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_enable_interrupt(CCU6_0, PIT_CH0); //开启CCU60 通道0的中断 +//------------------------------------------------------------------------------------------------------------------- +void pit_enable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + IfxCcu6_enableInterrupt(module, pit_ch * 2 + 7); +} diff --git a/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h b/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h index 97994ea..22a3a79 100644 --- a/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h +++ b/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h @@ -46,7 +46,10 @@ typedef enum //枚 void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time); - +void pit_close(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_start(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_disable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_enable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); //------------------------------------以下代码用于PIT中断------------------------------------ diff --git a/Example/13-FFT_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c b/Example/13-FFT_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c index 96692b7..1640b41 100644 --- a/Example/13-FFT_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c +++ b/Example/13-FFT_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c @@ -196,7 +196,7 @@ void rda5807_init(float freq) //复位 rad5807m_simiic_write(FM_ADDRESS,dat,2); - systick_delay_ms(STM0, 600); + systick_delay_ms(STM0, 50); while(rda5807_read_reg[8] != 0x58) { diff --git a/Example/13-FFT_Demo/鎺ㄨ崘IO鍒嗛厤.txt b/Example/13-FFT_Demo/鎺ㄨ崘IO鍒嗛厤.txt index df0fa4f..199fe87 100644 --- a/Example/13-FFT_Demo/鎺ㄨ崘IO鍒嗛厤.txt +++ b/Example/13-FFT_Demo/鎺ㄨ崘IO鍒嗛厤.txt @@ -3,6 +3,7 @@ 数据口:00_0 00_1 00_2 00_3 00_4 00_5 00_6 00_7 配置串口:摄像头RX:02_2 摄像头TX:02_3 VSY:02_0 + HREF:程序不需要,所以不接 PCLK:02_1 四路运放 A0 A1 A2 A3 等 diff --git a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/doc/version.txt b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/doc/version.txt index bb8abf2..1fdbd92 100644 --- a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/doc/version.txt +++ b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/doc/version.txt @@ -59,4 +59,9 @@ V1.0.7 修复使用systick_getval计时,当计时时间超过4秒左右会出现时间测量错误的问题。 对部分代码加入#pragma warning,避免提高优化等级时出现警告 修改1.8寸TFT屏幕初始化中关于屏幕方向选择部分的代码 - \ No newline at end of file + +V1.0.8 + 修复CCU61 通道1中断设置错误的问题 + 修复CCU6在线调试的时候定时器不能自动停止,导致在线调试时持续进中断的问题 + 对CCU6增加pit_close与pit_start函数用于控制定时器的开始与停止 + 对CCU6增加pit_disable_interrupt与pit_enable_interrupt函数用于控制中断开关 \ No newline at end of file diff --git a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/common/common.c b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/common/common.c index 6ecd4c9..4f8606b 100644 --- a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/common/common.c +++ b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/common/common.c @@ -24,7 +24,6 @@ uint8 camera_type; //摄像头型号 1:总钻风 2:凌瞳(暂未支持)3:小钻风 -uint32 te; App_Cpu0 g_AppCpu0; //频率信息变量 void get_clk(void) @@ -41,5 +40,4 @@ void get_clk(void) g_AppCpu0.info.sysFreq = IfxScuCcu_getSpbFrequency(); g_AppCpu0.info.stmFreq = IfxStm_getFrequency(&MODULE_STM0); - te = IfxScuCcu_getSriFrequency(); } diff --git a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c index e81100f..169c8df 100644 --- a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c +++ b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c @@ -40,7 +40,6 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) volatile Ifx_CCU6 *module; uint64 timer_input_clk; IfxCcu6_Timer g_Ccu6Timer; - IfxCcu6_TimerId timer_id; IfxCcu6_Timer_Config timerConfig; uint32 timer_period; @@ -90,15 +89,15 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) } else { - timerConfig.interrupt1.typeOfService = CCU6_1_CH1_INT_SERVICE; - timerConfig.interrupt1.priority = CCU6_1_CH1_ISR_PRIORITY; + timerConfig.interrupt2.typeOfService = CCU6_1_CH1_INT_SERVICE; + timerConfig.interrupt2.priority = CCU6_1_CH1_ISR_PRIORITY; } }break; } if(PIT_CH0 == pit_ch) { - timer_id = IfxCcu6_TimerId_t12; + timerConfig.timer = IfxCcu6_TimerId_t12; timerConfig.interrupt1.source = IfxCcu6_InterruptSource_t12PeriodMatch; timerConfig.interrupt1.serviceRequest = IfxCcu6_ServiceRequest_1; timerConfig.base.t12Period = timer_period; @@ -107,17 +106,13 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) } else { - timer_id = IfxCcu6_TimerId_t13; + timerConfig.timer = IfxCcu6_TimerId_t13; timerConfig.interrupt2.source = IfxCcu6_InterruptSource_t13PeriodMatch; timerConfig.interrupt2.serviceRequest = IfxCcu6_ServiceRequest_2; timerConfig.base.t13Period = timer_period; timerConfig.base.t13Frequency = (float)timer_input_clk; timerConfig.clock.t13countingInputMode = IfxCcu6_CountingInputMode_internal; } - - - timerConfig.timer = timer_id; - timerConfig.timer12.counterValue = 0; timerConfig.timer13.counterValue = 0; timerConfig.trigger.t13InSyncWithT12 = FALSE; @@ -126,5 +121,78 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) restoreInterrupts(interrupt_state); + IfxCcu6_setSuspendMode(module, IfxCcu6_SuspendMode_hard); IfxCcu6_Timer_start(&g_Ccu6Timer); } + +//------------------------------------------------------------------------------------------------------------------- +// @brief pit关闭 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_close(CCU6_0, PIT_CH0); //关闭CCU60 通道0的计时器 +//------------------------------------------------------------------------------------------------------------------- +void pit_close(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + IfxCcu6_Timer g_Ccu6Timer; + + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + + g_Ccu6Timer.ccu6 = module; + g_Ccu6Timer.timer = (IfxCcu6_TimerId)(pit_ch); + + IfxCcu6_Timer_stop(&g_Ccu6Timer); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief pit开始 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_start(CCU6_0, PIT_CH0); //打开CCU60 通道0的计时器 +//------------------------------------------------------------------------------------------------------------------- +void pit_start(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + IfxCcu6_Timer g_Ccu6Timer; + + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + + g_Ccu6Timer.ccu6 = module; + g_Ccu6Timer.timer = (IfxCcu6_TimerId)(pit_ch); + + IfxCcu6_Timer_start(&g_Ccu6Timer); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief 禁止pit中断 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_disable_interrupt(CCU6_0, PIT_CH0); //禁止CCU60 通道0的中断 +//------------------------------------------------------------------------------------------------------------------- +void pit_disable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + IfxCcu6_disableInterrupt(module, pit_ch * 2 + 7); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief 使能pit中断 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_enable_interrupt(CCU6_0, PIT_CH0); //开启CCU60 通道0的中断 +//------------------------------------------------------------------------------------------------------------------- +void pit_enable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + IfxCcu6_enableInterrupt(module, pit_ch * 2 + 7); +} diff --git a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h index 97994ea..22a3a79 100644 --- a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h +++ b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h @@ -46,7 +46,10 @@ typedef enum //枚 void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time); - +void pit_close(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_start(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_disable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_enable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); //------------------------------------以下代码用于PIT中断------------------------------------ diff --git a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c index 96692b7..1640b41 100644 --- a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c +++ b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c @@ -196,7 +196,7 @@ void rda5807_init(float freq) //复位 rad5807m_simiic_write(FM_ADDRESS,dat,2); - systick_delay_ms(STM0, 600); + systick_delay_ms(STM0, 50); while(rda5807_read_reg[8] != 0x58) { diff --git a/Example/14-Specifies_Variable_Or_Code_Location_Demo/鎺ㄨ崘IO鍒嗛厤.txt b/Example/14-Specifies_Variable_Or_Code_Location_Demo/鎺ㄨ崘IO鍒嗛厤.txt index df0fa4f..199fe87 100644 --- a/Example/14-Specifies_Variable_Or_Code_Location_Demo/鎺ㄨ崘IO鍒嗛厤.txt +++ b/Example/14-Specifies_Variable_Or_Code_Location_Demo/鎺ㄨ崘IO鍒嗛厤.txt @@ -3,6 +3,7 @@ 数据口:00_0 00_1 00_2 00_3 00_4 00_5 00_6 00_7 配置串口:摄像头RX:02_2 摄像头TX:02_3 VSY:02_0 + HREF:程序不需要,所以不接 PCLK:02_1 四路运放 A0 A1 A2 A3 等 diff --git a/Example/2-LED_Blink_Demo/Libraries/doc/version.txt b/Example/2-LED_Blink_Demo/Libraries/doc/version.txt index bb8abf2..1fdbd92 100644 --- a/Example/2-LED_Blink_Demo/Libraries/doc/version.txt +++ b/Example/2-LED_Blink_Demo/Libraries/doc/version.txt @@ -59,4 +59,9 @@ V1.0.7 修复使用systick_getval计时,当计时时间超过4秒左右会出现时间测量错误的问题。 对部分代码加入#pragma warning,避免提高优化等级时出现警告 修改1.8寸TFT屏幕初始化中关于屏幕方向选择部分的代码 - \ No newline at end of file + +V1.0.8 + 修复CCU61 通道1中断设置错误的问题 + 修复CCU6在线调试的时候定时器不能自动停止,导致在线调试时持续进中断的问题 + 对CCU6增加pit_close与pit_start函数用于控制定时器的开始与停止 + 对CCU6增加pit_disable_interrupt与pit_enable_interrupt函数用于控制中断开关 \ No newline at end of file diff --git a/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/common/common.c b/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/common/common.c index 6ecd4c9..4f8606b 100644 --- a/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/common/common.c +++ b/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/common/common.c @@ -24,7 +24,6 @@ uint8 camera_type; //摄像头型号 1:总钻风 2:凌瞳(暂未支持)3:小钻风 -uint32 te; App_Cpu0 g_AppCpu0; //频率信息变量 void get_clk(void) @@ -41,5 +40,4 @@ void get_clk(void) g_AppCpu0.info.sysFreq = IfxScuCcu_getSpbFrequency(); g_AppCpu0.info.stmFreq = IfxStm_getFrequency(&MODULE_STM0); - te = IfxScuCcu_getSriFrequency(); } diff --git a/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c b/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c index e81100f..169c8df 100644 --- a/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c +++ b/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c @@ -40,7 +40,6 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) volatile Ifx_CCU6 *module; uint64 timer_input_clk; IfxCcu6_Timer g_Ccu6Timer; - IfxCcu6_TimerId timer_id; IfxCcu6_Timer_Config timerConfig; uint32 timer_period; @@ -90,15 +89,15 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) } else { - timerConfig.interrupt1.typeOfService = CCU6_1_CH1_INT_SERVICE; - timerConfig.interrupt1.priority = CCU6_1_CH1_ISR_PRIORITY; + timerConfig.interrupt2.typeOfService = CCU6_1_CH1_INT_SERVICE; + timerConfig.interrupt2.priority = CCU6_1_CH1_ISR_PRIORITY; } }break; } if(PIT_CH0 == pit_ch) { - timer_id = IfxCcu6_TimerId_t12; + timerConfig.timer = IfxCcu6_TimerId_t12; timerConfig.interrupt1.source = IfxCcu6_InterruptSource_t12PeriodMatch; timerConfig.interrupt1.serviceRequest = IfxCcu6_ServiceRequest_1; timerConfig.base.t12Period = timer_period; @@ -107,17 +106,13 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) } else { - timer_id = IfxCcu6_TimerId_t13; + timerConfig.timer = IfxCcu6_TimerId_t13; timerConfig.interrupt2.source = IfxCcu6_InterruptSource_t13PeriodMatch; timerConfig.interrupt2.serviceRequest = IfxCcu6_ServiceRequest_2; timerConfig.base.t13Period = timer_period; timerConfig.base.t13Frequency = (float)timer_input_clk; timerConfig.clock.t13countingInputMode = IfxCcu6_CountingInputMode_internal; } - - - timerConfig.timer = timer_id; - timerConfig.timer12.counterValue = 0; timerConfig.timer13.counterValue = 0; timerConfig.trigger.t13InSyncWithT12 = FALSE; @@ -126,5 +121,78 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) restoreInterrupts(interrupt_state); + IfxCcu6_setSuspendMode(module, IfxCcu6_SuspendMode_hard); IfxCcu6_Timer_start(&g_Ccu6Timer); } + +//------------------------------------------------------------------------------------------------------------------- +// @brief pit关闭 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_close(CCU6_0, PIT_CH0); //关闭CCU60 通道0的计时器 +//------------------------------------------------------------------------------------------------------------------- +void pit_close(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + IfxCcu6_Timer g_Ccu6Timer; + + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + + g_Ccu6Timer.ccu6 = module; + g_Ccu6Timer.timer = (IfxCcu6_TimerId)(pit_ch); + + IfxCcu6_Timer_stop(&g_Ccu6Timer); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief pit开始 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_start(CCU6_0, PIT_CH0); //打开CCU60 通道0的计时器 +//------------------------------------------------------------------------------------------------------------------- +void pit_start(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + IfxCcu6_Timer g_Ccu6Timer; + + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + + g_Ccu6Timer.ccu6 = module; + g_Ccu6Timer.timer = (IfxCcu6_TimerId)(pit_ch); + + IfxCcu6_Timer_start(&g_Ccu6Timer); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief 禁止pit中断 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_disable_interrupt(CCU6_0, PIT_CH0); //禁止CCU60 通道0的中断 +//------------------------------------------------------------------------------------------------------------------- +void pit_disable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + IfxCcu6_disableInterrupt(module, pit_ch * 2 + 7); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief 使能pit中断 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_enable_interrupt(CCU6_0, PIT_CH0); //开启CCU60 通道0的中断 +//------------------------------------------------------------------------------------------------------------------- +void pit_enable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + IfxCcu6_enableInterrupt(module, pit_ch * 2 + 7); +} diff --git a/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h b/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h index 97994ea..22a3a79 100644 --- a/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h +++ b/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h @@ -46,7 +46,10 @@ typedef enum //枚 void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time); - +void pit_close(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_start(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_disable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_enable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); //------------------------------------以下代码用于PIT中断------------------------------------ diff --git a/Example/2-LED_Blink_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c b/Example/2-LED_Blink_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c index 96692b7..1640b41 100644 --- a/Example/2-LED_Blink_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c +++ b/Example/2-LED_Blink_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c @@ -196,7 +196,7 @@ void rda5807_init(float freq) //复位 rad5807m_simiic_write(FM_ADDRESS,dat,2); - systick_delay_ms(STM0, 600); + systick_delay_ms(STM0, 50); while(rda5807_read_reg[8] != 0x58) { diff --git a/Example/2-LED_Blink_Demo/鎺ㄨ崘IO鍒嗛厤.txt b/Example/2-LED_Blink_Demo/鎺ㄨ崘IO鍒嗛厤.txt index df0fa4f..199fe87 100644 --- a/Example/2-LED_Blink_Demo/鎺ㄨ崘IO鍒嗛厤.txt +++ b/Example/2-LED_Blink_Demo/鎺ㄨ崘IO鍒嗛厤.txt @@ -3,6 +3,7 @@ 数据口:00_0 00_1 00_2 00_3 00_4 00_5 00_6 00_7 配置串口:摄像头RX:02_2 摄像头TX:02_3 VSY:02_0 + HREF:程序不需要,所以不接 PCLK:02_1 四路运放 A0 A1 A2 A3 等 diff --git a/Example/3-PIT_Demo/Libraries/doc/version.txt b/Example/3-PIT_Demo/Libraries/doc/version.txt index bb8abf2..1fdbd92 100644 --- a/Example/3-PIT_Demo/Libraries/doc/version.txt +++ b/Example/3-PIT_Demo/Libraries/doc/version.txt @@ -59,4 +59,9 @@ V1.0.7 修复使用systick_getval计时,当计时时间超过4秒左右会出现时间测量错误的问题。 对部分代码加入#pragma warning,避免提高优化等级时出现警告 修改1.8寸TFT屏幕初始化中关于屏幕方向选择部分的代码 - \ No newline at end of file + +V1.0.8 + 修复CCU61 通道1中断设置错误的问题 + 修复CCU6在线调试的时候定时器不能自动停止,导致在线调试时持续进中断的问题 + 对CCU6增加pit_close与pit_start函数用于控制定时器的开始与停止 + 对CCU6增加pit_disable_interrupt与pit_enable_interrupt函数用于控制中断开关 \ No newline at end of file diff --git a/Example/3-PIT_Demo/Libraries/seekfree_libraries/common/common.c b/Example/3-PIT_Demo/Libraries/seekfree_libraries/common/common.c index 6ecd4c9..4f8606b 100644 --- a/Example/3-PIT_Demo/Libraries/seekfree_libraries/common/common.c +++ b/Example/3-PIT_Demo/Libraries/seekfree_libraries/common/common.c @@ -24,7 +24,6 @@ uint8 camera_type; //摄像头型号 1:总钻风 2:凌瞳(暂未支持)3:小钻风 -uint32 te; App_Cpu0 g_AppCpu0; //频率信息变量 void get_clk(void) @@ -41,5 +40,4 @@ void get_clk(void) g_AppCpu0.info.sysFreq = IfxScuCcu_getSpbFrequency(); g_AppCpu0.info.stmFreq = IfxStm_getFrequency(&MODULE_STM0); - te = IfxScuCcu_getSriFrequency(); } diff --git a/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c b/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c index e81100f..169c8df 100644 --- a/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c +++ b/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c @@ -40,7 +40,6 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) volatile Ifx_CCU6 *module; uint64 timer_input_clk; IfxCcu6_Timer g_Ccu6Timer; - IfxCcu6_TimerId timer_id; IfxCcu6_Timer_Config timerConfig; uint32 timer_period; @@ -90,15 +89,15 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) } else { - timerConfig.interrupt1.typeOfService = CCU6_1_CH1_INT_SERVICE; - timerConfig.interrupt1.priority = CCU6_1_CH1_ISR_PRIORITY; + timerConfig.interrupt2.typeOfService = CCU6_1_CH1_INT_SERVICE; + timerConfig.interrupt2.priority = CCU6_1_CH1_ISR_PRIORITY; } }break; } if(PIT_CH0 == pit_ch) { - timer_id = IfxCcu6_TimerId_t12; + timerConfig.timer = IfxCcu6_TimerId_t12; timerConfig.interrupt1.source = IfxCcu6_InterruptSource_t12PeriodMatch; timerConfig.interrupt1.serviceRequest = IfxCcu6_ServiceRequest_1; timerConfig.base.t12Period = timer_period; @@ -107,17 +106,13 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) } else { - timer_id = IfxCcu6_TimerId_t13; + timerConfig.timer = IfxCcu6_TimerId_t13; timerConfig.interrupt2.source = IfxCcu6_InterruptSource_t13PeriodMatch; timerConfig.interrupt2.serviceRequest = IfxCcu6_ServiceRequest_2; timerConfig.base.t13Period = timer_period; timerConfig.base.t13Frequency = (float)timer_input_clk; timerConfig.clock.t13countingInputMode = IfxCcu6_CountingInputMode_internal; } - - - timerConfig.timer = timer_id; - timerConfig.timer12.counterValue = 0; timerConfig.timer13.counterValue = 0; timerConfig.trigger.t13InSyncWithT12 = FALSE; @@ -126,5 +121,78 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) restoreInterrupts(interrupt_state); + IfxCcu6_setSuspendMode(module, IfxCcu6_SuspendMode_hard); IfxCcu6_Timer_start(&g_Ccu6Timer); } + +//------------------------------------------------------------------------------------------------------------------- +// @brief pit关闭 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_close(CCU6_0, PIT_CH0); //关闭CCU60 通道0的计时器 +//------------------------------------------------------------------------------------------------------------------- +void pit_close(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + IfxCcu6_Timer g_Ccu6Timer; + + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + + g_Ccu6Timer.ccu6 = module; + g_Ccu6Timer.timer = (IfxCcu6_TimerId)(pit_ch); + + IfxCcu6_Timer_stop(&g_Ccu6Timer); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief pit开始 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_start(CCU6_0, PIT_CH0); //打开CCU60 通道0的计时器 +//------------------------------------------------------------------------------------------------------------------- +void pit_start(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + IfxCcu6_Timer g_Ccu6Timer; + + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + + g_Ccu6Timer.ccu6 = module; + g_Ccu6Timer.timer = (IfxCcu6_TimerId)(pit_ch); + + IfxCcu6_Timer_start(&g_Ccu6Timer); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief 禁止pit中断 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_disable_interrupt(CCU6_0, PIT_CH0); //禁止CCU60 通道0的中断 +//------------------------------------------------------------------------------------------------------------------- +void pit_disable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + IfxCcu6_disableInterrupt(module, pit_ch * 2 + 7); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief 使能pit中断 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_enable_interrupt(CCU6_0, PIT_CH0); //开启CCU60 通道0的中断 +//------------------------------------------------------------------------------------------------------------------- +void pit_enable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + IfxCcu6_enableInterrupt(module, pit_ch * 2 + 7); +} diff --git a/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h b/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h index 97994ea..22a3a79 100644 --- a/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h +++ b/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h @@ -46,7 +46,10 @@ typedef enum //枚 void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time); - +void pit_close(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_start(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_disable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_enable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); //------------------------------------以下代码用于PIT中断------------------------------------ diff --git a/Example/3-PIT_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c b/Example/3-PIT_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c index 96692b7..1640b41 100644 --- a/Example/3-PIT_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c +++ b/Example/3-PIT_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c @@ -196,7 +196,7 @@ void rda5807_init(float freq) //复位 rad5807m_simiic_write(FM_ADDRESS,dat,2); - systick_delay_ms(STM0, 600); + systick_delay_ms(STM0, 50); while(rda5807_read_reg[8] != 0x58) { diff --git a/Example/3-PIT_Demo/鎺ㄨ崘IO鍒嗛厤.txt b/Example/3-PIT_Demo/鎺ㄨ崘IO鍒嗛厤.txt index df0fa4f..199fe87 100644 --- a/Example/3-PIT_Demo/鎺ㄨ崘IO鍒嗛厤.txt +++ b/Example/3-PIT_Demo/鎺ㄨ崘IO鍒嗛厤.txt @@ -3,6 +3,7 @@ 数据口:00_0 00_1 00_2 00_3 00_4 00_5 00_6 00_7 配置串口:摄像头RX:02_2 摄像头TX:02_3 VSY:02_0 + HREF:程序不需要,所以不接 PCLK:02_1 四路运放 A0 A1 A2 A3 等 diff --git a/Example/4-Encoder_Demo/Libraries/doc/version.txt b/Example/4-Encoder_Demo/Libraries/doc/version.txt index bb8abf2..1fdbd92 100644 --- a/Example/4-Encoder_Demo/Libraries/doc/version.txt +++ b/Example/4-Encoder_Demo/Libraries/doc/version.txt @@ -59,4 +59,9 @@ V1.0.7 修复使用systick_getval计时,当计时时间超过4秒左右会出现时间测量错误的问题。 对部分代码加入#pragma warning,避免提高优化等级时出现警告 修改1.8寸TFT屏幕初始化中关于屏幕方向选择部分的代码 - \ No newline at end of file + +V1.0.8 + 修复CCU61 通道1中断设置错误的问题 + 修复CCU6在线调试的时候定时器不能自动停止,导致在线调试时持续进中断的问题 + 对CCU6增加pit_close与pit_start函数用于控制定时器的开始与停止 + 对CCU6增加pit_disable_interrupt与pit_enable_interrupt函数用于控制中断开关 \ No newline at end of file diff --git a/Example/4-Encoder_Demo/Libraries/seekfree_libraries/common/common.c b/Example/4-Encoder_Demo/Libraries/seekfree_libraries/common/common.c index 6ecd4c9..4f8606b 100644 --- a/Example/4-Encoder_Demo/Libraries/seekfree_libraries/common/common.c +++ b/Example/4-Encoder_Demo/Libraries/seekfree_libraries/common/common.c @@ -24,7 +24,6 @@ uint8 camera_type; //摄像头型号 1:总钻风 2:凌瞳(暂未支持)3:小钻风 -uint32 te; App_Cpu0 g_AppCpu0; //频率信息变量 void get_clk(void) @@ -41,5 +40,4 @@ void get_clk(void) g_AppCpu0.info.sysFreq = IfxScuCcu_getSpbFrequency(); g_AppCpu0.info.stmFreq = IfxStm_getFrequency(&MODULE_STM0); - te = IfxScuCcu_getSriFrequency(); } diff --git a/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c b/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c index e81100f..169c8df 100644 --- a/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c +++ b/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c @@ -40,7 +40,6 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) volatile Ifx_CCU6 *module; uint64 timer_input_clk; IfxCcu6_Timer g_Ccu6Timer; - IfxCcu6_TimerId timer_id; IfxCcu6_Timer_Config timerConfig; uint32 timer_period; @@ -90,15 +89,15 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) } else { - timerConfig.interrupt1.typeOfService = CCU6_1_CH1_INT_SERVICE; - timerConfig.interrupt1.priority = CCU6_1_CH1_ISR_PRIORITY; + timerConfig.interrupt2.typeOfService = CCU6_1_CH1_INT_SERVICE; + timerConfig.interrupt2.priority = CCU6_1_CH1_ISR_PRIORITY; } }break; } if(PIT_CH0 == pit_ch) { - timer_id = IfxCcu6_TimerId_t12; + timerConfig.timer = IfxCcu6_TimerId_t12; timerConfig.interrupt1.source = IfxCcu6_InterruptSource_t12PeriodMatch; timerConfig.interrupt1.serviceRequest = IfxCcu6_ServiceRequest_1; timerConfig.base.t12Period = timer_period; @@ -107,17 +106,13 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) } else { - timer_id = IfxCcu6_TimerId_t13; + timerConfig.timer = IfxCcu6_TimerId_t13; timerConfig.interrupt2.source = IfxCcu6_InterruptSource_t13PeriodMatch; timerConfig.interrupt2.serviceRequest = IfxCcu6_ServiceRequest_2; timerConfig.base.t13Period = timer_period; timerConfig.base.t13Frequency = (float)timer_input_clk; timerConfig.clock.t13countingInputMode = IfxCcu6_CountingInputMode_internal; } - - - timerConfig.timer = timer_id; - timerConfig.timer12.counterValue = 0; timerConfig.timer13.counterValue = 0; timerConfig.trigger.t13InSyncWithT12 = FALSE; @@ -126,5 +121,78 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) restoreInterrupts(interrupt_state); + IfxCcu6_setSuspendMode(module, IfxCcu6_SuspendMode_hard); IfxCcu6_Timer_start(&g_Ccu6Timer); } + +//------------------------------------------------------------------------------------------------------------------- +// @brief pit关闭 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_close(CCU6_0, PIT_CH0); //关闭CCU60 通道0的计时器 +//------------------------------------------------------------------------------------------------------------------- +void pit_close(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + IfxCcu6_Timer g_Ccu6Timer; + + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + + g_Ccu6Timer.ccu6 = module; + g_Ccu6Timer.timer = (IfxCcu6_TimerId)(pit_ch); + + IfxCcu6_Timer_stop(&g_Ccu6Timer); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief pit开始 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_start(CCU6_0, PIT_CH0); //打开CCU60 通道0的计时器 +//------------------------------------------------------------------------------------------------------------------- +void pit_start(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + IfxCcu6_Timer g_Ccu6Timer; + + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + + g_Ccu6Timer.ccu6 = module; + g_Ccu6Timer.timer = (IfxCcu6_TimerId)(pit_ch); + + IfxCcu6_Timer_start(&g_Ccu6Timer); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief 禁止pit中断 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_disable_interrupt(CCU6_0, PIT_CH0); //禁止CCU60 通道0的中断 +//------------------------------------------------------------------------------------------------------------------- +void pit_disable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + IfxCcu6_disableInterrupt(module, pit_ch * 2 + 7); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief 使能pit中断 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_enable_interrupt(CCU6_0, PIT_CH0); //开启CCU60 通道0的中断 +//------------------------------------------------------------------------------------------------------------------- +void pit_enable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + IfxCcu6_enableInterrupt(module, pit_ch * 2 + 7); +} diff --git a/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h b/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h index 97994ea..22a3a79 100644 --- a/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h +++ b/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h @@ -46,7 +46,10 @@ typedef enum //枚 void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time); - +void pit_close(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_start(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_disable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_enable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); //------------------------------------以下代码用于PIT中断------------------------------------ diff --git a/Example/4-Encoder_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c b/Example/4-Encoder_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c index 96692b7..1640b41 100644 --- a/Example/4-Encoder_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c +++ b/Example/4-Encoder_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c @@ -196,7 +196,7 @@ void rda5807_init(float freq) //复位 rad5807m_simiic_write(FM_ADDRESS,dat,2); - systick_delay_ms(STM0, 600); + systick_delay_ms(STM0, 50); while(rda5807_read_reg[8] != 0x58) { diff --git a/Example/4-Encoder_Demo/鎺ㄨ崘IO鍒嗛厤.txt b/Example/4-Encoder_Demo/鎺ㄨ崘IO鍒嗛厤.txt index df0fa4f..199fe87 100644 --- a/Example/4-Encoder_Demo/鎺ㄨ崘IO鍒嗛厤.txt +++ b/Example/4-Encoder_Demo/鎺ㄨ崘IO鍒嗛厤.txt @@ -3,6 +3,7 @@ 数据口:00_0 00_1 00_2 00_3 00_4 00_5 00_6 00_7 配置串口:摄像头RX:02_2 摄像头TX:02_3 VSY:02_0 + HREF:程序不需要,所以不接 PCLK:02_1 四路运放 A0 A1 A2 A3 等 diff --git a/Example/5-UART_Demo/Libraries/doc/version.txt b/Example/5-UART_Demo/Libraries/doc/version.txt index bb8abf2..1fdbd92 100644 --- a/Example/5-UART_Demo/Libraries/doc/version.txt +++ b/Example/5-UART_Demo/Libraries/doc/version.txt @@ -59,4 +59,9 @@ V1.0.7 修复使用systick_getval计时,当计时时间超过4秒左右会出现时间测量错误的问题。 对部分代码加入#pragma warning,避免提高优化等级时出现警告 修改1.8寸TFT屏幕初始化中关于屏幕方向选择部分的代码 - \ No newline at end of file + +V1.0.8 + 修复CCU61 通道1中断设置错误的问题 + 修复CCU6在线调试的时候定时器不能自动停止,导致在线调试时持续进中断的问题 + 对CCU6增加pit_close与pit_start函数用于控制定时器的开始与停止 + 对CCU6增加pit_disable_interrupt与pit_enable_interrupt函数用于控制中断开关 \ No newline at end of file diff --git a/Example/5-UART_Demo/Libraries/seekfree_libraries/common/common.c b/Example/5-UART_Demo/Libraries/seekfree_libraries/common/common.c index 6ecd4c9..4f8606b 100644 --- a/Example/5-UART_Demo/Libraries/seekfree_libraries/common/common.c +++ b/Example/5-UART_Demo/Libraries/seekfree_libraries/common/common.c @@ -24,7 +24,6 @@ uint8 camera_type; //摄像头型号 1:总钻风 2:凌瞳(暂未支持)3:小钻风 -uint32 te; App_Cpu0 g_AppCpu0; //频率信息变量 void get_clk(void) @@ -41,5 +40,4 @@ void get_clk(void) g_AppCpu0.info.sysFreq = IfxScuCcu_getSpbFrequency(); g_AppCpu0.info.stmFreq = IfxStm_getFrequency(&MODULE_STM0); - te = IfxScuCcu_getSriFrequency(); } diff --git a/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c b/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c index e81100f..169c8df 100644 --- a/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c +++ b/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c @@ -40,7 +40,6 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) volatile Ifx_CCU6 *module; uint64 timer_input_clk; IfxCcu6_Timer g_Ccu6Timer; - IfxCcu6_TimerId timer_id; IfxCcu6_Timer_Config timerConfig; uint32 timer_period; @@ -90,15 +89,15 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) } else { - timerConfig.interrupt1.typeOfService = CCU6_1_CH1_INT_SERVICE; - timerConfig.interrupt1.priority = CCU6_1_CH1_ISR_PRIORITY; + timerConfig.interrupt2.typeOfService = CCU6_1_CH1_INT_SERVICE; + timerConfig.interrupt2.priority = CCU6_1_CH1_ISR_PRIORITY; } }break; } if(PIT_CH0 == pit_ch) { - timer_id = IfxCcu6_TimerId_t12; + timerConfig.timer = IfxCcu6_TimerId_t12; timerConfig.interrupt1.source = IfxCcu6_InterruptSource_t12PeriodMatch; timerConfig.interrupt1.serviceRequest = IfxCcu6_ServiceRequest_1; timerConfig.base.t12Period = timer_period; @@ -107,17 +106,13 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) } else { - timer_id = IfxCcu6_TimerId_t13; + timerConfig.timer = IfxCcu6_TimerId_t13; timerConfig.interrupt2.source = IfxCcu6_InterruptSource_t13PeriodMatch; timerConfig.interrupt2.serviceRequest = IfxCcu6_ServiceRequest_2; timerConfig.base.t13Period = timer_period; timerConfig.base.t13Frequency = (float)timer_input_clk; timerConfig.clock.t13countingInputMode = IfxCcu6_CountingInputMode_internal; } - - - timerConfig.timer = timer_id; - timerConfig.timer12.counterValue = 0; timerConfig.timer13.counterValue = 0; timerConfig.trigger.t13InSyncWithT12 = FALSE; @@ -126,5 +121,78 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) restoreInterrupts(interrupt_state); + IfxCcu6_setSuspendMode(module, IfxCcu6_SuspendMode_hard); IfxCcu6_Timer_start(&g_Ccu6Timer); } + +//------------------------------------------------------------------------------------------------------------------- +// @brief pit关闭 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_close(CCU6_0, PIT_CH0); //关闭CCU60 通道0的计时器 +//------------------------------------------------------------------------------------------------------------------- +void pit_close(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + IfxCcu6_Timer g_Ccu6Timer; + + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + + g_Ccu6Timer.ccu6 = module; + g_Ccu6Timer.timer = (IfxCcu6_TimerId)(pit_ch); + + IfxCcu6_Timer_stop(&g_Ccu6Timer); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief pit开始 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_start(CCU6_0, PIT_CH0); //打开CCU60 通道0的计时器 +//------------------------------------------------------------------------------------------------------------------- +void pit_start(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + IfxCcu6_Timer g_Ccu6Timer; + + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + + g_Ccu6Timer.ccu6 = module; + g_Ccu6Timer.timer = (IfxCcu6_TimerId)(pit_ch); + + IfxCcu6_Timer_start(&g_Ccu6Timer); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief 禁止pit中断 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_disable_interrupt(CCU6_0, PIT_CH0); //禁止CCU60 通道0的中断 +//------------------------------------------------------------------------------------------------------------------- +void pit_disable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + IfxCcu6_disableInterrupt(module, pit_ch * 2 + 7); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief 使能pit中断 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_enable_interrupt(CCU6_0, PIT_CH0); //开启CCU60 通道0的中断 +//------------------------------------------------------------------------------------------------------------------- +void pit_enable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + IfxCcu6_enableInterrupt(module, pit_ch * 2 + 7); +} diff --git a/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h b/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h index 97994ea..22a3a79 100644 --- a/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h +++ b/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h @@ -46,7 +46,10 @@ typedef enum //枚 void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time); - +void pit_close(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_start(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_disable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_enable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); //------------------------------------以下代码用于PIT中断------------------------------------ diff --git a/Example/5-UART_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c b/Example/5-UART_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c index 96692b7..1640b41 100644 --- a/Example/5-UART_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c +++ b/Example/5-UART_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c @@ -196,7 +196,7 @@ void rda5807_init(float freq) //复位 rad5807m_simiic_write(FM_ADDRESS,dat,2); - systick_delay_ms(STM0, 600); + systick_delay_ms(STM0, 50); while(rda5807_read_reg[8] != 0x58) { diff --git a/Example/5-UART_Demo/鎺ㄨ崘IO鍒嗛厤.txt b/Example/5-UART_Demo/鎺ㄨ崘IO鍒嗛厤.txt index df0fa4f..199fe87 100644 --- a/Example/5-UART_Demo/鎺ㄨ崘IO鍒嗛厤.txt +++ b/Example/5-UART_Demo/鎺ㄨ崘IO鍒嗛厤.txt @@ -3,6 +3,7 @@ 数据口:00_0 00_1 00_2 00_3 00_4 00_5 00_6 00_7 配置串口:摄像头RX:02_2 摄像头TX:02_3 VSY:02_0 + HREF:程序不需要,所以不接 PCLK:02_1 四路运放 A0 A1 A2 A3 等 diff --git a/Example/6-Printf_Demo/Libraries/doc/version.txt b/Example/6-Printf_Demo/Libraries/doc/version.txt index bb8abf2..1fdbd92 100644 --- a/Example/6-Printf_Demo/Libraries/doc/version.txt +++ b/Example/6-Printf_Demo/Libraries/doc/version.txt @@ -59,4 +59,9 @@ V1.0.7 修复使用systick_getval计时,当计时时间超过4秒左右会出现时间测量错误的问题。 对部分代码加入#pragma warning,避免提高优化等级时出现警告 修改1.8寸TFT屏幕初始化中关于屏幕方向选择部分的代码 - \ No newline at end of file + +V1.0.8 + 修复CCU61 通道1中断设置错误的问题 + 修复CCU6在线调试的时候定时器不能自动停止,导致在线调试时持续进中断的问题 + 对CCU6增加pit_close与pit_start函数用于控制定时器的开始与停止 + 对CCU6增加pit_disable_interrupt与pit_enable_interrupt函数用于控制中断开关 \ No newline at end of file diff --git a/Example/6-Printf_Demo/Libraries/seekfree_libraries/common/common.c b/Example/6-Printf_Demo/Libraries/seekfree_libraries/common/common.c index 6ecd4c9..4f8606b 100644 --- a/Example/6-Printf_Demo/Libraries/seekfree_libraries/common/common.c +++ b/Example/6-Printf_Demo/Libraries/seekfree_libraries/common/common.c @@ -24,7 +24,6 @@ uint8 camera_type; //摄像头型号 1:总钻风 2:凌瞳(暂未支持)3:小钻风 -uint32 te; App_Cpu0 g_AppCpu0; //频率信息变量 void get_clk(void) @@ -41,5 +40,4 @@ void get_clk(void) g_AppCpu0.info.sysFreq = IfxScuCcu_getSpbFrequency(); g_AppCpu0.info.stmFreq = IfxStm_getFrequency(&MODULE_STM0); - te = IfxScuCcu_getSriFrequency(); } diff --git a/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c b/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c index e81100f..169c8df 100644 --- a/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c +++ b/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c @@ -40,7 +40,6 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) volatile Ifx_CCU6 *module; uint64 timer_input_clk; IfxCcu6_Timer g_Ccu6Timer; - IfxCcu6_TimerId timer_id; IfxCcu6_Timer_Config timerConfig; uint32 timer_period; @@ -90,15 +89,15 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) } else { - timerConfig.interrupt1.typeOfService = CCU6_1_CH1_INT_SERVICE; - timerConfig.interrupt1.priority = CCU6_1_CH1_ISR_PRIORITY; + timerConfig.interrupt2.typeOfService = CCU6_1_CH1_INT_SERVICE; + timerConfig.interrupt2.priority = CCU6_1_CH1_ISR_PRIORITY; } }break; } if(PIT_CH0 == pit_ch) { - timer_id = IfxCcu6_TimerId_t12; + timerConfig.timer = IfxCcu6_TimerId_t12; timerConfig.interrupt1.source = IfxCcu6_InterruptSource_t12PeriodMatch; timerConfig.interrupt1.serviceRequest = IfxCcu6_ServiceRequest_1; timerConfig.base.t12Period = timer_period; @@ -107,17 +106,13 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) } else { - timer_id = IfxCcu6_TimerId_t13; + timerConfig.timer = IfxCcu6_TimerId_t13; timerConfig.interrupt2.source = IfxCcu6_InterruptSource_t13PeriodMatch; timerConfig.interrupt2.serviceRequest = IfxCcu6_ServiceRequest_2; timerConfig.base.t13Period = timer_period; timerConfig.base.t13Frequency = (float)timer_input_clk; timerConfig.clock.t13countingInputMode = IfxCcu6_CountingInputMode_internal; } - - - timerConfig.timer = timer_id; - timerConfig.timer12.counterValue = 0; timerConfig.timer13.counterValue = 0; timerConfig.trigger.t13InSyncWithT12 = FALSE; @@ -126,5 +121,78 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) restoreInterrupts(interrupt_state); + IfxCcu6_setSuspendMode(module, IfxCcu6_SuspendMode_hard); IfxCcu6_Timer_start(&g_Ccu6Timer); } + +//------------------------------------------------------------------------------------------------------------------- +// @brief pit关闭 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_close(CCU6_0, PIT_CH0); //关闭CCU60 通道0的计时器 +//------------------------------------------------------------------------------------------------------------------- +void pit_close(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + IfxCcu6_Timer g_Ccu6Timer; + + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + + g_Ccu6Timer.ccu6 = module; + g_Ccu6Timer.timer = (IfxCcu6_TimerId)(pit_ch); + + IfxCcu6_Timer_stop(&g_Ccu6Timer); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief pit开始 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_start(CCU6_0, PIT_CH0); //打开CCU60 通道0的计时器 +//------------------------------------------------------------------------------------------------------------------- +void pit_start(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + IfxCcu6_Timer g_Ccu6Timer; + + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + + g_Ccu6Timer.ccu6 = module; + g_Ccu6Timer.timer = (IfxCcu6_TimerId)(pit_ch); + + IfxCcu6_Timer_start(&g_Ccu6Timer); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief 禁止pit中断 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_disable_interrupt(CCU6_0, PIT_CH0); //禁止CCU60 通道0的中断 +//------------------------------------------------------------------------------------------------------------------- +void pit_disable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + IfxCcu6_disableInterrupt(module, pit_ch * 2 + 7); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief 使能pit中断 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_enable_interrupt(CCU6_0, PIT_CH0); //开启CCU60 通道0的中断 +//------------------------------------------------------------------------------------------------------------------- +void pit_enable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + IfxCcu6_enableInterrupt(module, pit_ch * 2 + 7); +} diff --git a/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h b/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h index 97994ea..22a3a79 100644 --- a/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h +++ b/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h @@ -46,7 +46,10 @@ typedef enum //枚 void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time); - +void pit_close(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_start(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_disable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_enable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); //------------------------------------以下代码用于PIT中断------------------------------------ diff --git a/Example/6-Printf_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c b/Example/6-Printf_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c index 96692b7..1640b41 100644 --- a/Example/6-Printf_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c +++ b/Example/6-Printf_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c @@ -196,7 +196,7 @@ void rda5807_init(float freq) //复位 rad5807m_simiic_write(FM_ADDRESS,dat,2); - systick_delay_ms(STM0, 600); + systick_delay_ms(STM0, 50); while(rda5807_read_reg[8] != 0x58) { diff --git a/Example/6-Printf_Demo/鎺ㄨ崘IO鍒嗛厤.txt b/Example/6-Printf_Demo/鎺ㄨ崘IO鍒嗛厤.txt index df0fa4f..199fe87 100644 --- a/Example/6-Printf_Demo/鎺ㄨ崘IO鍒嗛厤.txt +++ b/Example/6-Printf_Demo/鎺ㄨ崘IO鍒嗛厤.txt @@ -3,6 +3,7 @@ 数据口:00_0 00_1 00_2 00_3 00_4 00_5 00_6 00_7 配置串口:摄像头RX:02_2 摄像头TX:02_3 VSY:02_0 + HREF:程序不需要,所以不接 PCLK:02_1 四路运放 A0 A1 A2 A3 等 diff --git a/Example/7-GPIO_Interrupt_Demo/Libraries/doc/version.txt b/Example/7-GPIO_Interrupt_Demo/Libraries/doc/version.txt index bb8abf2..1fdbd92 100644 --- a/Example/7-GPIO_Interrupt_Demo/Libraries/doc/version.txt +++ b/Example/7-GPIO_Interrupt_Demo/Libraries/doc/version.txt @@ -59,4 +59,9 @@ V1.0.7 修复使用systick_getval计时,当计时时间超过4秒左右会出现时间测量错误的问题。 对部分代码加入#pragma warning,避免提高优化等级时出现警告 修改1.8寸TFT屏幕初始化中关于屏幕方向选择部分的代码 - \ No newline at end of file + +V1.0.8 + 修复CCU61 通道1中断设置错误的问题 + 修复CCU6在线调试的时候定时器不能自动停止,导致在线调试时持续进中断的问题 + 对CCU6增加pit_close与pit_start函数用于控制定时器的开始与停止 + 对CCU6增加pit_disable_interrupt与pit_enable_interrupt函数用于控制中断开关 \ No newline at end of file diff --git a/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/common/common.c b/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/common/common.c index 6ecd4c9..4f8606b 100644 --- a/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/common/common.c +++ b/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/common/common.c @@ -24,7 +24,6 @@ uint8 camera_type; //摄像头型号 1:总钻风 2:凌瞳(暂未支持)3:小钻风 -uint32 te; App_Cpu0 g_AppCpu0; //频率信息变量 void get_clk(void) @@ -41,5 +40,4 @@ void get_clk(void) g_AppCpu0.info.sysFreq = IfxScuCcu_getSpbFrequency(); g_AppCpu0.info.stmFreq = IfxStm_getFrequency(&MODULE_STM0); - te = IfxScuCcu_getSriFrequency(); } diff --git a/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c b/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c index e81100f..169c8df 100644 --- a/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c +++ b/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c @@ -40,7 +40,6 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) volatile Ifx_CCU6 *module; uint64 timer_input_clk; IfxCcu6_Timer g_Ccu6Timer; - IfxCcu6_TimerId timer_id; IfxCcu6_Timer_Config timerConfig; uint32 timer_period; @@ -90,15 +89,15 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) } else { - timerConfig.interrupt1.typeOfService = CCU6_1_CH1_INT_SERVICE; - timerConfig.interrupt1.priority = CCU6_1_CH1_ISR_PRIORITY; + timerConfig.interrupt2.typeOfService = CCU6_1_CH1_INT_SERVICE; + timerConfig.interrupt2.priority = CCU6_1_CH1_ISR_PRIORITY; } }break; } if(PIT_CH0 == pit_ch) { - timer_id = IfxCcu6_TimerId_t12; + timerConfig.timer = IfxCcu6_TimerId_t12; timerConfig.interrupt1.source = IfxCcu6_InterruptSource_t12PeriodMatch; timerConfig.interrupt1.serviceRequest = IfxCcu6_ServiceRequest_1; timerConfig.base.t12Period = timer_period; @@ -107,17 +106,13 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) } else { - timer_id = IfxCcu6_TimerId_t13; + timerConfig.timer = IfxCcu6_TimerId_t13; timerConfig.interrupt2.source = IfxCcu6_InterruptSource_t13PeriodMatch; timerConfig.interrupt2.serviceRequest = IfxCcu6_ServiceRequest_2; timerConfig.base.t13Period = timer_period; timerConfig.base.t13Frequency = (float)timer_input_clk; timerConfig.clock.t13countingInputMode = IfxCcu6_CountingInputMode_internal; } - - - timerConfig.timer = timer_id; - timerConfig.timer12.counterValue = 0; timerConfig.timer13.counterValue = 0; timerConfig.trigger.t13InSyncWithT12 = FALSE; @@ -126,5 +121,78 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) restoreInterrupts(interrupt_state); + IfxCcu6_setSuspendMode(module, IfxCcu6_SuspendMode_hard); IfxCcu6_Timer_start(&g_Ccu6Timer); } + +//------------------------------------------------------------------------------------------------------------------- +// @brief pit关闭 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_close(CCU6_0, PIT_CH0); //关闭CCU60 通道0的计时器 +//------------------------------------------------------------------------------------------------------------------- +void pit_close(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + IfxCcu6_Timer g_Ccu6Timer; + + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + + g_Ccu6Timer.ccu6 = module; + g_Ccu6Timer.timer = (IfxCcu6_TimerId)(pit_ch); + + IfxCcu6_Timer_stop(&g_Ccu6Timer); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief pit开始 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_start(CCU6_0, PIT_CH0); //打开CCU60 通道0的计时器 +//------------------------------------------------------------------------------------------------------------------- +void pit_start(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + IfxCcu6_Timer g_Ccu6Timer; + + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + + g_Ccu6Timer.ccu6 = module; + g_Ccu6Timer.timer = (IfxCcu6_TimerId)(pit_ch); + + IfxCcu6_Timer_start(&g_Ccu6Timer); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief 禁止pit中断 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_disable_interrupt(CCU6_0, PIT_CH0); //禁止CCU60 通道0的中断 +//------------------------------------------------------------------------------------------------------------------- +void pit_disable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + IfxCcu6_disableInterrupt(module, pit_ch * 2 + 7); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief 使能pit中断 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_enable_interrupt(CCU6_0, PIT_CH0); //开启CCU60 通道0的中断 +//------------------------------------------------------------------------------------------------------------------- +void pit_enable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + IfxCcu6_enableInterrupt(module, pit_ch * 2 + 7); +} diff --git a/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h b/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h index 97994ea..22a3a79 100644 --- a/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h +++ b/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h @@ -46,7 +46,10 @@ typedef enum //枚 void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time); - +void pit_close(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_start(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_disable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_enable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); //------------------------------------以下代码用于PIT中断------------------------------------ diff --git a/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c b/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c index 96692b7..1640b41 100644 --- a/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c +++ b/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c @@ -196,7 +196,7 @@ void rda5807_init(float freq) //复位 rad5807m_simiic_write(FM_ADDRESS,dat,2); - systick_delay_ms(STM0, 600); + systick_delay_ms(STM0, 50); while(rda5807_read_reg[8] != 0x58) { diff --git a/Example/7-GPIO_Interrupt_Demo/鎺ㄨ崘IO鍒嗛厤.txt b/Example/7-GPIO_Interrupt_Demo/鎺ㄨ崘IO鍒嗛厤.txt index df0fa4f..199fe87 100644 --- a/Example/7-GPIO_Interrupt_Demo/鎺ㄨ崘IO鍒嗛厤.txt +++ b/Example/7-GPIO_Interrupt_Demo/鎺ㄨ崘IO鍒嗛厤.txt @@ -3,6 +3,7 @@ 数据口:00_0 00_1 00_2 00_3 00_4 00_5 00_6 00_7 配置串口:摄像头RX:02_2 摄像头TX:02_3 VSY:02_0 + HREF:程序不需要,所以不接 PCLK:02_1 四路运放 A0 A1 A2 A3 等 diff --git a/Example/8-EEPROM_Demo/Libraries/doc/version.txt b/Example/8-EEPROM_Demo/Libraries/doc/version.txt index bb8abf2..1fdbd92 100644 --- a/Example/8-EEPROM_Demo/Libraries/doc/version.txt +++ b/Example/8-EEPROM_Demo/Libraries/doc/version.txt @@ -59,4 +59,9 @@ V1.0.7 修复使用systick_getval计时,当计时时间超过4秒左右会出现时间测量错误的问题。 对部分代码加入#pragma warning,避免提高优化等级时出现警告 修改1.8寸TFT屏幕初始化中关于屏幕方向选择部分的代码 - \ No newline at end of file + +V1.0.8 + 修复CCU61 通道1中断设置错误的问题 + 修复CCU6在线调试的时候定时器不能自动停止,导致在线调试时持续进中断的问题 + 对CCU6增加pit_close与pit_start函数用于控制定时器的开始与停止 + 对CCU6增加pit_disable_interrupt与pit_enable_interrupt函数用于控制中断开关 \ No newline at end of file diff --git a/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/common/common.c b/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/common/common.c index 6ecd4c9..4f8606b 100644 --- a/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/common/common.c +++ b/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/common/common.c @@ -24,7 +24,6 @@ uint8 camera_type; //摄像头型号 1:总钻风 2:凌瞳(暂未支持)3:小钻风 -uint32 te; App_Cpu0 g_AppCpu0; //频率信息变量 void get_clk(void) @@ -41,5 +40,4 @@ void get_clk(void) g_AppCpu0.info.sysFreq = IfxScuCcu_getSpbFrequency(); g_AppCpu0.info.stmFreq = IfxStm_getFrequency(&MODULE_STM0); - te = IfxScuCcu_getSriFrequency(); } diff --git a/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c b/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c index e81100f..169c8df 100644 --- a/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c +++ b/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c @@ -40,7 +40,6 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) volatile Ifx_CCU6 *module; uint64 timer_input_clk; IfxCcu6_Timer g_Ccu6Timer; - IfxCcu6_TimerId timer_id; IfxCcu6_Timer_Config timerConfig; uint32 timer_period; @@ -90,15 +89,15 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) } else { - timerConfig.interrupt1.typeOfService = CCU6_1_CH1_INT_SERVICE; - timerConfig.interrupt1.priority = CCU6_1_CH1_ISR_PRIORITY; + timerConfig.interrupt2.typeOfService = CCU6_1_CH1_INT_SERVICE; + timerConfig.interrupt2.priority = CCU6_1_CH1_ISR_PRIORITY; } }break; } if(PIT_CH0 == pit_ch) { - timer_id = IfxCcu6_TimerId_t12; + timerConfig.timer = IfxCcu6_TimerId_t12; timerConfig.interrupt1.source = IfxCcu6_InterruptSource_t12PeriodMatch; timerConfig.interrupt1.serviceRequest = IfxCcu6_ServiceRequest_1; timerConfig.base.t12Period = timer_period; @@ -107,17 +106,13 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) } else { - timer_id = IfxCcu6_TimerId_t13; + timerConfig.timer = IfxCcu6_TimerId_t13; timerConfig.interrupt2.source = IfxCcu6_InterruptSource_t13PeriodMatch; timerConfig.interrupt2.serviceRequest = IfxCcu6_ServiceRequest_2; timerConfig.base.t13Period = timer_period; timerConfig.base.t13Frequency = (float)timer_input_clk; timerConfig.clock.t13countingInputMode = IfxCcu6_CountingInputMode_internal; } - - - timerConfig.timer = timer_id; - timerConfig.timer12.counterValue = 0; timerConfig.timer13.counterValue = 0; timerConfig.trigger.t13InSyncWithT12 = FALSE; @@ -126,5 +121,78 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) restoreInterrupts(interrupt_state); + IfxCcu6_setSuspendMode(module, IfxCcu6_SuspendMode_hard); IfxCcu6_Timer_start(&g_Ccu6Timer); } + +//------------------------------------------------------------------------------------------------------------------- +// @brief pit关闭 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_close(CCU6_0, PIT_CH0); //关闭CCU60 通道0的计时器 +//------------------------------------------------------------------------------------------------------------------- +void pit_close(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + IfxCcu6_Timer g_Ccu6Timer; + + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + + g_Ccu6Timer.ccu6 = module; + g_Ccu6Timer.timer = (IfxCcu6_TimerId)(pit_ch); + + IfxCcu6_Timer_stop(&g_Ccu6Timer); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief pit开始 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_start(CCU6_0, PIT_CH0); //打开CCU60 通道0的计时器 +//------------------------------------------------------------------------------------------------------------------- +void pit_start(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + IfxCcu6_Timer g_Ccu6Timer; + + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + + g_Ccu6Timer.ccu6 = module; + g_Ccu6Timer.timer = (IfxCcu6_TimerId)(pit_ch); + + IfxCcu6_Timer_start(&g_Ccu6Timer); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief 禁止pit中断 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_disable_interrupt(CCU6_0, PIT_CH0); //禁止CCU60 通道0的中断 +//------------------------------------------------------------------------------------------------------------------- +void pit_disable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + IfxCcu6_disableInterrupt(module, pit_ch * 2 + 7); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief 使能pit中断 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_enable_interrupt(CCU6_0, PIT_CH0); //开启CCU60 通道0的中断 +//------------------------------------------------------------------------------------------------------------------- +void pit_enable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + IfxCcu6_enableInterrupt(module, pit_ch * 2 + 7); +} diff --git a/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h b/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h index 97994ea..22a3a79 100644 --- a/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h +++ b/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h @@ -46,7 +46,10 @@ typedef enum //枚 void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time); - +void pit_close(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_start(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_disable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_enable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); //------------------------------------以下代码用于PIT中断------------------------------------ diff --git a/Example/8-EEPROM_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c b/Example/8-EEPROM_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c index 96692b7..1640b41 100644 --- a/Example/8-EEPROM_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c +++ b/Example/8-EEPROM_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c @@ -196,7 +196,7 @@ void rda5807_init(float freq) //复位 rad5807m_simiic_write(FM_ADDRESS,dat,2); - systick_delay_ms(STM0, 600); + systick_delay_ms(STM0, 50); while(rda5807_read_reg[8] != 0x58) { diff --git a/Example/8-EEPROM_Demo/鎺ㄨ崘IO鍒嗛厤.txt b/Example/8-EEPROM_Demo/鎺ㄨ崘IO鍒嗛厤.txt index df0fa4f..199fe87 100644 --- a/Example/8-EEPROM_Demo/鎺ㄨ崘IO鍒嗛厤.txt +++ b/Example/8-EEPROM_Demo/鎺ㄨ崘IO鍒嗛厤.txt @@ -3,6 +3,7 @@ 数据口:00_0 00_1 00_2 00_3 00_4 00_5 00_6 00_7 配置串口:摄像头RX:02_2 摄像头TX:02_3 VSY:02_0 + HREF:程序不需要,所以不接 PCLK:02_1 四路运放 A0 A1 A2 A3 等 diff --git a/Example/9-PWM_Demo/Libraries/doc/version.txt b/Example/9-PWM_Demo/Libraries/doc/version.txt index bb8abf2..1fdbd92 100644 --- a/Example/9-PWM_Demo/Libraries/doc/version.txt +++ b/Example/9-PWM_Demo/Libraries/doc/version.txt @@ -59,4 +59,9 @@ V1.0.7 修复使用systick_getval计时,当计时时间超过4秒左右会出现时间测量错误的问题。 对部分代码加入#pragma warning,避免提高优化等级时出现警告 修改1.8寸TFT屏幕初始化中关于屏幕方向选择部分的代码 - \ No newline at end of file + +V1.0.8 + 修复CCU61 通道1中断设置错误的问题 + 修复CCU6在线调试的时候定时器不能自动停止,导致在线调试时持续进中断的问题 + 对CCU6增加pit_close与pit_start函数用于控制定时器的开始与停止 + 对CCU6增加pit_disable_interrupt与pit_enable_interrupt函数用于控制中断开关 \ No newline at end of file diff --git a/Example/9-PWM_Demo/Libraries/seekfree_libraries/common/common.c b/Example/9-PWM_Demo/Libraries/seekfree_libraries/common/common.c index 6ecd4c9..4f8606b 100644 --- a/Example/9-PWM_Demo/Libraries/seekfree_libraries/common/common.c +++ b/Example/9-PWM_Demo/Libraries/seekfree_libraries/common/common.c @@ -24,7 +24,6 @@ uint8 camera_type; //摄像头型号 1:总钻风 2:凌瞳(暂未支持)3:小钻风 -uint32 te; App_Cpu0 g_AppCpu0; //频率信息变量 void get_clk(void) @@ -41,5 +40,4 @@ void get_clk(void) g_AppCpu0.info.sysFreq = IfxScuCcu_getSpbFrequency(); g_AppCpu0.info.stmFreq = IfxStm_getFrequency(&MODULE_STM0); - te = IfxScuCcu_getSriFrequency(); } diff --git a/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c b/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c index e81100f..169c8df 100644 --- a/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c +++ b/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c @@ -40,7 +40,6 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) volatile Ifx_CCU6 *module; uint64 timer_input_clk; IfxCcu6_Timer g_Ccu6Timer; - IfxCcu6_TimerId timer_id; IfxCcu6_Timer_Config timerConfig; uint32 timer_period; @@ -90,15 +89,15 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) } else { - timerConfig.interrupt1.typeOfService = CCU6_1_CH1_INT_SERVICE; - timerConfig.interrupt1.priority = CCU6_1_CH1_ISR_PRIORITY; + timerConfig.interrupt2.typeOfService = CCU6_1_CH1_INT_SERVICE; + timerConfig.interrupt2.priority = CCU6_1_CH1_ISR_PRIORITY; } }break; } if(PIT_CH0 == pit_ch) { - timer_id = IfxCcu6_TimerId_t12; + timerConfig.timer = IfxCcu6_TimerId_t12; timerConfig.interrupt1.source = IfxCcu6_InterruptSource_t12PeriodMatch; timerConfig.interrupt1.serviceRequest = IfxCcu6_ServiceRequest_1; timerConfig.base.t12Period = timer_period; @@ -107,17 +106,13 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) } else { - timer_id = IfxCcu6_TimerId_t13; + timerConfig.timer = IfxCcu6_TimerId_t13; timerConfig.interrupt2.source = IfxCcu6_InterruptSource_t13PeriodMatch; timerConfig.interrupt2.serviceRequest = IfxCcu6_ServiceRequest_2; timerConfig.base.t13Period = timer_period; timerConfig.base.t13Frequency = (float)timer_input_clk; timerConfig.clock.t13countingInputMode = IfxCcu6_CountingInputMode_internal; } - - - timerConfig.timer = timer_id; - timerConfig.timer12.counterValue = 0; timerConfig.timer13.counterValue = 0; timerConfig.trigger.t13InSyncWithT12 = FALSE; @@ -126,5 +121,78 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time) restoreInterrupts(interrupt_state); + IfxCcu6_setSuspendMode(module, IfxCcu6_SuspendMode_hard); IfxCcu6_Timer_start(&g_Ccu6Timer); } + +//------------------------------------------------------------------------------------------------------------------- +// @brief pit关闭 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_close(CCU6_0, PIT_CH0); //关闭CCU60 通道0的计时器 +//------------------------------------------------------------------------------------------------------------------- +void pit_close(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + IfxCcu6_Timer g_Ccu6Timer; + + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + + g_Ccu6Timer.ccu6 = module; + g_Ccu6Timer.timer = (IfxCcu6_TimerId)(pit_ch); + + IfxCcu6_Timer_stop(&g_Ccu6Timer); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief pit开始 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_start(CCU6_0, PIT_CH0); //打开CCU60 通道0的计时器 +//------------------------------------------------------------------------------------------------------------------- +void pit_start(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + IfxCcu6_Timer g_Ccu6Timer; + + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + + g_Ccu6Timer.ccu6 = module; + g_Ccu6Timer.timer = (IfxCcu6_TimerId)(pit_ch); + + IfxCcu6_Timer_start(&g_Ccu6Timer); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief 禁止pit中断 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_disable_interrupt(CCU6_0, PIT_CH0); //禁止CCU60 通道0的中断 +//------------------------------------------------------------------------------------------------------------------- +void pit_disable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + IfxCcu6_disableInterrupt(module, pit_ch * 2 + 7); +} + +//------------------------------------------------------------------------------------------------------------------- +// @brief 使能pit中断 +// @param ccu6n 选择CCU6模块(CCU6_0、CCU6_1) +// @param pit_ch 选择通道(PIT_CH0、PIT_CH1) +// @return void +// @note +// Sample usage: pit_enable_interrupt(CCU6_0, PIT_CH0); //开启CCU60 通道0的中断 +//------------------------------------------------------------------------------------------------------------------- +void pit_enable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch) +{ + volatile Ifx_CCU6 *module; + module = IfxCcu6_getAddress((IfxCcu6_Index)ccu6n); + IfxCcu6_enableInterrupt(module, pit_ch * 2 + 7); +} diff --git a/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h b/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h index 97994ea..22a3a79 100644 --- a/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h +++ b/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.h @@ -46,7 +46,10 @@ typedef enum //枚 void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time); - +void pit_close(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_start(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_disable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); +void pit_enable_interrupt(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch); //------------------------------------以下代码用于PIT中断------------------------------------ diff --git a/Example/9-PWM_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c b/Example/9-PWM_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c index 96692b7..1640b41 100644 --- a/Example/9-PWM_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c +++ b/Example/9-PWM_Demo/Libraries/seekfree_peripheral/SEEKFREE_RDA5807.c @@ -196,7 +196,7 @@ void rda5807_init(float freq) //复位 rad5807m_simiic_write(FM_ADDRESS,dat,2); - systick_delay_ms(STM0, 600); + systick_delay_ms(STM0, 50); while(rda5807_read_reg[8] != 0x58) { diff --git a/Example/9-PWM_Demo/鎺ㄨ崘IO鍒嗛厤.txt b/Example/9-PWM_Demo/鎺ㄨ崘IO鍒嗛厤.txt index df0fa4f..199fe87 100644 --- a/Example/9-PWM_Demo/鎺ㄨ崘IO鍒嗛厤.txt +++ b/Example/9-PWM_Demo/鎺ㄨ崘IO鍒嗛厤.txt @@ -3,6 +3,7 @@ 数据口:00_0 00_1 00_2 00_3 00_4 00_5 00_6 00_7 配置串口:摄像头RX:02_2 摄像头TX:02_3 VSY:02_0 + HREF:程序不需要,所以不接 PCLK:02_1 四路运放 A0 A1 A2 A3 等 diff --git a/Seekfree_TC264_Opensource_Library/.cproject b/Seekfree_TC264_Opensource_Library/.cproject index c7e8979..311d388 100644 --- a/Seekfree_TC264_Opensource_Library/.cproject +++ b/Seekfree_TC264_Opensource_Library/.cproject @@ -162,7 +162,7 @@