贴上我的ipa代码- void ipa_config(uint32_t src, uint32_t dst, u16 high, u16 width, u16 offset_x)
- {
- ipa_destination_parameter_struct ipa_destination_init_struct;
- ipa_foreground_parameter_struct ipa_fg_init_struct;
- rcu_periph_clock_enable(RCU_IPA);
- ipa_deinit();
- /* configure IPA pixel format convert mode */
- ipa_pixel_format_convert_mode_set(IPA_FGTODE);
- /* configure destination pixel format */
- ipa_destination_init_struct.destination_pf = IPA_DPF_RGB565;
- /* configure destination memory base address */
- ipa_destination_init_struct.destination_memaddr = dst; //显存
- /* configure destination pre-defined alpha value RGB */
- ipa_destination_init_struct.destination_pregreen = 0;
- ipa_destination_init_struct.destination_preblue = 0;
- ipa_destination_init_struct.destination_prered = 0;
- ipa_destination_init_struct.destination_prealpha = 0;
- /* configure destination line offset */
- ipa_destination_init_struct.destination_lineoff = offset_x;
- /* configure height of the image to be processed */
- ipa_destination_init_struct.image_height = high;
- /* configure width of the image to be processed */
- ipa_destination_init_struct.image_width = width;
- /* IPA destination initialization */
- ipa_destination_init(&ipa_destination_init_struct);
- /* configure IPA foreground */
- ipa_fg_init_struct.foreground_memaddr = src; //临时绘制的缓存
- ipa_fg_init_struct.foreground_pf = FOREGROUND_PPF_RGB565;
- ipa_fg_init_struct.foreground_alpha_algorithm = IPA_FG_ALPHA_MODE_0;
- ipa_fg_init_struct.foreground_prealpha = 0x0;
- ipa_fg_init_struct.foreground_lineoff = 0;//offset_x;
- ipa_fg_init_struct.foreground_preblue = 0x0;
- ipa_fg_init_struct.foreground_pregreen = 0x0;
- ipa_fg_init_struct.foreground_prered = 0x0;
- /* foreground initialization */
-
- ipa_foreground_init(&ipa_fg_init_struct);
- }
|