├── .gitignore ├── .travis.yml ├── Drivers ├── CMSIS │ ├── DSP_Lib │ │ ├── Examples │ │ │ ├── arm_class_marks_example │ │ │ │ ├── ARM │ │ │ │ │ └── arm_class_marks_example_f32.c │ │ │ │ └── GCC │ │ │ │ │ └── arm_class_marks_example_f32.c │ │ │ ├── arm_convolution_example │ │ │ │ ├── ARM │ │ │ │ │ ├── arm_convolution_example_f32.c │ │ │ │ │ ├── math_helper.c │ │ │ │ │ └── math_helper.h │ │ │ │ └── GCC │ │ │ │ │ ├── arm_convolution_example_f32.c │ │ │ │ │ ├── math_helper.c │ │ │ │ │ └── math_helper.h │ │ │ ├── arm_dotproduct_example │ │ │ │ ├── ARM │ │ │ │ │ └── arm_dotproduct_example_f32.c │ │ │ │ └── GCC │ │ │ │ │ └── arm_dotproduct_example_f32.c │ │ │ ├── arm_fft_bin_example │ │ │ │ ├── ARM │ │ │ │ │ ├── arm_fft_bin_data.c │ │ │ │ │ └── arm_fft_bin_example_f32.c │ │ │ │ └── GCC │ │ │ │ │ ├── arm_fft_bin_data.c │ │ │ │ │ └── arm_fft_bin_example_f32.c │ │ │ ├── arm_fir_example │ │ │ │ └── ARM │ │ │ │ │ ├── arm_fir_data.c │ │ │ │ │ ├── arm_fir_example_f32.c │ │ │ │ │ ├── math_helper.c │ │ │ │ │ └── math_helper.h │ │ │ ├── arm_graphic_equalizer_example │ │ │ │ └── ARM │ │ │ │ │ ├── arm_graphic_equalizer_data.c │ │ │ │ │ ├── arm_graphic_equalizer_example_q31.c │ │ │ │ │ ├── math_helper.c │ │ │ │ │ └── math_helper.h │ │ │ ├── arm_linear_interp_example │ │ │ │ └── ARM │ │ │ │ │ ├── arm_linear_interp_data.c │ │ │ │ │ ├── arm_linear_interp_example_f32.c │ │ │ │ │ ├── math_helper.c │ │ │ │ │ └── math_helper.h │ │ │ ├── arm_matrix_example │ │ │ │ └── ARM │ │ │ │ │ ├── arm_matrix_example_f32.c │ │ │ │ │ ├── math_helper.c │ │ │ │ │ └── math_helper.h │ │ │ ├── arm_signal_converge_example │ │ │ │ └── ARM │ │ │ │ │ ├── arm_signal_converge_data.c │ │ │ │ │ ├── arm_signal_converge_example_f32.c │ │ │ │ │ ├── math_helper.c │ │ │ │ │ └── math_helper.h │ │ │ ├── arm_sin_cos_example │ │ │ │ └── ARM │ │ │ │ │ └── arm_sin_cos_example_f32.c │ │ │ └── arm_variance_example │ │ │ │ └── ARM │ │ │ │ └── arm_variance_example_f32.c │ │ └── Source │ │ │ ├── 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 │ │ │ └── arm_const_structs.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_f64.c │ │ │ ├── arm_biquad_cascade_df2T_init_f32.c │ │ │ ├── arm_biquad_cascade_df2T_init_f64.c │ │ │ ├── arm_biquad_cascade_stereo_df2T_f32.c │ │ │ ├── arm_biquad_cascade_stereo_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_cmplx_mult_f32.c │ │ │ ├── arm_mat_cmplx_mult_q15.c │ │ │ ├── arm_mat_cmplx_mult_q31.c │ │ │ ├── arm_mat_init_f32.c │ │ │ ├── arm_mat_init_q15.c │ │ │ ├── arm_mat_init_q31.c │ │ │ ├── arm_mat_inverse_f32.c │ │ │ ├── arm_mat_inverse_f64.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_f32.c │ │ │ ├── arm_cfft_q15.c │ │ │ ├── arm_cfft_q31.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_cfft_radix8_f32.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_fast_f32.c │ │ │ ├── arm_rfft_fast_init_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 │ ├── Device │ │ └── ST │ │ │ └── STM32F0xx │ │ │ ├── Include │ │ │ ├── stm32f030x6.h │ │ │ ├── stm32f030x8.h │ │ │ ├── stm32f030xc.h │ │ │ ├── stm32f031x6.h │ │ │ ├── stm32f038xx.h │ │ │ ├── stm32f042x6.h │ │ │ ├── stm32f048xx.h │ │ │ ├── stm32f051x8.h │ │ │ ├── stm32f058xx.h │ │ │ ├── stm32f070x6.h │ │ │ ├── stm32f070xb.h │ │ │ ├── stm32f071xb.h │ │ │ ├── stm32f072xb.h │ │ │ ├── stm32f078xx.h │ │ │ ├── stm32f091xc.h │ │ │ ├── stm32f098xx.h │ │ │ ├── stm32f0xx.h │ │ │ └── system_stm32f0xx.h │ │ │ └── Source │ │ │ └── Templates │ │ │ ├── arm │ │ │ ├── startup_stm32f030x6.s │ │ │ ├── startup_stm32f030x8.s │ │ │ ├── startup_stm32f030xc.s │ │ │ ├── startup_stm32f031x6.s │ │ │ ├── startup_stm32f038xx.s │ │ │ ├── startup_stm32f042x6.s │ │ │ ├── startup_stm32f048xx.s │ │ │ ├── startup_stm32f051x8.s │ │ │ ├── startup_stm32f058xx.s │ │ │ ├── startup_stm32f070x6.s │ │ │ ├── startup_stm32f070xb.s │ │ │ ├── startup_stm32f071xb.s │ │ │ ├── startup_stm32f072xb.s │ │ │ ├── startup_stm32f078xx.s │ │ │ ├── startup_stm32f091xc.s │ │ │ └── startup_stm32f098xx.s │ │ │ ├── gcc │ │ │ ├── startup_stm32f030x6.s │ │ │ ├── startup_stm32f030x8.s │ │ │ ├── startup_stm32f030xc.s │ │ │ ├── startup_stm32f031x6.s │ │ │ ├── startup_stm32f038xx.s │ │ │ ├── startup_stm32f042x6.s │ │ │ ├── startup_stm32f048xx.s │ │ │ ├── startup_stm32f051x8.s │ │ │ ├── startup_stm32f058xx.s │ │ │ ├── startup_stm32f070x6.s │ │ │ ├── startup_stm32f070xb.s │ │ │ ├── startup_stm32f071xb.s │ │ │ ├── startup_stm32f072xb.s │ │ │ ├── startup_stm32f078xx.s │ │ │ ├── startup_stm32f091xc.s │ │ │ └── startup_stm32f098xx.s │ │ │ ├── iar │ │ │ ├── linker │ │ │ │ ├── stm32f030x6_flash.icf │ │ │ │ ├── stm32f030x8_flash.icf │ │ │ │ ├── stm32f030xc_flash.icf │ │ │ │ ├── stm32f031x6_flash.icf │ │ │ │ ├── stm32f038xx_flash.icf │ │ │ │ ├── stm32f042x6_flash.icf │ │ │ │ ├── stm32f048xx_flash.icf │ │ │ │ ├── stm32f051x8_flash.icf │ │ │ │ ├── stm32f058xx_flash.icf │ │ │ │ ├── stm32f070x6_flash.icf │ │ │ │ ├── stm32f070xb_flash.icf │ │ │ │ ├── stm32f071xb_flash.icf │ │ │ │ ├── stm32f072xb_flash.icf │ │ │ │ ├── stm32f078xx_flash.icf │ │ │ │ ├── stm32f091xc_flash.icf │ │ │ │ ├── stm32f091xc_sram.icf │ │ │ │ ├── stm32f098xx_flash.icf │ │ │ │ └── stm32f098xx_sram.icf │ │ │ ├── startup_stm32f030x6.s │ │ │ ├── startup_stm32f030x8.s │ │ │ ├── startup_stm32f030xc.s │ │ │ ├── startup_stm32f031x6.s │ │ │ ├── startup_stm32f038xx.s │ │ │ ├── startup_stm32f042x6.s │ │ │ ├── startup_stm32f048xx.s │ │ │ ├── startup_stm32f051x8.s │ │ │ ├── startup_stm32f058xx.s │ │ │ ├── startup_stm32f070x6.s │ │ │ ├── startup_stm32f070xb.s │ │ │ ├── startup_stm32f071xb.s │ │ │ ├── startup_stm32f072xb.s │ │ │ ├── startup_stm32f078xx.s │ │ │ ├── startup_stm32f091xc.s │ │ │ └── startup_stm32f098xx.s │ │ │ └── system_stm32f0xx.c │ ├── Include │ │ ├── arm_common_tables.h │ │ ├── arm_const_structs.h │ │ ├── arm_math.h │ │ ├── cmsis_armcc.h │ │ ├── cmsis_armcc_V6.h │ │ ├── cmsis_gcc.h │ │ ├── core_cm0.h │ │ ├── core_cm0plus.h │ │ ├── core_cm3.h │ │ ├── core_cm4.h │ │ ├── core_cm7.h │ │ ├── core_cmFunc.h │ │ ├── core_cmInstr.h │ │ ├── core_cmSimd.h │ │ ├── core_sc000.h │ │ └── core_sc300.h │ ├── Lib │ │ ├── ARM │ │ │ ├── arm_cortexM0b_math.lib │ │ │ └── arm_cortexM0l_math.lib │ │ └── GCC │ │ │ └── libarm_cortexM0l_math.a │ └── RTOS │ │ └── Template │ │ └── cmsis_os.h └── STM32F0xx_HAL_Driver │ ├── Inc │ ├── Legacy │ │ ├── stm32_hal_legacy.h │ │ └── stm32f0xx_hal_can_legacy.h │ ├── stm32_assert_template.h │ ├── stm32f0xx_hal.h │ ├── stm32f0xx_hal_adc.h │ ├── stm32f0xx_hal_adc_ex.h │ ├── stm32f0xx_hal_can.h │ ├── stm32f0xx_hal_cec.h │ ├── stm32f0xx_hal_comp.h │ ├── stm32f0xx_hal_conf_template.h │ ├── stm32f0xx_hal_cortex.h │ ├── stm32f0xx_hal_crc.h │ ├── stm32f0xx_hal_crc_ex.h │ ├── stm32f0xx_hal_dac.h │ ├── stm32f0xx_hal_dac_ex.h │ ├── stm32f0xx_hal_def.h │ ├── stm32f0xx_hal_dma.h │ ├── stm32f0xx_hal_dma_ex.h │ ├── stm32f0xx_hal_exti.h │ ├── stm32f0xx_hal_flash.h │ ├── stm32f0xx_hal_flash_ex.h │ ├── stm32f0xx_hal_gpio.h │ ├── stm32f0xx_hal_gpio_ex.h │ ├── stm32f0xx_hal_i2c.h │ ├── stm32f0xx_hal_i2c_ex.h │ ├── stm32f0xx_hal_i2s.h │ ├── stm32f0xx_hal_irda.h │ ├── stm32f0xx_hal_irda_ex.h │ ├── stm32f0xx_hal_iwdg.h │ ├── stm32f0xx_hal_pcd.h │ ├── stm32f0xx_hal_pcd_ex.h │ ├── stm32f0xx_hal_pwr.h │ ├── stm32f0xx_hal_pwr_ex.h │ ├── stm32f0xx_hal_rcc.h │ ├── stm32f0xx_hal_rcc_ex.h │ ├── stm32f0xx_hal_rtc.h │ ├── stm32f0xx_hal_rtc_ex.h │ ├── stm32f0xx_hal_smartcard.h │ ├── stm32f0xx_hal_smartcard_ex.h │ ├── stm32f0xx_hal_smbus.h │ ├── stm32f0xx_hal_spi.h │ ├── stm32f0xx_hal_spi_ex.h │ ├── stm32f0xx_hal_tim.h │ ├── stm32f0xx_hal_tim_ex.h │ ├── stm32f0xx_hal_tsc.h │ ├── stm32f0xx_hal_uart.h │ ├── stm32f0xx_hal_uart_ex.h │ ├── stm32f0xx_hal_usart.h │ ├── stm32f0xx_hal_usart_ex.h │ ├── stm32f0xx_hal_wwdg.h │ ├── stm32f0xx_ll_adc.h │ ├── stm32f0xx_ll_bus.h │ ├── stm32f0xx_ll_comp.h │ ├── stm32f0xx_ll_cortex.h │ ├── stm32f0xx_ll_crc.h │ ├── stm32f0xx_ll_crs.h │ ├── stm32f0xx_ll_dac.h │ ├── stm32f0xx_ll_dma.h │ ├── stm32f0xx_ll_exti.h │ ├── stm32f0xx_ll_gpio.h │ ├── stm32f0xx_ll_i2c.h │ ├── stm32f0xx_ll_iwdg.h │ ├── stm32f0xx_ll_pwr.h │ ├── stm32f0xx_ll_rcc.h │ ├── stm32f0xx_ll_rtc.h │ ├── stm32f0xx_ll_spi.h │ ├── stm32f0xx_ll_system.h │ ├── stm32f0xx_ll_tim.h │ ├── stm32f0xx_ll_usart.h │ ├── stm32f0xx_ll_usb.h │ ├── stm32f0xx_ll_utils.h │ └── stm32f0xx_ll_wwdg.h │ └── Src │ ├── stm32f0xx_hal.c │ ├── stm32f0xx_hal_adc.c │ ├── stm32f0xx_hal_adc_ex.c │ ├── stm32f0xx_hal_can.c │ ├── stm32f0xx_hal_cec.c │ ├── stm32f0xx_hal_comp.c │ ├── stm32f0xx_hal_cortex.c │ ├── stm32f0xx_hal_crc.c │ ├── stm32f0xx_hal_crc_ex.c │ ├── stm32f0xx_hal_dac.c │ ├── stm32f0xx_hal_dac_ex.c │ ├── stm32f0xx_hal_dma.c │ ├── stm32f0xx_hal_exti.c │ ├── stm32f0xx_hal_flash.c │ ├── stm32f0xx_hal_flash_ex.c │ ├── stm32f0xx_hal_gpio.c │ ├── stm32f0xx_hal_i2c.c │ ├── stm32f0xx_hal_i2c_ex.c │ ├── stm32f0xx_hal_i2s.c │ ├── stm32f0xx_hal_irda.c │ ├── stm32f0xx_hal_iwdg.c │ ├── stm32f0xx_hal_pcd.c │ ├── stm32f0xx_hal_pcd_ex.c │ ├── stm32f0xx_hal_pwr.c │ ├── stm32f0xx_hal_pwr_ex.c │ ├── stm32f0xx_hal_rcc.c │ ├── stm32f0xx_hal_rcc_ex.c │ ├── stm32f0xx_hal_rtc.c │ ├── stm32f0xx_hal_rtc_ex.c │ ├── stm32f0xx_hal_smartcard.c │ ├── stm32f0xx_hal_smartcard_ex.c │ ├── stm32f0xx_hal_smbus.c │ ├── stm32f0xx_hal_spi.c │ ├── stm32f0xx_hal_spi_ex.c │ ├── stm32f0xx_hal_tim.c │ ├── stm32f0xx_hal_tim_ex.c │ ├── stm32f0xx_hal_tsc.c │ ├── stm32f0xx_hal_uart.c │ ├── stm32f0xx_hal_uart_ex.c │ ├── stm32f0xx_hal_usart.c │ ├── stm32f0xx_hal_usart_ex.c │ ├── stm32f0xx_hal_wwdg.c │ ├── stm32f0xx_ll_adc.c │ ├── stm32f0xx_ll_comp.c │ ├── stm32f0xx_ll_crc.c │ ├── stm32f0xx_ll_crs.c │ ├── stm32f0xx_ll_dac.c │ ├── stm32f0xx_ll_dma.c │ ├── stm32f0xx_ll_exti.c │ ├── stm32f0xx_ll_gpio.c │ ├── stm32f0xx_ll_i2c.c │ ├── stm32f0xx_ll_pwr.c │ ├── stm32f0xx_ll_rcc.c │ ├── stm32f0xx_ll_rtc.c │ ├── stm32f0xx_ll_spi.c │ ├── stm32f0xx_ll_tim.c │ ├── stm32f0xx_ll_usart.c │ ├── stm32f0xx_ll_usb.c │ └── stm32f0xx_ll_utils.c ├── LICENSE.md ├── Makefile ├── Middlewares └── ST │ └── STM32_USB_Device_Library │ ├── Class │ └── CDC │ │ ├── Inc │ │ ├── usbd_cdc.h │ │ └── usbd_cdc_if_template.h │ │ └── Src │ │ ├── usbd_cdc.c │ │ └── usbd_cdc_if_template.c │ └── Core │ ├── Inc │ ├── usbd_conf_template.h │ ├── usbd_core.h │ ├── usbd_ctlreq.h │ ├── usbd_def.h │ └── usbd_ioreq.h │ └── Src │ ├── usbd_conf_template.c │ ├── usbd_core.c │ ├── usbd_ctlreq.c │ └── usbd_ioreq.c ├── README.md ├── STM32F042C6_FLASH.ld ├── cube └── canable.ioc ├── inc ├── can.h ├── error.h ├── interrupts.h ├── led.h ├── printf.h ├── slcan.h ├── stm32f0xx_hal_conf.h ├── system.h ├── usb_device.h ├── usbd_cdc_if.h ├── usbd_conf.h └── usbd_desc.h ├── src ├── .directory ├── can.c ├── error.c ├── interrupts.c ├── led.c ├── main.c ├── printf.c ├── slcan.c ├── startup_stm32f042x6.s ├── system.c ├── system_stm32f0xx.c ├── usb_device.c ├── usbd_cdc_if.c ├── usbd_conf.c └── usbd_desc.c ├── stm32f0x.cfg └── windows-driver └── cantact.inf /.gitignore: -------------------------------------------------------------------------------- 1 | build/* 2 | /Default/ 3 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | notifications: 2 | email: false 3 | 4 | language: c 5 | 6 | env: 7 | global: 8 | - "ARTIFACTS_AWS_REGION=us-east-1" 9 | - "ARTIFACTS_S3_BUCKET=cantact-builds" 10 | - secure: "gol8KyPaZuEpibS+JIrzfWuwaYNtHF0gLR0Lol6PM49KZPnHfAg9P2zMNhESL6ZTmWFwEmhxuntFvOQbGqB55cJbmOv3ZeuYkMw4y+GRwKB3pRAqQTQXOx8uBSCvBw+zmwmbswUA+dlKVQAgGvHxjQRwSfByedZsDaCz/ACd7qs=" 11 | - secure: "dxFGsRnHyQWQgFBJztagS7OBWSef/p+tn9JhTgIOAZlI86dEe1bI/grkELsq4EV9IdgHFz6ks9+TT9Sb4IFu7+275sBJKAJOZw7Q2nILkUreF2WMwOJQd2ih0uQu3b68ccQxqQhp3s5FrOcUedwqnrM+Jk3+MhpKWO+cVgQ0SqQ=" 12 | 13 | before_script: 14 | - sudo apt-add-repository 'deb http://archive.ubuntu.com/ubuntu trusty main universe multiverse restricted' 15 | - sudo apt-get update -qq 16 | - sudo apt-get install -y gcc-arm-none-eabi 17 | - curl -sL https://raw.githubusercontent.com/travis-ci/artifacts/master/install | bash 18 | - export PATH=$PATH:~/bin/ 19 | 20 | script: make BUILD_NUMBER=$TRAVIS_BUILD_NUMBER 21 | 22 | after_success: 23 | "artifacts upload --target-paths=builds/b$TRAVIS_BUILD_NUMBER build/CANtact*" -------------------------------------------------------------------------------- /Drivers/CMSIS/DSP_Lib/Examples/arm_convolution_example/ARM/math_helper.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2013 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 17. January 2013 5 | * $Revision: V1.4.0 6 | * 7 | * Project: CMSIS DSP Library 8 | * 9 | * Title: math_helper.h 10 | * 11 | * Description: Prototypes of all helper functions required. 12 | * 13 | * Target Processor: Cortex-M4/Cortex-M3 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * - Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * - Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * - Neither the name of ARM LIMITED nor the names of its contributors 25 | * may be used to endorse or promote products derived from this 26 | * software without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 31 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 32 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 33 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 34 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 35 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 36 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 37 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 38 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | * -------------------------------------------------------------------- */ 41 | 42 | 43 | #include "arm_math.h" 44 | 45 | #ifndef MATH_HELPER_H 46 | #define MATH_HELPER_H 47 | 48 | float arm_snr_f32(float *pRef, float *pTest, uint32_t buffSize); 49 | void arm_float_to_q12_20(float *pIn, q31_t * pOut, uint32_t numSamples); 50 | void arm_provide_guard_bits_q15(q15_t *input_buf, uint32_t blockSize, uint32_t guard_bits); 51 | void arm_provide_guard_bits_q31(q31_t *input_buf, uint32_t blockSize, uint32_t guard_bits); 52 | void arm_float_to_q14(float *pIn, q15_t *pOut, uint32_t numSamples); 53 | void arm_float_to_q29(float *pIn, q31_t *pOut, uint32_t numSamples); 54 | void arm_float_to_q28(float *pIn, q31_t *pOut, uint32_t numSamples); 55 | void arm_float_to_q30(float *pIn, q31_t *pOut, uint32_t numSamples); 56 | void arm_clip_f32(float *pIn, uint32_t numSamples); 57 | uint32_t arm_calc_guard_bits(uint32_t num_adds); 58 | void arm_apply_guard_bits (float32_t * pIn, uint32_t numSamples, uint32_t guard_bits); 59 | uint32_t arm_compare_fixed_q15(q15_t *pIn, q15_t * pOut, uint32_t numSamples); 60 | uint32_t arm_compare_fixed_q31(q31_t *pIn, q31_t *pOut, uint32_t numSamples); 61 | uint32_t arm_calc_2pow(uint32_t guard_bits); 62 | #endif 63 | 64 | -------------------------------------------------------------------------------- /Drivers/CMSIS/DSP_Lib/Examples/arm_convolution_example/GCC/math_helper.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2013 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 17. January 2013 5 | * $Revision: V1.4.0 6 | * 7 | * Project: CMSIS DSP Library 8 | * 9 | * Title: math_helper.h 10 | * 11 | * Description: Prototypes of all helper functions required. 12 | * 13 | * Target Processor: Cortex-M4/Cortex-M3 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * - Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * - Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * - Neither the name of ARM LIMITED nor the names of its contributors 25 | * may be used to endorse or promote products derived from this 26 | * software without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 31 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 32 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 33 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 34 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 35 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 36 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 37 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 38 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | * -------------------------------------------------------------------- */ 41 | 42 | 43 | #include "arm_math.h" 44 | 45 | #ifndef MATH_HELPER_H 46 | #define MATH_HELPER_H 47 | 48 | float arm_snr_f32(float *pRef, float *pTest, uint32_t buffSize); 49 | void arm_float_to_q12_20(float *pIn, q31_t * pOut, uint32_t numSamples); 50 | void arm_provide_guard_bits_q15(q15_t *input_buf, uint32_t blockSize, uint32_t guard_bits); 51 | void arm_provide_guard_bits_q31(q31_t *input_buf, uint32_t blockSize, uint32_t guard_bits); 52 | void arm_float_to_q14(float *pIn, q15_t *pOut, uint32_t numSamples); 53 | void arm_float_to_q29(float *pIn, q31_t *pOut, uint32_t numSamples); 54 | void arm_float_to_q28(float *pIn, q31_t *pOut, uint32_t numSamples); 55 | void arm_float_to_q30(float *pIn, q31_t *pOut, uint32_t numSamples); 56 | void arm_clip_f32(float *pIn, uint32_t numSamples); 57 | uint32_t arm_calc_guard_bits(uint32_t num_adds); 58 | void arm_apply_guard_bits (float32_t * pIn, uint32_t numSamples, uint32_t guard_bits); 59 | uint32_t arm_compare_fixed_q15(q15_t *pIn, q15_t * pOut, uint32_t numSamples); 60 | uint32_t arm_compare_fixed_q31(q31_t *pIn, q31_t *pOut, uint32_t numSamples); 61 | uint32_t arm_calc_2pow(uint32_t guard_bits); 62 | #endif 63 | 64 | -------------------------------------------------------------------------------- /Drivers/CMSIS/DSP_Lib/Examples/arm_fir_example/ARM/math_helper.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2013 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 17. January 2013 5 | * $Revision: V1.4.0 6 | * 7 | * Project: CMSIS DSP Library 8 | * 9 | * Title: math_helper.h 10 | * 11 | * Description: Prototypes of all helper functions required. 12 | * 13 | * Target Processor: Cortex-M4/Cortex-M3 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * - Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * - Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * - Neither the name of ARM LIMITED nor the names of its contributors 25 | * may be used to endorse or promote products derived from this 26 | * software without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 31 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 32 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 33 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 34 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 35 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 36 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 37 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 38 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | * -------------------------------------------------------------------- */ 41 | 42 | 43 | #include "arm_math.h" 44 | 45 | #ifndef MATH_HELPER_H 46 | #define MATH_HELPER_H 47 | 48 | float arm_snr_f32(float *pRef, float *pTest, uint32_t buffSize); 49 | void arm_float_to_q12_20(float *pIn, q31_t * pOut, uint32_t numSamples); 50 | void arm_provide_guard_bits_q15(q15_t *input_buf, uint32_t blockSize, uint32_t guard_bits); 51 | void arm_provide_guard_bits_q31(q31_t *input_buf, uint32_t blockSize, uint32_t guard_bits); 52 | void arm_float_to_q14(float *pIn, q15_t *pOut, uint32_t numSamples); 53 | void arm_float_to_q29(float *pIn, q31_t *pOut, uint32_t numSamples); 54 | void arm_float_to_q28(float *pIn, q31_t *pOut, uint32_t numSamples); 55 | void arm_float_to_q30(float *pIn, q31_t *pOut, uint32_t numSamples); 56 | void arm_clip_f32(float *pIn, uint32_t numSamples); 57 | uint32_t arm_calc_guard_bits(uint32_t num_adds); 58 | void arm_apply_guard_bits (float32_t * pIn, uint32_t numSamples, uint32_t guard_bits); 59 | uint32_t arm_compare_fixed_q15(q15_t *pIn, q15_t * pOut, uint32_t numSamples); 60 | uint32_t arm_compare_fixed_q31(q31_t *pIn, q31_t *pOut, uint32_t numSamples); 61 | uint32_t arm_calc_2pow(uint32_t guard_bits); 62 | #endif 63 | 64 | -------------------------------------------------------------------------------- /Drivers/CMSIS/DSP_Lib/Examples/arm_graphic_equalizer_example/ARM/math_helper.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2013 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 17. January 2013 5 | * $Revision: V1.4.0 6 | * 7 | * Project: CMSIS DSP Library 8 | * 9 | * Title: math_helper.h 10 | * 11 | * Description: Prototypes of all helper functions required. 12 | * 13 | * Target Processor: Cortex-M4/Cortex-M3 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * - Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * - Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * - Neither the name of ARM LIMITED nor the names of its contributors 25 | * may be used to endorse or promote products derived from this 26 | * software without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 31 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 32 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 33 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 34 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 35 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 36 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 37 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 38 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | * -------------------------------------------------------------------- */ 41 | 42 | 43 | #include "arm_math.h" 44 | 45 | #ifndef MATH_HELPER_H 46 | #define MATH_HELPER_H 47 | 48 | float arm_snr_f32(float *pRef, float *pTest, uint32_t buffSize); 49 | void arm_float_to_q12_20(float *pIn, q31_t * pOut, uint32_t numSamples); 50 | void arm_provide_guard_bits_q15(q15_t *input_buf, uint32_t blockSize, uint32_t guard_bits); 51 | void arm_provide_guard_bits_q31(q31_t *input_buf, uint32_t blockSize, uint32_t guard_bits); 52 | void arm_float_to_q14(float *pIn, q15_t *pOut, uint32_t numSamples); 53 | void arm_float_to_q29(float *pIn, q31_t *pOut, uint32_t numSamples); 54 | void arm_float_to_q28(float *pIn, q31_t *pOut, uint32_t numSamples); 55 | void arm_float_to_q30(float *pIn, q31_t *pOut, uint32_t numSamples); 56 | void arm_clip_f32(float *pIn, uint32_t numSamples); 57 | uint32_t arm_calc_guard_bits(uint32_t num_adds); 58 | void arm_apply_guard_bits (float32_t * pIn, uint32_t numSamples, uint32_t guard_bits); 59 | uint32_t arm_compare_fixed_q15(q15_t *pIn, q15_t * pOut, uint32_t numSamples); 60 | uint32_t arm_compare_fixed_q31(q31_t *pIn, q31_t *pOut, uint32_t numSamples); 61 | uint32_t arm_calc_2pow(uint32_t guard_bits); 62 | #endif 63 | 64 | -------------------------------------------------------------------------------- /Drivers/CMSIS/DSP_Lib/Examples/arm_linear_interp_example/ARM/math_helper.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2013 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 17. January 2013 5 | * $Revision: V1.4.0 6 | * 7 | * Project: CMSIS DSP Library 8 | * 9 | * Title: math_helper.h 10 | * 11 | * Description: Prototypes of all helper functions required. 12 | * 13 | * Target Processor: Cortex-M4/Cortex-M3 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * - Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * - Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * - Neither the name of ARM LIMITED nor the names of its contributors 25 | * may be used to endorse or promote products derived from this 26 | * software without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 31 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 32 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 33 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 34 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 35 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 36 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 37 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 38 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | * -------------------------------------------------------------------- */ 41 | 42 | 43 | #include "arm_math.h" 44 | 45 | #ifndef MATH_HELPER_H 46 | #define MATH_HELPER_H 47 | 48 | float arm_snr_f32(float *pRef, float *pTest, uint32_t buffSize); 49 | void arm_float_to_q12_20(float *pIn, q31_t * pOut, uint32_t numSamples); 50 | void arm_provide_guard_bits_q15(q15_t *input_buf, uint32_t blockSize, uint32_t guard_bits); 51 | void arm_provide_guard_bits_q31(q31_t *input_buf, uint32_t blockSize, uint32_t guard_bits); 52 | void arm_float_to_q14(float *pIn, q15_t *pOut, uint32_t numSamples); 53 | void arm_float_to_q29(float *pIn, q31_t *pOut, uint32_t numSamples); 54 | void arm_float_to_q28(float *pIn, q31_t *pOut, uint32_t numSamples); 55 | void arm_float_to_q30(float *pIn, q31_t *pOut, uint32_t numSamples); 56 | void arm_clip_f32(float *pIn, uint32_t numSamples); 57 | uint32_t arm_calc_guard_bits(uint32_t num_adds); 58 | void arm_apply_guard_bits (float32_t * pIn, uint32_t numSamples, uint32_t guard_bits); 59 | uint32_t arm_compare_fixed_q15(q15_t *pIn, q15_t * pOut, uint32_t numSamples); 60 | uint32_t arm_compare_fixed_q31(q31_t *pIn, q31_t *pOut, uint32_t numSamples); 61 | uint32_t arm_calc_2pow(uint32_t guard_bits); 62 | #endif 63 | 64 | -------------------------------------------------------------------------------- /Drivers/CMSIS/DSP_Lib/Examples/arm_matrix_example/ARM/math_helper.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2013 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 17. January 2013 5 | * $Revision: V1.4.0 6 | * 7 | * Project: CMSIS DSP Library 8 | * 9 | * Title: math_helper.h 10 | * 11 | * Description: Prototypes of all helper functions required. 12 | * 13 | * Target Processor: Cortex-M4/Cortex-M3 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * - Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * - Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * - Neither the name of ARM LIMITED nor the names of its contributors 25 | * may be used to endorse or promote products derived from this 26 | * software without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 31 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 32 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 33 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 34 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 35 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 36 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 37 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 38 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | * -------------------------------------------------------------------- */ 41 | 42 | 43 | #include "arm_math.h" 44 | 45 | #ifndef MATH_HELPER_H 46 | #define MATH_HELPER_H 47 | 48 | float arm_snr_f32(float *pRef, float *pTest, uint32_t buffSize); 49 | void arm_float_to_q12_20(float *pIn, q31_t * pOut, uint32_t numSamples); 50 | void arm_provide_guard_bits_q15(q15_t *input_buf, uint32_t blockSize, uint32_t guard_bits); 51 | void arm_provide_guard_bits_q31(q31_t *input_buf, uint32_t blockSize, uint32_t guard_bits); 52 | void arm_float_to_q14(float *pIn, q15_t *pOut, uint32_t numSamples); 53 | void arm_float_to_q29(float *pIn, q31_t *pOut, uint32_t numSamples); 54 | void arm_float_to_q28(float *pIn, q31_t *pOut, uint32_t numSamples); 55 | void arm_float_to_q30(float *pIn, q31_t *pOut, uint32_t numSamples); 56 | void arm_clip_f32(float *pIn, uint32_t numSamples); 57 | uint32_t arm_calc_guard_bits(uint32_t num_adds); 58 | void arm_apply_guard_bits (float32_t * pIn, uint32_t numSamples, uint32_t guard_bits); 59 | uint32_t arm_compare_fixed_q15(q15_t *pIn, q15_t * pOut, uint32_t numSamples); 60 | uint32_t arm_compare_fixed_q31(q31_t *pIn, q31_t *pOut, uint32_t numSamples); 61 | uint32_t arm_calc_2pow(uint32_t guard_bits); 62 | #endif 63 | 64 | -------------------------------------------------------------------------------- /Drivers/CMSIS/DSP_Lib/Examples/arm_signal_converge_example/ARM/math_helper.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2013 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 17. January 2013 5 | * $Revision: V1.4.0 6 | * 7 | * Project: CMSIS DSP Library 8 | * 9 | * Title: math_helper.h 10 | * 11 | * Description: Prototypes of all helper functions required. 12 | * 13 | * Target Processor: Cortex-M4/Cortex-M3 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * - Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * - Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * - Neither the name of ARM LIMITED nor the names of its contributors 25 | * may be used to endorse or promote products derived from this 26 | * software without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 31 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 32 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 33 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 34 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 35 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 36 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 37 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 38 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | * -------------------------------------------------------------------- */ 41 | 42 | 43 | #include "arm_math.h" 44 | 45 | #ifndef MATH_HELPER_H 46 | #define MATH_HELPER_H 47 | 48 | float arm_snr_f32(float *pRef, float *pTest, uint32_t buffSize); 49 | void arm_float_to_q12_20(float *pIn, q31_t * pOut, uint32_t numSamples); 50 | void arm_provide_guard_bits_q15(q15_t *input_buf, uint32_t blockSize, uint32_t guard_bits); 51 | void arm_provide_guard_bits_q31(q31_t *input_buf, uint32_t blockSize, uint32_t guard_bits); 52 | void arm_float_to_q14(float *pIn, q15_t *pOut, uint32_t numSamples); 53 | void arm_float_to_q29(float *pIn, q31_t *pOut, uint32_t numSamples); 54 | void arm_float_to_q28(float *pIn, q31_t *pOut, uint32_t numSamples); 55 | void arm_float_to_q30(float *pIn, q31_t *pOut, uint32_t numSamples); 56 | void arm_clip_f32(float *pIn, uint32_t numSamples); 57 | uint32_t arm_calc_guard_bits(uint32_t num_adds); 58 | void arm_apply_guard_bits (float32_t * pIn, uint32_t numSamples, uint32_t guard_bits); 59 | uint32_t arm_compare_fixed_q15(q15_t *pIn, q15_t * pOut, uint32_t numSamples); 60 | uint32_t arm_compare_fixed_q31(q31_t *pIn, q31_t *pOut, uint32_t numSamples); 61 | uint32_t arm_calc_2pow(uint32_t guard_bits); 62 | #endif 63 | 64 | -------------------------------------------------------------------------------- /Drivers/CMSIS/DSP_Lib/Source/ControllerFunctions/arm_pid_init_f32.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_pid_init_f32.c 9 | * 10 | * Description: Floating-point PID Control initialization function 11 | * 12 | * 13 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * - Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * - Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * - Neither the name of ARM LIMITED nor the names of its contributors 25 | * may be used to endorse or promote products derived from this 26 | * software without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 31 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 32 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 33 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 34 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 35 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 36 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 37 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 38 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | * ------------------------------------------------------------------- */ 41 | 42 | #include "arm_math.h" 43 | 44 | /** 45 | * @addtogroup PID 46 | * @{ 47 | */ 48 | 49 | /** 50 | * @brief Initialization function for the floating-point PID Control. 51 | * @param[in,out] *S points to an instance of the PID structure. 52 | * @param[in] resetStateFlag flag to reset the state. 0 = no change in state & 1 = reset the state. 53 | * @return none. 54 | * \par Description: 55 | * \par 56 | * The resetStateFlag specifies whether to set state to zero or not. \n 57 | * The function computes the structure fields: A0, A1 A2 58 | * using the proportional gain( \c Kp), integral gain( \c Ki) and derivative gain( \c Kd) 59 | * also sets the state variables to all zeros. 60 | */ 61 | 62 | void arm_pid_init_f32( 63 | arm_pid_instance_f32 * S, 64 | int32_t resetStateFlag) 65 | { 66 | 67 | /* Derived coefficient A0 */ 68 | S->A0 = S->Kp + S->Ki + S->Kd; 69 | 70 | /* Derived coefficient A1 */ 71 | S->A1 = (-S->Kp) - ((float32_t) 2.0 * S->Kd); 72 | 73 | /* Derived coefficient A2 */ 74 | S->A2 = S->Kd; 75 | 76 | /* Check whether state needs reset or not */ 77 | if(resetStateFlag) 78 | { 79 | /* Clear the state buffer. The size will be always 3 samples */ 80 | memset(S->state, 0, 3u * sizeof(float32_t)); 81 | } 82 | 83 | } 84 | 85 | /** 86 | * @} end of PID group 87 | */ 88 | -------------------------------------------------------------------------------- /Drivers/CMSIS/DSP_Lib/Source/ControllerFunctions/arm_pid_init_q31.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 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 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * ------------------------------------------------------------------- */ 40 | 41 | #include "arm_math.h" 42 | 43 | /** 44 | * @addtogroup PID 45 | * @{ 46 | */ 47 | 48 | /** 49 | * @brief Initialization function for the Q31 PID Control. 50 | * @param[in,out] *S points to an instance of the Q31 PID structure. 51 | * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. 52 | * @return none. 53 | * \par Description: 54 | * \par 55 | * The resetStateFlag specifies whether to set state to zero or not. \n 56 | * The function computes the structure fields: A0, A1 A2 57 | * using the proportional gain( \c Kp), integral gain( \c Ki) and derivative gain( \c Kd) 58 | * also sets the state variables to all zeros. 59 | */ 60 | 61 | void arm_pid_init_q31( 62 | arm_pid_instance_q31 * S, 63 | int32_t resetStateFlag) 64 | { 65 | 66 | #ifndef ARM_MATH_CM0_FAMILY 67 | 68 | /* Run the below code for Cortex-M4 and Cortex-M3 */ 69 | 70 | /* Derived coefficient A0 */ 71 | S->A0 = __QADD(__QADD(S->Kp, S->Ki), S->Kd); 72 | 73 | /* Derived coefficient A1 */ 74 | S->A1 = -__QADD(__QADD(S->Kd, S->Kd), S->Kp); 75 | 76 | 77 | #else 78 | 79 | /* Run the below code for Cortex-M0 */ 80 | 81 | q31_t temp; 82 | 83 | /* Derived coefficient A0 */ 84 | temp = clip_q63_to_q31((q63_t) S->Kp + S->Ki); 85 | S->A0 = clip_q63_to_q31((q63_t) temp + S->Kd); 86 | 87 | /* Derived coefficient A1 */ 88 | temp = clip_q63_to_q31((q63_t) S->Kd + S->Kd); 89 | S->A1 = -clip_q63_to_q31((q63_t) temp + S->Kp); 90 | 91 | #endif /* #ifndef ARM_MATH_CM0_FAMILY */ 92 | 93 | /* Derived coefficient A2 */ 94 | S->A2 = S->Kd; 95 | 96 | /* Check whether state needs reset or not */ 97 | if(resetStateFlag) 98 | { 99 | /* Clear the state buffer. The size will be always 3 samples */ 100 | memset(S->state, 0, 3u * sizeof(q31_t)); 101 | } 102 | 103 | } 104 | 105 | /** 106 | * @} end of PID group 107 | */ 108 | -------------------------------------------------------------------------------- /Drivers/CMSIS/DSP_Lib/Source/ControllerFunctions/arm_pid_reset_f32.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 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 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * ------------------------------------------------------------------- */ 40 | 41 | #include "arm_math.h" 42 | 43 | /** 44 | * @addtogroup PID 45 | * @{ 46 | */ 47 | 48 | /** 49 | * @brief Reset function for the floating-point PID Control. 50 | * @param[in] *S Instance pointer of PID control data structure. 51 | * @return none. 52 | * \par Description: 53 | * The function resets the state buffer to zeros. 54 | */ 55 | void arm_pid_reset_f32( 56 | arm_pid_instance_f32 * S) 57 | { 58 | 59 | /* Clear the state buffer. The size will be always 3 samples */ 60 | memset(S->state, 0, 3u * sizeof(float32_t)); 61 | } 62 | 63 | /** 64 | * @} end of PID group 65 | */ 66 | -------------------------------------------------------------------------------- /Drivers/CMSIS/DSP_Lib/Source/ControllerFunctions/arm_pid_reset_q15.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 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 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * -------------------------------------------------------------------- */ 40 | 41 | #include "arm_math.h" 42 | 43 | /** 44 | * @addtogroup PID 45 | * @{ 46 | */ 47 | 48 | /** 49 | * @brief Reset function for the Q15 PID Control. 50 | * @param[in] *S Instance pointer of PID control data structure. 51 | * @return none. 52 | * \par Description: 53 | * The function resets the state buffer to zeros. 54 | */ 55 | void arm_pid_reset_q15( 56 | arm_pid_instance_q15 * S) 57 | { 58 | /* Reset state to zero, The size will be always 3 samples */ 59 | memset(S->state, 0, 3u * sizeof(q15_t)); 60 | } 61 | 62 | /** 63 | * @} end of PID group 64 | */ 65 | -------------------------------------------------------------------------------- /Drivers/CMSIS/DSP_Lib/Source/ControllerFunctions/arm_pid_reset_q31.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 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 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * ------------------------------------------------------------------- */ 40 | 41 | #include "arm_math.h" 42 | 43 | /** 44 | * @addtogroup PID 45 | * @{ 46 | */ 47 | 48 | /** 49 | * @brief Reset function for the Q31 PID Control. 50 | * @param[in] *S Instance pointer of PID control data structure. 51 | * @return none. 52 | * \par Description: 53 | * The function resets the state buffer to zeros. 54 | */ 55 | void arm_pid_reset_q31( 56 | arm_pid_instance_q31 * S) 57 | { 58 | 59 | /* Clear the state buffer. The size will be always 3 samples */ 60 | memset(S->state, 0, 3u * sizeof(q31_t)); 61 | } 62 | 63 | /** 64 | * @} end of PID group 65 | */ 66 | -------------------------------------------------------------------------------- /Drivers/CMSIS/DSP_Lib/Source/FastMathFunctions/arm_cos_q15.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 07. September 2015 5 | * $Revision: V.1.4.5 a 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_cos_q15.c 9 | * 10 | * Description: Fast cosine calculation for Q15 values. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * -------------------------------------------------------------------- */ 40 | 41 | #include "arm_math.h" 42 | #include "arm_common_tables.h" 43 | 44 | /** 45 | * @ingroup groupFastMath 46 | */ 47 | 48 | /** 49 | * @addtogroup cos 50 | * @{ 51 | */ 52 | 53 | /** 54 | * @brief Fast approximation to the trigonometric cosine function for Q15 data. 55 | * @param[in] x Scaled input value in radians. 56 | * @return cos(x). 57 | * 58 | * The Q15 input value is in the range [0 +0.9999] and is mapped to a radian 59 | * value in the range [0 2*pi). 60 | */ 61 | 62 | q15_t arm_cos_q15( 63 | q15_t x) 64 | { 65 | q15_t cosVal; /* Temporary variables for input, output */ 66 | int32_t index; /* Index variables */ 67 | q15_t a, b; /* Four nearest output values */ 68 | q15_t fract; /* Temporary values for fractional values */ 69 | 70 | /* add 0.25 (pi/2) to read sine table */ 71 | x = (uint16_t)x + 0x2000; 72 | if(x < 0) 73 | { /* convert negative numbers to corresponding positive ones */ 74 | x = (uint16_t)x + 0x8000; 75 | } 76 | 77 | /* Calculate the nearest index */ 78 | index = (uint32_t)x >> FAST_MATH_Q15_SHIFT; 79 | 80 | /* Calculation of fractional value */ 81 | fract = (x - (index << FAST_MATH_Q15_SHIFT)) << 9; 82 | 83 | /* Read two nearest values of input value from the sin table */ 84 | a = sinTable_q15[index]; 85 | b = sinTable_q15[index+1]; 86 | 87 | /* Linear interpolation process */ 88 | cosVal = (q31_t)(0x8000-fract)*a >> 16; 89 | cosVal = (q15_t)((((q31_t)cosVal << 16) + ((q31_t)fract*b)) >> 16); 90 | 91 | return cosVal << 1; 92 | } 93 | 94 | /** 95 | * @} end of cos group 96 | */ 97 | -------------------------------------------------------------------------------- /Drivers/CMSIS/DSP_Lib/Source/FastMathFunctions/arm_cos_q31.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 07. September 2015 5 | * $Revision: V.1.4.5 a 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_cos_q31.c 9 | * 10 | * Description: Fast cosine calculation for Q31 values. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * -------------------------------------------------------------------- */ 40 | 41 | #include "arm_math.h" 42 | #include "arm_common_tables.h" 43 | 44 | /** 45 | * @ingroup groupFastMath 46 | */ 47 | 48 | /** 49 | * @addtogroup cos 50 | * @{ 51 | */ 52 | 53 | /** 54 | * @brief Fast approximation to the trigonometric cosine function for Q31 data. 55 | * @param[in] x Scaled input value in radians. 56 | * @return cos(x). 57 | * 58 | * The Q31 input value is in the range [0 +0.9999] and is mapped to a radian 59 | * value in the range [0 2*pi). 60 | */ 61 | 62 | q31_t arm_cos_q31( 63 | q31_t x) 64 | { 65 | q31_t cosVal; /* Temporary variables for input, output */ 66 | int32_t index; /* Index variables */ 67 | q31_t a, b; /* Four nearest output values */ 68 | q31_t fract; /* Temporary values for fractional values */ 69 | 70 | /* add 0.25 (pi/2) to read sine table */ 71 | x = (uint32_t)x + 0x20000000; 72 | if(x < 0) 73 | { /* convert negative numbers to corresponding positive ones */ 74 | x = (uint32_t)x + 0x80000000; 75 | } 76 | 77 | /* Calculate the nearest index */ 78 | index = (uint32_t)x >> FAST_MATH_Q31_SHIFT; 79 | 80 | /* Calculation of fractional value */ 81 | fract = (x - (index << FAST_MATH_Q31_SHIFT)) << 9; 82 | 83 | /* Read two nearest values of input value from the sin table */ 84 | a = sinTable_q31[index]; 85 | b = sinTable_q31[index+1]; 86 | 87 | /* Linear interpolation process */ 88 | cosVal = (q63_t)(0x80000000-fract)*a >> 32; 89 | cosVal = (q31_t)((((q63_t)cosVal << 32) + ((q63_t)fract*b)) >> 32); 90 | 91 | return cosVal << 1; 92 | } 93 | 94 | /** 95 | * @} end of cos group 96 | */ 97 | -------------------------------------------------------------------------------- /Drivers/CMSIS/DSP_Lib/Source/FastMathFunctions/arm_sin_q15.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_sin_q15.c 9 | * 10 | * Description: Fast sine calculation for Q15 values. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * -------------------------------------------------------------------- */ 40 | 41 | #include "arm_math.h" 42 | #include "arm_common_tables.h" 43 | 44 | /** 45 | * @ingroup groupFastMath 46 | */ 47 | 48 | /** 49 | * @addtogroup sin 50 | * @{ 51 | */ 52 | 53 | /** 54 | * @brief Fast approximation to the trigonometric sine function for Q15 data. 55 | * @param[in] x Scaled input value in radians. 56 | * @return sin(x). 57 | * 58 | * The Q15 input value is in the range [0 +0.9999] and is mapped to a radian value in the range [0 2*pi). 59 | */ 60 | 61 | q15_t arm_sin_q15( 62 | q15_t x) 63 | { 64 | q15_t sinVal; /* Temporary variables for input, output */ 65 | int32_t index; /* Index variables */ 66 | q15_t a, b; /* Four nearest output values */ 67 | q15_t fract; /* Temporary values for fractional values */ 68 | 69 | /* Calculate the nearest index */ 70 | index = (uint32_t)x >> FAST_MATH_Q15_SHIFT; 71 | 72 | /* Calculation of fractional value */ 73 | fract = (x - (index << FAST_MATH_Q15_SHIFT)) << 9; 74 | 75 | /* Read two nearest values of input value from the sin table */ 76 | a = sinTable_q15[index]; 77 | b = sinTable_q15[index+1]; 78 | 79 | /* Linear interpolation process */ 80 | sinVal = (q31_t)(0x8000-fract)*a >> 16; 81 | sinVal = (q15_t)((((q31_t)sinVal << 16) + ((q31_t)fract*b)) >> 16); 82 | 83 | return sinVal << 1; 84 | } 85 | 86 | /** 87 | * @} end of sin group 88 | */ 89 | -------------------------------------------------------------------------------- /Drivers/CMSIS/DSP_Lib/Source/FastMathFunctions/arm_sin_q31.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_sin_q31.c 9 | * 10 | * Description: Fast sine calculation for Q31 values. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * -------------------------------------------------------------------- */ 40 | 41 | #include "arm_math.h" 42 | #include "arm_common_tables.h" 43 | 44 | /** 45 | * @ingroup groupFastMath 46 | */ 47 | 48 | /** 49 | * @addtogroup sin 50 | * @{ 51 | */ 52 | 53 | /** 54 | * @brief Fast approximation to the trigonometric sine function for Q31 data. 55 | * @param[in] x Scaled input value in radians. 56 | * @return sin(x). 57 | * 58 | * The Q31 input value is in the range [0 +0.9999] and is mapped to a radian value in the range [0 2*pi). */ 59 | 60 | q31_t arm_sin_q31( 61 | q31_t x) 62 | { 63 | q31_t sinVal; /* Temporary variables for input, output */ 64 | int32_t index; /* Index variables */ 65 | q31_t a, b; /* Four nearest output values */ 66 | q31_t fract; /* Temporary values for fractional values */ 67 | 68 | /* Calculate the nearest index */ 69 | index = (uint32_t)x >> FAST_MATH_Q31_SHIFT; 70 | 71 | /* Calculation of fractional value */ 72 | fract = (x - (index << FAST_MATH_Q31_SHIFT)) << 9; 73 | 74 | /* Read two nearest values of input value from the sin table */ 75 | a = sinTable_q31[index]; 76 | b = sinTable_q31[index+1]; 77 | 78 | /* Linear interpolation process */ 79 | sinVal = (q63_t)(0x80000000-fract)*a >> 32; 80 | sinVal = (q31_t)((((q63_t)sinVal << 32) + ((q63_t)fract*b)) >> 32); 81 | 82 | return sinVal << 1; 83 | } 84 | 85 | /** 86 | * @} end of sin group 87 | */ 88 | -------------------------------------------------------------------------------- /Drivers/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_fir_init_f32.c: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 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 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * ---------------------------------------------------------------------------*/ 40 | 41 | #include "arm_math.h" 42 | 43 | /** 44 | * @ingroup groupFilters 45 | */ 46 | 47 | /** 48 | * @addtogroup FIR 49 | * @{ 50 | */ 51 | 52 | /** 53 | * @details 54 | * 55 | * @param[in,out] *S points to an instance of the floating-point FIR filter structure. 56 | * @param[in] numTaps Number of filter coefficients in the filter. 57 | * @param[in] *pCoeffs points to the filter coefficients buffer. 58 | * @param[in] *pState points to the state buffer. 59 | * @param[in] blockSize number of samples that are processed per call. 60 | * @return none. 61 | * 62 | * Description: 63 | * \par 64 | * pCoeffs points to the array of filter coefficients stored in time reversed order: 65 | *
    
66 |  *    {b[numTaps-1], b[numTaps-2], b[N-2], ..., b[1], b[0]}    
67 |  * 
68 | * \par 69 | * pState points to the array of state variables. 70 | * pState is of length numTaps+blockSize-1 samples, where blockSize is the number of input samples processed by each call to arm_fir_f32(). 71 | */ 72 | 73 | void arm_fir_init_f32( 74 | arm_fir_instance_f32 * S, 75 | uint16_t numTaps, 76 | float32_t * pCoeffs, 77 | float32_t * pState, 78 | uint32_t blockSize) 79 | { 80 | /* Assign filter taps */ 81 | S->numTaps = numTaps; 82 | 83 | /* Assign coefficient pointer */ 84 | S->pCoeffs = pCoeffs; 85 | 86 | /* Clear state buffer and the size of state buffer is (blockSize + numTaps - 1) */ 87 | memset(pState, 0, (numTaps + (blockSize - 1u)) * sizeof(float32_t)); 88 | 89 | /* Assign state pointer */ 90 | S->pState = pState; 91 | 92 | } 93 | 94 | /** 95 | * @} end of FIR group 96 | */ 97 | -------------------------------------------------------------------------------- /Drivers/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_fir_init_q31.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 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 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * -------------------------------------------------------------------- */ 40 | 41 | #include "arm_math.h" 42 | 43 | /** 44 | * @ingroup groupFilters 45 | */ 46 | 47 | /** 48 | * @addtogroup FIR 49 | * @{ 50 | */ 51 | 52 | /** 53 | * @details 54 | * 55 | * @param[in,out] *S points to an instance of the Q31 FIR filter structure. 56 | * @param[in] numTaps Number of filter coefficients in the filter. 57 | * @param[in] *pCoeffs points to the filter coefficients buffer. 58 | * @param[in] *pState points to the state buffer. 59 | * @param[in] blockSize number of samples that are processed per call. 60 | * @return none. 61 | * 62 | * Description: 63 | * \par 64 | * pCoeffs points to the array of filter coefficients stored in time reversed order: 65 | *
    
66 |  *    {b[numTaps-1], b[numTaps-2], b[N-2], ..., b[1], b[0]}    
67 |  * 
68 | * \par 69 | * pState points to the array of state variables. 70 | * pState is of length numTaps+blockSize-1 samples, where blockSize is the number of input samples processed by each call to arm_fir_q31(). 71 | */ 72 | 73 | void arm_fir_init_q31( 74 | arm_fir_instance_q31 * S, 75 | uint16_t numTaps, 76 | q31_t * pCoeffs, 77 | q31_t * pState, 78 | uint32_t blockSize) 79 | { 80 | /* Assign filter taps */ 81 | S->numTaps = numTaps; 82 | 83 | /* Assign coefficient pointer */ 84 | S->pCoeffs = pCoeffs; 85 | 86 | /* Clear state buffer and state array size is (blockSize + numTaps - 1) */ 87 | memset(pState, 0, (blockSize + ((uint32_t) numTaps - 1u)) * sizeof(q31_t)); 88 | 89 | /* Assign state pointer */ 90 | S->pState = pState; 91 | 92 | } 93 | 94 | /** 95 | * @} end of FIR group 96 | */ 97 | -------------------------------------------------------------------------------- /Drivers/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_fir_init_q7.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 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 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * ------------------------------------------------------------------- */ 40 | 41 | #include "arm_math.h" 42 | 43 | /** 44 | * @ingroup groupFilters 45 | */ 46 | 47 | /** 48 | * @addtogroup FIR 49 | * @{ 50 | */ 51 | /** 52 | * @param[in,out] *S points to an instance of the Q7 FIR filter structure. 53 | * @param[in] numTaps Number of filter coefficients in the filter. 54 | * @param[in] *pCoeffs points to the filter coefficients buffer. 55 | * @param[in] *pState points to the state buffer. 56 | * @param[in] blockSize number of samples that are processed per call. 57 | * @return none 58 | * 59 | * Description: 60 | * \par 61 | * pCoeffs points to the array of filter coefficients stored in time reversed order: 62 | *
    
63 |  *    {b[numTaps-1], b[numTaps-2], b[N-2], ..., b[1], b[0]}    
64 |  * 
65 | * \par 66 | * pState points to the array of state variables. 67 | * pState is of length numTaps+blockSize-1 samples, where blockSize is the number of input samples processed by each call to arm_fir_q7(). 68 | */ 69 | 70 | void arm_fir_init_q7( 71 | arm_fir_instance_q7 * S, 72 | uint16_t numTaps, 73 | q7_t * pCoeffs, 74 | q7_t * pState, 75 | uint32_t blockSize) 76 | { 77 | 78 | /* Assign filter taps */ 79 | S->numTaps = numTaps; 80 | 81 | /* Assign coefficient pointer */ 82 | S->pCoeffs = pCoeffs; 83 | 84 | /* Clear the state buffer. The size is always (blockSize + numTaps - 1) */ 85 | memset(pState, 0, (numTaps + (blockSize - 1u)) * sizeof(q7_t)); 86 | 87 | /* Assign state pointer */ 88 | S->pState = pState; 89 | 90 | } 91 | 92 | /** 93 | * @} end of FIR group 94 | */ 95 | -------------------------------------------------------------------------------- /Drivers/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_fir_lattice_init_f32.c: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 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 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * ---------------------------------------------------------------------------*/ 40 | 41 | #include "arm_math.h" 42 | 43 | /** 44 | * @ingroup groupFilters 45 | */ 46 | 47 | /** 48 | * @addtogroup FIR_Lattice 49 | * @{ 50 | */ 51 | 52 | /** 53 | * @brief Initialization function for the floating-point FIR lattice filter. 54 | * @param[in] *S points to an instance of the floating-point FIR lattice structure. 55 | * @param[in] numStages number of filter stages. 56 | * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages. 57 | * @param[in] *pState points to the state buffer. The array is of length numStages. 58 | * @return none. 59 | */ 60 | 61 | void arm_fir_lattice_init_f32( 62 | arm_fir_lattice_instance_f32 * S, 63 | uint16_t numStages, 64 | float32_t * pCoeffs, 65 | float32_t * pState) 66 | { 67 | /* Assign filter taps */ 68 | S->numStages = numStages; 69 | 70 | /* Assign coefficient pointer */ 71 | S->pCoeffs = pCoeffs; 72 | 73 | /* Clear state buffer and size is always numStages */ 74 | memset(pState, 0, (numStages) * sizeof(float32_t)); 75 | 76 | /* Assign state pointer */ 77 | S->pState = pState; 78 | 79 | } 80 | 81 | /** 82 | * @} end of FIR_Lattice group 83 | */ 84 | -------------------------------------------------------------------------------- /Drivers/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_fir_lattice_init_q15.c: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 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 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * ---------------------------------------------------------------------------*/ 40 | 41 | #include "arm_math.h" 42 | 43 | /** 44 | * @ingroup groupFilters 45 | */ 46 | 47 | /** 48 | * @addtogroup FIR_Lattice 49 | * @{ 50 | */ 51 | 52 | /** 53 | * @brief Initialization function for the Q15 FIR lattice filter. 54 | * @param[in] *S points to an instance of the Q15 FIR lattice structure. 55 | * @param[in] numStages number of filter stages. 56 | * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages. 57 | * @param[in] *pState points to the state buffer. The array is of length numStages. 58 | * @return none. 59 | */ 60 | 61 | void arm_fir_lattice_init_q15( 62 | arm_fir_lattice_instance_q15 * S, 63 | uint16_t numStages, 64 | q15_t * pCoeffs, 65 | q15_t * pState) 66 | { 67 | /* Assign filter taps */ 68 | S->numStages = numStages; 69 | 70 | /* Assign coefficient pointer */ 71 | S->pCoeffs = pCoeffs; 72 | 73 | /* Clear state buffer and size is always numStages */ 74 | memset(pState, 0, (numStages) * sizeof(q15_t)); 75 | 76 | /* Assign state pointer */ 77 | S->pState = pState; 78 | 79 | } 80 | 81 | /** 82 | * @} end of FIR_Lattice group 83 | */ 84 | -------------------------------------------------------------------------------- /Drivers/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_fir_lattice_init_q31.c: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 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 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * ---------------------------------------------------------------------------*/ 40 | 41 | #include "arm_math.h" 42 | 43 | /** 44 | * @ingroup groupFilters 45 | */ 46 | 47 | /** 48 | * @addtogroup FIR_Lattice 49 | * @{ 50 | */ 51 | 52 | /** 53 | * @brief Initialization function for the Q31 FIR lattice filter. 54 | * @param[in] *S points to an instance of the Q31 FIR lattice structure. 55 | * @param[in] numStages number of filter stages. 56 | * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages. 57 | * @param[in] *pState points to the state buffer. The array is of length numStages. 58 | * @return none. 59 | */ 60 | 61 | void arm_fir_lattice_init_q31( 62 | arm_fir_lattice_instance_q31 * S, 63 | uint16_t numStages, 64 | q31_t * pCoeffs, 65 | q31_t * pState) 66 | { 67 | /* Assign filter taps */ 68 | S->numStages = numStages; 69 | 70 | /* Assign coefficient pointer */ 71 | S->pCoeffs = pCoeffs; 72 | 73 | /* Clear state buffer and size is always numStages */ 74 | memset(pState, 0, (numStages) * sizeof(q31_t)); 75 | 76 | /* Assign state pointer */ 77 | S->pState = pState; 78 | 79 | } 80 | 81 | /** 82 | * @} end of FIR_Lattice group 83 | */ 84 | -------------------------------------------------------------------------------- /Drivers/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_iir_lattice_init_f32.c: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 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 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * ---------------------------------------------------------------------------*/ 40 | 41 | #include "arm_math.h" 42 | 43 | /** 44 | * @ingroup groupFilters 45 | */ 46 | 47 | /** 48 | * @addtogroup IIR_Lattice 49 | * @{ 50 | */ 51 | 52 | /** 53 | * @brief Initialization function for the floating-point IIR lattice filter. 54 | * @param[in] *S points to an instance of the floating-point IIR lattice structure. 55 | * @param[in] numStages number of stages in the filter. 56 | * @param[in] *pkCoeffs points to the reflection coefficient buffer. The array is of length numStages. 57 | * @param[in] *pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1. 58 | * @param[in] *pState points to the state buffer. The array is of length numStages+blockSize. 59 | * @param[in] blockSize number of samples to process. 60 | * @return none. 61 | */ 62 | 63 | void arm_iir_lattice_init_f32( 64 | arm_iir_lattice_instance_f32 * S, 65 | uint16_t numStages, 66 | float32_t * pkCoeffs, 67 | float32_t * pvCoeffs, 68 | float32_t * pState, 69 | uint32_t blockSize) 70 | { 71 | /* Assign filter taps */ 72 | S->numStages = numStages; 73 | 74 | /* Assign reflection coefficient pointer */ 75 | S->pkCoeffs = pkCoeffs; 76 | 77 | /* Assign ladder coefficient pointer */ 78 | S->pvCoeffs = pvCoeffs; 79 | 80 | /* Clear state buffer and size is always blockSize + numStages */ 81 | memset(pState, 0, (numStages + blockSize) * sizeof(float32_t)); 82 | 83 | /* Assign state pointer */ 84 | S->pState = pState; 85 | 86 | 87 | } 88 | 89 | /** 90 | * @} end of IIR_Lattice group 91 | */ 92 | -------------------------------------------------------------------------------- /Drivers/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_iir_lattice_init_q15.c: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 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 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * ---------------------------------------------------------------------------*/ 40 | 41 | #include "arm_math.h" 42 | 43 | /** 44 | * @ingroup groupFilters 45 | */ 46 | 47 | /** 48 | * @addtogroup IIR_Lattice 49 | * @{ 50 | */ 51 | 52 | /** 53 | * @brief Initialization function for the Q15 IIR lattice filter. 54 | * @param[in] *S points to an instance of the Q15 IIR lattice structure. 55 | * @param[in] numStages number of stages in the filter. 56 | * @param[in] *pkCoeffs points to reflection coefficient buffer. The array is of length numStages. 57 | * @param[in] *pvCoeffs points to ladder coefficient buffer. The array is of length numStages+1. 58 | * @param[in] *pState points to state buffer. The array is of length numStages+blockSize. 59 | * @param[in] blockSize number of samples to process per call. 60 | * @return none. 61 | */ 62 | 63 | void arm_iir_lattice_init_q15( 64 | arm_iir_lattice_instance_q15 * S, 65 | uint16_t numStages, 66 | q15_t * pkCoeffs, 67 | q15_t * pvCoeffs, 68 | q15_t * pState, 69 | uint32_t blockSize) 70 | { 71 | /* Assign filter taps */ 72 | S->numStages = numStages; 73 | 74 | /* Assign reflection coefficient pointer */ 75 | S->pkCoeffs = pkCoeffs; 76 | 77 | /* Assign ladder coefficient pointer */ 78 | S->pvCoeffs = pvCoeffs; 79 | 80 | /* Clear state buffer and size is always blockSize + numStages */ 81 | memset(pState, 0, (numStages + blockSize) * sizeof(q15_t)); 82 | 83 | /* Assign state pointer */ 84 | S->pState = pState; 85 | 86 | 87 | } 88 | 89 | /** 90 | * @} end of IIR_Lattice group 91 | */ 92 | -------------------------------------------------------------------------------- /Drivers/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_iir_lattice_init_q31.c: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 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 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * ---------------------------------------------------------------------------*/ 40 | 41 | #include "arm_math.h" 42 | 43 | /** 44 | * @ingroup groupFilters 45 | */ 46 | 47 | /** 48 | * @addtogroup IIR_Lattice 49 | * @{ 50 | */ 51 | 52 | /** 53 | * @brief Initialization function for the Q31 IIR lattice filter. 54 | * @param[in] *S points to an instance of the Q31 IIR lattice structure. 55 | * @param[in] numStages number of stages in the filter. 56 | * @param[in] *pkCoeffs points to the reflection coefficient buffer. The array is of length numStages. 57 | * @param[in] *pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1. 58 | * @param[in] *pState points to the state buffer. The array is of length numStages+blockSize. 59 | * @param[in] blockSize number of samples to process. 60 | * @return none. 61 | */ 62 | 63 | void arm_iir_lattice_init_q31( 64 | arm_iir_lattice_instance_q31 * S, 65 | uint16_t numStages, 66 | q31_t * pkCoeffs, 67 | q31_t * pvCoeffs, 68 | q31_t * pState, 69 | uint32_t blockSize) 70 | { 71 | /* Assign filter taps */ 72 | S->numStages = numStages; 73 | 74 | /* Assign reflection coefficient pointer */ 75 | S->pkCoeffs = pkCoeffs; 76 | 77 | /* Assign ladder coefficient pointer */ 78 | S->pvCoeffs = pvCoeffs; 79 | 80 | /* Clear state buffer and size is always blockSize + numStages */ 81 | memset(pState, 0, (numStages + blockSize) * sizeof(q31_t)); 82 | 83 | /* Assign state pointer */ 84 | S->pState = pState; 85 | 86 | 87 | } 88 | 89 | /** 90 | * @} end of IIR_Lattice group 91 | */ 92 | -------------------------------------------------------------------------------- /Drivers/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_lms_init_f32.c: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 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 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * ---------------------------------------------------------------------------*/ 40 | 41 | #include "arm_math.h" 42 | 43 | /** 44 | * @addtogroup LMS 45 | * @{ 46 | */ 47 | 48 | /** 49 | * @brief Initialization function for floating-point LMS filter. 50 | * @param[in] *S points to an instance of the floating-point LMS filter structure. 51 | * @param[in] numTaps number of filter coefficients. 52 | * @param[in] *pCoeffs points to the coefficient buffer. 53 | * @param[in] *pState points to state buffer. 54 | * @param[in] mu step size that controls filter coefficient updates. 55 | * @param[in] blockSize number of samples to process. 56 | * @return none. 57 | */ 58 | 59 | /** 60 | * \par Description: 61 | * pCoeffs points to the array of filter coefficients stored in time reversed order: 62 | *
    
63 |  *    {b[numTaps-1], b[numTaps-2], b[N-2], ..., b[1], b[0]}    
64 |  * 
65 | * The initial filter coefficients serve as a starting point for the adaptive filter. 66 | * 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(). 67 | */ 68 | 69 | void arm_lms_init_f32( 70 | arm_lms_instance_f32 * S, 71 | uint16_t numTaps, 72 | float32_t * pCoeffs, 73 | float32_t * pState, 74 | float32_t mu, 75 | uint32_t blockSize) 76 | { 77 | /* Assign filter taps */ 78 | S->numTaps = numTaps; 79 | 80 | /* Assign coefficient pointer */ 81 | S->pCoeffs = pCoeffs; 82 | 83 | /* Clear state buffer and size is always blockSize + numTaps */ 84 | memset(pState, 0, (numTaps + (blockSize - 1)) * sizeof(float32_t)); 85 | 86 | /* Assign state pointer */ 87 | S->pState = pState; 88 | 89 | /* Assign Step size value */ 90 | S->mu = mu; 91 | } 92 | 93 | /** 94 | * @} end of LMS group 95 | */ 96 | -------------------------------------------------------------------------------- /Drivers/CMSIS/DSP_Lib/Source/MatrixFunctions/arm_mat_init_f32.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 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 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * -------------------------------------------------------------------------- */ 40 | 41 | #include "arm_math.h" 42 | 43 | /** 44 | * @ingroup groupMatrix 45 | */ 46 | 47 | /** 48 | * @defgroup MatrixInit Matrix Initialization 49 | * 50 | * Initializes the underlying matrix data structure. 51 | * The functions set the numRows, 52 | * numCols, and pData fields 53 | * of the matrix data structure. 54 | */ 55 | 56 | /** 57 | * @addtogroup MatrixInit 58 | * @{ 59 | */ 60 | 61 | /** 62 | * @brief Floating-point matrix initialization. 63 | * @param[in,out] *S points to an instance of the floating-point matrix structure. 64 | * @param[in] nRows number of rows in the matrix. 65 | * @param[in] nColumns number of columns in the matrix. 66 | * @param[in] *pData points to the matrix data array. 67 | * @return none 68 | */ 69 | 70 | void arm_mat_init_f32( 71 | arm_matrix_instance_f32 * S, 72 | uint16_t nRows, 73 | uint16_t nColumns, 74 | float32_t * pData) 75 | { 76 | /* Assign Number of Rows */ 77 | S->numRows = nRows; 78 | 79 | /* Assign Number of Columns */ 80 | S->numCols = nColumns; 81 | 82 | /* Assign Data pointer */ 83 | S->pData = pData; 84 | } 85 | 86 | /** 87 | * @} end of MatrixInit group 88 | */ 89 | -------------------------------------------------------------------------------- /Drivers/CMSIS/DSP_Lib/Source/MatrixFunctions/arm_mat_init_q15.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 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 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * -------------------------------------------------------------------------- */ 40 | 41 | 42 | #include "arm_math.h" 43 | 44 | /** 45 | * @ingroup groupMatrix 46 | */ 47 | 48 | /** 49 | * @addtogroup MatrixInit 50 | * @{ 51 | */ 52 | 53 | /** 54 | * @brief Q15 matrix initialization. 55 | * @param[in,out] *S points to an instance of the floating-point matrix structure. 56 | * @param[in] nRows number of rows in the matrix. 57 | * @param[in] nColumns number of columns in the matrix. 58 | * @param[in] *pData points to the matrix data array. 59 | * @return none 60 | */ 61 | 62 | void arm_mat_init_q15( 63 | arm_matrix_instance_q15 * S, 64 | uint16_t nRows, 65 | uint16_t nColumns, 66 | q15_t * pData) 67 | { 68 | /* Assign Number of Rows */ 69 | S->numRows = nRows; 70 | 71 | /* Assign Number of Columns */ 72 | S->numCols = nColumns; 73 | 74 | /* Assign Data pointer */ 75 | S->pData = pData; 76 | } 77 | 78 | /** 79 | * @} end of MatrixInit group 80 | */ 81 | -------------------------------------------------------------------------------- /Drivers/CMSIS/DSP_Lib/Source/MatrixFunctions/arm_mat_init_q31.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 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 | * Redistribution and use in source and binary forms, with or without 14 | * modification, are permitted provided that the following conditions 15 | * are met: 16 | * - Redistributions of source code must retain the above copyright 17 | * notice, this list of conditions and the following disclaimer. 18 | * - Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions and the following disclaimer in 20 | * the documentation and/or other materials provided with the 21 | * distribution. 22 | * - Neither the name of ARM LIMITED nor the names of its contributors 23 | * may be used to endorse or promote products derived from this 24 | * software without specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 27 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 28 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 29 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 30 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 31 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 32 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 34 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 35 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 36 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 37 | * POSSIBILITY OF SUCH DAMAGE. 38 | * -------------------------------------------------------------------------- */ 39 | 40 | 41 | #include "arm_math.h" 42 | 43 | /** 44 | * @ingroup groupMatrix 45 | */ 46 | 47 | /** 48 | * @defgroup MatrixInit Matrix Initialization 49 | * 50 | */ 51 | 52 | /** 53 | * @addtogroup MatrixInit 54 | * @{ 55 | */ 56 | 57 | /** 58 | * @brief Q31 matrix initialization. 59 | * @param[in,out] *S points to an instance of the floating-point matrix structure. 60 | * @param[in] nRows number of rows in the matrix. 61 | * @param[in] nColumns number of columns in the matrix. 62 | * @param[in] *pData points to the matrix data array. 63 | * @return none 64 | */ 65 | 66 | void arm_mat_init_q31( 67 | arm_matrix_instance_q31 * S, 68 | uint16_t nRows, 69 | uint16_t nColumns, 70 | q31_t * pData) 71 | { 72 | /* Assign Number of Rows */ 73 | S->numRows = nRows; 74 | 75 | /* Assign Number of Columns */ 76 | S->numCols = nColumns; 77 | 78 | /* Assign Data pointer */ 79 | S->pData = pData; 80 | } 81 | 82 | /** 83 | * @} end of MatrixInit group 84 | */ 85 | -------------------------------------------------------------------------------- /Drivers/CMSIS/DSP_Lib/Source/SupportFunctions/arm_copy_q15.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 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 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * -------------------------------------------------------------------- */ 40 | 41 | #include "arm_math.h" 42 | 43 | /** 44 | * @ingroup groupSupport 45 | */ 46 | 47 | /** 48 | * @addtogroup copy 49 | * @{ 50 | */ 51 | /** 52 | * @brief Copies the elements of a Q15 vector. 53 | * @param[in] *pSrc points to input vector 54 | * @param[out] *pDst points to output vector 55 | * @param[in] blockSize length of the input vector 56 | * @return none. 57 | * 58 | */ 59 | 60 | void arm_copy_q15( 61 | q15_t * pSrc, 62 | q15_t * pDst, 63 | uint32_t blockSize) 64 | { 65 | uint32_t blkCnt; /* loop counter */ 66 | 67 | #ifndef ARM_MATH_CM0_FAMILY 68 | 69 | /* Run the below code for Cortex-M4 and Cortex-M3 */ 70 | 71 | /*loop Unrolling */ 72 | blkCnt = blockSize >> 2u; 73 | 74 | /* First part of the processing with loop unrolling. Compute 4 outputs at a time. 75 | ** a second loop below computes the remaining 1 to 3 samples. */ 76 | while(blkCnt > 0u) 77 | { 78 | /* C = A */ 79 | /* Read two inputs */ 80 | *__SIMD32(pDst)++ = *__SIMD32(pSrc)++; 81 | *__SIMD32(pDst)++ = *__SIMD32(pSrc)++; 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 | 92 | #else 93 | 94 | /* Run the below code for Cortex-M0 */ 95 | 96 | /* Loop over blockSize number of values */ 97 | blkCnt = blockSize; 98 | 99 | #endif /* #ifndef ARM_MATH_CM0_FAMILY */ 100 | 101 | while(blkCnt > 0u) 102 | { 103 | /* C = A */ 104 | /* Copy and then store the value in the destination buffer */ 105 | *pDst++ = *pSrc++; 106 | 107 | /* Decrement the loop counter */ 108 | blkCnt--; 109 | } 110 | } 111 | 112 | /** 113 | * @} end of BasicCopy group 114 | */ 115 | -------------------------------------------------------------------------------- /Drivers/CMSIS/DSP_Lib/Source/SupportFunctions/arm_copy_q7.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 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 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * -------------------------------------------------------------------- */ 40 | 41 | #include "arm_math.h" 42 | 43 | /** 44 | * @ingroup groupSupport 45 | */ 46 | 47 | /** 48 | * @addtogroup copy 49 | * @{ 50 | */ 51 | 52 | /** 53 | * @brief Copies the elements of a Q7 vector. 54 | * @param[in] *pSrc points to input vector 55 | * @param[out] *pDst points to output vector 56 | * @param[in] blockSize length of the input vector 57 | * @return none. 58 | * 59 | */ 60 | 61 | void arm_copy_q7( 62 | q7_t * pSrc, 63 | q7_t * pDst, 64 | uint32_t blockSize) 65 | { 66 | uint32_t blkCnt; /* loop counter */ 67 | 68 | #ifndef ARM_MATH_CM0_FAMILY 69 | 70 | /* Run the below code for Cortex-M4 and Cortex-M3 */ 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 = A */ 80 | /* Copy and then store the results in the destination buffer */ 81 | /* 4 samples are copied and stored at a time using SIMD */ 82 | *__SIMD32(pDst)++ = *__SIMD32(pSrc)++; 83 | 84 | /* Decrement the loop counter */ 85 | blkCnt--; 86 | } 87 | 88 | /* If the blockSize is not a multiple of 4, compute any remaining output samples here. 89 | ** No loop unrolling is used. */ 90 | blkCnt = blockSize % 0x4u; 91 | 92 | #else 93 | 94 | /* Run the below code for Cortex-M0 */ 95 | 96 | /* Loop over blockSize number of values */ 97 | blkCnt = blockSize; 98 | 99 | #endif /* #ifndef ARM_MATH_CM0_FAMILY */ 100 | 101 | 102 | while(blkCnt > 0u) 103 | { 104 | /* C = A */ 105 | /* Copy and then store the results in the destination buffer */ 106 | *pDst++ = *pSrc++; 107 | 108 | /* Decrement the loop counter */ 109 | blkCnt--; 110 | } 111 | } 112 | 113 | /** 114 | * @} end of BasicCopy group 115 | */ 116 | -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f030x6.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/normaldotcom/canable-fw/9fddea4ad12b05acc519d90c3771ba5c54a81ea2/Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f030x6.h -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f030x8.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/normaldotcom/canable-fw/9fddea4ad12b05acc519d90c3771ba5c54a81ea2/Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f030x8.h -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f030xc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/normaldotcom/canable-fw/9fddea4ad12b05acc519d90c3771ba5c54a81ea2/Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f030xc.h -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f031x6.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/normaldotcom/canable-fw/9fddea4ad12b05acc519d90c3771ba5c54a81ea2/Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f031x6.h -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f038xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/normaldotcom/canable-fw/9fddea4ad12b05acc519d90c3771ba5c54a81ea2/Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f038xx.h -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f042x6.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/normaldotcom/canable-fw/9fddea4ad12b05acc519d90c3771ba5c54a81ea2/Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f042x6.h -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f048xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/normaldotcom/canable-fw/9fddea4ad12b05acc519d90c3771ba5c54a81ea2/Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f048xx.h -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f051x8.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/normaldotcom/canable-fw/9fddea4ad12b05acc519d90c3771ba5c54a81ea2/Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f051x8.h -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f058xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/normaldotcom/canable-fw/9fddea4ad12b05acc519d90c3771ba5c54a81ea2/Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f058xx.h -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f070x6.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/normaldotcom/canable-fw/9fddea4ad12b05acc519d90c3771ba5c54a81ea2/Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f070x6.h -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f070xb.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/normaldotcom/canable-fw/9fddea4ad12b05acc519d90c3771ba5c54a81ea2/Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f070xb.h -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f071xb.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/normaldotcom/canable-fw/9fddea4ad12b05acc519d90c3771ba5c54a81ea2/Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f071xb.h -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f072xb.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/normaldotcom/canable-fw/9fddea4ad12b05acc519d90c3771ba5c54a81ea2/Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f072xb.h -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f078xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/normaldotcom/canable-fw/9fddea4ad12b05acc519d90c3771ba5c54a81ea2/Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f078xx.h -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f091xc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/normaldotcom/canable-fw/9fddea4ad12b05acc519d90c3771ba5c54a81ea2/Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f091xc.h -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f098xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/normaldotcom/canable-fw/9fddea4ad12b05acc519d90c3771ba5c54a81ea2/Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f098xx.h -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Include/system_stm32f0xx.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file system_stm32f0xx.h 4 | * @author MCD Application Team 5 | * @brief CMSIS Cortex-M0 Device System Source File for STM32F0xx devices. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© COPYRIGHT(c) 2016 STMicroelectronics

10 | * 11 | * Redistribution and use in source and binary forms, with or without modification, 12 | * are permitted provided that the following conditions are met: 13 | * 1. Redistributions of source code must retain the above copyright notice, 14 | * this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, 16 | * this list of conditions and the following disclaimer in the documentation 17 | * and/or other materials provided with the distribution. 18 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 19 | * may be used to endorse or promote products derived from this software 20 | * without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 23 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 25 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 28 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 30 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | * 33 | ****************************************************************************** 34 | */ 35 | 36 | /** @addtogroup CMSIS 37 | * @{ 38 | */ 39 | 40 | /** @addtogroup stm32f0xx_system 41 | * @{ 42 | */ 43 | 44 | /** 45 | * @brief Define to prevent recursive inclusion 46 | */ 47 | #ifndef __SYSTEM_STM32F0XX_H 48 | #define __SYSTEM_STM32F0XX_H 49 | 50 | #ifdef __cplusplus 51 | extern "C" { 52 | #endif 53 | 54 | /** @addtogroup STM32F0xx_System_Includes 55 | * @{ 56 | */ 57 | 58 | /** 59 | * @} 60 | */ 61 | 62 | 63 | /** @addtogroup STM32F0xx_System_Exported_types 64 | * @{ 65 | */ 66 | /* This variable is updated in three ways: 67 | 1) by calling CMSIS function SystemCoreClockUpdate() 68 | 3) by calling HAL API function HAL_RCC_GetHCLKFreq() 69 | 3) by calling HAL API function HAL_RCC_ClockConfig() 70 | Note: If you use this function to configure the system clock; then there 71 | is no need to call the 2 first functions listed above, since SystemCoreClock 72 | variable is updated automatically. 73 | */ 74 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ 75 | extern const uint8_t AHBPrescTable[16]; /*!< AHB prescalers table values */ 76 | extern const uint8_t APBPrescTable[8]; /*!< APB prescalers table values */ 77 | 78 | /** 79 | * @} 80 | */ 81 | 82 | /** @addtogroup STM32F0xx_System_Exported_Constants 83 | * @{ 84 | */ 85 | 86 | /** 87 | * @} 88 | */ 89 | 90 | /** @addtogroup STM32F0xx_System_Exported_Macros 91 | * @{ 92 | */ 93 | 94 | /** 95 | * @} 96 | */ 97 | 98 | /** @addtogroup STM32F0xx_System_Exported_Functions 99 | * @{ 100 | */ 101 | 102 | extern void SystemInit(void); 103 | extern void SystemCoreClockUpdate(void); 104 | /** 105 | * @} 106 | */ 107 | 108 | #ifdef __cplusplus 109 | } 110 | #endif 111 | 112 | #endif /*__SYSTEM_STM32F0XX_H */ 113 | 114 | /** 115 | * @} 116 | */ 117 | 118 | /** 119 | * @} 120 | */ 121 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 122 | -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/iar/linker/stm32f030x6_flash.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x08000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x08007FFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x20000FFF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x400; 13 | define symbol __ICFEDIT_size_heap__ = 0x200; 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | define memory mem with size = 4G; 17 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 18 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 19 | 20 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 21 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 22 | 23 | initialize by copy { readwrite }; 24 | do not initialize { section .noinit }; 25 | 26 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 27 | 28 | place in ROM_region { readonly }; 29 | place in RAM_region { readwrite, 30 | block CSTACK, block HEAP }; 31 | 32 | export symbol __ICFEDIT_region_RAM_start__; 33 | export symbol __ICFEDIT_region_RAM_end__; 34 | -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/iar/linker/stm32f030x8_flash.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x08000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x0800FFFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x20001FFF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x400; 13 | define symbol __ICFEDIT_size_heap__ = 0x200; 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | define memory mem with size = 4G; 17 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 18 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 19 | 20 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 21 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 22 | 23 | initialize by copy { readwrite }; 24 | do not initialize { section .noinit }; 25 | 26 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 27 | 28 | place in ROM_region { readonly }; 29 | place in RAM_region { readwrite, 30 | block CSTACK, block HEAP }; 31 | 32 | export symbol __ICFEDIT_region_RAM_start__; 33 | export symbol __ICFEDIT_region_RAM_end__; 34 | -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/iar/linker/stm32f030xc_flash.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x08000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x0803FFFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x20007FFF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x400; 13 | define symbol __ICFEDIT_size_heap__ = 0x200; 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | define memory mem with size = 4G; 17 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 18 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 19 | 20 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 21 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 22 | 23 | initialize by copy { readwrite }; 24 | do not initialize { section .noinit }; 25 | 26 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 27 | 28 | place in ROM_region { readonly }; 29 | place in RAM_region { readwrite, 30 | block CSTACK, block HEAP }; 31 | 32 | export symbol __ICFEDIT_region_RAM_start__; 33 | export symbol __ICFEDIT_region_RAM_end__; 34 | -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/iar/linker/stm32f031x6_flash.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x08000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x08007FFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x20000FFF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x400; 13 | define symbol __ICFEDIT_size_heap__ = 0x200; 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | define memory mem with size = 4G; 17 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 18 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 19 | 20 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 21 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 22 | 23 | initialize by copy { readwrite }; 24 | do not initialize { section .noinit }; 25 | 26 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 27 | 28 | place in ROM_region { readonly }; 29 | place in RAM_region { readwrite, 30 | block CSTACK, block HEAP }; 31 | 32 | export symbol __ICFEDIT_region_RAM_start__; 33 | export symbol __ICFEDIT_region_RAM_end__; 34 | -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/iar/linker/stm32f038xx_flash.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x08000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x08007FFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x20000FFF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x400; 13 | define symbol __ICFEDIT_size_heap__ = 0x200; 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | define memory mem with size = 4G; 17 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 18 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 19 | 20 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 21 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 22 | 23 | initialize by copy { readwrite }; 24 | do not initialize { section .noinit }; 25 | 26 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 27 | 28 | place in ROM_region { readonly }; 29 | place in RAM_region { readwrite, 30 | block CSTACK, block HEAP }; 31 | 32 | export symbol __ICFEDIT_region_RAM_start__; 33 | export symbol __ICFEDIT_region_RAM_end__; 34 | -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/iar/linker/stm32f042x6_flash.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x08000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x08007FFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x200017FF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x400; 13 | define symbol __ICFEDIT_size_heap__ = 0x200; 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | define memory mem with size = 4G; 17 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 18 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 19 | 20 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 21 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 22 | 23 | initialize by copy { readwrite }; 24 | do not initialize { section .noinit }; 25 | 26 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 27 | 28 | place in ROM_region { readonly }; 29 | place in RAM_region { readwrite, 30 | block CSTACK, block HEAP }; 31 | 32 | export symbol __ICFEDIT_region_RAM_start__; 33 | export symbol __ICFEDIT_region_RAM_end__; 34 | -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/iar/linker/stm32f048xx_flash.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x08000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x08007FFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x200017FF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x400; 13 | define symbol __ICFEDIT_size_heap__ = 0x200; 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | define memory mem with size = 4G; 17 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 18 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 19 | 20 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 21 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 22 | 23 | initialize by copy { readwrite }; 24 | do not initialize { section .noinit }; 25 | 26 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 27 | 28 | place in ROM_region { readonly }; 29 | place in RAM_region { readwrite, 30 | block CSTACK, block HEAP }; 31 | 32 | export symbol __ICFEDIT_region_RAM_start__; 33 | export symbol __ICFEDIT_region_RAM_end__; 34 | -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/iar/linker/stm32f051x8_flash.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x08000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x0800FFFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x20001FFF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x400; 13 | define symbol __ICFEDIT_size_heap__ = 0x200; 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | define memory mem with size = 4G; 17 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 18 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 19 | 20 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 21 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 22 | 23 | initialize by copy { readwrite }; 24 | do not initialize { section .noinit }; 25 | 26 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 27 | 28 | place in ROM_region { readonly }; 29 | place in RAM_region { readwrite, 30 | block CSTACK, block HEAP }; 31 | 32 | export symbol __ICFEDIT_region_RAM_start__; 33 | export symbol __ICFEDIT_region_RAM_end__; 34 | -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/iar/linker/stm32f058xx_flash.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x08000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x0800FFFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x20001FFF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x400; 13 | define symbol __ICFEDIT_size_heap__ = 0x200; 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | define memory mem with size = 4G; 17 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 18 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 19 | 20 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 21 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 22 | 23 | initialize by copy { readwrite }; 24 | do not initialize { section .noinit }; 25 | 26 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 27 | 28 | place in ROM_region { readonly }; 29 | place in RAM_region { readwrite, 30 | block CSTACK, block HEAP }; 31 | 32 | export symbol __ICFEDIT_region_RAM_start__; 33 | export symbol __ICFEDIT_region_RAM_end__; 34 | -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/iar/linker/stm32f070x6_flash.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x08000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x08007FFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x200017FF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x400; 13 | define symbol __ICFEDIT_size_heap__ = 0x200; 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | define memory mem with size = 4G; 17 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 18 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 19 | 20 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 21 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 22 | 23 | initialize by copy { readwrite }; 24 | do not initialize { section .noinit }; 25 | 26 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 27 | 28 | place in ROM_region { readonly }; 29 | place in RAM_region { readwrite, 30 | block CSTACK, block HEAP }; 31 | 32 | export symbol __ICFEDIT_region_RAM_start__; 33 | export symbol __ICFEDIT_region_RAM_end__; 34 | -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/iar/linker/stm32f070xb_flash.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x08000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x0801FFFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x20003FFF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x400; 13 | define symbol __ICFEDIT_size_heap__ = 0x200; 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | define memory mem with size = 4G; 17 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 18 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 19 | 20 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 21 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 22 | 23 | initialize by copy { readwrite }; 24 | do not initialize { section .noinit }; 25 | 26 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 27 | 28 | place in ROM_region { readonly }; 29 | place in RAM_region { readwrite, 30 | block CSTACK, block HEAP }; 31 | 32 | export symbol __ICFEDIT_region_RAM_start__; 33 | export symbol __ICFEDIT_region_RAM_end__; 34 | -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/iar/linker/stm32f071xb_flash.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x08000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x0801FFFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x20003FFF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x400; 13 | define symbol __ICFEDIT_size_heap__ = 0x200; 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | define memory mem with size = 4G; 17 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 18 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 19 | 20 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 21 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 22 | 23 | initialize by copy { readwrite }; 24 | do not initialize { section .noinit }; 25 | 26 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 27 | 28 | place in ROM_region { readonly }; 29 | place in RAM_region { readwrite, 30 | block CSTACK, block HEAP }; 31 | 32 | export symbol __ICFEDIT_region_RAM_start__; 33 | export symbol __ICFEDIT_region_RAM_end__; 34 | -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/iar/linker/stm32f072xb_flash.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x08000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x0801FFFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x20003FFF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x400; 13 | define symbol __ICFEDIT_size_heap__ = 0x200; 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | define memory mem with size = 4G; 17 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 18 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 19 | 20 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 21 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 22 | 23 | initialize by copy { readwrite }; 24 | do not initialize { section .noinit }; 25 | 26 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 27 | 28 | place in ROM_region { readonly }; 29 | place in RAM_region { readwrite, 30 | block CSTACK, block HEAP }; 31 | 32 | export symbol __ICFEDIT_region_RAM_start__; 33 | export symbol __ICFEDIT_region_RAM_end__; 34 | -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/iar/linker/stm32f078xx_flash.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x08000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x0801FFFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x20003FFF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x400; 13 | define symbol __ICFEDIT_size_heap__ = 0x200; 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | define memory mem with size = 4G; 17 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 18 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 19 | 20 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 21 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 22 | 23 | initialize by copy { readwrite }; 24 | do not initialize { section .noinit }; 25 | 26 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 27 | 28 | place in ROM_region { readonly }; 29 | place in RAM_region { readwrite, 30 | block CSTACK, block HEAP }; 31 | 32 | export symbol __ICFEDIT_region_RAM_start__; 33 | export symbol __ICFEDIT_region_RAM_end__; 34 | -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/iar/linker/stm32f091xc_flash.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x08000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x0803FFFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x20007FFF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x400; 13 | define symbol __ICFEDIT_size_heap__ = 0x200; 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | define memory mem with size = 4G; 17 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 18 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 19 | 20 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 21 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 22 | 23 | initialize by copy { readwrite }; 24 | do not initialize { section .noinit }; 25 | 26 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 27 | 28 | place in ROM_region { readonly }; 29 | place in RAM_region { readwrite, 30 | block CSTACK, block HEAP }; 31 | 32 | export symbol __ICFEDIT_region_RAM_start__; 33 | export symbol __ICFEDIT_region_RAM_end__; 34 | -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/iar/linker/stm32f091xc_sram.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x20000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x20000000 ; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x20003FFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20004000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x20007FFF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x400; 13 | define symbol __ICFEDIT_size_heap__ = 0x200; 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | 17 | define memory mem with size = 4G; 18 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 19 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 20 | 21 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 22 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 23 | 24 | initialize by copy { readwrite }; 25 | do not initialize { section .noinit }; 26 | 27 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 28 | 29 | place in ROM_region { readonly }; 30 | place in RAM_region { readwrite, 31 | block CSTACK, block HEAP }; -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/iar/linker/stm32f098xx_flash.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x08000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x0803FFFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x20007FFF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x400; 13 | define symbol __ICFEDIT_size_heap__ = 0x200; 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | define memory mem with size = 4G; 17 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 18 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 19 | 20 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 21 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 22 | 23 | initialize by copy { readwrite }; 24 | do not initialize { section .noinit }; 25 | 26 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 27 | 28 | place in ROM_region { readonly }; 29 | place in RAM_region { readwrite, 30 | block CSTACK, block HEAP }; 31 | 32 | export symbol __ICFEDIT_region_RAM_start__; 33 | export symbol __ICFEDIT_region_RAM_end__; 34 | -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/iar/linker/stm32f098xx_sram.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x20000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x20000000 ; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x20003FFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20004000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x20007FFF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x400; 13 | define symbol __ICFEDIT_size_heap__ = 0x200; 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | 17 | define memory mem with size = 4G; 18 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 19 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 20 | 21 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 22 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 23 | 24 | initialize by copy { readwrite }; 25 | do not initialize { section .noinit }; 26 | 27 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 28 | 29 | place in ROM_region { readonly }; 30 | place in RAM_region { readwrite, 31 | block CSTACK, block HEAP }; -------------------------------------------------------------------------------- /Drivers/CMSIS/Include/arm_const_structs.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_const_structs.h 9 | * 10 | * Description: This file has constant structs that are initialized for 11 | * user convenience. For example, some can be given as 12 | * arguments to the arm_cfft_f32() function. 13 | * 14 | * Target Processor: Cortex-M4/Cortex-M3 15 | * 16 | * Redistribution and use in source and binary forms, with or without 17 | * modification, are permitted provided that the following conditions 18 | * are met: 19 | * - Redistributions of source code must retain the above copyright 20 | * notice, this list of conditions and the following disclaimer. 21 | * - Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in 23 | * the documentation and/or other materials provided with the 24 | * distribution. 25 | * - Neither the name of ARM LIMITED nor the names of its contributors 26 | * may be used to endorse or promote products derived from this 27 | * software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 32 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 33 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 34 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 35 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 36 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 37 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 38 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 39 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 40 | * POSSIBILITY OF SUCH DAMAGE. 41 | * -------------------------------------------------------------------- */ 42 | 43 | #ifndef _ARM_CONST_STRUCTS_H 44 | #define _ARM_CONST_STRUCTS_H 45 | 46 | #include "arm_math.h" 47 | #include "arm_common_tables.h" 48 | 49 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len16; 50 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len32; 51 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len64; 52 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len128; 53 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len256; 54 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len512; 55 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len1024; 56 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len2048; 57 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len4096; 58 | 59 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len16; 60 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len32; 61 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len64; 62 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len128; 63 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len256; 64 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len512; 65 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len1024; 66 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len2048; 67 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len4096; 68 | 69 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len16; 70 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len32; 71 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len64; 72 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len128; 73 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len256; 74 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len512; 75 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len1024; 76 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len2048; 77 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len4096; 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /Drivers/CMSIS/Include/core_cmFunc.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file core_cmFunc.h 3 | * @brief CMSIS Cortex-M Core Function Access Header File 4 | * @version V4.30 5 | * @date 20. October 2015 6 | ******************************************************************************/ 7 | /* Copyright (c) 2009 - 2015 ARM LIMITED 8 | 9 | All rights reserved. 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | - Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | - Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | - Neither the name of ARM nor the names of its contributors may be used 18 | to endorse or promote products derived from this software without 19 | specific prior written permission. 20 | * 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE 25 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | POSSIBILITY OF SUCH DAMAGE. 32 | ---------------------------------------------------------------------------*/ 33 | 34 | 35 | #if defined ( __ICCARM__ ) 36 | #pragma system_include /* treat file as system include file for MISRA check */ 37 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 38 | #pragma clang system_header /* treat file as system include file */ 39 | #endif 40 | 41 | #ifndef __CORE_CMFUNC_H 42 | #define __CORE_CMFUNC_H 43 | 44 | 45 | /* ########################### Core Function Access ########################### */ 46 | /** \ingroup CMSIS_Core_FunctionInterface 47 | \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions 48 | @{ 49 | */ 50 | 51 | /*------------------ RealView Compiler -----------------*/ 52 | #if defined ( __CC_ARM ) 53 | #include "cmsis_armcc.h" 54 | 55 | /*------------------ ARM Compiler V6 -------------------*/ 56 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 57 | #include "cmsis_armcc_V6.h" 58 | 59 | /*------------------ GNU Compiler ----------------------*/ 60 | #elif defined ( __GNUC__ ) 61 | #include "cmsis_gcc.h" 62 | 63 | /*------------------ ICC Compiler ----------------------*/ 64 | #elif defined ( __ICCARM__ ) 65 | #include 66 | 67 | /*------------------ TI CCS Compiler -------------------*/ 68 | #elif defined ( __TMS470__ ) 69 | #include 70 | 71 | /*------------------ TASKING Compiler ------------------*/ 72 | #elif defined ( __TASKING__ ) 73 | /* 74 | * The CMSIS functions have been implemented as intrinsics in the compiler. 75 | * Please use "carm -?i" to get an up to date list of all intrinsics, 76 | * Including the CMSIS ones. 77 | */ 78 | 79 | /*------------------ COSMIC Compiler -------------------*/ 80 | #elif defined ( __CSMC__ ) 81 | #include 82 | 83 | #endif 84 | 85 | /*@} end of CMSIS_Core_RegAccFunctions */ 86 | 87 | #endif /* __CORE_CMFUNC_H */ 88 | -------------------------------------------------------------------------------- /Drivers/CMSIS/Include/core_cmInstr.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file core_cmInstr.h 3 | * @brief CMSIS Cortex-M Core Instruction Access Header File 4 | * @version V4.30 5 | * @date 20. October 2015 6 | ******************************************************************************/ 7 | /* Copyright (c) 2009 - 2015 ARM LIMITED 8 | 9 | All rights reserved. 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | - Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | - Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | - Neither the name of ARM nor the names of its contributors may be used 18 | to endorse or promote products derived from this software without 19 | specific prior written permission. 20 | * 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE 25 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | POSSIBILITY OF SUCH DAMAGE. 32 | ---------------------------------------------------------------------------*/ 33 | 34 | 35 | #if defined ( __ICCARM__ ) 36 | #pragma system_include /* treat file as system include file for MISRA check */ 37 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 38 | #pragma clang system_header /* treat file as system include file */ 39 | #endif 40 | 41 | #ifndef __CORE_CMINSTR_H 42 | #define __CORE_CMINSTR_H 43 | 44 | 45 | /* ########################## Core Instruction Access ######################### */ 46 | /** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface 47 | Access to dedicated instructions 48 | @{ 49 | */ 50 | 51 | /*------------------ RealView Compiler -----------------*/ 52 | #if defined ( __CC_ARM ) 53 | #include "cmsis_armcc.h" 54 | 55 | /*------------------ ARM Compiler V6 -------------------*/ 56 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 57 | #include "cmsis_armcc_V6.h" 58 | 59 | /*------------------ GNU Compiler ----------------------*/ 60 | #elif defined ( __GNUC__ ) 61 | #include "cmsis_gcc.h" 62 | 63 | /*------------------ ICC Compiler ----------------------*/ 64 | #elif defined ( __ICCARM__ ) 65 | #include 66 | 67 | /*------------------ TI CCS Compiler -------------------*/ 68 | #elif defined ( __TMS470__ ) 69 | #include 70 | 71 | /*------------------ TASKING Compiler ------------------*/ 72 | #elif defined ( __TASKING__ ) 73 | /* 74 | * The CMSIS functions have been implemented as intrinsics in the compiler. 75 | * Please use "carm -?i" to get an up to date list of all intrinsics, 76 | * Including the CMSIS ones. 77 | */ 78 | 79 | /*------------------ COSMIC Compiler -------------------*/ 80 | #elif defined ( __CSMC__ ) 81 | #include 82 | 83 | #endif 84 | 85 | /*@}*/ /* end of group CMSIS_Core_InstructionInterface */ 86 | 87 | #endif /* __CORE_CMINSTR_H */ 88 | -------------------------------------------------------------------------------- /Drivers/CMSIS/Include/core_cmSimd.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file core_cmSimd.h 3 | * @brief CMSIS Cortex-M SIMD Header File 4 | * @version V4.30 5 | * @date 20. October 2015 6 | ******************************************************************************/ 7 | /* Copyright (c) 2009 - 2015 ARM LIMITED 8 | 9 | All rights reserved. 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | - Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | - Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | - Neither the name of ARM nor the names of its contributors may be used 18 | to endorse or promote products derived from this software without 19 | specific prior written permission. 20 | * 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE 25 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | POSSIBILITY OF SUCH DAMAGE. 32 | ---------------------------------------------------------------------------*/ 33 | 34 | 35 | #if defined ( __ICCARM__ ) 36 | #pragma system_include /* treat file as system include file for MISRA check */ 37 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 38 | #pragma clang system_header /* treat file as system include file */ 39 | #endif 40 | 41 | #ifndef __CORE_CMSIMD_H 42 | #define __CORE_CMSIMD_H 43 | 44 | #ifdef __cplusplus 45 | extern "C" { 46 | #endif 47 | 48 | 49 | /* ################### Compiler specific Intrinsics ########################### */ 50 | /** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics 51 | Access to dedicated SIMD instructions 52 | @{ 53 | */ 54 | 55 | /*------------------ RealView Compiler -----------------*/ 56 | #if defined ( __CC_ARM ) 57 | #include "cmsis_armcc.h" 58 | 59 | /*------------------ ARM Compiler V6 -------------------*/ 60 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 61 | #include "cmsis_armcc_V6.h" 62 | 63 | /*------------------ GNU Compiler ----------------------*/ 64 | #elif defined ( __GNUC__ ) 65 | #include "cmsis_gcc.h" 66 | 67 | /*------------------ ICC Compiler ----------------------*/ 68 | #elif defined ( __ICCARM__ ) 69 | #include 70 | 71 | /*------------------ TI CCS Compiler -------------------*/ 72 | #elif defined ( __TMS470__ ) 73 | #include 74 | 75 | /*------------------ TASKING Compiler ------------------*/ 76 | #elif defined ( __TASKING__ ) 77 | /* 78 | * The CMSIS functions have been implemented as intrinsics in the compiler. 79 | * Please use "carm -?i" to get an up to date list of all intrinsics, 80 | * Including the CMSIS ones. 81 | */ 82 | 83 | /*------------------ COSMIC Compiler -------------------*/ 84 | #elif defined ( __CSMC__ ) 85 | #include 86 | 87 | #endif 88 | 89 | /*@} end of group CMSIS_SIMD_intrinsics */ 90 | 91 | 92 | #ifdef __cplusplus 93 | } 94 | #endif 95 | 96 | #endif /* __CORE_CMSIMD_H */ 97 | -------------------------------------------------------------------------------- /Drivers/CMSIS/Lib/ARM/arm_cortexM0b_math.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/normaldotcom/canable-fw/9fddea4ad12b05acc519d90c3771ba5c54a81ea2/Drivers/CMSIS/Lib/ARM/arm_cortexM0b_math.lib -------------------------------------------------------------------------------- /Drivers/CMSIS/Lib/ARM/arm_cortexM0l_math.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/normaldotcom/canable-fw/9fddea4ad12b05acc519d90c3771ba5c54a81ea2/Drivers/CMSIS/Lib/ARM/arm_cortexM0l_math.lib -------------------------------------------------------------------------------- /Drivers/CMSIS/Lib/GCC/libarm_cortexM0l_math.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/normaldotcom/canable-fw/9fddea4ad12b05acc519d90c3771ba5c54a81ea2/Drivers/CMSIS/Lib/GCC/libarm_cortexM0l_math.a -------------------------------------------------------------------------------- /Drivers/STM32F0xx_HAL_Driver/Inc/stm32_assert_template.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32_assert.h 4 | * @author MCD Application Team 5 | * @brief STM32 assert template file. 6 | * This file should be copied to the application folder and renamed 7 | * to stm32_assert.h. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© Copyright (c) 2016 STMicroelectronics. 12 | * All rights reserved.

13 | * 14 | * This software component is licensed by ST under BSD 3-Clause license, 15 | * the "License"; You may not use this file except in compliance with the 16 | * License. You may obtain a copy of the License at: 17 | * opensource.org/licenses/BSD-3-Clause 18 | * 19 | ****************************************************************************** 20 | */ 21 | 22 | /* Define to prevent recursive inclusion -------------------------------------*/ 23 | #ifndef __STM32_ASSERT_H 24 | #define __STM32_ASSERT_H 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /* Exported types ------------------------------------------------------------*/ 31 | /* Exported constants --------------------------------------------------------*/ 32 | /* Includes ------------------------------------------------------------------*/ 33 | /* Exported macro ------------------------------------------------------------*/ 34 | #ifdef USE_FULL_ASSERT 35 | /** 36 | * @brief The assert_param macro is used for function's parameters check. 37 | * @param expr If expr is false, it calls assert_failed function 38 | * which reports the name of the source file and the source 39 | * line number of the call that failed. 40 | * If expr is true, it returns no value. 41 | * @retval None 42 | */ 43 | #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) 44 | /* Exported functions ------------------------------------------------------- */ 45 | void assert_failed(uint8_t* file, uint32_t line); 46 | #else 47 | #define assert_param(expr) ((void)0U) 48 | #endif /* USE_FULL_ASSERT */ 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #endif /* __STM32_ASSERT_H */ 55 | 56 | 57 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 58 | -------------------------------------------------------------------------------- /Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_pcd_ex.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f0xx_hal_pcd_ex.h 4 | * @author MCD Application Team 5 | * @brief Header file of PCD HAL Extension module. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2016 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under BSD 3-Clause license, 13 | * the "License"; You may not use this file except in compliance with the 14 | * License. You may obtain a copy of the License at: 15 | * opensource.org/licenses/BSD-3-Clause 16 | * 17 | ****************************************************************************** 18 | */ 19 | 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef STM32F0xx_HAL_PCD_EX_H 22 | #define STM32F0xx_HAL_PCD_EX_H 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "stm32f0xx_hal_def.h" 30 | 31 | #if defined (USB) 32 | /** @addtogroup STM32F0xx_HAL_Driver 33 | * @{ 34 | */ 35 | 36 | /** @addtogroup PCDEx 37 | * @{ 38 | */ 39 | /* Exported types ------------------------------------------------------------*/ 40 | /* Exported constants --------------------------------------------------------*/ 41 | /* Exported macros -----------------------------------------------------------*/ 42 | /* Exported functions --------------------------------------------------------*/ 43 | /** @addtogroup PCDEx_Exported_Functions PCDEx Exported Functions 44 | * @{ 45 | */ 46 | /** @addtogroup PCDEx_Exported_Functions_Group1 Peripheral Control functions 47 | * @{ 48 | */ 49 | 50 | 51 | 52 | HAL_StatusTypeDef HAL_PCDEx_PMAConfig(PCD_HandleTypeDef *hpcd, 53 | uint16_t ep_addr, 54 | uint16_t ep_kind, 55 | uint32_t pmaadress); 56 | 57 | 58 | HAL_StatusTypeDef HAL_PCDEx_ActivateLPM(PCD_HandleTypeDef *hpcd); 59 | HAL_StatusTypeDef HAL_PCDEx_DeActivateLPM(PCD_HandleTypeDef *hpcd); 60 | 61 | 62 | HAL_StatusTypeDef HAL_PCDEx_ActivateBCD(PCD_HandleTypeDef *hpcd); 63 | HAL_StatusTypeDef HAL_PCDEx_DeActivateBCD(PCD_HandleTypeDef *hpcd); 64 | void HAL_PCDEx_BCD_VBUSDetect(PCD_HandleTypeDef *hpcd); 65 | 66 | void HAL_PCDEx_LPM_Callback(PCD_HandleTypeDef *hpcd, PCD_LPM_MsgTypeDef msg); 67 | void HAL_PCDEx_BCD_Callback(PCD_HandleTypeDef *hpcd, PCD_BCD_MsgTypeDef msg); 68 | 69 | /** 70 | * @} 71 | */ 72 | 73 | /** 74 | * @} 75 | */ 76 | 77 | /** 78 | * @} 79 | */ 80 | 81 | /** 82 | * @} 83 | */ 84 | #endif /* defined (USB) */ 85 | 86 | #ifdef __cplusplus 87 | } 88 | #endif 89 | 90 | 91 | #endif /* STM32F0xx_HAL_PCD_EX_H */ 92 | 93 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 94 | -------------------------------------------------------------------------------- /Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_spi_ex.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f0xx_hal_spi_ex.h 4 | * @author MCD Application Team 5 | * @brief Header file of SPI HAL Extended module. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2016 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under BSD 3-Clause license, 13 | * the "License"; You may not use this file except in compliance with the 14 | * License. You may obtain a copy of the License at: 15 | * opensource.org/licenses/BSD-3-Clause 16 | * 17 | ****************************************************************************** 18 | */ 19 | 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef STM32F0xx_HAL_SPI_EX_H 22 | #define STM32F0xx_HAL_SPI_EX_H 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "stm32f0xx_hal_def.h" 30 | 31 | /** @addtogroup STM32F0xx_HAL_Driver 32 | * @{ 33 | */ 34 | 35 | /** @addtogroup SPIEx 36 | * @{ 37 | */ 38 | 39 | /* Exported types ------------------------------------------------------------*/ 40 | /* Exported constants --------------------------------------------------------*/ 41 | /* Exported macros -----------------------------------------------------------*/ 42 | /* Exported functions --------------------------------------------------------*/ 43 | /** @addtogroup SPIEx_Exported_Functions 44 | * @{ 45 | */ 46 | 47 | /* Initialization and de-initialization functions ****************************/ 48 | /* IO operation functions *****************************************************/ 49 | /** @addtogroup SPIEx_Exported_Functions_Group1 50 | * @{ 51 | */ 52 | HAL_StatusTypeDef HAL_SPIEx_FlushRxFifo(SPI_HandleTypeDef *hspi); 53 | /** 54 | * @} 55 | */ 56 | 57 | /** 58 | * @} 59 | */ 60 | 61 | /** 62 | * @} 63 | */ 64 | 65 | /** 66 | * @} 67 | */ 68 | 69 | #ifdef __cplusplus 70 | } 71 | #endif 72 | 73 | #endif /* STM32F0xx_HAL_SPI_EX_H */ 74 | 75 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 76 | -------------------------------------------------------------------------------- /Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_spi_ex.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f0xx_hal_spi_ex.c 4 | * @author MCD Application Team 5 | * @brief Extended SPI HAL module driver. 6 | * This file provides firmware functions to manage the following 7 | * SPI peripheral extended functionalities : 8 | * + IO operation functions 9 | * 10 | ****************************************************************************** 11 | * @attention 12 | * 13 | *

© Copyright (c) 2016 STMicroelectronics. 14 | * All rights reserved.

15 | * 16 | * This software component is licensed by ST under BSD 3-Clause license, 17 | * the "License"; You may not use this file except in compliance with the 18 | * License. You may obtain a copy of the License at: 19 | * opensource.org/licenses/BSD-3-Clause 20 | * 21 | ****************************************************************************** 22 | */ 23 | 24 | /* Includes ------------------------------------------------------------------*/ 25 | #include "stm32f0xx_hal.h" 26 | 27 | /** @addtogroup STM32F0xx_HAL_Driver 28 | * @{ 29 | */ 30 | 31 | /** @defgroup SPIEx SPIEx 32 | * @brief SPI Extended HAL module driver 33 | * @{ 34 | */ 35 | #ifdef HAL_SPI_MODULE_ENABLED 36 | 37 | /* Private typedef -----------------------------------------------------------*/ 38 | /* Private defines -----------------------------------------------------------*/ 39 | /** @defgroup SPIEx_Private_Constants SPIEx Private Constants 40 | * @{ 41 | */ 42 | #define SPI_FIFO_SIZE 4UL 43 | /** 44 | * @} 45 | */ 46 | 47 | /* Private macros ------------------------------------------------------------*/ 48 | /* Private variables ---------------------------------------------------------*/ 49 | /* Private function prototypes -----------------------------------------------*/ 50 | /* Exported functions --------------------------------------------------------*/ 51 | 52 | /** @defgroup SPIEx_Exported_Functions SPIEx Exported Functions 53 | * @{ 54 | */ 55 | 56 | /** @defgroup SPIEx_Exported_Functions_Group1 IO operation functions 57 | * @brief Data transfers functions 58 | * 59 | @verbatim 60 | ============================================================================== 61 | ##### IO operation functions ##### 62 | =============================================================================== 63 | [..] 64 | This subsection provides a set of extended functions to manage the SPI 65 | data transfers. 66 | 67 | (#) Rx data flush function: 68 | (++) HAL_SPIEx_FlushRxFifo() 69 | 70 | @endverbatim 71 | * @{ 72 | */ 73 | 74 | /** 75 | * @brief Flush the RX fifo. 76 | * @param hspi pointer to a SPI_HandleTypeDef structure that contains 77 | * the configuration information for the specified SPI module. 78 | * @retval HAL status 79 | */ 80 | HAL_StatusTypeDef HAL_SPIEx_FlushRxFifo(SPI_HandleTypeDef *hspi) 81 | { 82 | __IO uint32_t tmpreg; 83 | uint8_t count = 0U; 84 | while ((hspi->Instance->SR & SPI_FLAG_FRLVL) != SPI_FRLVL_EMPTY) 85 | { 86 | count++; 87 | tmpreg = hspi->Instance->DR; 88 | UNUSED(tmpreg); /* To avoid GCC warning */ 89 | if (count == SPI_FIFO_SIZE) 90 | { 91 | return HAL_TIMEOUT; 92 | } 93 | } 94 | return HAL_OK; 95 | } 96 | 97 | /** 98 | * @} 99 | */ 100 | 101 | /** 102 | * @} 103 | */ 104 | 105 | #endif /* HAL_SPI_MODULE_ENABLED */ 106 | 107 | /** 108 | * @} 109 | */ 110 | 111 | /** 112 | * @} 113 | */ 114 | 115 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 116 | -------------------------------------------------------------------------------- /Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_wwdg.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/normaldotcom/canable-fw/9fddea4ad12b05acc519d90c3771ba5c54a81ea2/Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_wwdg.c -------------------------------------------------------------------------------- /Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_ll_crc.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f0xx_ll_crc.c 4 | * @author MCD Application Team 5 | * @brief CRC LL module driver. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2016 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under BSD 3-Clause license, 13 | * the "License"; You may not use this file except in compliance with the 14 | * License. You may obtain a copy of the License at: 15 | * opensource.org/licenses/BSD-3-Clause 16 | * 17 | ****************************************************************************** 18 | */ 19 | #if defined(USE_FULL_LL_DRIVER) 20 | 21 | /* Includes ------------------------------------------------------------------*/ 22 | #include "stm32f0xx_ll_crc.h" 23 | #include "stm32f0xx_ll_bus.h" 24 | 25 | #ifdef USE_FULL_ASSERT 26 | #include "stm32_assert.h" 27 | #else 28 | #define assert_param(expr) ((void)0U) 29 | #endif 30 | 31 | /** @addtogroup STM32F0xx_LL_Driver 32 | * @{ 33 | */ 34 | 35 | #if defined (CRC) 36 | 37 | /** @addtogroup CRC_LL 38 | * @{ 39 | */ 40 | 41 | /* Private types -------------------------------------------------------------*/ 42 | /* Private variables ---------------------------------------------------------*/ 43 | /* Private constants ---------------------------------------------------------*/ 44 | /* Private macros ------------------------------------------------------------*/ 45 | /* Private function prototypes -----------------------------------------------*/ 46 | 47 | /* Exported functions --------------------------------------------------------*/ 48 | /** @addtogroup CRC_LL_Exported_Functions 49 | * @{ 50 | */ 51 | 52 | /** @addtogroup CRC_LL_EF_Init 53 | * @{ 54 | */ 55 | 56 | /** 57 | * @brief De-initialize CRC registers (Registers restored to their default values). 58 | * @param CRCx CRC Instance 59 | * @retval An ErrorStatus enumeration value: 60 | * - SUCCESS: CRC registers are de-initialized 61 | * - ERROR: CRC registers are not de-initialized 62 | */ 63 | ErrorStatus LL_CRC_DeInit(CRC_TypeDef *CRCx) 64 | { 65 | ErrorStatus status = SUCCESS; 66 | 67 | /* Check the parameters */ 68 | assert_param(IS_CRC_ALL_INSTANCE(CRCx)); 69 | 70 | if (CRCx == CRC) 71 | { 72 | #if defined(CRC_POL_POL) 73 | /* Set programmable polynomial size in CR register to reset value (32 bits)*/ 74 | LL_CRC_SetPolynomialSize(CRCx, LL_CRC_POLYLENGTH_32B); 75 | 76 | /* Set programmable polynomial in POL register to reset value */ 77 | LL_CRC_SetPolynomialCoef(CRCx, LL_CRC_DEFAULT_CRC32_POLY); 78 | #endif /* CRC_POL_POL */ 79 | 80 | /* Set INIT register to reset value */ 81 | LL_CRC_SetInitialData(CRCx, LL_CRC_DEFAULT_CRC_INITVALUE); 82 | 83 | /* Set Reversibility options on I/O data values in CR register to reset value */ 84 | LL_CRC_SetInputDataReverseMode(CRCx, LL_CRC_INDATA_REVERSE_NONE); 85 | LL_CRC_SetOutputDataReverseMode(CRCx, LL_CRC_OUTDATA_REVERSE_NONE); 86 | 87 | /* Reset the CRC calculation unit */ 88 | LL_CRC_ResetCRCCalculationUnit(CRCx); 89 | 90 | /* Reset IDR register */ 91 | LL_CRC_Write_IDR(CRCx, 0x00U); 92 | } 93 | else 94 | { 95 | status = ERROR; 96 | } 97 | 98 | return (status); 99 | } 100 | 101 | /** 102 | * @} 103 | */ 104 | 105 | /** 106 | * @} 107 | */ 108 | 109 | /** 110 | * @} 111 | */ 112 | 113 | #endif /* defined (CRC) */ 114 | 115 | /** 116 | * @} 117 | */ 118 | 119 | #endif /* USE_FULL_LL_DRIVER */ 120 | 121 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 122 | 123 | -------------------------------------------------------------------------------- /Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_ll_crs.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f0xx_ll_crs.h 4 | * @author MCD Application Team 5 | * @brief CRS LL module driver. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2016 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under BSD 3-Clause license, 13 | * the "License"; You may not use this file except in compliance with the 14 | * License. You may obtain a copy of the License at: 15 | * opensource.org/licenses/BSD-3-Clause 16 | * 17 | ****************************************************************************** 18 | */ 19 | 20 | #if defined(USE_FULL_LL_DRIVER) 21 | 22 | /* Includes ------------------------------------------------------------------*/ 23 | #include "stm32f0xx_ll_crs.h" 24 | #include "stm32f0xx_ll_bus.h" 25 | 26 | /** @addtogroup STM32F0xx_LL_Driver 27 | * @{ 28 | */ 29 | 30 | #if defined(CRS) 31 | 32 | /** @defgroup CRS_LL CRS 33 | * @{ 34 | */ 35 | 36 | /* Private types -------------------------------------------------------------*/ 37 | /* Private variables ---------------------------------------------------------*/ 38 | /* Private constants ---------------------------------------------------------*/ 39 | /* Private macros ------------------------------------------------------------*/ 40 | /* Private function prototypes -----------------------------------------------*/ 41 | 42 | /* Exported functions --------------------------------------------------------*/ 43 | /** @addtogroup CRS_LL_Exported_Functions 44 | * @{ 45 | */ 46 | 47 | /** @addtogroup CRS_LL_EF_Init 48 | * @{ 49 | */ 50 | 51 | /** 52 | * @brief De-Initializes CRS peripheral registers to their default reset values. 53 | * @retval An ErrorStatus enumeration value: 54 | * - SUCCESS: CRS registers are de-initialized 55 | * - ERROR: not applicable 56 | */ 57 | ErrorStatus LL_CRS_DeInit(void) 58 | { 59 | LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_CRS); 60 | LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_CRS); 61 | 62 | return SUCCESS; 63 | } 64 | 65 | 66 | 67 | /** 68 | * @} 69 | */ 70 | 71 | /** 72 | * @} 73 | */ 74 | 75 | /** 76 | * @} 77 | */ 78 | 79 | #endif /* defined(CRS) */ 80 | 81 | /** 82 | * @} 83 | */ 84 | 85 | #endif /* USE_FULL_LL_DRIVER */ 86 | 87 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 88 | -------------------------------------------------------------------------------- /Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_ll_pwr.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f0xx_ll_pwr.c 4 | * @author MCD Application Team 5 | * @brief PWR LL module driver. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2016 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under BSD 3-Clause license, 13 | * the "License"; You may not use this file except in compliance with the 14 | * License. You may obtain a copy of the License at: 15 | * opensource.org/licenses/BSD-3-Clause 16 | * 17 | ****************************************************************************** 18 | */ 19 | 20 | #if defined(USE_FULL_LL_DRIVER) 21 | 22 | /* Includes ------------------------------------------------------------------*/ 23 | #include "stm32f0xx_ll_pwr.h" 24 | #include "stm32f0xx_ll_bus.h" 25 | 26 | /** @addtogroup STM32F0xx_LL_Driver 27 | * @{ 28 | */ 29 | 30 | #if defined(PWR) 31 | 32 | /** @defgroup PWR_LL PWR 33 | * @{ 34 | */ 35 | 36 | /* Private types -------------------------------------------------------------*/ 37 | /* Private variables ---------------------------------------------------------*/ 38 | /* Private constants ---------------------------------------------------------*/ 39 | /* Private macros ------------------------------------------------------------*/ 40 | /* Private function prototypes -----------------------------------------------*/ 41 | 42 | /* Exported functions --------------------------------------------------------*/ 43 | /** @addtogroup PWR_LL_Exported_Functions 44 | * @{ 45 | */ 46 | 47 | /** @addtogroup PWR_LL_EF_Init 48 | * @{ 49 | */ 50 | 51 | /** 52 | * @brief De-initialize the PWR registers to their default reset values. 53 | * @retval An ErrorStatus enumeration value: 54 | * - SUCCESS: PWR registers are de-initialized 55 | * - ERROR: not applicable 56 | */ 57 | ErrorStatus LL_PWR_DeInit(void) 58 | { 59 | /* Force reset of PWR clock */ 60 | LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_PWR); 61 | 62 | /* Release reset of PWR clock */ 63 | LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_PWR); 64 | 65 | return SUCCESS; 66 | } 67 | 68 | /** 69 | * @} 70 | */ 71 | 72 | /** 73 | * @} 74 | */ 75 | 76 | /** 77 | * @} 78 | */ 79 | #endif /* defined(PWR) */ 80 | /** 81 | * @} 82 | */ 83 | 84 | #endif /* USE_FULL_LL_DRIVER */ 85 | 86 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 87 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # Licenses 2 | 3 | ## CANtact Sources 4 | 5 | The MIT License (MIT) 6 | 7 | Copyright (c) 2015 Eric Evenchick 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in 17 | all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | THE SOFTWARE. 26 | 27 | ## STM32 HAL 28 | 29 | The HAL is distributed under a non-restrictive BSD (Berkeley Software 30 | Distribution) license. 31 | 32 | ## STM32 USB Library 33 | Code from the STM32 USB library is licensed under ST Micro's [Liberty V2 34 | License](http://www.st.com/software_license_agreement_liberty_v2) 35 | 36 | -------------------------------------------------------------------------------- /Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc/usbd_cdc_if_template.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file usbd_cdc_if_template.h 4 | * @author MCD Application Team 5 | * @brief Header for usbd_cdc_if_template.c file. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2015 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under Ultimate Liberty license 13 | * SLA0044, the "License"; You may not use this file except in compliance with 14 | * the License. You may obtain a copy of the License at: 15 | * www.st.com/SLA0044 16 | * 17 | ****************************************************************************** 18 | */ 19 | 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __USBD_CDC_IF_TEMPLATE_H 22 | #define __USBD_CDC_IF_TEMPLATE_H 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "usbd_cdc.h" 30 | 31 | /* Exported types ------------------------------------------------------------*/ 32 | /* Exported constants --------------------------------------------------------*/ 33 | 34 | extern USBD_CDC_ItfTypeDef USBD_CDC_Template_fops; 35 | 36 | /* Exported macro ------------------------------------------------------------*/ 37 | /* Exported functions ------------------------------------------------------- */ 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | #endif /* __USBD_CDC_IF_TEMPLATE_H */ 44 | 45 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 46 | -------------------------------------------------------------------------------- /Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_ctlreq.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file usbd_req.h 4 | * @author MCD Application Team 5 | * @brief Header file for the usbd_req.c file 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2015 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under Ultimate Liberty license 13 | * SLA0044, the "License"; You may not use this file except in compliance with 14 | * the License. You may obtain a copy of the License at: 15 | * www.st.com/SLA0044 16 | * 17 | ****************************************************************************** 18 | */ 19 | 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __USB_REQUEST_H 22 | #define __USB_REQUEST_H 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "usbd_def.h" 30 | 31 | 32 | /** @addtogroup STM32_USB_DEVICE_LIBRARY 33 | * @{ 34 | */ 35 | 36 | /** @defgroup USBD_REQ 37 | * @brief header file for the usbd_req.c file 38 | * @{ 39 | */ 40 | 41 | /** @defgroup USBD_REQ_Exported_Defines 42 | * @{ 43 | */ 44 | /** 45 | * @} 46 | */ 47 | 48 | 49 | /** @defgroup USBD_REQ_Exported_Types 50 | * @{ 51 | */ 52 | /** 53 | * @} 54 | */ 55 | 56 | 57 | 58 | /** @defgroup USBD_REQ_Exported_Macros 59 | * @{ 60 | */ 61 | /** 62 | * @} 63 | */ 64 | 65 | /** @defgroup USBD_REQ_Exported_Variables 66 | * @{ 67 | */ 68 | /** 69 | * @} 70 | */ 71 | 72 | /** @defgroup USBD_REQ_Exported_FunctionsPrototype 73 | * @{ 74 | */ 75 | 76 | USBD_StatusTypeDef USBD_StdDevReq(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req); 77 | USBD_StatusTypeDef USBD_StdItfReq(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req); 78 | USBD_StatusTypeDef USBD_StdEPReq(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req); 79 | 80 | 81 | void USBD_CtlError(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req); 82 | 83 | void USBD_ParseSetupRequest(USBD_SetupReqTypedef *req, uint8_t *pdata); 84 | 85 | void USBD_GetString(uint8_t *desc, uint8_t *unicode, uint16_t *len); 86 | /** 87 | * @} 88 | */ 89 | 90 | #ifdef __cplusplus 91 | } 92 | #endif 93 | 94 | #endif /* __USB_REQUEST_H */ 95 | 96 | /** 97 | * @} 98 | */ 99 | 100 | /** 101 | * @} 102 | */ 103 | 104 | 105 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 106 | -------------------------------------------------------------------------------- /Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_ioreq.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file usbd_ioreq.h 4 | * @author MCD Application Team 5 | * @brief Header file for the usbd_ioreq.c file 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2015 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under Ultimate Liberty license 13 | * SLA0044, the "License"; You may not use this file except in compliance with 14 | * the License. You may obtain a copy of the License at: 15 | * www.st.com/SLA0044 16 | * 17 | ****************************************************************************** 18 | */ 19 | 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __USBD_IOREQ_H 22 | #define __USBD_IOREQ_H 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "usbd_def.h" 30 | #include "usbd_core.h" 31 | 32 | /** @addtogroup STM32_USB_DEVICE_LIBRARY 33 | * @{ 34 | */ 35 | 36 | /** @defgroup USBD_IOREQ 37 | * @brief header file for the usbd_ioreq.c file 38 | * @{ 39 | */ 40 | 41 | /** @defgroup USBD_IOREQ_Exported_Defines 42 | * @{ 43 | */ 44 | /** 45 | * @} 46 | */ 47 | 48 | 49 | /** @defgroup USBD_IOREQ_Exported_Types 50 | * @{ 51 | */ 52 | 53 | 54 | /** 55 | * @} 56 | */ 57 | 58 | 59 | 60 | /** @defgroup USBD_IOREQ_Exported_Macros 61 | * @{ 62 | */ 63 | 64 | /** 65 | * @} 66 | */ 67 | 68 | /** @defgroup USBD_IOREQ_Exported_Variables 69 | * @{ 70 | */ 71 | 72 | /** 73 | * @} 74 | */ 75 | 76 | /** @defgroup USBD_IOREQ_Exported_FunctionsPrototype 77 | * @{ 78 | */ 79 | 80 | USBD_StatusTypeDef USBD_CtlSendData(USBD_HandleTypeDef *pdev, 81 | uint8_t *pbuf, 82 | uint16_t len); 83 | 84 | USBD_StatusTypeDef USBD_CtlContinueSendData(USBD_HandleTypeDef *pdev, 85 | uint8_t *pbuf, 86 | uint16_t len); 87 | 88 | USBD_StatusTypeDef USBD_CtlPrepareRx(USBD_HandleTypeDef *pdev, 89 | uint8_t *pbuf, 90 | uint16_t len); 91 | 92 | USBD_StatusTypeDef USBD_CtlContinueRx(USBD_HandleTypeDef *pdev, 93 | uint8_t *pbuf, 94 | uint16_t len); 95 | 96 | USBD_StatusTypeDef USBD_CtlSendStatus(USBD_HandleTypeDef *pdev); 97 | 98 | USBD_StatusTypeDef USBD_CtlReceiveStatus(USBD_HandleTypeDef *pdev); 99 | 100 | uint32_t USBD_GetRxCount(USBD_HandleTypeDef *pdev, uint8_t ep_addr); 101 | 102 | /** 103 | * @} 104 | */ 105 | 106 | #ifdef __cplusplus 107 | } 108 | #endif 109 | 110 | #endif /* __USBD_IOREQ_H */ 111 | 112 | /** 113 | * @} 114 | */ 115 | 116 | /** 117 | * @} 118 | */ 119 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 120 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CANable Firmware 2 | 3 | This repository contains sources for the slcan CANable firmware, based off of the CANtact firwmare. This firmware may still compile and run on the CANtact. 4 | 5 | ## Supported Commands 6 | 7 | - `O` - Open channel 8 | - `C` - Close channel 9 | - `S0` - Set bitrate to 10k 10 | - `S1` - Set bitrate to 20k 11 | - `S2` - Set bitrate to 50k 12 | - `S3` - Set bitrate to 100k 13 | - `S4` - Set bitrate to 125k 14 | - `S5` - Set bitrate to 250k 15 | - `S6` - Set bitrate to 500k 16 | - `S7` - Set bitrate to 750k 17 | - `S8` - Set bitrate to 1M 18 | - `M0` - Set mode to normal mode (default) 19 | - `M1` - Set mode to silent mode 20 | - `A0` - Disable automatic retransmission 21 | - `A1` - Enable automatic retransmission (default) 22 | - `TIIIIIIIILDD...` - Transmit data frame (Extended ID) [ID, length, data] 23 | - `tIIILDD...` - Transmit data frame (Standard ID) [ID, length, data] 24 | - `RIIIIIIIIL` - Transmit remote frame (Extended ID) [ID, length] 25 | - `rIIIL` - Transmit remote frame (Standard ID) [ID, length] 26 | - `V` - Returns firmware version and remote path as a string 27 | 28 | Note: Channel configuration commands must be sent before opening the channel. The channel must be opened before transmitting frames. 29 | 30 | This firmware currently does not provide any ACK/NACK feedback for serial commands. 31 | 32 | ## Building 33 | 34 | Firmware builds with GCC. Specifically, you will need gcc-arm-none-eabi, which 35 | is packaged for Windows, OS X, and Linux on 36 | [Launchpad](https://launchpad.net/gcc-arm-embedded/+download). Download for your 37 | system and add the `bin` folder to your PATH. 38 | 39 | Your Linux distribution may also have a prebuilt package for `arm-none-eabi-gcc`, check your distro's repositories to see if a build exists. 40 | 41 | - If you have a CANable device, you can compile using `make`. 42 | - If you have a CANtact or other device with external oscillator, you can compile using `make INTERNAL_OSCILLATOR=1` 43 | 44 | ## Flashing with the Bootloader 45 | 46 | Simply plug in your CANable with the BOOT jumper enabled (or depress the boot button on the CANable Pro while plugging in). Next, type `make flash` and your CANable will be updated to the latest firwmare. Unplug/replug the device after moving the boot jumper back, and your CANable will be up and running. 47 | 48 | ## Debugging 49 | 50 | Debugging and flashing can be done with any STM32 Discovery board as a 51 | programmer, or an st-link. You can also use other tools that support SWD. 52 | 53 | To use an STM32 Discovery, run [OpenOCD](http://openocd.sourceforge.net/) using 54 | the stm32f0x.cfg file: `openocd -f fw/stm32f0x.cfg`. 55 | 56 | With OpenOCD running, arm-none-eabi-gdb can be used to load code and debug. 57 | 58 | ## Contributors 59 | 60 | - [Ethan Zonca](https://github.com/normaldotcom) - New features, HAL updates, Makefile fixes and code size optimization, updates for CANable 61 | - [onejope](https://github.com/onejope) - Fixes to extended ID handling 62 | - Phil Wise - Added dfu-util compatibility to Makefile 63 | 64 | ## License 65 | 66 | See LICENSE.md 67 | -------------------------------------------------------------------------------- /STM32F042C6_FLASH.ld: -------------------------------------------------------------------------------- 1 | /* Entry Point */ 2 | ENTRY(Reset_Handler) 3 | 4 | /* Highest address of the user mode stack */ 5 | _estack = 0x200017FF; /* end of RAM */ 6 | 7 | /* Generate a link error if heap and stack don't fit into RAM */ 8 | _Min_Heap_Size = 0; /* required amount of heap */ 9 | _Min_Stack_Size = 0x400; /* required amount of stack */ 10 | 11 | /* Specify the memory areas */ 12 | MEMORY 13 | { 14 | FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 32K 15 | RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 6K 16 | } 17 | 18 | /* Define output sections */ 19 | SECTIONS 20 | { 21 | /* The startup code goes first into FLASH */ 22 | .isr_vector : 23 | { 24 | . = ALIGN(4); 25 | KEEP(*(.isr_vector)) /* Startup code */ 26 | . = ALIGN(4); 27 | } >FLASH 28 | 29 | /* The program code and other data goes into FLASH */ 30 | .text : 31 | { 32 | . = ALIGN(4); 33 | *(.text) /* .text sections (code) */ 34 | *(.text*) /* .text* sections (code) */ 35 | *(.glue_7) /* glue arm to thumb code */ 36 | *(.glue_7t) /* glue thumb to arm code */ 37 | *(.eh_frame) 38 | 39 | KEEP (*(.init)) 40 | KEEP (*(.fini)) 41 | 42 | . = ALIGN(4); 43 | _etext = .; /* define a global symbols at end of code */ 44 | } >FLASH 45 | 46 | /* Constant data goes into FLASH */ 47 | .rodata : 48 | { 49 | . = ALIGN(4); 50 | *(.rodata) /* .rodata sections (constants, strings, etc.) */ 51 | *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ 52 | . = ALIGN(4); 53 | } >FLASH 54 | 55 | .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH 56 | .ARM : { 57 | __exidx_start = .; 58 | *(.ARM.exidx*) 59 | __exidx_end = .; 60 | } >FLASH 61 | 62 | .preinit_array : 63 | { 64 | PROVIDE_HIDDEN (__preinit_array_start = .); 65 | KEEP (*(.preinit_array*)) 66 | PROVIDE_HIDDEN (__preinit_array_end = .); 67 | } >FLASH 68 | .init_array : 69 | { 70 | PROVIDE_HIDDEN (__init_array_start = .); 71 | KEEP (*(SORT(.init_array.*))) 72 | KEEP (*(.init_array*)) 73 | PROVIDE_HIDDEN (__init_array_end = .); 74 | } >FLASH 75 | .fini_array : 76 | { 77 | PROVIDE_HIDDEN (__fini_array_start = .); 78 | KEEP (*(SORT(.fini_array.*))) 79 | KEEP (*(.fini_array*)) 80 | PROVIDE_HIDDEN (__fini_array_end = .); 81 | } >FLASH 82 | 83 | /* used by the startup to initialize data */ 84 | _sidata = LOADADDR(.data); 85 | 86 | /* Initialized data sections goes into RAM, load LMA copy after code */ 87 | .data : 88 | { 89 | . = ALIGN(4); 90 | _sdata = .; /* create a global symbol at data start */ 91 | *(.data) /* .data sections */ 92 | *(.data*) /* .data* sections */ 93 | 94 | . = ALIGN(4); 95 | _edata = .; /* define a global symbol at data end */ 96 | } >RAM AT> FLASH 97 | 98 | 99 | /* Uninitialized data section */ 100 | . = ALIGN(4); 101 | .bss : 102 | { 103 | /* This is used by the startup in order to initialize the .bss secion */ 104 | _sbss = .; /* define a global symbol at bss start */ 105 | __bss_start__ = _sbss; 106 | *(.bss) 107 | *(.bss*) 108 | *(COMMON) 109 | 110 | . = ALIGN(4); 111 | _ebss = .; /* define a global symbol at bss end */ 112 | __bss_end__ = _ebss; 113 | } >RAM 114 | 115 | /* User_heap_stack section, used to check that there is enough RAM left */ 116 | ._user_heap_stack : 117 | { 118 | . = ALIGN(4); 119 | PROVIDE ( end = . ); 120 | PROVIDE ( _end = . ); 121 | . = . + _Min_Heap_Size; 122 | . = . + _Min_Stack_Size; 123 | . = ALIGN(4); 124 | } >RAM 125 | 126 | 127 | 128 | /* Remove information from the standard libraries */ 129 | /DISCARD/ : 130 | { 131 | libc.a ( * ) 132 | libm.a ( * ) 133 | libgcc.a ( * ) 134 | } 135 | 136 | .ARM.attributes 0 : { *(.ARM.attributes) } 137 | } 138 | -------------------------------------------------------------------------------- /inc/can.h: -------------------------------------------------------------------------------- 1 | #ifndef _CAN_H 2 | #define _CAN_H 3 | 4 | enum can_bitrate { 5 | CAN_BITRATE_10K = 0, 6 | CAN_BITRATE_20K, 7 | CAN_BITRATE_50K, 8 | CAN_BITRATE_100K, 9 | CAN_BITRATE_125K, 10 | CAN_BITRATE_250K, 11 | CAN_BITRATE_500K, 12 | CAN_BITRATE_750K, 13 | CAN_BITRATE_1000K, 14 | 15 | CAN_BITRATE_INVALID, 16 | }; 17 | 18 | typedef enum can_bus_state { 19 | OFF_BUS = 0, 20 | ON_BUS = 1, 21 | } can_bus_state_t; 22 | 23 | 24 | // CAN transmit buffering 25 | #define TXQUEUE_LEN 28 // Number of buffers allocated 26 | #define TXQUEUE_DATALEN 8 // CAN DLC length of data buffers 27 | 28 | typedef struct cantxbuf_ 29 | { 30 | uint8_t data[TXQUEUE_LEN][TXQUEUE_DATALEN]; // Data buffer 31 | CAN_TxHeaderTypeDef header[TXQUEUE_LEN]; // Header buffer 32 | uint8_t head; // Head pointer 33 | uint8_t tail; // Tail pointer 34 | uint8_t full; // TODO: Set this when we are full, clear when the tail moves one. 35 | } can_txbuf_t; 36 | 37 | 38 | // Prototypes 39 | void can_init(void); 40 | void can_enable(void); 41 | void can_disable(void); 42 | void can_set_bitrate(enum can_bitrate bitrate); 43 | void can_set_silent(uint8_t silent); 44 | void can_set_autoretransmit(uint8_t autoretransmit); 45 | uint32_t can_tx(CAN_TxHeaderTypeDef *tx_msg_header, uint8_t *tx_msg_data); 46 | uint32_t can_rx(CAN_RxHeaderTypeDef *rx_msg_header, uint8_t *rx_msg_data); 47 | 48 | 49 | void can_process(void); 50 | 51 | uint8_t is_can_msg_pending(uint8_t fifo); 52 | CAN_HandleTypeDef* can_gethandle(void); 53 | 54 | #endif // _CAN_H 55 | -------------------------------------------------------------------------------- /inc/error.h: -------------------------------------------------------------------------------- 1 | #ifndef INC_ERROR_H_ 2 | #define INC_ERROR_H_ 3 | 4 | 5 | typedef enum _error_t 6 | { 7 | ERR_PERIPHINIT = 0, 8 | ERR_USBTX_BUSY, 9 | ERR_CAN_TXFAIL, 10 | ERR_CANRXFIFO_OVERFLOW, 11 | ERR_FULLBUF_CANTX, 12 | ERR_FULLBUF_USBRX, 13 | 14 | ERR_MAX 15 | } error_t; 16 | 17 | 18 | // Prototypes 19 | void error_assert(error_t err); 20 | uint32_t error_timestamp(error_t err); 21 | uint8_t error_occurred(error_t err); 22 | uint32_t error_reg(void); 23 | 24 | #endif /* INC_ERROR_H_ */ 25 | -------------------------------------------------------------------------------- /inc/interrupts.h: -------------------------------------------------------------------------------- 1 | #ifndef __STM32F0xx_IT_H 2 | #define __STM32F0xx_IT_H 3 | 4 | void USB_IRQHandler(void); 5 | void SysTick_Handler(void); 6 | 7 | #endif 8 | 9 | -------------------------------------------------------------------------------- /inc/led.h: -------------------------------------------------------------------------------- 1 | #ifndef _LED_H 2 | #define _LED_H 3 | 4 | 5 | #define LED_BLUE_Pin GPIO_PIN_1 6 | #define LED_BLUE_Port GPIOB 7 | #define LED_BLUE LED_BLUE_Port , LED_BLUE_Pin 8 | 9 | #define LED_GREEN_Pin GPIO_PIN_0 10 | #define LED_GREEN_Port GPIOB 11 | #define LED_GREEN LED_GREEN_Port , LED_GREEN_Pin 12 | 13 | 14 | 15 | #define LED_DURATION 25 16 | 17 | void led_init(); 18 | void led_blue_blink(uint8_t numblinks); 19 | void led_green_on(void); 20 | void led_green_off(void); 21 | void led_blue_on(void); 22 | void led_process(void); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /inc/slcan.h: -------------------------------------------------------------------------------- 1 | #ifndef _SLCAN_H 2 | #define _SLCAN_H 3 | 4 | int8_t slcan_parse_frame(uint8_t *buf, CAN_RxHeaderTypeDef *frame_header, uint8_t* frame_data); 5 | int8_t slcan_parse_str(uint8_t *buf, uint8_t len); 6 | 7 | // maximum rx buffer len: extended CAN frame with timestamp 8 | #define SLCAN_MTU 30 // (sizeof("T1111222281122334455667788EA5F\r")+1) 9 | 10 | #define SLCAN_STD_ID_LEN 3 11 | #define SLCAN_EXT_ID_LEN 8 12 | 13 | #endif // _SLCAN_H 14 | -------------------------------------------------------------------------------- /inc/system.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYSTEM_H 2 | #define _SYSTEM_H 3 | 4 | 5 | void system_init(void); 6 | void system_hex32(char *out, uint32_t val); 7 | void system_irq_enable(void); 8 | void system_irq_disable(void); 9 | 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /inc/usbd_cdc_if.h: -------------------------------------------------------------------------------- 1 | #ifndef __USBD_CDC_IF_H__ 2 | #define __USBD_CDC_IF_H__ 3 | 4 | #include "usbd_cdc.h" 5 | 6 | // Buffer settings 7 | #define TX_BUF_SIZE 64 // Linear TX buf size 8 | #define NUM_RX_BUFS 6 // Number of RX buffers in FIFO 9 | #define RX_BUF_SIZE CDC_DATA_FS_MAX_PACKET_SIZE // Size of RX buffer item 10 | 11 | // Receive buffering: circular buffer FIFO 12 | typedef struct _usbrx_buf_ 13 | { 14 | // Receive buffering: circular buffer FIFO 15 | uint8_t buf[NUM_RX_BUFS][RX_BUF_SIZE]; 16 | uint32_t msglen[NUM_RX_BUFS]; 17 | uint8_t head; 18 | uint8_t tail; 19 | 20 | } usbrx_buf_t; 21 | 22 | 23 | // CDC Interface callback. 24 | extern USBD_CDC_ItfTypeDef USBD_Interface_fops_FS; 25 | 26 | 27 | // Prototypes 28 | uint8_t CDC_Transmit_FS(uint8_t* Buf, uint16_t Len); 29 | void cdc_process(void); 30 | 31 | 32 | 33 | #endif /* __USBD_CDC_IF_H__ */ 34 | 35 | -------------------------------------------------------------------------------- /src/.directory: -------------------------------------------------------------------------------- 1 | [Dolphin] 2 | Timestamp=2018,10,7,12,21,12 3 | Version=4 4 | ViewMode=1 5 | -------------------------------------------------------------------------------- /src/error.c: -------------------------------------------------------------------------------- 1 | // 2 | // Error: handling / reporting of system errors 3 | // 4 | 5 | 6 | #include "stm32f0xx_hal.h" 7 | #include "error.h" 8 | 9 | 10 | // Private variables 11 | static uint32_t err_reg = 0; 12 | static uint32_t err_time[ERR_MAX] = {0}; 13 | 14 | 15 | // Assert an error: sets err register bit and records timestamp 16 | void error_assert(error_t err) 17 | { 18 | if(err >= ERR_MAX) 19 | return; 20 | 21 | err_time[err] = HAL_GetTick(); 22 | err_reg |= (1 << err); 23 | } 24 | 25 | 26 | // Get the systick at which an error last occurred, or 0 otherwise 27 | uint32_t error_timestamp(error_t err) 28 | { 29 | if(err >= ERR_MAX) 30 | return 0; 31 | 32 | return err_time[err]; 33 | } 34 | 35 | // Returns 1 if the error has occurred since boot 36 | uint8_t error_occurred(error_t err) 37 | { 38 | if(err >= ERR_MAX) 39 | return 0; 40 | 41 | return (err_reg & (1 << err)) > 0; 42 | } 43 | 44 | // Return value of error register 45 | uint32_t error_reg(void) 46 | { 47 | return err_reg; 48 | } 49 | -------------------------------------------------------------------------------- /src/interrupts.c: -------------------------------------------------------------------------------- 1 | // 2 | // interrupts: handle global system interrupts 3 | // 4 | 5 | #include "stm32f0xx_hal.h" 6 | #include "interrupts.h" 7 | #include "can.h" 8 | #include "led.h" 9 | 10 | 11 | 12 | // Externs 13 | extern PCD_HandleTypeDef hpcd_USB_FS; 14 | 15 | 16 | 17 | void NMI_Handler(void) 18 | { 19 | while(1); 20 | } 21 | 22 | void HardFault_Handler(void) 23 | { 24 | while(1); 25 | } 26 | 27 | 28 | // Handle USB interrupts 29 | void USB_IRQHandler(void) 30 | { 31 | HAL_PCD_IRQHandler(&hpcd_USB_FS); 32 | } 33 | 34 | 35 | // Handle SysTick interrupt 36 | void SysTick_Handler(void) 37 | { 38 | HAL_IncTick(); 39 | HAL_SYSTICK_IRQHandler(); 40 | } 41 | 42 | 43 | // Handle CAN interrupts 44 | void CEC_CAN_IRQHandler(void) 45 | { 46 | HAL_CAN_IRQHandler(can_gethandle()); 47 | } 48 | -------------------------------------------------------------------------------- /src/led.c: -------------------------------------------------------------------------------- 1 | // 2 | // LED: Handles blinking of status light 3 | // 4 | 5 | #include "stm32f0xx_hal.h" 6 | #include "led.h" 7 | 8 | 9 | // Private variables 10 | static uint32_t led_blue_laston = 0; 11 | static uint32_t led_green_laston = 0; 12 | static uint32_t led_blue_lastoff = 0; 13 | static uint32_t led_green_lastoff = 0; 14 | 15 | 16 | // Initialize LED GPIOs 17 | void led_init() 18 | { 19 | __HAL_RCC_GPIOB_CLK_ENABLE(); 20 | GPIO_InitTypeDef GPIO_InitStruct; 21 | GPIO_InitStruct.Pin = GPIO_PIN_0 | GPIO_PIN_1; 22 | GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; 23 | GPIO_InitStruct.Pull = GPIO_PULLUP; 24 | GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_MEDIUM; 25 | GPIO_InitStruct.Alternate = 0; 26 | HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); 27 | 28 | HAL_GPIO_WritePin(LED_GREEN, 1); 29 | } 30 | 31 | 32 | // Turn green LED on 33 | void led_green_on(void) 34 | { 35 | // Make sure the LED has been off for at least LED_DURATION before turning on again 36 | // This prevents a solid status LED on a busy canbus 37 | if(led_green_laston == 0 && HAL_GetTick() - led_green_lastoff > LED_DURATION) 38 | { 39 | // Invert LED 40 | HAL_GPIO_WritePin(LED_GREEN, 0); 41 | led_green_laston = HAL_GetTick(); 42 | } 43 | } 44 | 45 | 46 | // Turn green LED on 47 | void led_green_off(void) 48 | { 49 | HAL_GPIO_WritePin(LED_GREEN, 0); 50 | } 51 | 52 | 53 | // Blink blue LED (blocking) 54 | void led_blue_blink(uint8_t numblinks) 55 | { 56 | uint8_t i; 57 | for(i=0; i LED_DURATION) 73 | { 74 | HAL_GPIO_WritePin(LED_BLUE, 1); 75 | led_blue_laston = HAL_GetTick(); 76 | } 77 | } 78 | 79 | 80 | // Process time-based LED events 81 | void led_process(void) 82 | { 83 | // If LED has been on for long enough, turn it off 84 | if(led_blue_laston > 0 && HAL_GetTick() - led_blue_laston > LED_DURATION) 85 | { 86 | HAL_GPIO_WritePin(LED_BLUE, 0); 87 | led_blue_laston = 0; 88 | led_blue_lastoff = HAL_GetTick(); 89 | } 90 | 91 | // If LED has been on for long enough, turn it off 92 | if(led_green_laston > 0 && HAL_GetTick() - led_green_laston > LED_DURATION) 93 | { 94 | // Invert LED 95 | HAL_GPIO_WritePin(LED_GREEN, 1); 96 | led_green_laston = 0; 97 | led_green_lastoff = HAL_GetTick(); 98 | } 99 | } 100 | 101 | -------------------------------------------------------------------------------- /src/main.c: -------------------------------------------------------------------------------- 1 | // 2 | // CANable firmware 3 | // 4 | 5 | #include "stm32f0xx.h" 6 | #include "stm32f0xx_hal.h" 7 | 8 | #include "usb_device.h" 9 | #include "usbd_cdc_if.h" 10 | #include "can.h" 11 | #include "slcan.h" 12 | #include "system.h" 13 | #include "led.h" 14 | #include "error.h" 15 | 16 | 17 | int main(void) 18 | { 19 | // Initialize peripherals 20 | system_init(); 21 | can_init(); 22 | led_init(); 23 | usb_init(); 24 | 25 | led_blue_blink(2); 26 | 27 | // Storage for status and received message buffer 28 | CAN_RxHeaderTypeDef rx_msg_header; 29 | uint8_t rx_msg_data[8] = {0}; 30 | uint8_t msg_buf[SLCAN_MTU]; 31 | 32 | 33 | while(1) 34 | { 35 | cdc_process(); 36 | led_process(); 37 | can_process(); 38 | 39 | // If CAN message receive is pending, process the message 40 | if(is_can_msg_pending(CAN_RX_FIFO0)) 41 | { 42 | // If message received from bus, parse the frame 43 | if (can_rx(&rx_msg_header, rx_msg_data) == HAL_OK) 44 | { 45 | uint16_t msg_len = slcan_parse_frame((uint8_t *)&msg_buf, &rx_msg_header, rx_msg_data); 46 | 47 | // Transmit message via USB-CDC 48 | if(msg_len) 49 | { 50 | CDC_Transmit_FS(msg_buf, msg_len); 51 | } 52 | } 53 | } 54 | } 55 | } 56 | 57 | -------------------------------------------------------------------------------- /src/system.c: -------------------------------------------------------------------------------- 1 | // 2 | // system: initalize system clocks and other core peripherals 3 | // 4 | 5 | #include "stm32f0xx_hal.h" 6 | #include "system.h" 7 | 8 | 9 | // Initialize system clocks 10 | void system_init(void) 11 | { 12 | HAL_Init(); 13 | 14 | 15 | RCC_OscInitTypeDef RCC_OscInitStruct; 16 | RCC_ClkInitTypeDef RCC_ClkInitStruct; 17 | RCC_PeriphCLKInitTypeDef PeriphClkInit; 18 | 19 | // Set up the oscillators 20 | // use internal HSI48 (48 MHz), no PLL 21 | RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI48; 22 | RCC_OscInitStruct.HSI48State = RCC_HSI48_ON; 23 | RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; 24 | 25 | // Set sysclk, hclk, and pclk1 source to HSI48 (48 MHz) 26 | RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | 27 | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1); 28 | RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI48; 29 | RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; 30 | RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; 31 | 32 | // Set USB clock source to HSI48 (48 MHz) 33 | PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USB; 34 | PeriphClkInit.UsbClockSelection = RCC_USBCLKSOURCE_HSI48; 35 | 36 | HAL_RCC_OscConfig(&RCC_OscInitStruct); 37 | HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1); 38 | HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit); 39 | 40 | HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000); 41 | HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); 42 | HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); 43 | 44 | // Enable clock recovery system for internal oscillator 45 | RCC_CRSInitTypeDef RCC_CRSInitStruct; 46 | __HAL_RCC_CRS_CLK_ENABLE(); 47 | 48 | // Default Synchro Signal division factor (not divided) 49 | RCC_CRSInitStruct.Prescaler = RCC_CRS_SYNC_DIV1; 50 | 51 | // Set the SYNCSRC[1:0] bits according to CRS_Source value 52 | RCC_CRSInitStruct.Source = RCC_CRS_SYNC_SOURCE_USB; 53 | 54 | // Rising polarity 55 | RCC_CRSInitStruct.Polarity = RCC_CRS_SYNC_POLARITY_RISING; 56 | 57 | // HSI48 is synchronized with USB SOF at 1KHz rate 58 | RCC_CRSInitStruct.ReloadValue = __HAL_RCC_CRS_RELOADVALUE_CALCULATE(48000000, 1000); 59 | RCC_CRSInitStruct.ErrorLimitValue = RCC_CRS_ERRORLIMIT_DEFAULT; 60 | 61 | // Set the TRIM[5:0] to the default value 62 | RCC_CRSInitStruct.HSI48CalibrationValue = 32; 63 | 64 | // Start automatic synchronization 65 | HAL_RCCEx_CRSConfig(&RCC_CRSInitStruct); 66 | 67 | HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); 68 | __HAL_RCC_GPIOF_CLK_ENABLE(); 69 | __HAL_RCC_GPIOA_CLK_ENABLE(); 70 | __HAL_RCC_GPIOB_CLK_ENABLE(); 71 | } 72 | 73 | 74 | // Convert a 32-bit value to an ascii hex value 75 | void system_hex32(char *out, uint32_t val) 76 | { 77 | char *p = out + 8; 78 | *p-- = 0; 79 | while (p >= out) { 80 | uint8_t nybble = val & 0x0F; 81 | if (nybble < 10) 82 | *p = '0' + nybble; 83 | else 84 | *p = 'A' + nybble - 10; 85 | val >>= 4; 86 | p--; 87 | } 88 | } 89 | 90 | 91 | // Disable all interrupts 92 | void system_irq_disable(void) 93 | { 94 | __disable_irq(); 95 | __DSB(); 96 | __ISB(); 97 | } 98 | 99 | 100 | // Enable all interrupts 101 | void system_irq_enable(void) 102 | { 103 | __enable_irq(); 104 | } 105 | 106 | -------------------------------------------------------------------------------- /src/usb_device.c: -------------------------------------------------------------------------------- 1 | // 2 | // usb_device: start the USB-CDC interface 3 | // 4 | 5 | #include "usb_device.h" 6 | #include "usbd_core.h" 7 | #include "usbd_desc.h" 8 | #include "usbd_cdc.h" 9 | #include "usbd_cdc_if.h" 10 | 11 | 12 | // USB Device Core handle declaration. 13 | USBD_HandleTypeDef hUsbDeviceFS; 14 | 15 | // Init USB device, add CDC class and start the library 16 | void usb_init(void) 17 | { 18 | USBD_Init(&hUsbDeviceFS, &FS_Desc, DEVICE_FS); 19 | USBD_RegisterClass(&hUsbDeviceFS, &USBD_CDC); 20 | USBD_CDC_RegisterInterface(&hUsbDeviceFS, &USBD_Interface_fops_FS); 21 | USBD_Start(&hUsbDeviceFS); 22 | } 23 | -------------------------------------------------------------------------------- /stm32f0x.cfg: -------------------------------------------------------------------------------- 1 | set CHIPNAME STM32F042C6T6 2 | 3 | adapter_khz 100 4 | 5 | source [find interface/stlink-v2.cfg] 6 | 7 | transport select hla_swd 8 | 9 | set WORKAREASIZE 0x2000 10 | source [find target/stm32f0x.cfg] 11 | 12 | reset_config none separate 13 | -------------------------------------------------------------------------------- /windows-driver/cantact.inf: -------------------------------------------------------------------------------- 1 | ; Windows CANtact CDC ACM Setup File 2 | ; Copyright (c) 2000 Microsoft Corporation 3 | 4 | [DefaultInstall] 5 | CopyINF="cantact.inf" 6 | 7 | [Version] 8 | Signature="$Windows NT$" 9 | Class=Ports 10 | ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318} 11 | Provider=%MFGNAME% 12 | DriverVer=7/1/2012,10.0.0.0 13 | 14 | [Manufacturer] 15 | %MFGNAME%=DeviceList, NTx86, NTamd64, NTia64 16 | 17 | [SourceDisksNames] 18 | 19 | [SourceDisksFiles] 20 | 21 | [DestinationDirs] 22 | DefaultDestDir=12 23 | 24 | [DriverInstall] 25 | Include=mdmcpq.inf 26 | CopyFiles=FakeModemCopyFileSection 27 | AddReg=DriverInstall.AddReg 28 | 29 | [DriverInstall.Services] 30 | Include=mdmcpq.inf 31 | AddService=usbser, 0x00000002, LowerFilter_Service_Inst 32 | 33 | [DriverInstall.AddReg] 34 | HKR,,EnumPropPages32,,"msports.dll,SerialPortPropPageProvider" 35 | 36 | ;------------------------------------------------------------------------------ 37 | ; Vendor and Product ID Definitions 38 | ;------------------------------------------------------------------------------ 39 | ; When developing your USB device, the VID and PID used in the PC side 40 | ; application program and the firmware on the microcontroller must match. 41 | ; Modify the below line to use your VID and PID. Use the format as shown below. 42 | ; Note: One INF file can be used for multiple devices with different VID and PIDs. 43 | ; For each supported device, append ",USB\VID_xxxx&PID_yyyy" to the end of the line. 44 | ;------------------------------------------------------------------------------ 45 | [DeviceList] 46 | %DESCRIPTION%=DriverInstall, USB\VID_AD50&PID_60C4 47 | 48 | [DeviceList.NTx86] 49 | %DESCRIPTION%=DriverInstall, USB\VID_AD50&PID_60C4 50 | 51 | [DeviceList.NTamd64] 52 | %DESCRIPTION%=DriverInstall, USB\VID_AD50&PID_60C4 53 | 54 | [DeviceList.NTia64] 55 | %DESCRIPTION%=DriverInstall, USB\VID_AD50&PID_60C4 56 | 57 | ;------------------------------------------------------------------------------ 58 | ; String Definitions 59 | ;------------------------------------------------------------------------------ 60 | ;Modify these strings to customize your device 61 | ;------------------------------------------------------------------------------ 62 | [Strings] 63 | MFGNAME="http://www.cantact.io" 64 | DESCRIPTION="CANtact USB/CAN Device" --------------------------------------------------------------------------------