├── Readme.md ├── STM32F4_QCopter_20130617 ├── Libraries │ ├── CMSIS │ │ ├── BasicMathFunctions │ │ │ ├── arm_abs_f32.c │ │ │ ├── arm_abs_q15.c │ │ │ ├── arm_abs_q31.c │ │ │ ├── arm_abs_q7.c │ │ │ ├── arm_add_f32.c │ │ │ ├── arm_add_q15.c │ │ │ ├── arm_add_q31.c │ │ │ ├── arm_add_q7.c │ │ │ ├── arm_dot_prod_f32.c │ │ │ ├── arm_dot_prod_q15.c │ │ │ ├── arm_dot_prod_q31.c │ │ │ ├── arm_dot_prod_q7.c │ │ │ ├── arm_mult_f32.c │ │ │ ├── arm_mult_q15.c │ │ │ ├── arm_mult_q31.c │ │ │ ├── arm_mult_q7.c │ │ │ ├── arm_negate_f32.c │ │ │ ├── arm_negate_q15.c │ │ │ ├── arm_negate_q31.c │ │ │ ├── arm_negate_q7.c │ │ │ ├── arm_offset_f32.c │ │ │ ├── arm_offset_q15.c │ │ │ ├── arm_offset_q31.c │ │ │ ├── arm_offset_q7.c │ │ │ ├── arm_scale_f32.c │ │ │ ├── arm_scale_q15.c │ │ │ ├── arm_scale_q31.c │ │ │ ├── arm_scale_q7.c │ │ │ ├── arm_shift_q15.c │ │ │ ├── arm_shift_q31.c │ │ │ ├── arm_shift_q7.c │ │ │ ├── arm_sub_f32.c │ │ │ ├── arm_sub_q15.c │ │ │ ├── arm_sub_q31.c │ │ │ └── arm_sub_q7.c │ │ ├── CommonTables │ │ │ └── arm_common_tables.c │ │ ├── ComplexMathFunctions │ │ │ ├── arm_cmplx_conj_f32.c │ │ │ ├── arm_cmplx_conj_q15.c │ │ │ ├── arm_cmplx_conj_q31.c │ │ │ ├── arm_cmplx_dot_prod_f32.c │ │ │ ├── arm_cmplx_dot_prod_q15.c │ │ │ ├── arm_cmplx_dot_prod_q31.c │ │ │ ├── arm_cmplx_mag_f32.c │ │ │ ├── arm_cmplx_mag_q15.c │ │ │ ├── arm_cmplx_mag_q31.c │ │ │ ├── arm_cmplx_mag_squared_f32.c │ │ │ ├── arm_cmplx_mag_squared_q15.c │ │ │ ├── arm_cmplx_mag_squared_q31.c │ │ │ ├── arm_cmplx_mult_cmplx_f32.c │ │ │ ├── arm_cmplx_mult_cmplx_q15.c │ │ │ ├── arm_cmplx_mult_cmplx_q31.c │ │ │ ├── arm_cmplx_mult_real_f32.c │ │ │ ├── arm_cmplx_mult_real_q15.c │ │ │ └── arm_cmplx_mult_real_q31.c │ │ ├── ControllerFunctions │ │ │ ├── arm_pid_init_f32.c │ │ │ ├── arm_pid_init_q15.c │ │ │ ├── arm_pid_init_q31.c │ │ │ ├── arm_pid_reset_f32.c │ │ │ ├── arm_pid_reset_q15.c │ │ │ ├── arm_pid_reset_q31.c │ │ │ ├── arm_sin_cos_f32.c │ │ │ └── arm_sin_cos_q31.c │ │ ├── FastMathFunctions │ │ │ ├── arm_cos_f32.c │ │ │ ├── arm_cos_q15.c │ │ │ ├── arm_cos_q31.c │ │ │ ├── arm_sin_f32.c │ │ │ ├── arm_sin_q15.c │ │ │ ├── arm_sin_q31.c │ │ │ ├── arm_sqrt_q15.c │ │ │ └── arm_sqrt_q31.c │ │ ├── FilteringFunctions │ │ │ ├── arm_biquad_cascade_df1_32x64_init_q31.c │ │ │ ├── arm_biquad_cascade_df1_32x64_q31.c │ │ │ ├── arm_biquad_cascade_df1_f32.c │ │ │ ├── arm_biquad_cascade_df1_fast_q15.c │ │ │ ├── arm_biquad_cascade_df1_fast_q31.c │ │ │ ├── arm_biquad_cascade_df1_init_f32.c │ │ │ ├── arm_biquad_cascade_df1_init_q15.c │ │ │ ├── arm_biquad_cascade_df1_init_q31.c │ │ │ ├── arm_biquad_cascade_df1_q15.c │ │ │ ├── arm_biquad_cascade_df1_q31.c │ │ │ ├── arm_biquad_cascade_df2T_f32.c │ │ │ ├── arm_biquad_cascade_df2T_init_f32.c │ │ │ ├── arm_conv_f32.c │ │ │ ├── arm_conv_fast_opt_q15.c │ │ │ ├── arm_conv_fast_q15.c │ │ │ ├── arm_conv_fast_q31.c │ │ │ ├── arm_conv_opt_q15.c │ │ │ ├── arm_conv_opt_q7.c │ │ │ ├── arm_conv_partial_f32.c │ │ │ ├── arm_conv_partial_fast_opt_q15.c │ │ │ ├── arm_conv_partial_fast_q15.c │ │ │ ├── arm_conv_partial_fast_q31.c │ │ │ ├── arm_conv_partial_opt_q15.c │ │ │ ├── arm_conv_partial_opt_q7.c │ │ │ ├── arm_conv_partial_q15.c │ │ │ ├── arm_conv_partial_q31.c │ │ │ ├── arm_conv_partial_q7.c │ │ │ ├── arm_conv_q15.c │ │ │ ├── arm_conv_q31.c │ │ │ ├── arm_conv_q7.c │ │ │ ├── arm_correlate_f32.c │ │ │ ├── arm_correlate_fast_opt_q15.c │ │ │ ├── arm_correlate_fast_q15.c │ │ │ ├── arm_correlate_fast_q31.c │ │ │ ├── arm_correlate_opt_q15.c │ │ │ ├── arm_correlate_opt_q7.c │ │ │ ├── arm_correlate_q15.c │ │ │ ├── arm_correlate_q31.c │ │ │ ├── arm_correlate_q7.c │ │ │ ├── arm_fir_decimate_f32.c │ │ │ ├── arm_fir_decimate_fast_q15.c │ │ │ ├── arm_fir_decimate_fast_q31.c │ │ │ ├── arm_fir_decimate_init_f32.c │ │ │ ├── arm_fir_decimate_init_q15.c │ │ │ ├── arm_fir_decimate_init_q31.c │ │ │ ├── arm_fir_decimate_q15.c │ │ │ ├── arm_fir_decimate_q31.c │ │ │ ├── arm_fir_f32.c │ │ │ ├── arm_fir_fast_q15.c │ │ │ ├── arm_fir_fast_q31.c │ │ │ ├── arm_fir_init_f32.c │ │ │ ├── arm_fir_init_q15.c │ │ │ ├── arm_fir_init_q31.c │ │ │ ├── arm_fir_init_q7.c │ │ │ ├── arm_fir_interpolate_f32.c │ │ │ ├── arm_fir_interpolate_init_f32.c │ │ │ ├── arm_fir_interpolate_init_q15.c │ │ │ ├── arm_fir_interpolate_init_q31.c │ │ │ ├── arm_fir_interpolate_q15.c │ │ │ ├── arm_fir_interpolate_q31.c │ │ │ ├── arm_fir_lattice_f32.c │ │ │ ├── arm_fir_lattice_init_f32.c │ │ │ ├── arm_fir_lattice_init_q15.c │ │ │ ├── arm_fir_lattice_init_q31.c │ │ │ ├── arm_fir_lattice_q15.c │ │ │ ├── arm_fir_lattice_q31.c │ │ │ ├── arm_fir_q15.c │ │ │ ├── arm_fir_q31.c │ │ │ ├── arm_fir_q7.c │ │ │ ├── arm_fir_sparse_f32.c │ │ │ ├── arm_fir_sparse_init_f32.c │ │ │ ├── arm_fir_sparse_init_q15.c │ │ │ ├── arm_fir_sparse_init_q31.c │ │ │ ├── arm_fir_sparse_init_q7.c │ │ │ ├── arm_fir_sparse_q15.c │ │ │ ├── arm_fir_sparse_q31.c │ │ │ ├── arm_fir_sparse_q7.c │ │ │ ├── arm_iir_lattice_f32.c │ │ │ ├── arm_iir_lattice_init_f32.c │ │ │ ├── arm_iir_lattice_init_q15.c │ │ │ ├── arm_iir_lattice_init_q31.c │ │ │ ├── arm_iir_lattice_q15.c │ │ │ ├── arm_iir_lattice_q31.c │ │ │ ├── arm_lms_f32.c │ │ │ ├── arm_lms_init_f32.c │ │ │ ├── arm_lms_init_q15.c │ │ │ ├── arm_lms_init_q31.c │ │ │ ├── arm_lms_norm_f32.c │ │ │ ├── arm_lms_norm_init_f32.c │ │ │ ├── arm_lms_norm_init_q15.c │ │ │ ├── arm_lms_norm_init_q31.c │ │ │ ├── arm_lms_norm_q15.c │ │ │ ├── arm_lms_norm_q31.c │ │ │ ├── arm_lms_q15.c │ │ │ └── arm_lms_q31.c │ │ ├── MatrixFunctions │ │ │ ├── arm_mat_add_f32.c │ │ │ ├── arm_mat_add_q15.c │ │ │ ├── arm_mat_add_q31.c │ │ │ ├── arm_mat_init_f32.c │ │ │ ├── arm_mat_init_q15.c │ │ │ ├── arm_mat_init_q31.c │ │ │ ├── arm_mat_inverse_f32.c │ │ │ ├── arm_mat_mult_f32.c │ │ │ ├── arm_mat_mult_fast_q15.c │ │ │ ├── arm_mat_mult_fast_q31.c │ │ │ ├── arm_mat_mult_q15.c │ │ │ ├── arm_mat_mult_q31.c │ │ │ ├── arm_mat_scale_f32.c │ │ │ ├── arm_mat_scale_q15.c │ │ │ ├── arm_mat_scale_q31.c │ │ │ ├── arm_mat_sub_f32.c │ │ │ ├── arm_mat_sub_q15.c │ │ │ ├── arm_mat_sub_q31.c │ │ │ ├── arm_mat_trans_f32.c │ │ │ ├── arm_mat_trans_q15.c │ │ │ └── arm_mat_trans_q31.c │ │ ├── StatisticsFunctions │ │ │ ├── arm_max_f32.c │ │ │ ├── arm_max_q15.c │ │ │ ├── arm_max_q31.c │ │ │ ├── arm_max_q7.c │ │ │ ├── arm_mean_f32.c │ │ │ ├── arm_mean_q15.c │ │ │ ├── arm_mean_q31.c │ │ │ ├── arm_mean_q7.c │ │ │ ├── arm_min_f32.c │ │ │ ├── arm_min_q15.c │ │ │ ├── arm_min_q31.c │ │ │ ├── arm_min_q7.c │ │ │ ├── arm_power_f32.c │ │ │ ├── arm_power_q15.c │ │ │ ├── arm_power_q31.c │ │ │ ├── arm_power_q7.c │ │ │ ├── arm_rms_f32.c │ │ │ ├── arm_rms_q15.c │ │ │ ├── arm_rms_q31.c │ │ │ ├── arm_std_f32.c │ │ │ ├── arm_std_q15.c │ │ │ ├── arm_std_q31.c │ │ │ ├── arm_var_f32.c │ │ │ ├── arm_var_q15.c │ │ │ └── arm_var_q31.c │ │ ├── SupportFunctions │ │ │ ├── arm_copy_f32.c │ │ │ ├── arm_copy_q15.c │ │ │ ├── arm_copy_q31.c │ │ │ ├── arm_copy_q7.c │ │ │ ├── arm_fill_f32.c │ │ │ ├── arm_fill_q15.c │ │ │ ├── arm_fill_q31.c │ │ │ ├── arm_fill_q7.c │ │ │ ├── arm_float_to_q15.c │ │ │ ├── arm_float_to_q31.c │ │ │ ├── arm_float_to_q7.c │ │ │ ├── arm_q15_to_float.c │ │ │ ├── arm_q15_to_q31.c │ │ │ ├── arm_q15_to_q7.c │ │ │ ├── arm_q31_to_float.c │ │ │ ├── arm_q31_to_q15.c │ │ │ ├── arm_q31_to_q7.c │ │ │ ├── arm_q7_to_float.c │ │ │ ├── arm_q7_to_q15.c │ │ │ └── arm_q7_to_q31.c │ │ ├── TransformFunctions │ │ │ ├── arm_bitreversal.c │ │ │ ├── arm_cfft_radix2_f32.c │ │ │ ├── arm_cfft_radix2_init_f32.c │ │ │ ├── arm_cfft_radix2_init_q15.c │ │ │ ├── arm_cfft_radix2_init_q31.c │ │ │ ├── arm_cfft_radix2_q15.c │ │ │ ├── arm_cfft_radix2_q31.c │ │ │ ├── arm_cfft_radix4_f32.c │ │ │ ├── arm_cfft_radix4_init_f32.c │ │ │ ├── arm_cfft_radix4_init_q15.c │ │ │ ├── arm_cfft_radix4_init_q31.c │ │ │ ├── arm_cfft_radix4_q15.c │ │ │ ├── arm_cfft_radix4_q31.c │ │ │ ├── arm_dct4_f32.c │ │ │ ├── arm_dct4_init_f32.c │ │ │ ├── arm_dct4_init_q15.c │ │ │ ├── arm_dct4_init_q31.c │ │ │ ├── arm_dct4_q15.c │ │ │ ├── arm_dct4_q31.c │ │ │ ├── arm_rfft_f32.c │ │ │ ├── arm_rfft_init_f32.c │ │ │ ├── arm_rfft_init_q15.c │ │ │ ├── arm_rfft_init_q31.c │ │ │ ├── arm_rfft_q15.c │ │ │ └── arm_rfft_q31.c │ │ ├── arm_common_tables.h │ │ ├── arm_math.h │ │ ├── cmsis_os.h │ │ ├── core_cm0.h │ │ ├── core_cm0plus.h │ │ ├── core_cm3.h │ │ ├── core_cm4.h │ │ ├── core_cm4_simd.h │ │ ├── core_cmFunc.h │ │ ├── core_cmInstr.h │ │ ├── core_sc000.h │ │ ├── core_sc300.h │ │ ├── startup │ │ │ ├── startup_stm32f40xx.s │ │ │ └── startup_stm32f427x.s │ │ ├── stm32f4xx.h │ │ ├── system_stm32f4xx.c │ │ └── system_stm32f4xx.h │ ├── Fatfs │ │ ├── inc │ │ │ ├── diskio.h │ │ │ ├── ffconf.h │ │ │ ├── integer.h │ │ │ └── system_fatfs.h │ │ ├── readme.txt │ │ └── src │ │ │ ├── diskio.c │ │ │ ├── option │ │ │ ├── cc932.c │ │ │ ├── cc936.c │ │ │ ├── cc949.c │ │ │ ├── cc950.c │ │ │ ├── ccsbcs.c │ │ │ ├── syscall.c │ │ │ └── unicode.c │ │ │ └── system_fatfs.c │ └── STM32F4xx_StdPeriph_Driver │ │ ├── inc │ │ ├── misc.h │ │ ├── stm32f4xx_adc.h │ │ ├── stm32f4xx_can.h │ │ ├── stm32f4xx_crc.h │ │ ├── stm32f4xx_cryp.h │ │ ├── stm32f4xx_dac.h │ │ ├── stm32f4xx_dbgmcu.h │ │ ├── stm32f4xx_dcmi.h │ │ ├── stm32f4xx_dma.h │ │ ├── stm32f4xx_exti.h │ │ ├── stm32f4xx_flash.h │ │ ├── stm32f4xx_fsmc.h │ │ ├── stm32f4xx_gpio.h │ │ ├── stm32f4xx_hash.h │ │ ├── stm32f4xx_i2c.h │ │ ├── stm32f4xx_iwdg.h │ │ ├── stm32f4xx_pwr.h │ │ ├── stm32f4xx_rcc.h │ │ ├── stm32f4xx_rng.h │ │ ├── stm32f4xx_rtc.h │ │ ├── stm32f4xx_sdio.h │ │ ├── stm32f4xx_spi.h │ │ ├── stm32f4xx_syscfg.h │ │ ├── stm32f4xx_tim.h │ │ ├── stm32f4xx_usart.h │ │ └── stm32f4xx_wwdg.h │ │ └── src │ │ ├── misc.c │ │ ├── stm32f4xx_adc.c │ │ ├── stm32f4xx_can.c │ │ ├── stm32f4xx_crc.c │ │ ├── stm32f4xx_cryp.c │ │ ├── stm32f4xx_cryp_aes.c │ │ ├── stm32f4xx_cryp_des.c │ │ ├── stm32f4xx_cryp_tdes.c │ │ ├── stm32f4xx_dac.c │ │ ├── stm32f4xx_dbgmcu.c │ │ ├── stm32f4xx_dcmi.c │ │ ├── stm32f4xx_dma.c │ │ ├── stm32f4xx_exti.c │ │ ├── stm32f4xx_flash.c │ │ ├── stm32f4xx_fsmc.c │ │ ├── stm32f4xx_gpio.c │ │ ├── stm32f4xx_hash.c │ │ ├── stm32f4xx_hash_md5.c │ │ ├── stm32f4xx_hash_sha1.c │ │ ├── stm32f4xx_i2c.c │ │ ├── stm32f4xx_iwdg.c │ │ ├── stm32f4xx_pwr.c │ │ ├── stm32f4xx_rcc.c │ │ ├── stm32f4xx_rng.c │ │ ├── stm32f4xx_rtc.c │ │ ├── stm32f4xx_sdio.c │ │ ├── stm32f4xx_spi.c │ │ ├── stm32f4xx_syscfg.c │ │ ├── stm32f4xx_tim.c │ │ ├── stm32f4xx_usart.c │ │ └── stm32f4xx_wwdg.c ├── Program_Algorithm │ ├── algorithm_bubbleSort.c │ ├── algorithm_bubblesort.h │ ├── algorithm_kalman.c │ ├── algorithm_kalman.h │ ├── algorithm_mathUnit.c │ ├── algorithm_mathUnit.h │ ├── algorithm_moveAve.c │ ├── algorithm_moveAve.h │ ├── algorithm_pid.c │ ├── algorithm_pid.h │ ├── algorithm_quaternion.c │ └── algorithm_quaternion.h ├── Program_Dirver │ ├── stm32f4_adc.c │ ├── stm32f4_adc.h │ ├── stm32f4_delay.c │ ├── stm32f4_delay.h │ ├── stm32f4_i2c.c │ ├── stm32f4_i2c.h │ ├── stm32f4_sdio.c │ ├── stm32f4_sdio.h │ ├── stm32f4_spi.c │ ├── stm32f4_spi.h │ ├── stm32f4_system.c │ ├── stm32f4_system.h │ ├── stm32f4_typedef.h │ ├── stm32f4_usart.c │ └── stm32f4_usart.h ├── Program_Master │ ├── QCopter.c │ ├── QCopter.h │ ├── QCopter_it.c │ ├── lcd.c │ ├── lcd.h │ ├── module_fontlib.h │ ├── module_keyBoard.c │ ├── module_keyBoard.h │ ├── module_nrf24l01.c │ ├── module_nrf24l01.h │ ├── module_rs232.c │ ├── module_rs232.h │ ├── module_ssd1963.c │ ├── module_ssd1963.h │ ├── module_xpt2046.c │ ├── module_xpt2046.h │ ├── stm32f4xx_conf.h │ ├── system_engine3D.c │ ├── system_engine3D.h │ ├── system_waveForm.c │ ├── system_waveForm.h │ ├── system_windows.c │ ├── system_windows.h │ ├── tft_spi.c │ └── tft_spi.h ├── Program_Slave │ ├── QCopter.c │ ├── QCopter.h │ ├── QCopter_AHRS.c │ ├── QCopter_AHRS.h │ ├── QCopter_CTRL.c │ ├── QCopter_CTRL.h │ ├── QCopter_it.c │ ├── module_bmp085.c │ ├── module_bmp085.h │ ├── module_keyBoard.c │ ├── module_keyBoard.h │ ├── module_l3g4200.c │ ├── module_l3g4200.h │ ├── module_lsm303.c │ ├── module_lsm303.h │ ├── module_motor.c │ ├── module_motor.h │ ├── module_nrf24l01.c │ ├── module_nrf24l01.h │ ├── module_rs232.c │ ├── module_rs232.h │ ├── module_sensor.c │ ├── module_sensor.h │ └── stm32f4xx_conf.h ├── Project_MasterV3 │ ├── Program_STM32.uvopt │ ├── Program_STM32.uvproj │ └── Readme.txt ├── Project_SlaveV2 │ ├── Program_STM32.uvopt │ ├── Program_STM32.uvproj │ └── Readme.txt ├── STM32F4.xlsx └── Tool │ ├── AccessPort137.rar │ ├── AccessPort137 │ ├── AccessPort.exe │ ├── AccessPort.ini │ ├── Apsm.sys │ ├── Apsm_x64.sys │ ├── Language │ │ ├── apchs.ini │ │ ├── apcht.ini │ │ ├── apeng.ini │ │ └── aprus.ini │ ├── license.txt │ ├── readme_en_US.txt │ ├── readme_zh_CN.txt │ └── readme_zh_TW.txt │ ├── Img2Lcd │ ├── Img2Lcd.exe │ ├── Img2Lcd_chs.chm │ └── SSS.DLL │ ├── TFT助手.rar │ ├── VisualScope │ ├── CRC16_code.txt │ ├── VisualScope.exe │ ├── VisualScope.exe使用說明.pdf │ ├── acc.dat │ ├── config.dat │ ├── readme.txt │ ├── sample.dat │ └── 新建 文本文檔.txt │ └── putty.exe ├── 四軸飛行器_專題報告.pdf ├── 四軸飛行器_專題海報.pdf ├── 四軸飛行器_研究紀錄_20130615.pdf ├── 推導_PID控制器.pdf ├── 推導_四元數.pdf ├── 推導_橢圓擬合.pdf └── 無人飛行載具_四軸飛行器.pdf /Readme.md: -------------------------------------------------------------------------------- 1 | Quadcopter 2 | ======== 3 | * Author : [Hom](https://github.com/Hom19910422) 4 | * Update : 2013/12/07 5 | * Description : 6 | 101年的大學專題,專題成果大致可以達到平衡(不太穩),但尚無法懸停, 7 | 需要更新、更穩定的飛控版本請到 [QCopterFC](https://github.com/Hom19910422/QCopterFlightControl) 下載,這裡將不再做更新。 8 | 9 | 飛控板 10 | ======== 11 | * 控制器 STM32F405RG 64Pin 168MHz DSP FPU 12 | * 感測器 L3G4200 + LSM303 13 | * 無線傳輸 nRF24L01P + PA + LNA 14 | * 6個PWM通道 連接電調、LED、PPM 15 | * 1個UART接口 可擴充GPS模組、藍芽模組、電腦傳輸RS232 16 | 17 | 遙控器 18 | ======== 19 | * 控制器 STM32F407VG 100Pin 168MHz DSP FPU 20 | * 顯示器 4.3吋螢幕,480*242,SSD1963 21 | * 無線傳輸 nRF24L01P + PA + LNA 22 | * 儲存紀錄 SD卡,使用SDIO操作 23 | * 1個I2C接口 外擴其他裝置 24 | * 1個UART接口 可擴充GPS模組、藍芽模組、電腦傳輸RS232 25 | * DEMO Videos https://www.youtube.com/watch?v=KsObp2a2QdA 26 |
27 |
28 | 四軸飛行器
29 |
30 |
31 | 飛控板
32 |
33 |
34 | 遙控器正面
35 |
36 |
37 | 遙控器背面
38 |
39 |
40 | 螢幕主畫面
41 |
42 |
43 | 螢幕示波器
44 |
45 |
46 | 螢幕測試
47 |
48 |
49 |
resetStateFlag
specifies whether to set state to zero or not. \n
49 | * The function computes the structure fields: A0
, A1
A2
50 | * using the proportional gain( \c Kp), integral gain( \c Ki) and derivative gain( \c Kd)
51 | * also sets the state variables to all zeros.
52 | */
53 |
54 | void arm_pid_init_f32(
55 | arm_pid_instance_f32 * S,
56 | int32_t resetStateFlag)
57 | {
58 |
59 | /* Derived coefficient A0 */
60 | S->A0 = S->Kp + S->Ki + S->Kd;
61 |
62 | /* Derived coefficient A1 */
63 | S->A1 = (-S->Kp) - ((float32_t) 2.0 * S->Kd);
64 |
65 | /* Derived coefficient A2 */
66 | S->A2 = S->Kd;
67 |
68 | /* Check whether state needs reset or not */
69 | if(resetStateFlag)
70 | {
71 | /* Clear the state buffer. The size will be always 3 samples */
72 | memset(S->state, 0, 3u * sizeof(float32_t));
73 | }
74 |
75 | }
76 |
77 | /**
78 | * @} end of PID group
79 | */
80 |
--------------------------------------------------------------------------------
/STM32F4_QCopter_20130617/Libraries/CMSIS/ControllerFunctions/arm_pid_init_q15.c:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. February 2012
5 | * $Revision: V1.1.0
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_pid_init_q15.c
9 | *
10 | * Description: Q15 PID Control initialization function
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.1.0 2012/02/15
15 | * Updated with more optimizations, bug fixes and minor API changes.
16 | *
17 | * Version 1.0.10 2011/7/15
18 | * Big Endian support added and Merged M0 and M3/M4 Source code.
19 | *
20 | * Version 1.0.3 2010/11/29
21 | * Re-organized the CMSIS folders and updated documentation.
22 | *
23 | * Version 1.0.2 2010/11/11
24 | * Documentation updated.
25 | *
26 | * Version 1.0.1 2010/10/05
27 | * Production release and review comments incorporated.
28 | *
29 | * Version 1.0.0 2010/09/20
30 | * Production release and review comments incorporated.
31 | * -------------------------------------------------------------------- */
32 |
33 | #include "arm_math.h"
34 |
35 | /**
36 | * @addtogroup PID
37 | * @{
38 | */
39 |
40 | /**
41 | * @details
42 | * @param[in,out] *S points to an instance of the Q15 PID structure.
43 | * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state.
44 | * @return none.
45 | * \par Description:
46 | * \par
47 | * The resetStateFlag
specifies whether to set state to zero or not. \n
48 | * The function computes the structure fields: A0
, A1
A2
49 | * using the proportional gain( \c Kp), integral gain( \c Ki) and derivative gain( \c Kd)
50 | * also sets the state variables to all zeros.
51 | */
52 |
53 | void arm_pid_init_q15(
54 | arm_pid_instance_q15 * S,
55 | int32_t resetStateFlag)
56 | {
57 |
58 | #ifndef ARM_MATH_CM0
59 |
60 | /* Run the below code for Cortex-M4 and Cortex-M3 */
61 |
62 | /* Derived coefficient A0 */
63 | S->A0 = __QADD16(__QADD16(S->Kp, S->Ki), S->Kd);
64 |
65 | /* Derived coefficients and pack into A1 */
66 |
67 | #ifndef ARM_MATH_BIG_ENDIAN
68 |
69 | S->A1 = __PKHBT(-__QADD16(__QADD16(S->Kd, S->Kd), S->Kp), S->Kd, 16);
70 |
71 | #else
72 |
73 | S->A1 = __PKHBT(S->Kd, -__QADD16(__QADD16(S->Kd, S->Kd), S->Kp), 16);
74 |
75 | #endif /* #ifndef ARM_MATH_BIG_ENDIAN */
76 |
77 | /* Check whether state needs reset or not */
78 | if(resetStateFlag)
79 | {
80 | /* Clear the state buffer. The size will be always 3 samples */
81 | memset(S->state, 0, 3u * sizeof(q15_t));
82 | }
83 |
84 | #else
85 |
86 | /* Run the below code for Cortex-M0 */
87 |
88 | q31_t temp; /*to store the sum */
89 |
90 | /* Derived coefficient A0 */
91 | temp = S->Kp + S->Ki + S->Kd;
92 | S->A0 = (q15_t) __SSAT(temp, 16);
93 |
94 | /* Derived coefficients and pack into A1 */
95 | temp = -(S->Kd + S->Kd + S->Kp);
96 | S->A1 = (q15_t) __SSAT(temp, 16);
97 | S->A2 = S->Kd;
98 |
99 |
100 |
101 | /* Check whether state needs reset or not */
102 | if(resetStateFlag)
103 | {
104 | /* Clear the state buffer. The size will be always 3 samples */
105 | memset(S->state, 0, 3u * sizeof(q15_t));
106 | }
107 |
108 | #endif /* #ifndef ARM_MATH_CM0 */
109 |
110 | }
111 |
112 | /**
113 | * @} end of PID group
114 | */
115 |
--------------------------------------------------------------------------------
/STM32F4_QCopter_20130617/Libraries/CMSIS/ControllerFunctions/arm_pid_init_q31.c:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. February 2012
5 | * $Revision: V1.1.0
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_pid_init_q31.c
9 | *
10 | * Description: Q31 PID Control initialization function
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.1.0 2012/02/15
15 | * Updated with more optimizations, bug fixes and minor API changes.
16 | *
17 | * Version 1.0.10 2011/7/15
18 | * Big Endian support added and Merged M0 and M3/M4 Source code.
19 | *
20 | * Version 1.0.3 2010/11/29
21 | * Re-organized the CMSIS folders and updated documentation.
22 | *
23 | * Version 1.0.2 2010/11/11
24 | * Documentation updated.
25 | *
26 | * Version 1.0.1 2010/10/05
27 | * Production release and review comments incorporated.
28 | *
29 | * Version 1.0.0 2010/09/20
30 | * Production release and review comments incorporated.
31 | * ------------------------------------------------------------------- */
32 |
33 | #include "arm_math.h"
34 |
35 | /**
36 | * @addtogroup PID
37 | * @{
38 | */
39 |
40 | /**
41 | * @brief Initialization function for the Q31 PID Control.
42 | * @param[in,out] *S points to an instance of the Q31 PID structure.
43 | * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state.
44 | * @return none.
45 | * \par Description:
46 | * \par
47 | * The resetStateFlag
specifies whether to set state to zero or not. \n
48 | * The function computes the structure fields: A0
, A1
A2
49 | * using the proportional gain( \c Kp), integral gain( \c Ki) and derivative gain( \c Kd)
50 | * also sets the state variables to all zeros.
51 | */
52 |
53 | void arm_pid_init_q31(
54 | arm_pid_instance_q31 * S,
55 | int32_t resetStateFlag)
56 | {
57 |
58 | #ifndef ARM_MATH_CM0
59 |
60 | /* Run the below code for Cortex-M4 and Cortex-M3 */
61 |
62 | /* Derived coefficient A0 */
63 | S->A0 = __QADD(__QADD(S->Kp, S->Ki), S->Kd);
64 |
65 | /* Derived coefficient A1 */
66 | S->A1 = -__QADD(__QADD(S->Kd, S->Kd), S->Kp);
67 |
68 |
69 | #else
70 |
71 | /* Run the below code for Cortex-M0 */
72 |
73 | q31_t temp;
74 |
75 | /* Derived coefficient A0 */
76 | temp = clip_q63_to_q31((q63_t) S->Kp + S->Ki);
77 | S->A0 = clip_q63_to_q31((q63_t) temp + S->Kd);
78 |
79 | /* Derived coefficient A1 */
80 | temp = clip_q63_to_q31((q63_t) S->Kd + S->Kd);
81 | S->A1 = -clip_q63_to_q31((q63_t) temp + S->Kp);
82 |
83 | #endif /* #ifndef ARM_MATH_CM0 */
84 |
85 | /* Derived coefficient A2 */
86 | S->A2 = S->Kd;
87 |
88 | /* Check whether state needs reset or not */
89 | if(resetStateFlag)
90 | {
91 | /* Clear the state buffer. The size will be always 3 samples */
92 | memset(S->state, 0, 3u * sizeof(q31_t));
93 | }
94 |
95 | }
96 |
97 | /**
98 | * @} end of PID group
99 | */
100 |
--------------------------------------------------------------------------------
/STM32F4_QCopter_20130617/Libraries/CMSIS/ControllerFunctions/arm_pid_reset_f32.c:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. February 2012
5 | * $Revision: V1.1.0
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_pid_reset_f32.c
9 | *
10 | * Description: Floating-point PID Control reset function
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.1.0 2012/02/15
15 | * Updated with more optimizations, bug fixes and minor API changes.
16 | *
17 | * Version 1.0.10 2011/7/15
18 | * Big Endian support added and Merged M0 and M3/M4 Source code.
19 | *
20 | * Version 1.0.3 2010/11/29
21 | * Re-organized the CMSIS folders and updated documentation.
22 | *
23 | * Version 1.0.2 2010/11/11
24 | * Documentation updated.
25 | *
26 | * Version 1.0.1 2010/10/05
27 | * Production release and review comments incorporated.
28 | *
29 | * Version 1.0.0 2010/09/20
30 | * Production release and review comments incorporated.
31 | * ------------------------------------------------------------------- */
32 |
33 | #include "arm_math.h"
34 |
35 | /**
36 | * @addtogroup PID
37 | * @{
38 | */
39 |
40 | /**
41 | * @brief Reset function for the floating-point PID Control.
42 | * @param[in] *S Instance pointer of PID control data structure.
43 | * @return none.
44 | * \par Description:
45 | * The function resets the state buffer to zeros.
46 | */
47 | void arm_pid_reset_f32(
48 | arm_pid_instance_f32 * S)
49 | {
50 |
51 | /* Clear the state buffer. The size will be always 3 samples */
52 | memset(S->state, 0, 3u * sizeof(float32_t));
53 | }
54 |
55 | /**
56 | * @} end of PID group
57 | */
58 |
--------------------------------------------------------------------------------
/STM32F4_QCopter_20130617/Libraries/CMSIS/ControllerFunctions/arm_pid_reset_q15.c:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. February 2012
5 | * $Revision: V1.1.0
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_pid_reset_q15.c
9 | *
10 | * Description: Q15 PID Control reset function
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.1.0 2012/02/15
15 | * Updated with more optimizations, bug fixes and minor API changes.
16 | *
17 | * Version 1.0.10 2011/7/15
18 | * Big Endian support added and Merged M0 and M3/M4 Source code.
19 | *
20 | * Version 1.0.3 2010/11/29
21 | * Re-organized the CMSIS folders and updated documentation.
22 | *
23 | * Version 1.0.2 2010/11/11
24 | * Documentation updated.
25 | *
26 | * Version 1.0.1 2010/10/05
27 | * Production release and review comments incorporated.
28 | *
29 | * Version 1.0.0 2010/09/20
30 | * Production release and review comments incorporated.
31 | * -------------------------------------------------------------------- */
32 |
33 | #include "arm_math.h"
34 |
35 | /**
36 | * @addtogroup PID
37 | * @{
38 | */
39 |
40 | /**
41 | * @brief Reset function for the Q15 PID Control.
42 | * @param[in] *S Instance pointer of PID control data structure.
43 | * @return none.
44 | * \par Description:
45 | * The function resets the state buffer to zeros.
46 | */
47 | void arm_pid_reset_q15(
48 | arm_pid_instance_q15 * S)
49 | {
50 | /* Reset state to zero, The size will be always 3 samples */
51 | memset(S->state, 0, 3u * sizeof(q15_t));
52 | }
53 |
54 | /**
55 | * @} end of PID group
56 | */
57 |
--------------------------------------------------------------------------------
/STM32F4_QCopter_20130617/Libraries/CMSIS/ControllerFunctions/arm_pid_reset_q31.c:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. February 2012
5 | * $Revision: V1.1.0
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_pid_reset_q31.c
9 | *
10 | * Description: Q31 PID Control reset function
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.1.0 2012/02/15
15 | * Updated with more optimizations, bug fixes and minor API changes.
16 | *
17 | * Version 1.0.10 2011/7/15
18 | * Big Endian support added and Merged M0 and M3/M4 Source code.
19 | *
20 | * Version 1.0.3 2010/11/29
21 | * Re-organized the CMSIS folders and updated documentation.
22 | *
23 | * Version 1.0.2 2010/11/11
24 | * Documentation updated.
25 | *
26 | * Version 1.0.1 2010/10/05
27 | * Production release and review comments incorporated.
28 | *
29 | * Version 1.0.0 2010/09/20
30 | * Production release and review comments incorporated.
31 | * ------------------------------------------------------------------- */
32 |
33 | #include "arm_math.h"
34 |
35 | /**
36 | * @addtogroup PID
37 | * @{
38 | */
39 |
40 | /**
41 | * @brief Reset function for the Q31 PID Control.
42 | * @param[in] *S Instance pointer of PID control data structure.
43 | * @return none.
44 | * \par Description:
45 | * The function resets the state buffer to zeros.
46 | */
47 | void arm_pid_reset_q31(
48 | arm_pid_instance_q31 * S)
49 | {
50 |
51 | /* Clear the state buffer. The size will be always 3 samples */
52 | memset(S->state, 0, 3u * sizeof(q31_t));
53 | }
54 |
55 | /**
56 | * @} end of PID group
57 | */
58 |
--------------------------------------------------------------------------------
/STM32F4_QCopter_20130617/Libraries/CMSIS/FilteringFunctions/arm_biquad_cascade_df2T_init_f32.c:
--------------------------------------------------------------------------------
1 | /*-----------------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. February 2012
5 | * $Revision: V1.1.0
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_biquad_cascade_df2T_init_f32.c
9 | *
10 | * Description: Initialization function for the floating-point transposed
11 | * direct form II Biquad cascade filter.
12 | *
13 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
14 | *
15 | * Version 1.1.0 2012/02/15
16 | * Updated with more optimizations, bug fixes and minor API changes.
17 | *
18 | * Version 1.0.10 2011/7/15
19 | * Big Endian support added and Merged M0 and M3/M4 Source code.
20 | *
21 | * Version 1.0.3 2010/11/29
22 | * Re-organized the CMSIS folders and updated documentation.
23 | *
24 | * Version 1.0.2 2010/11/11
25 | * Documentation updated.
26 | *
27 | * Version 1.0.1 2010/10/05
28 | * Production release and review comments incorporated.
29 | *
30 | * Version 1.0.0 2010/09/20
31 | * Production release and review comments incorporated
32 | *
33 | * Version 0.0.7 2010/06/10
34 | * Misra-C changes done
35 | * ---------------------------------------------------------------------------*/
36 |
37 | #include "arm_math.h"
38 |
39 | /**
40 | * @ingroup groupFilters
41 | */
42 |
43 | /**
44 | * @addtogroup BiquadCascadeDF2T
45 | * @{
46 | */
47 |
48 | /**
49 | * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter.
50 | * @param[in,out] *S points to an instance of the filter data structure.
51 | * @param[in] numStages number of 2nd order stages in the filter.
52 | * @param[in] *pCoeffs points to the filter coefficients.
53 | * @param[in] *pState points to the state buffer.
54 | * @return none
55 | *
56 | * Coefficient and State Ordering:
57 | * \par
58 | * The coefficients are stored in the array pCoeffs
in the following order:
59 | * 60 | * {b10, b11, b12, a11, a12, b20, b21, b22, a21, a22, ...} 61 | *62 | * 63 | * \par 64 | * where
b1x
and a1x
are the coefficients for the first stage,
65 | * b2x
and a2x
are the coefficients for the second stage,
66 | * and so on. The pCoeffs
array contains a total of 5*numStages
values.
67 | *
68 | * \par
69 | * The pState
is a pointer to state array.
70 | * Each Biquad stage has 2 state variables d1,
and d2
.
71 | * The 2 state variables for stage 1 are first, then the 2 state variables for stage 2, and so on.
72 | * The state array has a total length of 2*numStages
values.
73 | * The state variables are updated after each block of data is processed; the coefficients are untouched.
74 | */
75 |
76 | void arm_biquad_cascade_df2T_init_f32(
77 | arm_biquad_cascade_df2T_instance_f32 * S,
78 | uint8_t numStages,
79 | float32_t * pCoeffs,
80 | float32_t * pState)
81 | {
82 | /* Assign filter stages */
83 | S->numStages = numStages;
84 |
85 | /* Assign coefficient pointer */
86 | S->pCoeffs = pCoeffs;
87 |
88 | /* Clear state buffer and size is always 2 * numStages */
89 | memset(pState, 0, (2u * (uint32_t) numStages) * sizeof(float32_t));
90 |
91 | /* Assign state pointer */
92 | S->pState = pState;
93 | }
94 |
95 | /**
96 | * @} end of BiquadCascadeDF2T group
97 | */
98 |
--------------------------------------------------------------------------------
/STM32F4_QCopter_20130617/Libraries/CMSIS/FilteringFunctions/arm_fir_decimate_init_q31.c:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. February 2012
5 | * $Revision: V1.1.0
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_fir_decimate_init_q31.c
9 | *
10 | * Description: Initialization function for Q31 FIR Decimation filter.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.1.0 2012/02/15
15 | * Updated with more optimizations, bug fixes and minor API changes.
16 | *
17 | * Version 1.0.10 2011/7/15
18 | * Big Endian support added and Merged M0 and M3/M4 Source code.
19 | *
20 | * Version 1.0.3 2010/11/29
21 | * Re-organized the CMSIS folders and updated documentation.
22 | *
23 | * Version 1.0.2 2010/11/11
24 | * Documentation updated.
25 | *
26 | * Version 1.0.1 2010/10/05
27 | * Production release and review comments incorporated.
28 | *
29 | * Version 1.0.0 2010/09/20
30 | * Production release and review comments incorporated
31 | *
32 | * Version 0.0.7 2010/06/10
33 | * Misra-C changes done
34 | * ------------------------------------------------------------------- */
35 |
36 | #include "arm_math.h"
37 |
38 | /**
39 | * @ingroup groupFilters
40 | */
41 |
42 | /**
43 | * @addtogroup FIR_decimate
44 | * @{
45 | */
46 |
47 | /**
48 | * @brief Initialization function for the Q31 FIR decimator.
49 | * @param[in,out] *S points to an instance of the Q31 FIR decimator structure.
50 | * @param[in] numTaps number of coefficients in the filter.
51 | * @param[in] M decimation factor.
52 | * @param[in] *pCoeffs points to the filter coefficients.
53 | * @param[in] *pState points to the state buffer.
54 | * @param[in] blockSize number of input samples to process per call.
55 | * @return The function returns ARM_MATH_SUCCESS if initialization was successful or ARM_MATH_LENGTH_ERROR if
56 | * blockSize
is not a multiple of M
.
57 | *
58 | * Description:
59 | * \par
60 | * pCoeffs
points to the array of filter coefficients stored in time reversed order:
61 | * 62 | * {b[numTaps-1], b[numTaps-2], b[N-2], ..., b[1], b[0]} 63 | *64 | * \par 65 | *
pState
points to the array of state variables.
66 | * pState
is of length numTaps+blockSize-1
words where blockSize
is the number of input samples passed to arm_fir_decimate_q31()
.
67 | * M
is the decimation factor.
68 | */
69 |
70 | arm_status arm_fir_decimate_init_q31(
71 | arm_fir_decimate_instance_q31 * S,
72 | uint16_t numTaps,
73 | uint8_t M,
74 | q31_t * pCoeffs,
75 | q31_t * pState,
76 | uint32_t blockSize)
77 | {
78 | arm_status status;
79 |
80 | /* The size of the input block must be a multiple of the decimation factor */
81 | if((blockSize % M) != 0u)
82 | {
83 | /* Set status as ARM_MATH_LENGTH_ERROR */
84 | status = ARM_MATH_LENGTH_ERROR;
85 | }
86 | else
87 | {
88 | /* Assign filter taps */
89 | S->numTaps = numTaps;
90 |
91 | /* Assign coefficient pointer */
92 | S->pCoeffs = pCoeffs;
93 |
94 | /* Clear the state buffer. The size is always (blockSize + numTaps - 1) */
95 | memset(pState, 0, (numTaps + (blockSize - 1)) * sizeof(q31_t));
96 |
97 | /* Assign state pointer */
98 | S->pState = pState;
99 |
100 | /* Assign Decimation factor */
101 | S->M = M;
102 |
103 | status = ARM_MATH_SUCCESS;
104 | }
105 |
106 | return (status);
107 |
108 | }
109 |
110 | /**
111 | * @} end of FIR_decimate group
112 | */
113 |
--------------------------------------------------------------------------------
/STM32F4_QCopter_20130617/Libraries/CMSIS/FilteringFunctions/arm_fir_init_f32.c:
--------------------------------------------------------------------------------
1 | /*-----------------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. February 2012
5 | * $Revision: V1.1.0
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_fir_init_f32.c
9 | *
10 | * Description: Floating-point FIR filter initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.1.0 2012/02/15
15 | * Updated with more optimizations, bug fixes and minor API changes.
16 | *
17 | * Version 1.0.10 2011/7/15
18 | * Big Endian support added and Merged M0 and M3/M4 Source code.
19 | *
20 | * Version 1.0.3 2010/11/29
21 | * Re-organized the CMSIS folders and updated documentation.
22 | *
23 | * Version 1.0.2 2010/11/11
24 | * Documentation updated.
25 | *
26 | * Version 1.0.1 2010/10/05
27 | * Production release and review comments incorporated.
28 | *
29 | * Version 1.0.0 2010/09/20
30 | * Production release and review comments incorporated.
31 | *
32 | * Version 0.0.5 2010/04/26
33 | * incorporated review comments and updated with latest CMSIS layer
34 | *
35 | * Version 0.0.3 2010/03/10
36 | * Initial version
37 | * ---------------------------------------------------------------------------*/
38 |
39 | #include "arm_math.h"
40 |
41 | /**
42 | * @ingroup groupFilters
43 | */
44 |
45 | /**
46 | * @addtogroup FIR
47 | * @{
48 | */
49 |
50 | /**
51 | * @details
52 | *
53 | * @param[in,out] *S points to an instance of the floating-point FIR filter structure.
54 | * @param[in] numTaps Number of filter coefficients in the filter.
55 | * @param[in] *pCoeffs points to the filter coefficients buffer.
56 | * @param[in] *pState points to the state buffer.
57 | * @param[in] blockSize number of samples that are processed per call.
58 | * @return none.
59 | *
60 | * Description:
61 | * \par
62 | * pCoeffs
points to the array of filter coefficients stored in time reversed order:
63 | * 64 | * {b[numTaps-1], b[numTaps-2], b[N-2], ..., b[1], b[0]} 65 | *66 | * \par 67 | *
pState
points to the array of state variables.
68 | * pState
is of length numTaps+blockSize-1
samples, where blockSize
is the number of input samples processed by each call to arm_fir_f32()
.
69 | */
70 |
71 | void arm_fir_init_f32(
72 | arm_fir_instance_f32 * S,
73 | uint16_t numTaps,
74 | float32_t * pCoeffs,
75 | float32_t * pState,
76 | uint32_t blockSize)
77 | {
78 | /* Assign filter taps */
79 | S->numTaps = numTaps;
80 |
81 | /* Assign coefficient pointer */
82 | S->pCoeffs = pCoeffs;
83 |
84 | /* Clear state buffer and the size of state buffer is (blockSize + numTaps - 1) */
85 | memset(pState, 0, (numTaps + (blockSize - 1u)) * sizeof(float32_t));
86 |
87 | /* Assign state pointer */
88 | S->pState = pState;
89 |
90 | }
91 |
92 | /**
93 | * @} end of FIR group
94 | */
95 |
--------------------------------------------------------------------------------
/STM32F4_QCopter_20130617/Libraries/CMSIS/FilteringFunctions/arm_fir_init_q31.c:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. February 2012
5 | * $Revision: V1.1.0
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_fir_init_q31.c
9 | *
10 | * Description: Q31 FIR filter initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.1.0 2012/02/15
15 | * Updated with more optimizations, bug fixes and minor API changes.
16 | *
17 | * Version 1.0.10 2011/7/15
18 | * Big Endian support added and Merged M0 and M3/M4 Source code.
19 | *
20 | * Version 1.0.3 2010/11/29
21 | * Re-organized the CMSIS folders and updated documentation.
22 | *
23 | * Version 1.0.2 2010/11/11
24 | * Documentation updated.
25 | *
26 | * Version 1.0.1 2010/10/05
27 | * Production release and review comments incorporated.
28 | *
29 | * Version 1.0.0 2010/09/20
30 | * Production release and review comments incorporated.
31 | *
32 | * Version 0.0.5 2010/04/26
33 | * incorporated review comments and updated with latest CMSIS layer
34 | *
35 | * Version 0.0.3 2010/03/10
36 | * Initial version
37 | * -------------------------------------------------------------------- */
38 |
39 | #include "arm_math.h"
40 |
41 | /**
42 | * @ingroup groupFilters
43 | */
44 |
45 | /**
46 | * @addtogroup FIR
47 | * @{
48 | */
49 |
50 | /**
51 | * @details
52 | *
53 | * @param[in,out] *S points to an instance of the Q31 FIR filter structure.
54 | * @param[in] numTaps Number of filter coefficients in the filter.
55 | * @param[in] *pCoeffs points to the filter coefficients buffer.
56 | * @param[in] *pState points to the state buffer.
57 | * @param[in] blockSize number of samples that are processed per call.
58 | * @return none.
59 | *
60 | * Description:
61 | * \par
62 | * pCoeffs
points to the array of filter coefficients stored in time reversed order:
63 | * 64 | * {b[numTaps-1], b[numTaps-2], b[N-2], ..., b[1], b[0]} 65 | *66 | * \par 67 | *
pState
points to the array of state variables.
68 | * pState
is of length numTaps+blockSize-1
samples, where blockSize
is the number of input samples processed by each call to arm_fir_q31()
.
69 | */
70 |
71 | void arm_fir_init_q31(
72 | arm_fir_instance_q31 * S,
73 | uint16_t numTaps,
74 | q31_t * pCoeffs,
75 | q31_t * pState,
76 | uint32_t blockSize)
77 | {
78 | /* Assign filter taps */
79 | S->numTaps = numTaps;
80 |
81 | /* Assign coefficient pointer */
82 | S->pCoeffs = pCoeffs;
83 |
84 | /* Clear state buffer and state array size is (blockSize + numTaps - 1) */
85 | memset(pState, 0, (blockSize + ((uint32_t) numTaps - 1u)) * sizeof(q31_t));
86 |
87 | /* Assign state pointer */
88 | S->pState = pState;
89 |
90 | }
91 |
92 | /**
93 | * @} end of FIR group
94 | */
95 |
--------------------------------------------------------------------------------
/STM32F4_QCopter_20130617/Libraries/CMSIS/FilteringFunctions/arm_fir_init_q7.c:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. February 2012
5 | * $Revision: V1.1.0
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_fir_init_q7.c
9 | *
10 | * Description: Q7 FIR filter initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.1.0 2012/02/15
15 | * Updated with more optimizations, bug fixes and minor API changes.
16 | *
17 | * Version 1.0.10 2011/7/15
18 | * Big Endian support added and Merged M0 and M3/M4 Source code.
19 | *
20 | * Version 1.0.3 2010/11/29
21 | * Re-organized the CMSIS folders and updated documentation.
22 | *
23 | * Version 1.0.2 2010/11/11
24 | * Documentation updated.
25 | *
26 | * Version 1.0.1 2010/10/05
27 | * Production release and review comments incorporated.
28 | *
29 | * Version 1.0.0 2010/09/20
30 | * Production release and review comments incorporated.
31 | *
32 | * Version 0.0.5 2010/04/26
33 | * incorporated review comments and updated with latest CMSIS layer
34 | *
35 | * Version 0.0.3 2010/03/10
36 | * Initial version
37 | * ------------------------------------------------------------------- */
38 |
39 | #include "arm_math.h"
40 |
41 | /**
42 | * @ingroup groupFilters
43 | */
44 |
45 | /**
46 | * @addtogroup FIR
47 | * @{
48 | */
49 | /**
50 | * @param[in,out] *S points to an instance of the Q7 FIR filter structure.
51 | * @param[in] numTaps Number of filter coefficients in the filter.
52 | * @param[in] *pCoeffs points to the filter coefficients buffer.
53 | * @param[in] *pState points to the state buffer.
54 | * @param[in] blockSize number of samples that are processed per call.
55 | * @return none
56 | *
57 | * Description:
58 | * \par
59 | * pCoeffs
points to the array of filter coefficients stored in time reversed order:
60 | * 61 | * {b[numTaps-1], b[numTaps-2], b[N-2], ..., b[1], b[0]} 62 | *63 | * \par 64 | *
pState
points to the array of state variables.
65 | * pState
is of length numTaps+blockSize-1
samples, where blockSize
is the number of input samples processed by each call to arm_fir_q7()
.
66 | */
67 |
68 | void arm_fir_init_q7(
69 | arm_fir_instance_q7 * S,
70 | uint16_t numTaps,
71 | q7_t * pCoeffs,
72 | q7_t * pState,
73 | uint32_t blockSize)
74 | {
75 |
76 | /* Assign filter taps */
77 | S->numTaps = numTaps;
78 |
79 | /* Assign coefficient pointer */
80 | S->pCoeffs = pCoeffs;
81 |
82 | /* Clear the state buffer. The size is always (blockSize + numTaps - 1) */
83 | memset(pState, 0, (numTaps + (blockSize - 1u)) * sizeof(q7_t));
84 |
85 | /* Assign state pointer */
86 | S->pState = pState;
87 |
88 | }
89 |
90 | /**
91 | * @} end of FIR group
92 | */
93 |
--------------------------------------------------------------------------------
/STM32F4_QCopter_20130617/Libraries/CMSIS/FilteringFunctions/arm_fir_lattice_init_f32.c:
--------------------------------------------------------------------------------
1 | /*-----------------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. February 2012
5 | * $Revision: V1.1.0
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_fir_lattice_init_f32.c
9 | *
10 | * Description: Floating-point FIR Lattice filter initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.1.0 2012/02/15
15 | * Updated with more optimizations, bug fixes and minor API changes.
16 | *
17 | * Version 1.0.10 2011/7/15
18 | * Big Endian support added and Merged M0 and M3/M4 Source code.
19 | *
20 | * Version 1.0.3 2010/11/29
21 | * Re-organized the CMSIS folders and updated documentation.
22 | *
23 | * Version 1.0.2 2010/11/11
24 | * Documentation updated.
25 | *
26 | * Version 1.0.1 2010/10/05
27 | * Production release and review comments incorporated.
28 | *
29 | * Version 1.0.0 2010/09/20
30 | * Production release and review comments incorporated
31 | *
32 | * Version 0.0.7 2010/06/10
33 | * Misra-C changes done
34 | * ---------------------------------------------------------------------------*/
35 |
36 | #include "arm_math.h"
37 |
38 | /**
39 | * @ingroup groupFilters
40 | */
41 |
42 | /**
43 | * @addtogroup FIR_Lattice
44 | * @{
45 | */
46 |
47 | /**
48 | * @brief Initialization function for the floating-point FIR lattice filter.
49 | * @param[in] *S points to an instance of the floating-point FIR lattice structure.
50 | * @param[in] numStages number of filter stages.
51 | * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages.
52 | * @param[in] *pState points to the state buffer. The array is of length numStages.
53 | * @return none.
54 | */
55 |
56 | void arm_fir_lattice_init_f32(
57 | arm_fir_lattice_instance_f32 * S,
58 | uint16_t numStages,
59 | float32_t * pCoeffs,
60 | float32_t * pState)
61 | {
62 | /* Assign filter taps */
63 | S->numStages = numStages;
64 |
65 | /* Assign coefficient pointer */
66 | S->pCoeffs = pCoeffs;
67 |
68 | /* Clear state buffer and size is always numStages */
69 | memset(pState, 0, (numStages) * sizeof(float32_t));
70 |
71 | /* Assign state pointer */
72 | S->pState = pState;
73 |
74 | }
75 |
76 | /**
77 | * @} end of FIR_Lattice group
78 | */
79 |
--------------------------------------------------------------------------------
/STM32F4_QCopter_20130617/Libraries/CMSIS/FilteringFunctions/arm_fir_lattice_init_q15.c:
--------------------------------------------------------------------------------
1 | /*-----------------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. February 2012
5 | * $Revision: V1.1.0
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_fir_lattice_init_q15.c
9 | *
10 | * Description: Q15 FIR Lattice filter initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.1.0 2012/02/15
15 | * Updated with more optimizations, bug fixes and minor API changes.
16 | *
17 | * Version 1.0.10 2011/7/15
18 | * Big Endian support added and Merged M0 and M3/M4 Source code.
19 | *
20 | * Version 1.0.3 2010/11/29
21 | * Re-organized the CMSIS folders and updated documentation.
22 | *
23 | * Version 1.0.2 2010/11/11
24 | * Documentation updated.
25 | *
26 | * Version 1.0.1 2010/10/05
27 | * Production release and review comments incorporated.
28 | *
29 | * Version 1.0.0 2010/09/20
30 | * Production release and review comments incorporated
31 | *
32 | * Version 0.0.7 2010/06/10
33 | * Misra-C changes done
34 | * ---------------------------------------------------------------------------*/
35 |
36 | #include "arm_math.h"
37 |
38 | /**
39 | * @ingroup groupFilters
40 | */
41 |
42 | /**
43 | * @addtogroup FIR_Lattice
44 | * @{
45 | */
46 |
47 | /**
48 | * @brief Initialization function for the Q15 FIR lattice filter.
49 | * @param[in] *S points to an instance of the Q15 FIR lattice structure.
50 | * @param[in] numStages number of filter stages.
51 | * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages.
52 | * @param[in] *pState points to the state buffer. The array is of length numStages.
53 | * @return none.
54 | */
55 |
56 | void arm_fir_lattice_init_q15(
57 | arm_fir_lattice_instance_q15 * S,
58 | uint16_t numStages,
59 | q15_t * pCoeffs,
60 | q15_t * pState)
61 | {
62 | /* Assign filter taps */
63 | S->numStages = numStages;
64 |
65 | /* Assign coefficient pointer */
66 | S->pCoeffs = pCoeffs;
67 |
68 | /* Clear state buffer and size is always numStages */
69 | memset(pState, 0, (numStages) * sizeof(q15_t));
70 |
71 | /* Assign state pointer */
72 | S->pState = pState;
73 |
74 | }
75 |
76 | /**
77 | * @} end of FIR_Lattice group
78 | */
79 |
--------------------------------------------------------------------------------
/STM32F4_QCopter_20130617/Libraries/CMSIS/FilteringFunctions/arm_fir_lattice_init_q31.c:
--------------------------------------------------------------------------------
1 | /*-----------------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. February 2012
5 | * $Revision: V1.1.0
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_fir_lattice_init_q31.c
9 | *
10 | * Description: Q31 FIR lattice filter initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.1.0 2012/02/15
15 | * Updated with more optimizations, bug fixes and minor API changes.
16 | *
17 | * Version 1.0.10 2011/7/15
18 | * Big Endian support added and Merged M0 and M3/M4 Source code.
19 | *
20 | * Version 1.0.3 2010/11/29
21 | * Re-organized the CMSIS folders and updated documentation.
22 | *
23 | * Version 1.0.2 2010/11/11
24 | * Documentation updated.
25 | *
26 | * Version 1.0.1 2010/10/05
27 | * Production release and review comments incorporated.
28 | *
29 | * Version 1.0.0 2010/09/20
30 | * Production release and review comments incorporated
31 | *
32 | * Version 0.0.7 2010/06/10
33 | * Misra-C changes done
34 | * ---------------------------------------------------------------------------*/
35 |
36 | #include "arm_math.h"
37 |
38 | /**
39 | * @ingroup groupFilters
40 | */
41 |
42 | /**
43 | * @addtogroup FIR_Lattice
44 | * @{
45 | */
46 |
47 | /**
48 | * @brief Initialization function for the Q31 FIR lattice filter.
49 | * @param[in] *S points to an instance of the Q31 FIR lattice structure.
50 | * @param[in] numStages number of filter stages.
51 | * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages.
52 | * @param[in] *pState points to the state buffer. The array is of length numStages.
53 | * @return none.
54 | */
55 |
56 | void arm_fir_lattice_init_q31(
57 | arm_fir_lattice_instance_q31 * S,
58 | uint16_t numStages,
59 | q31_t * pCoeffs,
60 | q31_t * pState)
61 | {
62 | /* Assign filter taps */
63 | S->numStages = numStages;
64 |
65 | /* Assign coefficient pointer */
66 | S->pCoeffs = pCoeffs;
67 |
68 | /* Clear state buffer and size is always numStages */
69 | memset(pState, 0, (numStages) * sizeof(q31_t));
70 |
71 | /* Assign state pointer */
72 | S->pState = pState;
73 |
74 | }
75 |
76 | /**
77 | * @} end of FIR_Lattice group
78 | */
79 |
--------------------------------------------------------------------------------
/STM32F4_QCopter_20130617/Libraries/CMSIS/FilteringFunctions/arm_fir_sparse_init_f32.c:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. February 2012
5 | * $Revision: V1.1.0
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_fir_sparse_init_f32.c
9 | *
10 | * Description: Floating-point sparse FIR filter initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.1.0 2012/02/15
15 | * Updated with more optimizations, bug fixes and minor API changes.
16 | *
17 | * Version 1.0.10 2011/7/15
18 | * Big Endian support added and Merged M0 and M3/M4 Source code.
19 | *
20 | * Version 1.0.3 2010/11/29
21 | * Re-organized the CMSIS folders and updated documentation.
22 | *
23 | * Version 1.0.2 2010/11/11
24 | * Documentation updated.
25 | *
26 | * Version 1.0.1 2010/10/05
27 | * Production release and review comments incorporated.
28 | *
29 | * Version 1.0.0 2010/09/20
30 | * Production release and review comments incorporated
31 | *
32 | * Version 0.0.7 2010/06/10
33 | * Misra-C changes done
34 | * ---------------------------------------------------------------------------*/
35 |
36 | #include "arm_math.h"
37 |
38 | /**
39 | * @ingroup groupFilters
40 | */
41 |
42 | /**
43 | * @addtogroup FIR_Sparse
44 | * @{
45 | */
46 |
47 | /**
48 | * @brief Initialization function for the floating-point sparse FIR filter.
49 | * @param[in,out] *S points to an instance of the floating-point sparse FIR structure.
50 | * @param[in] numTaps number of nonzero coefficients in the filter.
51 | * @param[in] *pCoeffs points to the array of filter coefficients.
52 | * @param[in] *pState points to the state buffer.
53 | * @param[in] *pTapDelay points to the array of offset times.
54 | * @param[in] maxDelay maximum offset time supported.
55 | * @param[in] blockSize number of samples that will be processed per block.
56 | * @return none
57 | *
58 | * Description:
59 | * \par
60 | * pCoeffs
holds the filter coefficients and has length numTaps
.
61 | * pState
holds the filter's state variables and must be of length
62 | * maxDelay + blockSize
, where maxDelay
63 | * is the maximum number of delay line values.
64 | * blockSize
is the
65 | * number of samples processed by the arm_fir_sparse_f32()
function.
66 | */
67 |
68 | void arm_fir_sparse_init_f32(
69 | arm_fir_sparse_instance_f32 * S,
70 | uint16_t numTaps,
71 | float32_t * pCoeffs,
72 | float32_t * pState,
73 | int32_t * pTapDelay,
74 | uint16_t maxDelay,
75 | uint32_t blockSize)
76 | {
77 | /* Assign filter taps */
78 | S->numTaps = numTaps;
79 |
80 | /* Assign coefficient pointer */
81 | S->pCoeffs = pCoeffs;
82 |
83 | /* Assign TapDelay pointer */
84 | S->pTapDelay = pTapDelay;
85 |
86 | /* Assign MaxDelay */
87 | S->maxDelay = maxDelay;
88 |
89 | /* reset the stateIndex to 0 */
90 | S->stateIndex = 0u;
91 |
92 | /* Clear state buffer and size is always maxDelay + blockSize */
93 | memset(pState, 0, (maxDelay + blockSize) * sizeof(float32_t));
94 |
95 | /* Assign state pointer */
96 | S->pState = pState;
97 |
98 | }
99 |
100 | /**
101 | * @} end of FIR_Sparse group
102 | */
103 |
--------------------------------------------------------------------------------
/STM32F4_QCopter_20130617/Libraries/CMSIS/FilteringFunctions/arm_fir_sparse_init_q15.c:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. February 2012
5 | * $Revision: V1.1.0
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_fir_sparse_init_q15.c
9 | *
10 | * Description: Q15 sparse FIR filter initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.1.0 2012/02/15
15 | * Updated with more optimizations, bug fixes and minor API changes.
16 | *
17 | * Version 1.0.10 2011/7/15
18 | * Big Endian support added and Merged M0 and M3/M4 Source code.
19 | *
20 | * Version 1.0.3 2010/11/29
21 | * Re-organized the CMSIS folders and updated documentation.
22 | *
23 | * Version 1.0.2 2010/11/11
24 | * Documentation updated.
25 | *
26 | * Version 1.0.1 2010/10/05
27 | * Production release and review comments incorporated.
28 | *
29 | * Version 1.0.0 2010/09/20
30 | * Production release and review comments incorporated
31 | *
32 | * Version 0.0.7 2010/06/10
33 | * Misra-C changes done
34 | * ---------------------------------------------------------------------------*/
35 |
36 | #include "arm_math.h"
37 |
38 | /**
39 | * @ingroup groupFilters
40 | */
41 |
42 | /**
43 | * @addtogroup FIR_Sparse
44 | * @{
45 | */
46 |
47 | /**
48 | * @brief Initialization function for the Q15 sparse FIR filter.
49 | * @param[in,out] *S points to an instance of the Q15 sparse FIR structure.
50 | * @param[in] numTaps number of nonzero coefficients in the filter.
51 | * @param[in] *pCoeffs points to the array of filter coefficients.
52 | * @param[in] *pState points to the state buffer.
53 | * @param[in] *pTapDelay points to the array of offset times.
54 | * @param[in] maxDelay maximum offset time supported.
55 | * @param[in] blockSize number of samples that will be processed per block.
56 | * @return none
57 | *
58 | * Description:
59 | * \par
60 | * pCoeffs
holds the filter coefficients and has length numTaps
.
61 | * pState
holds the filter's state variables and must be of length
62 | * maxDelay + blockSize
, where maxDelay
63 | * is the maximum number of delay line values.
64 | * blockSize
is the
65 | * number of words processed by arm_fir_sparse_q15()
function.
66 | */
67 |
68 | void arm_fir_sparse_init_q15(
69 | arm_fir_sparse_instance_q15 * S,
70 | uint16_t numTaps,
71 | q15_t * pCoeffs,
72 | q15_t * pState,
73 | int32_t * pTapDelay,
74 | uint16_t maxDelay,
75 | uint32_t blockSize)
76 | {
77 | /* Assign filter taps */
78 | S->numTaps = numTaps;
79 |
80 | /* Assign coefficient pointer */
81 | S->pCoeffs = pCoeffs;
82 |
83 | /* Assign TapDelay pointer */
84 | S->pTapDelay = pTapDelay;
85 |
86 | /* Assign MaxDelay */
87 | S->maxDelay = maxDelay;
88 |
89 | /* reset the stateIndex to 0 */
90 | S->stateIndex = 0u;
91 |
92 | /* Clear state buffer and size is always maxDelay + blockSize */
93 | memset(pState, 0, (maxDelay + blockSize) * sizeof(q15_t));
94 |
95 | /* Assign state pointer */
96 | S->pState = pState;
97 |
98 | }
99 |
100 | /**
101 | * @} end of FIR_Sparse group
102 | */
103 |
--------------------------------------------------------------------------------
/STM32F4_QCopter_20130617/Libraries/CMSIS/FilteringFunctions/arm_fir_sparse_init_q31.c:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. February 2012
5 | * $Revision: V1.1.0
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_fir_sparse_init_q31.c
9 | *
10 | * Description: Q31 sparse FIR filter initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.1.0 2012/02/15
15 | * Updated with more optimizations, bug fixes and minor API changes.
16 | *
17 | * Version 1.0.10 2011/7/15
18 | * Big Endian support added and Merged M0 and M3/M4 Source code.
19 | *
20 | * Version 1.0.3 2010/11/29
21 | * Re-organized the CMSIS folders and updated documentation.
22 | *
23 | * Version 1.0.2 2010/11/11
24 | * Documentation updated.
25 | *
26 | * Version 1.0.1 2010/10/05
27 | * Production release and review comments incorporated.
28 | *
29 | * Version 1.0.0 2010/09/20
30 | * Production release and review comments incorporated
31 | *
32 | * Version 0.0.7 2010/06/10
33 | * Misra-C changes done
34 | * ---------------------------------------------------------------------------*/
35 |
36 | #include "arm_math.h"
37 |
38 | /**
39 | * @ingroup groupFilters
40 | */
41 |
42 | /**
43 | * @addtogroup FIR_Sparse
44 | * @{
45 | */
46 |
47 | /**
48 | * @brief Initialization function for the Q31 sparse FIR filter.
49 | * @param[in,out] *S points to an instance of the Q31 sparse FIR structure.
50 | * @param[in] numTaps number of nonzero coefficients in the filter.
51 | * @param[in] *pCoeffs points to the array of filter coefficients.
52 | * @param[in] *pState points to the state buffer.
53 | * @param[in] *pTapDelay points to the array of offset times.
54 | * @param[in] maxDelay maximum offset time supported.
55 | * @param[in] blockSize number of samples that will be processed per block.
56 | * @return none
57 | *
58 | * Description:
59 | * \par
60 | * pCoeffs
holds the filter coefficients and has length numTaps
.
61 | * pState
holds the filter's state variables and must be of length
62 | * maxDelay + blockSize
, where maxDelay
63 | * is the maximum number of delay line values.
64 | * blockSize
is the number of words processed by arm_fir_sparse_q31()
function.
65 | */
66 |
67 | void arm_fir_sparse_init_q31(
68 | arm_fir_sparse_instance_q31 * S,
69 | uint16_t numTaps,
70 | q31_t * pCoeffs,
71 | q31_t * pState,
72 | int32_t * pTapDelay,
73 | uint16_t maxDelay,
74 | uint32_t blockSize)
75 | {
76 | /* Assign filter taps */
77 | S->numTaps = numTaps;
78 |
79 | /* Assign coefficient pointer */
80 | S->pCoeffs = pCoeffs;
81 |
82 | /* Assign TapDelay pointer */
83 | S->pTapDelay = pTapDelay;
84 |
85 | /* Assign MaxDelay */
86 | S->maxDelay = maxDelay;
87 |
88 | /* reset the stateIndex to 0 */
89 | S->stateIndex = 0u;
90 |
91 | /* Clear state buffer and size is always maxDelay + blockSize */
92 | memset(pState, 0, (maxDelay + blockSize) * sizeof(q31_t));
93 |
94 | /* Assign state pointer */
95 | S->pState = pState;
96 |
97 | }
98 |
99 | /**
100 | * @} end of FIR_Sparse group
101 | */
102 |
--------------------------------------------------------------------------------
/STM32F4_QCopter_20130617/Libraries/CMSIS/FilteringFunctions/arm_fir_sparse_init_q7.c:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. February 2012
5 | * $Revision: V1.1.0
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_fir_sparse_init_q7.c
9 | *
10 | * Description: Q7 sparse FIR filter initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.1.0 2012/02/15
15 | * Updated with more optimizations, bug fixes and minor API changes.
16 | *
17 | * Version 1.0.10 2011/7/15
18 | * Big Endian support added and Merged M0 and M3/M4 Source code.
19 | *
20 | * Version 1.0.3 2010/11/29
21 | * Re-organized the CMSIS folders and updated documentation.
22 | *
23 | * Version 1.0.2 2010/11/11
24 | * Documentation updated.
25 | *
26 | * Version 1.0.1 2010/10/05
27 | * Production release and review comments incorporated.
28 | *
29 | * Version 1.0.0 2010/09/20
30 | * Production release and review comments incorporated
31 | *
32 | * Version 0.0.7 2010/06/10
33 | * Misra-C changes done
34 | * ---------------------------------------------------------------------------*/
35 |
36 | #include "arm_math.h"
37 |
38 | /**
39 | * @ingroup groupFilters
40 | */
41 |
42 | /**
43 | * @addtogroup FIR_Sparse
44 | * @{
45 | */
46 |
47 | /**
48 | * @brief Initialization function for the Q7 sparse FIR filter.
49 | * @param[in,out] *S points to an instance of the Q7 sparse FIR structure.
50 | * @param[in] numTaps number of nonzero coefficients in the filter.
51 | * @param[in] *pCoeffs points to the array of filter coefficients.
52 | * @param[in] *pState points to the state buffer.
53 | * @param[in] *pTapDelay points to the array of offset times.
54 | * @param[in] maxDelay maximum offset time supported.
55 | * @param[in] blockSize number of samples that will be processed per block.
56 | * @return none
57 | *
58 | * Description:
59 | * \par
60 | * pCoeffs
holds the filter coefficients and has length numTaps
.
61 | * pState
holds the filter's state variables and must be of length
62 | * maxDelay + blockSize
, where maxDelay
63 | * is the maximum number of delay line values.
64 | * blockSize
is the
65 | * number of samples processed by the arm_fir_sparse_q7()
function.
66 | */
67 |
68 | void arm_fir_sparse_init_q7(
69 | arm_fir_sparse_instance_q7 * S,
70 | uint16_t numTaps,
71 | q7_t * pCoeffs,
72 | q7_t * pState,
73 | int32_t * pTapDelay,
74 | uint16_t maxDelay,
75 | uint32_t blockSize)
76 | {
77 | /* Assign filter taps */
78 | S->numTaps = numTaps;
79 |
80 | /* Assign coefficient pointer */
81 | S->pCoeffs = pCoeffs;
82 |
83 | /* Assign TapDelay pointer */
84 | S->pTapDelay = pTapDelay;
85 |
86 | /* Assign MaxDelay */
87 | S->maxDelay = maxDelay;
88 |
89 | /* reset the stateIndex to 0 */
90 | S->stateIndex = 0u;
91 |
92 | /* Clear state buffer and size is always maxDelay + blockSize */
93 | memset(pState, 0, (maxDelay + blockSize) * sizeof(q7_t));
94 |
95 | /* Assign state pointer */
96 | S->pState = pState;
97 |
98 | }
99 |
100 | /**
101 | * @} end of FIR_Sparse group
102 | */
103 |
--------------------------------------------------------------------------------
/STM32F4_QCopter_20130617/Libraries/CMSIS/FilteringFunctions/arm_iir_lattice_init_f32.c:
--------------------------------------------------------------------------------
1 | /*-----------------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. February 2012
5 | * $Revision: V1.1.0
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_iir_lattice_init_f32.c
9 | *
10 | * Description: Floating-point IIR lattice filter initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.1.0 2012/02/15
15 | * Updated with more optimizations, bug fixes and minor API changes.
16 | *
17 | * Version 1.0.10 2011/7/15
18 | * Big Endian support added and Merged M0 and M3/M4 Source code.
19 | *
20 | * Version 1.0.3 2010/11/29
21 | * Re-organized the CMSIS folders and updated documentation.
22 | *
23 | * Version 1.0.2 2010/11/11
24 | * Documentation updated.
25 | *
26 | * Version 1.0.1 2010/10/05
27 | * Production release and review comments incorporated.
28 | *
29 | * Version 1.0.0 2010/09/20
30 | * Production release and review comments incorporated
31 | *
32 | * Version 0.0.7 2010/06/10
33 | * Misra-C changes done
34 | * ---------------------------------------------------------------------------*/
35 |
36 | #include "arm_math.h"
37 |
38 | /**
39 | * @ingroup groupFilters
40 | */
41 |
42 | /**
43 | * @addtogroup IIR_Lattice
44 | * @{
45 | */
46 |
47 | /**
48 | * @brief Initialization function for the floating-point IIR lattice filter.
49 | * @param[in] *S points to an instance of the floating-point IIR lattice structure.
50 | * @param[in] numStages number of stages in the filter.
51 | * @param[in] *pkCoeffs points to the reflection coefficient buffer. The array is of length numStages.
52 | * @param[in] *pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1.
53 | * @param[in] *pState points to the state buffer. The array is of length numStages+blockSize.
54 | * @param[in] blockSize number of samples to process.
55 | * @return none.
56 | */
57 |
58 | void arm_iir_lattice_init_f32(
59 | arm_iir_lattice_instance_f32 * S,
60 | uint16_t numStages,
61 | float32_t * pkCoeffs,
62 | float32_t * pvCoeffs,
63 | float32_t * pState,
64 | uint32_t blockSize)
65 | {
66 | /* Assign filter taps */
67 | S->numStages = numStages;
68 |
69 | /* Assign reflection coefficient pointer */
70 | S->pkCoeffs = pkCoeffs;
71 |
72 | /* Assign ladder coefficient pointer */
73 | S->pvCoeffs = pvCoeffs;
74 |
75 | /* Clear state buffer and size is always blockSize + numStages */
76 | memset(pState, 0, (numStages + blockSize) * sizeof(float32_t));
77 |
78 | /* Assign state pointer */
79 | S->pState = pState;
80 |
81 |
82 | }
83 |
84 | /**
85 | * @} end of IIR_Lattice group
86 | */
87 |
--------------------------------------------------------------------------------
/STM32F4_QCopter_20130617/Libraries/CMSIS/FilteringFunctions/arm_iir_lattice_init_q15.c:
--------------------------------------------------------------------------------
1 | /*-----------------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. February 2012
5 | * $Revision: V1.1.0
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_iir_lattice_init_q15.c
9 | *
10 | * Description: Q15 IIR lattice filter initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.1.0 2012/02/15
15 | * Updated with more optimizations, bug fixes and minor API changes.
16 | *
17 | * Version 1.0.10 2011/7/15
18 | * Big Endian support added and Merged M0 and M3/M4 Source code.
19 | *
20 | * Version 1.0.3 2010/11/29
21 | * Re-organized the CMSIS folders and updated documentation.
22 | *
23 | * Version 1.0.2 2010/11/11
24 | * Documentation updated.
25 | *
26 | * Version 1.0.1 2010/10/05
27 | * Production release and review comments incorporated.
28 | *
29 | * Version 1.0.0 2010/09/20
30 | * Production release and review comments incorporated
31 | *
32 | * Version 0.0.7 2010/06/10
33 | * Misra-C changes done
34 | * ---------------------------------------------------------------------------*/
35 |
36 | #include "arm_math.h"
37 |
38 | /**
39 | * @ingroup groupFilters
40 | */
41 |
42 | /**
43 | * @addtogroup IIR_Lattice
44 | * @{
45 | */
46 |
47 | /**
48 | * @brief Initialization function for the Q15 IIR lattice filter.
49 | * @param[in] *S points to an instance of the Q15 IIR lattice structure.
50 | * @param[in] numStages number of stages in the filter.
51 | * @param[in] *pkCoeffs points to reflection coefficient buffer. The array is of length numStages.
52 | * @param[in] *pvCoeffs points to ladder coefficient buffer. The array is of length numStages+1.
53 | * @param[in] *pState points to state buffer. The array is of length numStages+blockSize.
54 | * @param[in] blockSize number of samples to process per call.
55 | * @return none.
56 | */
57 |
58 | void arm_iir_lattice_init_q15(
59 | arm_iir_lattice_instance_q15 * S,
60 | uint16_t numStages,
61 | q15_t * pkCoeffs,
62 | q15_t * pvCoeffs,
63 | q15_t * pState,
64 | uint32_t blockSize)
65 | {
66 | /* Assign filter taps */
67 | S->numStages = numStages;
68 |
69 | /* Assign reflection coefficient pointer */
70 | S->pkCoeffs = pkCoeffs;
71 |
72 | /* Assign ladder coefficient pointer */
73 | S->pvCoeffs = pvCoeffs;
74 |
75 | /* Clear state buffer and size is always blockSize + numStages */
76 | memset(pState, 0, (numStages + blockSize) * sizeof(q15_t));
77 |
78 | /* Assign state pointer */
79 | S->pState = pState;
80 |
81 |
82 | }
83 |
84 | /**
85 | * @} end of IIR_Lattice group
86 | */
87 |
--------------------------------------------------------------------------------
/STM32F4_QCopter_20130617/Libraries/CMSIS/FilteringFunctions/arm_iir_lattice_init_q31.c:
--------------------------------------------------------------------------------
1 | /*-----------------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. February 2012
5 | * $Revision: V1.1.0
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_iir_lattice_init_q31.c
9 | *
10 | * Description: Initialization function for the Q31 IIR lattice filter.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.1.0 2012/02/15
15 | * Updated with more optimizations, bug fixes and minor API changes.
16 | *
17 | * Version 1.0.10 2011/7/15
18 | * Big Endian support added and Merged M0 and M3/M4 Source code.
19 | *
20 | * Version 1.0.3 2010/11/29
21 | * Re-organized the CMSIS folders and updated documentation.
22 | *
23 | * Version 1.0.2 2010/11/11
24 | * Documentation updated.
25 | *
26 | * Version 1.0.1 2010/10/05
27 | * Production release and review comments incorporated.
28 | *
29 | * Version 1.0.0 2010/09/20
30 | * Production release and review comments incorporated
31 | *
32 | * Version 0.0.7 2010/06/10
33 | * Misra-C changes done
34 | * ---------------------------------------------------------------------------*/
35 |
36 | #include "arm_math.h"
37 |
38 | /**
39 | * @ingroup groupFilters
40 | */
41 |
42 | /**
43 | * @addtogroup IIR_Lattice
44 | * @{
45 | */
46 |
47 | /**
48 | * @brief Initialization function for the Q31 IIR lattice filter.
49 | * @param[in] *S points to an instance of the Q31 IIR lattice structure.
50 | * @param[in] numStages number of stages in the filter.
51 | * @param[in] *pkCoeffs points to the reflection coefficient buffer. The array is of length numStages.
52 | * @param[in] *pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1.
53 | * @param[in] *pState points to the state buffer. The array is of length numStages+blockSize.
54 | * @param[in] blockSize number of samples to process.
55 | * @return none.
56 | */
57 |
58 | void arm_iir_lattice_init_q31(
59 | arm_iir_lattice_instance_q31 * S,
60 | uint16_t numStages,
61 | q31_t * pkCoeffs,
62 | q31_t * pvCoeffs,
63 | q31_t * pState,
64 | uint32_t blockSize)
65 | {
66 | /* Assign filter taps */
67 | S->numStages = numStages;
68 |
69 | /* Assign reflection coefficient pointer */
70 | S->pkCoeffs = pkCoeffs;
71 |
72 | /* Assign ladder coefficient pointer */
73 | S->pvCoeffs = pvCoeffs;
74 |
75 | /* Clear state buffer and size is always blockSize + numStages */
76 | memset(pState, 0, (numStages + blockSize) * sizeof(q31_t));
77 |
78 | /* Assign state pointer */
79 | S->pState = pState;
80 |
81 |
82 | }
83 |
84 | /**
85 | * @} end of IIR_Lattice group
86 | */
87 |
--------------------------------------------------------------------------------
/STM32F4_QCopter_20130617/Libraries/CMSIS/FilteringFunctions/arm_lms_init_f32.c:
--------------------------------------------------------------------------------
1 | /*-----------------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. February 2012
5 | * $Revision: V1.1.0
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_lms_init_f32.c
9 | *
10 | * Description: Floating-point LMS filter initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.1.0 2012/02/15
15 | * Updated with more optimizations, bug fixes and minor API changes.
16 | *
17 | * Version 1.0.10 2011/7/15
18 | * Big Endian support added and Merged M0 and M3/M4 Source code.
19 | *
20 | * Version 1.0.3 2010/11/29
21 | * Re-organized the CMSIS folders and updated documentation.
22 | *
23 | * Version 1.0.2 2010/11/11
24 | * Documentation updated.
25 | *
26 | * Version 1.0.1 2010/10/05
27 | * Production release and review comments incorporated.
28 | *
29 | * Version 1.0.0 2010/09/20
30 | * Production release and review comments incorporated
31 | *
32 | * Version 0.0.7 2010/06/10
33 | * Misra-C changes done
34 | * ---------------------------------------------------------------------------*/
35 |
36 | #include "arm_math.h"
37 |
38 | /**
39 | * @addtogroup LMS
40 | * @{
41 | */
42 |
43 | /**
44 | * @brief Initialization function for floating-point LMS filter.
45 | * @param[in] *S points to an instance of the floating-point LMS filter structure.
46 | * @param[in] numTaps number of filter coefficients.
47 | * @param[in] *pCoeffs points to the coefficient buffer.
48 | * @param[in] *pState points to state buffer.
49 | * @param[in] mu step size that controls filter coefficient updates.
50 | * @param[in] blockSize number of samples to process.
51 | * @return none.
52 | */
53 |
54 | /**
55 | * \par Description:
56 | * pCoeffs
points to the array of filter coefficients stored in time reversed order:
57 | * 58 | * {b[numTaps-1], b[numTaps-2], b[N-2], ..., b[1], b[0]} 59 | *60 | * The initial filter coefficients serve as a starting point for the adaptive filter. 61 | *
pState
points to an array of length numTaps+blockSize-1
samples, where blockSize
is the number of input samples processed by each call to arm_lms_f32()
.
62 | */
63 |
64 | void arm_lms_init_f32(
65 | arm_lms_instance_f32 * S,
66 | uint16_t numTaps,
67 | float32_t * pCoeffs,
68 | float32_t * pState,
69 | float32_t mu,
70 | uint32_t blockSize)
71 | {
72 | /* Assign filter taps */
73 | S->numTaps = numTaps;
74 |
75 | /* Assign coefficient pointer */
76 | S->pCoeffs = pCoeffs;
77 |
78 | /* Clear state buffer and size is always blockSize + numTaps */
79 | memset(pState, 0, (numTaps + (blockSize - 1)) * sizeof(float32_t));
80 |
81 | /* Assign state pointer */
82 | S->pState = pState;
83 |
84 | /* Assign Step size value */
85 | S->mu = mu;
86 | }
87 |
88 | /**
89 | * @} end of LMS group
90 | */
91 |
--------------------------------------------------------------------------------
/STM32F4_QCopter_20130617/Libraries/CMSIS/FilteringFunctions/arm_lms_init_q15.c:
--------------------------------------------------------------------------------
1 | /*-----------------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. February 2012
5 | * $Revision: V1.1.0
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_lms_init_q15.c
9 | *
10 | * Description: Q15 LMS filter initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.1.0 2012/02/15
15 | * Updated with more optimizations, bug fixes and minor API changes.
16 | *
17 | * Version 1.0.10 2011/7/15
18 | * Big Endian support added and Merged M0 and M3/M4 Source code.
19 | *
20 | * Version 1.0.3 2010/11/29
21 | * Re-organized the CMSIS folders and updated documentation.
22 | *
23 | * Version 1.0.2 2010/11/11
24 | * Documentation updated.
25 | *
26 | * Version 1.0.1 2010/10/05
27 | * Production release and review comments incorporated.
28 | *
29 | * Version 1.0.0 2010/09/20
30 | * Production release and review comments incorporated
31 | *
32 | * Version 0.0.7 2010/06/10
33 | * Misra-C changes done
34 | * ---------------------------------------------------------------------------*/
35 |
36 | #include "arm_math.h"
37 |
38 | /**
39 | * @ingroup groupFilters
40 | */
41 |
42 | /**
43 | * @addtogroup LMS
44 | * @{
45 | */
46 |
47 | /**
48 | * @brief Initialization function for the Q15 LMS filter.
49 | * @param[in] *S points to an instance of the Q15 LMS filter structure.
50 | * @param[in] numTaps number of filter coefficients.
51 | * @param[in] *pCoeffs points to the coefficient buffer.
52 | * @param[in] *pState points to the state buffer.
53 | * @param[in] mu step size that controls filter coefficient updates.
54 | * @param[in] blockSize number of samples to process.
55 | * @param[in] postShift bit shift applied to coefficients.
56 | * @return none.
57 | *
58 | * \par Description:
59 | * pCoeffs
points to the array of filter coefficients stored in time reversed order:
60 | * 61 | * {b[numTaps-1], b[numTaps-2], b[N-2], ..., b[1], b[0]} 62 | *63 | * The initial filter coefficients serve as a starting point for the adaptive filter. 64 | *
pState
points to the array of state variables and size of array is
65 | * numTaps+blockSize-1
samples, where blockSize
is the number of
66 | * input samples processed by each call to arm_lms_q15()
.
67 | */
68 |
69 | void arm_lms_init_q15(
70 | arm_lms_instance_q15 * S,
71 | uint16_t numTaps,
72 | q15_t * pCoeffs,
73 | q15_t * pState,
74 | q15_t mu,
75 | uint32_t blockSize,
76 | uint32_t postShift)
77 | {
78 | /* Assign filter taps */
79 | S->numTaps = numTaps;
80 |
81 | /* Assign coefficient pointer */
82 | S->pCoeffs = pCoeffs;
83 |
84 | /* Clear state buffer and size is always blockSize + numTaps - 1 */
85 | memset(pState, 0, (numTaps + (blockSize - 1u)) * sizeof(q15_t));
86 |
87 | /* Assign state pointer */
88 | S->pState = pState;
89 |
90 | /* Assign Step size value */
91 | S->mu = mu;
92 |
93 | /* Assign postShift value to be applied */
94 | S->postShift = postShift;
95 |
96 | }
97 |
98 | /**
99 | * @} end of LMS group
100 | */
101 |
--------------------------------------------------------------------------------
/STM32F4_QCopter_20130617/Libraries/CMSIS/FilteringFunctions/arm_lms_init_q31.c:
--------------------------------------------------------------------------------
1 | /*-----------------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. February 2012
5 | * $Revision: V1.1.0
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_lms_init_q31.c
9 | *
10 | * Description: Q31 LMS filter initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.1.0 2012/02/15
15 | * Updated with more optimizations, bug fixes and minor API changes.
16 | *
17 | * Version 1.0.10 2011/7/15
18 | * Big Endian support added and Merged M0 and M3/M4 Source code.
19 | *
20 | * Version 1.0.3 2010/11/29
21 | * Re-organized the CMSIS folders and updated documentation.
22 | *
23 | * Version 1.0.2 2010/11/11
24 | * Documentation updated.
25 | *
26 | * Version 1.0.1 2010/10/05
27 | * Production release and review comments incorporated.
28 | *
29 | * Version 1.0.0 2010/09/20
30 | * Production release and review comments incorporated
31 | *
32 | * Version 0.0.7 2010/06/10
33 | * Misra-C changes done
34 | * ---------------------------------------------------------------------------*/
35 |
36 | #include "arm_math.h"
37 |
38 | /**
39 | * @ingroup groupFilters
40 | */
41 |
42 | /**
43 | * @addtogroup LMS
44 | * @{
45 | */
46 |
47 | /**
48 | * @brief Initialization function for Q31 LMS filter.
49 | * @param[in] *S points to an instance of the Q31 LMS filter structure.
50 | * @param[in] numTaps number of filter coefficients.
51 | * @param[in] *pCoeffs points to coefficient buffer.
52 | * @param[in] *pState points to state buffer.
53 | * @param[in] mu step size that controls filter coefficient updates.
54 | * @param[in] blockSize number of samples to process.
55 | * @param[in] postShift bit shift applied to coefficients.
56 | * @return none.
57 | *
58 | * \par Description:
59 | * pCoeffs
points to the array of filter coefficients stored in time reversed order:
60 | * 61 | * {b[numTaps-1], b[numTaps-2], b[N-2], ..., b[1], b[0]} 62 | *63 | * The initial filter coefficients serve as a starting point for the adaptive filter. 64 | *
pState
points to an array of length numTaps+blockSize-1
samples,
65 | * where blockSize
is the number of input samples processed by each call to
66 | * arm_lms_q31()
.
67 | */
68 |
69 | void arm_lms_init_q31(
70 | arm_lms_instance_q31 * S,
71 | uint16_t numTaps,
72 | q31_t * pCoeffs,
73 | q31_t * pState,
74 | q31_t mu,
75 | uint32_t blockSize,
76 | uint32_t postShift)
77 | {
78 | /* Assign filter taps */
79 | S->numTaps = numTaps;
80 |
81 | /* Assign coefficient pointer */
82 | S->pCoeffs = pCoeffs;
83 |
84 | /* Clear state buffer and size is always blockSize + numTaps - 1 */
85 | memset(pState, 0, ((uint32_t) numTaps + (blockSize - 1u)) * sizeof(q31_t));
86 |
87 | /* Assign state pointer */
88 | S->pState = pState;
89 |
90 | /* Assign Step size value */
91 | S->mu = mu;
92 |
93 | /* Assign postShift value to be applied */
94 | S->postShift = postShift;
95 |
96 | }
97 |
98 | /**
99 | * @} end of LMS group
100 | */
101 |
--------------------------------------------------------------------------------
/STM32F4_QCopter_20130617/Libraries/CMSIS/FilteringFunctions/arm_lms_norm_init_f32.c:
--------------------------------------------------------------------------------
1 | /*-----------------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. February 2012
5 | * $Revision: V1.1.0
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_lms_norm_init_f32.c
9 | *
10 | * Description: Floating-point NLMS filter initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.1.0 2012/02/15
15 | * Updated with more optimizations, bug fixes and minor API changes.
16 | *
17 | * Version 1.0.10 2011/7/15
18 | * Big Endian support added and Merged M0 and M3/M4 Source code.
19 | *
20 | * Version 1.0.3 2010/11/29
21 | * Re-organized the CMSIS folders and updated documentation.
22 | *
23 | * Version 1.0.2 2010/11/11
24 | * Documentation updated.
25 | *
26 | * Version 1.0.1 2010/10/05
27 | * Production release and review comments incorporated.
28 | *
29 | * Version 1.0.0 2010/09/20
30 | * Production release and review comments incorporated
31 | *
32 | * Version 0.0.7 2010/06/10
33 | * Misra-C changes done
34 | * ---------------------------------------------------------------------------*/
35 |
36 | #include "arm_math.h"
37 |
38 | /**
39 | * @ingroup groupFilters
40 | */
41 |
42 | /**
43 | * @addtogroup LMS_NORM
44 | * @{
45 | */
46 |
47 | /**
48 | * @brief Initialization function for floating-point normalized LMS filter.
49 | * @param[in] *S points to an instance of the floating-point LMS filter structure.
50 | * @param[in] numTaps number of filter coefficients.
51 | * @param[in] *pCoeffs points to coefficient buffer.
52 | * @param[in] *pState points to state buffer.
53 | * @param[in] mu step size that controls filter coefficient updates.
54 | * @param[in] blockSize number of samples to process.
55 | * @return none.
56 | *
57 | * \par Description:
58 | * pCoeffs
points to the array of filter coefficients stored in time reversed order:
59 | * 60 | * {b[numTaps-1], b[numTaps-2], b[N-2], ..., b[1], b[0]} 61 | *62 | * The initial filter coefficients serve as a starting point for the adaptive filter. 63 | *
pState
points to an array of length numTaps+blockSize-1
samples,
64 | * where blockSize
is the number of input samples processed by each call to arm_lms_norm_f32()
.
65 | */
66 |
67 | void arm_lms_norm_init_f32(
68 | arm_lms_norm_instance_f32 * S,
69 | uint16_t numTaps,
70 | float32_t * pCoeffs,
71 | float32_t * pState,
72 | float32_t mu,
73 | uint32_t blockSize)
74 | {
75 | /* Assign filter taps */
76 | S->numTaps = numTaps;
77 |
78 | /* Assign coefficient pointer */
79 | S->pCoeffs = pCoeffs;
80 |
81 | /* Clear state buffer and size is always blockSize + numTaps - 1 */
82 | memset(pState, 0, (numTaps + (blockSize - 1u)) * sizeof(float32_t));
83 |
84 | /* Assign state pointer */
85 | S->pState = pState;
86 |
87 | /* Assign Step size value */
88 | S->mu = mu;
89 |
90 | /* Initialise Energy to zero */
91 | S->energy = 0.0f;
92 |
93 | /* Initialise x0 to zero */
94 | S->x0 = 0.0f;
95 |
96 | }
97 |
98 | /**
99 | * @} end of LMS_NORM group
100 | */
101 |
--------------------------------------------------------------------------------
/STM32F4_QCopter_20130617/Libraries/CMSIS/FilteringFunctions/arm_lms_norm_init_q15.c:
--------------------------------------------------------------------------------
1 | /*-----------------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. February 2012
5 | * $Revision: V1.1.0
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_lms_norm_init_q15.c
9 | *
10 | * Description: Q15 NLMS initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.1.0 2012/02/15
15 | * Updated with more optimizations, bug fixes and minor API changes.
16 | *
17 | * Version 1.0.10 2011/7/15
18 | * Big Endian support added and Merged M0 and M3/M4 Source code.
19 | *
20 | * Version 1.0.3 2010/11/29
21 | * Re-organized the CMSIS folders and updated documentation.
22 | *
23 | * Version 1.0.2 2010/11/11
24 | * Documentation updated.
25 | *
26 | * Version 1.0.1 2010/10/05
27 | * Production release and review comments incorporated.
28 | *
29 | * Version 1.0.0 2010/09/20
30 | * Production release and review comments incorporated
31 | *
32 | * Version 0.0.7 2010/06/10
33 | * Misra-C changes done
34 | * ---------------------------------------------------------------------------*/
35 |
36 | #include "arm_math.h"
37 | #include "arm_common_tables.h"
38 |
39 | /**
40 | * @addtogroup LMS_NORM
41 | * @{
42 | */
43 |
44 | /**
45 | * @brief Initialization function for Q15 normalized LMS filter.
46 | * @param[in] *S points to an instance of the Q15 normalized LMS filter structure.
47 | * @param[in] numTaps number of filter coefficients.
48 | * @param[in] *pCoeffs points to coefficient buffer.
49 | * @param[in] *pState points to state buffer.
50 | * @param[in] mu step size that controls filter coefficient updates.
51 | * @param[in] blockSize number of samples to process.
52 | * @param[in] postShift bit shift applied to coefficients.
53 | * @return none.
54 | *
55 | * Description:
56 | * \par
57 | * pCoeffs
points to the array of filter coefficients stored in time reversed order:
58 | * 59 | * {b[numTaps-1], b[numTaps-2], b[N-2], ..., b[1], b[0]} 60 | *61 | * The initial filter coefficients serve as a starting point for the adaptive filter. 62 | *
pState
points to the array of state variables and size of array is
63 | * numTaps+blockSize-1
samples, where blockSize
is the number of input samples processed
64 | * by each call to arm_lms_norm_q15()
.
65 | */
66 |
67 | void arm_lms_norm_init_q15(
68 | arm_lms_norm_instance_q15 * S,
69 | uint16_t numTaps,
70 | q15_t * pCoeffs,
71 | q15_t * pState,
72 | q15_t mu,
73 | uint32_t blockSize,
74 | uint8_t postShift)
75 | {
76 | /* Assign filter taps */
77 | S->numTaps = numTaps;
78 |
79 | /* Assign coefficient pointer */
80 | S->pCoeffs = pCoeffs;
81 |
82 | /* Clear state buffer and size is always blockSize + numTaps - 1 */
83 | memset(pState, 0, (numTaps + (blockSize - 1u)) * sizeof(q15_t));
84 |
85 | /* Assign post Shift value applied to coefficients */
86 | S->postShift = postShift;
87 |
88 | /* Assign state pointer */
89 | S->pState = pState;
90 |
91 | /* Assign Step size value */
92 | S->mu = mu;
93 |
94 | /* Initialize reciprocal pointer table */
95 | S->recipTable = (q15_t *) armRecipTableQ15;
96 |
97 | /* Initialise Energy to zero */
98 | S->energy = 0;
99 |
100 | /* Initialise x0 to zero */
101 | S->x0 = 0;
102 |
103 | }
104 |
105 | /**
106 | * @} end of LMS_NORM group
107 | */
108 |
--------------------------------------------------------------------------------
/STM32F4_QCopter_20130617/Libraries/CMSIS/FilteringFunctions/arm_lms_norm_init_q31.c:
--------------------------------------------------------------------------------
1 | /*-----------------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. February 2012
5 | * $Revision: V1.1.0
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_lms_norm_init_q31.c
9 | *
10 | * Description: Q31 NLMS initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.1.0 2012/02/15
15 | * Updated with more optimizations, bug fixes and minor API changes.
16 | *
17 | * Version 1.0.10 2011/7/15
18 | * Big Endian support added and Merged M0 and M3/M4 Source code.
19 | *
20 | * Version 1.0.3 2010/11/29
21 | * Re-organized the CMSIS folders and updated documentation.
22 | *
23 | * Version 1.0.2 2010/11/11
24 | * Documentation updated.
25 | *
26 | * Version 1.0.1 2010/10/05
27 | * Production release and review comments incorporated.
28 | *
29 | * Version 1.0.0 2010/09/20
30 | * Production release and review comments incorporated
31 | *
32 | * Version 0.0.7 2010/06/10
33 | * Misra-C changes done
34 | * ---------------------------------------------------------------------------*/
35 |
36 | #include "arm_math.h"
37 | #include "arm_common_tables.h"
38 |
39 | /**
40 | * @addtogroup LMS_NORM
41 | * @{
42 | */
43 |
44 | /**
45 | * @brief Initialization function for Q31 normalized LMS filter.
46 | * @param[in] *S points to an instance of the Q31 normalized LMS filter structure.
47 | * @param[in] numTaps number of filter coefficients.
48 | * @param[in] *pCoeffs points to coefficient buffer.
49 | * @param[in] *pState points to state buffer.
50 | * @param[in] mu step size that controls filter coefficient updates.
51 | * @param[in] blockSize number of samples to process.
52 | * @param[in] postShift bit shift applied to coefficients.
53 | * @return none.
54 | *
55 | * Description:
56 | * \par
57 | * pCoeffs
points to the array of filter coefficients stored in time reversed order:
58 | * 59 | * {b[numTaps-1], b[numTaps-2], b[N-2], ..., b[1], b[0]} 60 | *61 | * The initial filter coefficients serve as a starting point for the adaptive filter. 62 | *
pState
points to an array of length numTaps+blockSize-1
samples,
63 | * where blockSize
is the number of input samples processed by each call to arm_lms_norm_q31()
.
64 | */
65 |
66 | void arm_lms_norm_init_q31(
67 | arm_lms_norm_instance_q31 * S,
68 | uint16_t numTaps,
69 | q31_t * pCoeffs,
70 | q31_t * pState,
71 | q31_t mu,
72 | uint32_t blockSize,
73 | uint8_t postShift)
74 | {
75 | /* Assign filter taps */
76 | S->numTaps = numTaps;
77 |
78 | /* Assign coefficient pointer */
79 | S->pCoeffs = pCoeffs;
80 |
81 | /* Clear state buffer and size is always blockSize + numTaps - 1 */
82 | memset(pState, 0, (numTaps + (blockSize - 1u)) * sizeof(q31_t));
83 |
84 | /* Assign post Shift value applied to coefficients */
85 | S->postShift = postShift;
86 |
87 | /* Assign state pointer */
88 | S->pState = pState;
89 |
90 | /* Assign Step size value */
91 | S->mu = mu;
92 |
93 | /* Initialize reciprocal pointer table */
94 | S->recipTable = (q31_t *) armRecipTableQ31;
95 |
96 | /* Initialise Energy to zero */
97 | S->energy = 0;
98 |
99 | /* Initialise x0 to zero */
100 | S->x0 = 0;
101 |
102 | }
103 |
104 | /**
105 | * @} end of LMS_NORM group
106 | */
107 |
--------------------------------------------------------------------------------
/STM32F4_QCopter_20130617/Libraries/CMSIS/MatrixFunctions/arm_mat_init_f32.c:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. February 2012
5 | * $Revision: V1.1.0
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_mat_init_f32.c
9 | *
10 | * Description: Floating-point matrix initialization.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.1.0 2012/02/15
15 | * Updated with more optimizations, bug fixes and minor API changes.
16 | *
17 | * Version 1.0.10 2011/7/15
18 | * Big Endian support added and Merged M0 and M3/M4 Source code.
19 | *
20 | * Version 1.0.3 2010/11/29
21 | * Re-organized the CMSIS folders and updated documentation.
22 | *
23 | * Version 1.0.2 2010/11/11
24 | * Documentation updated.
25 | *
26 | * Version 1.0.1 2010/10/05
27 | * Production release and review comments incorporated.
28 | *
29 | * Version 1.0.0 2010/09/20
30 | * Production release and review comments incorporated.
31 | *
32 | * Version 0.0.5 2010/04/26
33 | * incorporated review comments and updated with latest CMSIS layer
34 | *
35 | * Version 0.0.3 2010/03/10
36 | * Initial version
37 | * -------------------------------------------------------------------------- */
38 |
39 | #include "arm_math.h"
40 |
41 | /**
42 | * @ingroup groupMatrix
43 | */
44 |
45 | /**
46 | * @defgroup MatrixInit Matrix Initialization
47 | *
48 | * Initializes the underlying matrix data structure.
49 | * The functions set the numRows
,
50 | * numCols
, and pData
fields
51 | * of the matrix data structure.
52 | */
53 |
54 | /**
55 | * @addtogroup MatrixInit
56 | * @{
57 | */
58 |
59 | /**
60 | * @brief Floating-point matrix initialization.
61 | * @param[in,out] *S points to an instance of the floating-point matrix structure.
62 | * @param[in] nRows number of rows in the matrix.
63 | * @param[in] nColumns number of columns in the matrix.
64 | * @param[in] *pData points to the matrix data array.
65 | * @return none
66 | */
67 |
68 | void arm_mat_init_f32(
69 | arm_matrix_instance_f32 * S,
70 | uint16_t nRows,
71 | uint16_t nColumns,
72 | float32_t * pData)
73 | {
74 | /* Assign Number of Rows */
75 | S->numRows = nRows;
76 |
77 | /* Assign Number of Columns */
78 | S->numCols = nColumns;
79 |
80 | /* Assign Data pointer */
81 | S->pData = pData;
82 | }
83 |
84 | /**
85 | * @} end of MatrixInit group
86 | */
87 |
--------------------------------------------------------------------------------
/STM32F4_QCopter_20130617/Libraries/CMSIS/MatrixFunctions/arm_mat_init_q15.c:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. February 2012
5 | * $Revision: V1.1.0
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_mat_init_q15.c
9 | *
10 | * Description: Q15 matrix initialization.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.1.0 2012/02/15
15 | * Updated with more optimizations, bug fixes and minor API changes.
16 | *
17 | * Version 1.0.10 2011/7/15
18 | * Big Endian support added and Merged M0 and M3/M4 Source code.
19 | *
20 | * Version 1.0.3 2010/11/29
21 | * Re-organized the CMSIS folders and updated documentation.
22 | *
23 | * Version 1.0.2 2010/11/11
24 | * Documentation updated.
25 | *
26 | * Version 1.0.1 2010/10/05
27 | * Production release and review comments incorporated.
28 | *
29 | * Version 1.0.0 2010/09/20
30 | * Production release and review comments incorporated.
31 | *
32 | * Version 0.0.5 2010/04/26
33 | * incorporated review comments and updated with latest CMSIS layer
34 | *
35 | * Version 0.0.3 2010/03/10
36 | * Initial version
37 | * -------------------------------------------------------------------------- */
38 |
39 |
40 | #include "arm_math.h"
41 |
42 | /**
43 | * @ingroup groupMatrix
44 | */
45 |
46 | /**
47 | * @addtogroup MatrixInit
48 | * @{
49 | */
50 |
51 | /**
52 | * @brief Q15 matrix initialization.
53 | * @param[in,out] *S points to an instance of the floating-point matrix structure.
54 | * @param[in] nRows number of rows in the matrix.
55 | * @param[in] nColumns number of columns in the matrix.
56 | * @param[in] *pData points to the matrix data array.
57 | * @return none
58 | */
59 |
60 | void arm_mat_init_q15(
61 | arm_matrix_instance_q15 * S,
62 | uint16_t nRows,
63 | uint16_t nColumns,
64 | q15_t * pData)
65 | {
66 | /* Assign Number of Rows */
67 | S->numRows = nRows;
68 |
69 | /* Assign Number of Columns */
70 | S->numCols = nColumns;
71 |
72 | /* Assign Data pointer */
73 | S->pData = pData;
74 | }
75 |
76 | /**
77 | * @} end of MatrixInit group
78 | */
79 |
--------------------------------------------------------------------------------
/STM32F4_QCopter_20130617/Libraries/CMSIS/MatrixFunctions/arm_mat_init_q31.c:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. February 2012
5 | * $Revision: V1.1.0
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_mat_init_q31.c
9 | *
10 | * Description: Q31 matrix initialization.
11 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
12 | *
13 | * Version 1.1.0 2012/02/15
14 | * Updated with more optimizations, bug fixes and minor API changes.
15 | *
16 | * Version 1.0.10 2011/7/15
17 | * Big Endian support added and Merged M0 and M3/M4 Source code.
18 | *
19 | * Version 1.0.3 2010/11/29
20 | * Re-organized the CMSIS folders and updated documentation.
21 | *
22 | * Version 1.0.2 2010/11/11
23 | * Documentation updated.
24 | *
25 | * Version 1.0.1 2010/10/05
26 | * Production release and review comments incorporated.
27 | *
28 | * Version 1.0.0 2010/09/20
29 | * Production release and review comments incorporated.
30 | *
31 | * Version 0.0.5 2010/04/26
32 | * incorporated review comments and updated with latest CMSIS layer
33 | *
34 | * Version 0.0.3 2010/03/10
35 | * Initial version
36 | * -------------------------------------------------------------------------- */
37 |
38 |
39 | #include "arm_math.h"
40 |
41 | /**
42 | * @ingroup groupMatrix
43 | */
44 |
45 | /**
46 | * @defgroup MatrixInit Matrix Initialization
47 | *
48 | */
49 |
50 | /**
51 | * @addtogroup MatrixInit
52 | * @{
53 | */
54 |
55 | /**
56 | * @brief Q31 matrix initialization.
57 | * @param[in,out] *S points to an instance of the floating-point matrix structure.
58 | * @param[in] nRows number of rows in the matrix.
59 | * @param[in] nColumns number of columns in the matrix.
60 | * @param[in] *pData points to the matrix data array.
61 | * @return none
62 | */
63 |
64 | void arm_mat_init_q31(
65 | arm_matrix_instance_q31 * S,
66 | uint16_t nRows,
67 | uint16_t nColumns,
68 | q31_t * pData)
69 | {
70 | /* Assign Number of Rows */
71 | S->numRows = nRows;
72 |
73 | /* Assign Number of Columns */
74 | S->numCols = nColumns;
75 |
76 | /* Assign Data pointer */
77 | S->pData = pData;
78 | }
79 |
80 | /**
81 | * @} end of MatrixInit group
82 | */
83 |
--------------------------------------------------------------------------------
/STM32F4_QCopter_20130617/Libraries/CMSIS/SupportFunctions/arm_copy_f32.c:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. February 2012
5 | * $Revision: V1.1.0
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_copy_f32.c
9 | *
10 | * Description: Copies the elements of a floating-point vector.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.1.0 2012/02/15
15 | * Updated with more optimizations, bug fixes and minor API changes.
16 | *
17 | * Version 1.0.10 2011/7/15
18 | * Big Endian support added and Merged M0 and M3/M4 Source code.
19 | *
20 | * Version 1.0.3 2010/11/29
21 | * Re-organized the CMSIS folders and updated documentation.
22 | *
23 | * Version 1.0.2 2010/11/11
24 | * Documentation updated.
25 | *
26 | * Version 1.0.1 2010/10/05
27 | * Production release and review comments incorporated.
28 | *
29 | * Version 1.0.0 2010/09/20
30 | * Production release and review comments incorporated.
31 | *
32 | * Version 0.0.7 2010/06/10
33 | * Misra-C changes done
34 | * ---------------------------------------------------------------------------- */
35 |
36 | #include "arm_math.h"
37 |
38 | /**
39 | * @ingroup groupSupport
40 | */
41 |
42 | /**
43 | * @defgroup copy Vector Copy
44 | *
45 | * Copies sample by sample from source vector to destination vector.
46 | *
47 | * 48 | * pDst[n] = pSrc[n]; 0 <= n < blockSize. 49 | *50 | * 51 | * There are separate functions for floating point, Q31, Q15, and Q7 data types. 52 | */ 53 | 54 | /** 55 | * @addtogroup copy 56 | * @{ 57 | */ 58 | 59 | /** 60 | * @brief Copies the elements of a floating-point vector. 61 | * @param[in] *pSrc points to input vector 62 | * @param[out] *pDst points to output vector 63 | * @param[in] blockSize length of the input vector 64 | * @return none. 65 | * 66 | */ 67 | 68 | 69 | void arm_copy_f32( 70 | float32_t * pSrc, 71 | float32_t * pDst, 72 | uint32_t blockSize) 73 | { 74 | uint32_t blkCnt; /* loop counter */ 75 | 76 | #ifndef ARM_MATH_CM0 77 | 78 | /* Run the below code for Cortex-M4 and Cortex-M3 */ 79 | float32_t in1, in2, in3, in4; 80 | 81 | /*loop Unrolling */ 82 | blkCnt = blockSize >> 2u; 83 | 84 | /* First part of the processing with loop unrolling. Compute 4 outputs at a time. 85 | ** a second loop below computes the remaining 1 to 3 samples. */ 86 | while(blkCnt > 0u) 87 | { 88 | /* C = A */ 89 | /* Copy and then store the results in the destination buffer */ 90 | in1 = *pSrc++; 91 | in2 = *pSrc++; 92 | in3 = *pSrc++; 93 | in4 = *pSrc++; 94 | 95 | *pDst++ = in1; 96 | *pDst++ = in2; 97 | *pDst++ = in3; 98 | *pDst++ = in4; 99 | 100 | /* Decrement the loop counter */ 101 | blkCnt--; 102 | } 103 | 104 | /* If the blockSize is not a multiple of 4, compute any remaining output samples here. 105 | ** No loop unrolling is used. */ 106 | blkCnt = blockSize % 0x4u; 107 | 108 | #else 109 | 110 | /* Run the below code for Cortex-M0 */ 111 | 112 | /* Loop over blockSize number of values */ 113 | blkCnt = blockSize; 114 | 115 | #endif /* #ifndef ARM_MATH_CM0 */ 116 | 117 | while(blkCnt > 0u) 118 | { 119 | /* C = A */ 120 | /* Copy and then store the results in the destination buffer */ 121 | *pDst++ = *pSrc++; 122 | 123 | /* Decrement the loop counter */ 124 | blkCnt--; 125 | } 126 | } 127 | 128 | /** 129 | * @} end of BasicCopy group 130 | */ 131 | -------------------------------------------------------------------------------- /STM32F4_QCopter_20130617/Libraries/CMSIS/SupportFunctions/arm_copy_q15.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 15. February 2012 5 | * $Revision: V1.1.0 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_copy_q15.c 9 | * 10 | * Description: Copies the elements of a Q15 vector. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Version 1.1.0 2012/02/15 15 | * Updated with more optimizations, bug fixes and minor API changes. 16 | * 17 | * Version 1.0.10 2011/7/15 18 | * Big Endian support added and Merged M0 and M3/M4 Source code. 19 | * 20 | * Version 1.0.3 2010/11/29 21 | * Re-organized the CMSIS folders and updated documentation. 22 | * 23 | * Version 1.0.2 2010/11/11 24 | * Documentation updated. 25 | * 26 | * Version 1.0.1 2010/10/05 27 | * Production release and review comments incorporated. 28 | * 29 | * Version 1.0.0 2010/09/20 30 | * Production release and review comments incorporated. 31 | * 32 | * Version 0.0.7 2010/06/10 33 | * Misra-C changes done 34 | * -------------------------------------------------------------------- */ 35 | 36 | #include "arm_math.h" 37 | 38 | /** 39 | * @ingroup groupSupport 40 | */ 41 | 42 | /** 43 | * @addtogroup copy 44 | * @{ 45 | */ 46 | /** 47 | * @brief Copies the elements of a Q15 vector. 48 | * @param[in] *pSrc points to input vector 49 | * @param[out] *pDst points to output vector 50 | * @param[in] blockSize length of the input vector 51 | * @return none. 52 | * 53 | */ 54 | 55 | void arm_copy_q15( 56 | q15_t * pSrc, 57 | q15_t * pDst, 58 | uint32_t blockSize) 59 | { 60 | uint32_t blkCnt; /* loop counter */ 61 | 62 | #ifndef ARM_MATH_CM0 63 | 64 | /* Run the below code for Cortex-M4 and Cortex-M3 */ 65 | 66 | /*loop Unrolling */ 67 | blkCnt = blockSize >> 2u; 68 | 69 | /* First part of the processing with loop unrolling. Compute 4 outputs at a time. 70 | ** a second loop below computes the remaining 1 to 3 samples. */ 71 | while(blkCnt > 0u) 72 | { 73 | /* C = A */ 74 | /* Read two inputs */ 75 | *__SIMD32(pDst)++ = *__SIMD32(pSrc)++; 76 | *__SIMD32(pDst)++ = *__SIMD32(pSrc)++; 77 | 78 | /* Decrement the loop counter */ 79 | blkCnt--; 80 | } 81 | 82 | /* If the blockSize is not a multiple of 4, compute any remaining output samples here. 83 | ** No loop unrolling is used. */ 84 | blkCnt = blockSize % 0x4u; 85 | 86 | 87 | #else 88 | 89 | /* Run the below code for Cortex-M0 */ 90 | 91 | /* Loop over blockSize number of values */ 92 | blkCnt = blockSize; 93 | 94 | #endif /* #ifndef ARM_MATH_CM0 */ 95 | 96 | while(blkCnt > 0u) 97 | { 98 | /* C = A */ 99 | /* Copy and then store the value in the destination buffer */ 100 | *pDst++ = *pSrc++; 101 | 102 | /* Decrement the loop counter */ 103 | blkCnt--; 104 | } 105 | } 106 | 107 | /** 108 | * @} end of BasicCopy group 109 | */ 110 | -------------------------------------------------------------------------------- /STM32F4_QCopter_20130617/Libraries/CMSIS/SupportFunctions/arm_copy_q31.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 15. February 2012 5 | * $Revision: V1.1.0 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_copy_q31.c 9 | * 10 | * Description: Copies the elements of a Q31 vector. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Version 1.1.0 2012/02/15 15 | * Updated with more optimizations, bug fixes and minor API changes. 16 | * 17 | * Version 1.0.10 2011/7/15 18 | * Big Endian support added and Merged M0 and M3/M4 Source code. 19 | * 20 | * Version 1.0.3 2010/11/29 21 | * Re-organized the CMSIS folders and updated documentation. 22 | * 23 | * Version 1.0.2 2010/11/11 24 | * Documentation updated. 25 | * 26 | * Version 1.0.1 2010/10/05 27 | * Production release and review comments incorporated. 28 | * 29 | * Version 1.0.0 2010/09/20 30 | * Production release and review comments incorporated. 31 | * 32 | * Version 0.0.7 2010/06/10 33 | * Misra-C changes done 34 | * -------------------------------------------------------------------- */ 35 | 36 | #include "arm_math.h" 37 | 38 | /** 39 | * @ingroup groupSupport 40 | */ 41 | 42 | /** 43 | * @addtogroup copy 44 | * @{ 45 | */ 46 | 47 | /** 48 | * @brief Copies the elements of a Q31 vector. 49 | * @param[in] *pSrc points to input vector 50 | * @param[out] *pDst points to output vector 51 | * @param[in] blockSize length of the input vector 52 | * @return none. 53 | * 54 | */ 55 | 56 | void arm_copy_q31( 57 | q31_t * pSrc, 58 | q31_t * pDst, 59 | uint32_t blockSize) 60 | { 61 | uint32_t blkCnt; /* loop counter */ 62 | 63 | 64 | #ifndef ARM_MATH_CM0 65 | 66 | /* Run the below code for Cortex-M4 and Cortex-M3 */ 67 | q31_t in1, in2, in3, in4; 68 | 69 | /*loop Unrolling */ 70 | blkCnt = blockSize >> 2u; 71 | 72 | /* First part of the processing with loop unrolling. Compute 4 outputs at a time. 73 | ** a second loop below computes the remaining 1 to 3 samples. */ 74 | while(blkCnt > 0u) 75 | { 76 | /* C = A */ 77 | /* Copy and then store the values in the destination buffer */ 78 | in1 = *pSrc++; 79 | in2 = *pSrc++; 80 | in3 = *pSrc++; 81 | in4 = *pSrc++; 82 | 83 | *pDst++ = in1; 84 | *pDst++ = in2; 85 | *pDst++ = in3; 86 | *pDst++ = in4; 87 | 88 | /* Decrement the loop counter */ 89 | blkCnt--; 90 | } 91 | 92 | /* If the blockSize is not a multiple of 4, compute any remaining output samples here. 93 | ** No loop unrolling is used. */ 94 | blkCnt = blockSize % 0x4u; 95 | 96 | #else 97 | 98 | /* Run the below code for Cortex-M0 */ 99 | 100 | /* Loop over blockSize number of values */ 101 | blkCnt = blockSize; 102 | 103 | #endif /* #ifndef ARM_MATH_CM0 */ 104 | 105 | while(blkCnt > 0u) 106 | { 107 | /* C = A */ 108 | /* Copy and then store the value in the destination buffer */ 109 | *pDst++ = *pSrc++; 110 | 111 | /* Decrement the loop counter */ 112 | blkCnt--; 113 | } 114 | } 115 | 116 | /** 117 | * @} end of BasicCopy group 118 | */ 119 | -------------------------------------------------------------------------------- /STM32F4_QCopter_20130617/Libraries/CMSIS/SupportFunctions/arm_copy_q7.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 15. February 2012 5 | * $Revision: V1.1.0 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_copy_q7.c 9 | * 10 | * Description: Copies the elements of a Q7 vector. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Version 1.1.0 2012/02/15 15 | * Updated with more optimizations, bug fixes and minor API changes. 16 | * 17 | * Version 1.0.10 2011/7/15 18 | * Big Endian support added and Merged M0 and M3/M4 Source code. 19 | * 20 | * Version 1.0.3 2010/11/29 21 | * Re-organized the CMSIS folders and updated documentation. 22 | * 23 | * Version 1.0.2 2010/11/11 24 | * Documentation updated. 25 | * 26 | * Version 1.0.1 2010/10/05 27 | * Production release and review comments incorporated. 28 | * 29 | * Version 1.0.0 2010/09/20 30 | * Production release and review comments incorporated. 31 | * 32 | * Version 0.0.7 2010/06/10 33 | * Misra-C changes done 34 | * -------------------------------------------------------------------- */ 35 | 36 | #include "arm_math.h" 37 | 38 | /** 39 | * @ingroup groupSupport 40 | */ 41 | 42 | /** 43 | * @addtogroup copy 44 | * @{ 45 | */ 46 | 47 | /** 48 | * @brief Copies the elements of a Q7 vector. 49 | * @param[in] *pSrc points to input vector 50 | * @param[out] *pDst points to output vector 51 | * @param[in] blockSize length of the input vector 52 | * @return none. 53 | * 54 | */ 55 | 56 | void arm_copy_q7( 57 | q7_t * pSrc, 58 | q7_t * pDst, 59 | uint32_t blockSize) 60 | { 61 | uint32_t blkCnt; /* loop counter */ 62 | 63 | #ifndef ARM_MATH_CM0 64 | 65 | /* Run the below code for Cortex-M4 and Cortex-M3 */ 66 | 67 | /*loop Unrolling */ 68 | blkCnt = blockSize >> 2u; 69 | 70 | /* First part of the processing with loop unrolling. Compute 4 outputs at a time. 71 | ** a second loop below computes the remaining 1 to 3 samples. */ 72 | while(blkCnt > 0u) 73 | { 74 | /* C = A */ 75 | /* Copy and then store the results in the destination buffer */ 76 | /* 4 samples are copied and stored at a time using SIMD */ 77 | *__SIMD32(pDst)++ = *__SIMD32(pSrc)++; 78 | 79 | /* Decrement the loop counter */ 80 | blkCnt--; 81 | } 82 | 83 | /* If the blockSize is not a multiple of 4, compute any remaining output samples here. 84 | ** No loop unrolling is used. */ 85 | blkCnt = blockSize % 0x4u; 86 | 87 | #else 88 | 89 | /* Run the below code for Cortex-M0 */ 90 | 91 | /* Loop over blockSize number of values */ 92 | blkCnt = blockSize; 93 | 94 | #endif /* #ifndef ARM_MATH_CM0 */ 95 | 96 | 97 | while(blkCnt > 0u) 98 | { 99 | /* C = A */ 100 | /* Copy and then store the results in the destination buffer */ 101 | *pDst++ = *pSrc++; 102 | 103 | /* Decrement the loop counter */ 104 | blkCnt--; 105 | } 106 | } 107 | 108 | /** 109 | * @} end of BasicCopy group 110 | */ 111 | -------------------------------------------------------------------------------- /STM32F4_QCopter_20130617/Libraries/CMSIS/SupportFunctions/arm_fill_f32.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 15. February 2012 5 | * $Revision: V1.1.0 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_fill_f32.c 9 | * 10 | * Description: Fills a constant value into a floating-point vector. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Version 1.1.0 2012/02/15 15 | * Updated with more optimizations, bug fixes and minor API changes. 16 | * 17 | * Version 1.0.10 2011/7/15 18 | * Big Endian support added and Merged M0 and M3/M4 Source code. 19 | * 20 | * Version 1.0.3 2010/11/29 21 | * Re-organized the CMSIS folders and updated documentation. 22 | * 23 | * Version 1.0.2 2010/11/11 24 | * Documentation updated. 25 | * 26 | * Version 1.0.1 2010/10/05 27 | * Production release and review comments incorporated. 28 | * 29 | * Version 1.0.0 2010/09/20 30 | * Production release and review comments incorporated. 31 | * 32 | * Version 0.0.7 2010/06/10 33 | * Misra-C changes done 34 | * ---------------------------------------------------------------------------- */ 35 | 36 | #include "arm_math.h" 37 | 38 | /** 39 | * @ingroup groupSupport 40 | */ 41 | 42 | /** 43 | * @defgroup Fill Vector Fill 44 | * 45 | * Fills the destination vector with a constant value. 46 | * 47 | *
48 | * pDst[n] = value; 0 <= n < blockSize. 49 | *50 | * 51 | * There are separate functions for floating point, Q31, Q15, and Q7 data types. 52 | */ 53 | 54 | /** 55 | * @addtogroup Fill 56 | * @{ 57 | */ 58 | 59 | /** 60 | * @brief Fills a constant value into a floating-point vector. 61 | * @param[in] value input value to be filled 62 | * @param[out] *pDst points to output vector 63 | * @param[in] blockSize length of the output vector 64 | * @return none. 65 | * 66 | */ 67 | 68 | 69 | void arm_fill_f32( 70 | float32_t value, 71 | float32_t * pDst, 72 | uint32_t blockSize) 73 | { 74 | uint32_t blkCnt; /* loop counter */ 75 | 76 | #ifndef ARM_MATH_CM0 77 | 78 | /* Run the below code for Cortex-M4 and Cortex-M3 */ 79 | float32_t in1 = value; 80 | float32_t in2 = value; 81 | float32_t in3 = value; 82 | float32_t in4 = value; 83 | 84 | /*loop Unrolling */ 85 | blkCnt = blockSize >> 2u; 86 | 87 | /* First part of the processing with loop unrolling. Compute 4 outputs at a time. 88 | ** a second loop below computes the remaining 1 to 3 samples. */ 89 | while(blkCnt > 0u) 90 | { 91 | /* C = value */ 92 | /* Fill the value in the destination buffer */ 93 | *pDst++ = in1; 94 | *pDst++ = in2; 95 | *pDst++ = in3; 96 | *pDst++ = in4; 97 | 98 | /* Decrement the loop counter */ 99 | blkCnt--; 100 | } 101 | 102 | /* If the blockSize is not a multiple of 4, compute any remaining output samples here. 103 | ** No loop unrolling is used. */ 104 | blkCnt = blockSize % 0x4u; 105 | 106 | #else 107 | 108 | /* Run the below code for Cortex-M0 */ 109 | 110 | /* Loop over blockSize number of values */ 111 | blkCnt = blockSize; 112 | 113 | #endif /* #ifndef ARM_MATH_CM0 */ 114 | 115 | 116 | while(blkCnt > 0u) 117 | { 118 | /* C = value */ 119 | /* Fill the value in the destination buffer */ 120 | *pDst++ = value; 121 | 122 | /* Decrement the loop counter */ 123 | blkCnt--; 124 | } 125 | } 126 | 127 | /** 128 | * @} end of Fill group 129 | */ 130 | -------------------------------------------------------------------------------- /STM32F4_QCopter_20130617/Libraries/CMSIS/SupportFunctions/arm_fill_q15.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 15. February 2012 5 | * $Revision: V1.1.0 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_fill_q15.c 9 | * 10 | * Description: Fills a constant value into a Q15 vector. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Version 1.1.0 2012/02/15 15 | * Updated with more optimizations, bug fixes and minor API changes. 16 | * 17 | * Version 1.0.10 2011/7/15 18 | * Big Endian support added and Merged M0 and M3/M4 Source code. 19 | * 20 | * Version 1.0.3 2010/11/29 21 | * Re-organized the CMSIS folders and updated documentation. 22 | * 23 | * Version 1.0.2 2010/11/11 24 | * Documentation updated. 25 | * 26 | * Version 1.0.1 2010/10/05 27 | * Production release and review comments incorporated. 28 | * 29 | * Version 1.0.0 2010/09/20 30 | * Production release and review comments incorporated. 31 | * 32 | * Version 0.0.7 2010/06/10 33 | * Misra-C changes done 34 | * -------------------------------------------------------------------- */ 35 | 36 | #include "arm_math.h" 37 | 38 | /** 39 | * @ingroup groupSupport 40 | */ 41 | 42 | /** 43 | * @addtogroup Fill 44 | * @{ 45 | */ 46 | 47 | /** 48 | * @brief Fills a constant value into a Q15 vector. 49 | * @param[in] value input value to be filled 50 | * @param[out] *pDst points to output vector 51 | * @param[in] blockSize length of the output vector 52 | * @return none. 53 | * 54 | */ 55 | 56 | void arm_fill_q15( 57 | q15_t value, 58 | q15_t * pDst, 59 | uint32_t blockSize) 60 | { 61 | uint32_t blkCnt; /* loop counter */ 62 | 63 | #ifndef ARM_MATH_CM0 64 | 65 | /* Run the below code for Cortex-M4 and Cortex-M3 */ 66 | 67 | q31_t packedValue; /* value packed to 32 bits */ 68 | 69 | 70 | /*loop Unrolling */ 71 | blkCnt = blockSize >> 2u; 72 | 73 | /* Packing two 16 bit values to 32 bit value in order to use SIMD */ 74 | packedValue = __PKHBT(value, value, 16u); 75 | 76 | /* First part of the processing with loop unrolling. Compute 4 outputs at a time. 77 | ** a second loop below computes the remaining 1 to 3 samples. */ 78 | while(blkCnt > 0u) 79 | { 80 | /* C = value */ 81 | /* Fill the value in the destination buffer */ 82 | *__SIMD32(pDst)++ = packedValue; 83 | *__SIMD32(pDst)++ = packedValue; 84 | 85 | /* Decrement the loop counter */ 86 | blkCnt--; 87 | } 88 | 89 | /* If the blockSize is not a multiple of 4, compute any remaining output samples here. 90 | ** No loop unrolling is used. */ 91 | blkCnt = blockSize % 0x4u; 92 | 93 | #else 94 | 95 | /* Run the below code for Cortex-M0 */ 96 | 97 | /* Loop over blockSize number of values */ 98 | blkCnt = blockSize; 99 | 100 | #endif /* #ifndef ARM_MATH_CM0 */ 101 | 102 | while(blkCnt > 0u) 103 | { 104 | /* C = value */ 105 | /* Fill the value in the destination buffer */ 106 | *pDst++ = value; 107 | 108 | /* Decrement the loop counter */ 109 | blkCnt--; 110 | } 111 | } 112 | 113 | /** 114 | * @} end of Fill group 115 | */ 116 | -------------------------------------------------------------------------------- /STM32F4_QCopter_20130617/Libraries/CMSIS/SupportFunctions/arm_fill_q31.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 15. February 2012 5 | * $Revision: V1.1.0 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_fill_q31.c 9 | * 10 | * Description: Fills a constant value into a Q31 vector. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Version 1.1.0 2012/02/15 15 | * Updated with more optimizations, bug fixes and minor API changes. 16 | * 17 | * Version 1.0.10 2011/7/15 18 | * Big Endian support added and Merged M0 and M3/M4 Source code. 19 | * 20 | * Version 1.0.3 2010/11/29 21 | * Re-organized the CMSIS folders and updated documentation. 22 | * 23 | * Version 1.0.2 2010/11/11 24 | * Documentation updated. 25 | * 26 | * Version 1.0.1 2010/10/05 27 | * Production release and review comments incorporated. 28 | * 29 | * Version 1.0.0 2010/09/20 30 | * Production release and review comments incorporated. 31 | * 32 | * Version 0.0.7 2010/06/10 33 | * Misra-C changes done 34 | * -------------------------------------------------------------------- */ 35 | 36 | #include "arm_math.h" 37 | 38 | /** 39 | * @ingroup groupSupport 40 | */ 41 | 42 | /** 43 | * @addtogroup Fill 44 | * @{ 45 | */ 46 | 47 | /** 48 | * @brief Fills a constant value into a Q31 vector. 49 | * @param[in] value input value to be filled 50 | * @param[out] *pDst points to output vector 51 | * @param[in] blockSize length of the output vector 52 | * @return none. 53 | * 54 | */ 55 | 56 | void arm_fill_q31( 57 | q31_t value, 58 | q31_t * pDst, 59 | uint32_t blockSize) 60 | { 61 | uint32_t blkCnt; /* loop counter */ 62 | 63 | 64 | #ifndef ARM_MATH_CM0 65 | 66 | /* Run the below code for Cortex-M4 and Cortex-M3 */ 67 | q31_t in1 = value; 68 | q31_t in2 = value; 69 | q31_t in3 = value; 70 | q31_t in4 = value; 71 | 72 | /*loop Unrolling */ 73 | blkCnt = blockSize >> 2u; 74 | 75 | /* First part of the processing with loop unrolling. Compute 4 outputs at a time. 76 | ** a second loop below computes the remaining 1 to 3 samples. */ 77 | while(blkCnt > 0u) 78 | { 79 | /* C = value */ 80 | /* Fill the value in the destination buffer */ 81 | *pDst++ = in1; 82 | *pDst++ = in2; 83 | *pDst++ = in3; 84 | *pDst++ = in4; 85 | 86 | /* Decrement the loop counter */ 87 | blkCnt--; 88 | } 89 | 90 | /* If the blockSize is not a multiple of 4, compute any remaining output samples here. 91 | ** No loop unrolling is used. */ 92 | blkCnt = blockSize % 0x4u; 93 | 94 | #else 95 | 96 | /* Run the below code for Cortex-M0 */ 97 | 98 | /* Loop over blockSize number of values */ 99 | blkCnt = blockSize; 100 | 101 | #endif /* #ifndef ARM_MATH_CM0 */ 102 | 103 | while(blkCnt > 0u) 104 | { 105 | /* C = value */ 106 | /* Fill the value in the destination buffer */ 107 | *pDst++ = value; 108 | 109 | /* Decrement the loop counter */ 110 | blkCnt--; 111 | } 112 | } 113 | 114 | /** 115 | * @} end of Fill group 116 | */ 117 | -------------------------------------------------------------------------------- /STM32F4_QCopter_20130617/Libraries/CMSIS/SupportFunctions/arm_fill_q7.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 15. February 2012 5 | * $Revision: V1.1.0 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_fill_q7.c 9 | * 10 | * Description: Fills a constant value into a Q7 vector. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Version 1.1.0 2012/02/15 15 | * Updated with more optimizations, bug fixes and minor API changes. 16 | * 17 | * Version 1.0.10 2011/7/15 18 | * Big Endian support added and Merged M0 and M3/M4 Source code. 19 | * 20 | * Version 1.0.3 2010/11/29 21 | * Re-organized the CMSIS folders and updated documentation. 22 | * 23 | * Version 1.0.2 2010/11/11 24 | * Documentation updated. 25 | * 26 | * Version 1.0.1 2010/10/05 27 | * Production release and review comments incorporated. 28 | * 29 | * Version 1.0.0 2010/09/20 30 | * Production release and review comments incorporated. 31 | * 32 | * Version 0.0.7 2010/06/10 33 | * Misra-C changes done 34 | * -------------------------------------------------------------------- */ 35 | 36 | #include "arm_math.h" 37 | 38 | /** 39 | * @ingroup groupSupport 40 | */ 41 | 42 | /** 43 | * @addtogroup Fill 44 | * @{ 45 | */ 46 | 47 | /** 48 | * @brief Fills a constant value into a Q7 vector. 49 | * @param[in] value input value to be filled 50 | * @param[out] *pDst points to output vector 51 | * @param[in] blockSize length of the output vector 52 | * @return none. 53 | * 54 | */ 55 | 56 | void arm_fill_q7( 57 | q7_t value, 58 | q7_t * pDst, 59 | uint32_t blockSize) 60 | { 61 | uint32_t blkCnt; /* loop counter */ 62 | 63 | #ifndef ARM_MATH_CM0 64 | 65 | /* Run the below code for Cortex-M4 and Cortex-M3 */ 66 | 67 | q31_t packedValue; /* value packed to 32 bits */ 68 | 69 | /*loop Unrolling */ 70 | blkCnt = blockSize >> 2u; 71 | 72 | /* Packing four 8 bit values to 32 bit value in order to use SIMD */ 73 | packedValue = __PACKq7(value, value, value, value); 74 | 75 | /* First part of the processing with loop unrolling. Compute 4 outputs at a time. 76 | ** a second loop below computes the remaining 1 to 3 samples. */ 77 | while(blkCnt > 0u) 78 | { 79 | /* C = value */ 80 | /* Fill the value in the destination buffer */ 81 | *__SIMD32(pDst)++ = packedValue; 82 | 83 | /* Decrement the loop counter */ 84 | blkCnt--; 85 | } 86 | 87 | /* If the blockSize is not a multiple of 4, compute any remaining output samples here. 88 | ** No loop unrolling is used. */ 89 | blkCnt = blockSize % 0x4u; 90 | 91 | #else 92 | 93 | /* Run the below code for Cortex-M0 */ 94 | 95 | /* Loop over blockSize number of values */ 96 | blkCnt = blockSize; 97 | 98 | #endif /* #ifndef ARM_MATH_CM0 */ 99 | 100 | while(blkCnt > 0u) 101 | { 102 | /* C = value */ 103 | /* Fill the value in the destination buffer */ 104 | *pDst++ = value; 105 | 106 | /* Decrement the loop counter */ 107 | blkCnt--; 108 | } 109 | } 110 | 111 | /** 112 | * @} end of Fill group 113 | */ 114 | -------------------------------------------------------------------------------- /STM32F4_QCopter_20130617/Libraries/CMSIS/SupportFunctions/arm_q7_to_float.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * Copyright (C) 2010 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 15. February 2012 5 | * $Revision: V1.1.0 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_q7_to_float.c 9 | * 10 | * Description: Converts the elements of the Q7 vector to floating-point vector. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Version 1.1.0 2012/02/15 15 | * Updated with more optimizations, bug fixes and minor API changes. 16 | * 17 | * Version 1.0.10 2011/7/15 18 | * Big Endian support added and Merged M0 and M3/M4 Source code. 19 | * 20 | * Version 1.0.3 2010/11/29 21 | * Re-organized the CMSIS folders and updated documentation. 22 | * 23 | * Version 1.0.2 2010/11/11 24 | * Documentation updated. 25 | * 26 | * Version 1.0.1 2010/10/05 27 | * Production release and review comments incorporated. 28 | * 29 | * Version 1.0.0 2010/09/20 30 | * Production release and review comments incorporated. 31 | * ---------------------------------------------------------------------------- */ 32 | 33 | #include "arm_math.h" 34 | 35 | /** 36 | * @ingroup groupSupport 37 | */ 38 | 39 | /** 40 | * @defgroup q7_to_x Convert 8-bit Integer value 41 | */ 42 | 43 | /** 44 | * @addtogroup q7_to_x 45 | * @{ 46 | */ 47 | 48 | /** 49 | * @brief Converts the elements of the Q7 vector to floating-point vector. 50 | * @param[in] *pSrc points to the Q7 input vector 51 | * @param[out] *pDst points to the floating-point output vector 52 | * @param[in] blockSize length of the input vector 53 | * @return none. 54 | * 55 | * \par Description: 56 | * 57 | * The equation used for the conversion process is: 58 | * 59 | *
60 | * pDst[n] = (float32_t) pSrc[n] / 128; 0 <= n < blockSize. 61 | *62 | * 63 | */ 64 | 65 | 66 | void arm_q7_to_float( 67 | q7_t * pSrc, 68 | float32_t * pDst, 69 | uint32_t blockSize) 70 | { 71 | q7_t *pIn = pSrc; /* Src pointer */ 72 | uint32_t blkCnt; /* loop counter */ 73 | 74 | 75 | #ifndef ARM_MATH_CM0 76 | 77 | /* Run the below code for Cortex-M4 and Cortex-M3 */ 78 | 79 | /*loop Unrolling */ 80 | blkCnt = blockSize >> 2u; 81 | 82 | /* First part of the processing with loop unrolling. Compute 4 outputs at a time. 83 | ** a second loop below computes the remaining 1 to 3 samples. */ 84 | while(blkCnt > 0u) 85 | { 86 | /* C = (float32_t) A / 128 */ 87 | /* convert from q7 to float and then store the results in the destination buffer */ 88 | *pDst++ = ((float32_t) * pIn++ / 128.0f); 89 | *pDst++ = ((float32_t) * pIn++ / 128.0f); 90 | *pDst++ = ((float32_t) * pIn++ / 128.0f); 91 | *pDst++ = ((float32_t) * pIn++ / 128.0f); 92 | 93 | /* Decrement the loop counter */ 94 | blkCnt--; 95 | } 96 | 97 | /* If the blockSize is not a multiple of 4, compute any remaining output samples here. 98 | ** No loop unrolling is used. */ 99 | blkCnt = blockSize % 0x4u; 100 | 101 | #else 102 | 103 | /* Run the below code for Cortex-M0 */ 104 | 105 | /* Loop over blockSize number of values */ 106 | blkCnt = blockSize; 107 | 108 | #endif /* #ifndef ARM_MATH_CM0 */ 109 | 110 | while(blkCnt > 0u) 111 | { 112 | /* C = (float32_t) A / 128 */ 113 | /* convert from q7 to float and then store the results in the destination buffer */ 114 | *pDst++ = ((float32_t) * pIn++ / 128.0f); 115 | 116 | /* Decrement the loop counter */ 117 | blkCnt--; 118 | } 119 | } 120 | 121 | /** 122 | * @} end of q7_to_x group 123 | */ 124 | -------------------------------------------------------------------------------- /STM32F4_QCopter_20130617/Libraries/CMSIS/arm_common_tables.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 11. November 2010 5 | * $Revision: V1.0.2 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_common_tables.h 9 | * 10 | * Description: This file has extern declaration for common tables like Bitreverse, reciprocal etc which are used across different functions 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3 13 | * 14 | * Version 1.0.2 2010/11/11 15 | * Documentation updated. 16 | * 17 | * Version 1.0.1 2010/10/05 18 | * Production release and review comments incorporated. 19 | * 20 | * Version 1.0.0 2010/09/20 21 | * Production release and review comments incorporated. 22 | * -------------------------------------------------------------------- */ 23 | 24 | #ifndef _ARM_COMMON_TABLES_H 25 | #define _ARM_COMMON_TABLES_H 26 | 27 | #include "arm_math.h" 28 | 29 | extern const uint16_t armBitRevTable[1024]; 30 | extern const q15_t armRecipTableQ15[64]; 31 | extern const q31_t armRecipTableQ31[64]; 32 | extern const q31_t realCoefAQ31[1024]; 33 | extern const q31_t realCoefBQ31[1024]; 34 | extern const float32_t twiddleCoef[6144]; 35 | extern const q31_t twiddleCoefQ31[6144]; 36 | extern const q15_t twiddleCoefQ15[6144]; 37 | 38 | #endif /* ARM_COMMON_TABLES_H */ 39 | -------------------------------------------------------------------------------- /STM32F4_QCopter_20130617/Libraries/CMSIS/stm32f4xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hom-Wang/Quadcopter/c183227b0d462d4653904d70477b0d93cc3441bc/STM32F4_QCopter_20130617/Libraries/CMSIS/stm32f4xx.h -------------------------------------------------------------------------------- /STM32F4_QCopter_20130617/Libraries/CMSIS/system_stm32f4xx.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file system_stm32f4xx.h 4 | * @author MCD Application Team 5 | * @version V1.1.0 6 | * @date 11-January-2013 7 | * @brief CMSIS Cortex-M4 Device System Source File for STM32F4xx devices. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *