你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。

【F769IDISCOVERY评测】评测三 硬件JPEG解码

[复制链接]
wenyangzeng 提问时间:2016-12-2 16:38 /
         STM32F769ISTM32官网内置了硬件JPEG解码,使得处理JPEG图像的速度大大提高。在STM32Cube_FW_F7_V1.5.0\Projects\STM32F769I-Discovery\Examples\JPEGi里的演示代码让我们能够体验一下这个新功能。

    首先我们要先在CN5插入uCD卡,卡中存入1个名为image.jpg的JPG图片文件,图像的分辨率为800×480。

编译下载后运行,可以感受到图像显示速度非常的快。
IMG_1404.JPG
      未插卡

   IMG_1403.JPG
     显示的JPEG图像

收藏 1 评论15 发布时间:2016-12-2 16:38

举报

15个回答
xiaoye82 回答时间:2016-12-2 17:03:07
peter001 回答时间:2016-12-2 18:45:59
支持一下
liuxy236@tom.co 回答时间:2016-12-2 22:21:17
leo121_3006061 回答时间:2016-12-3 01:32:27
这什么图片,看着
wenyangzeng 回答时间:2016-12-3 07:27:03

显微镜下的某细菌
leo121_3006061 回答时间:2016-12-3 14:32:43
wenyangzeng 发表于 2016-12-3 07:27
显微镜下的某细菌

难怪啊,恐惧症
五哥1 回答时间:2016-12-5 18:26:18
好可怕的图片
xiaoye82 回答时间:2016-12-7 12:20:00
hpdell 回答时间:2017-5-23 09:31:05
你好,硬件解码 jpg ,可否实现横竖屏显示功能啊 ??
wenyangzeng 回答时间:2017-5-23 09:59:49
本帖最后由 wenyangzeng 于 2017-5-23 19:12 编辑
hpdell 发表于 2017-5-23 09:31
你好,硬件解码 jpg ,可否实现横竖屏显示功能啊 ??

这个一定可以的,关键在TFT初始化参数中关于横屏或竖屏的寄存器配置参数,比如SD1289的寄存器配置:
无标题.png

F769IDISCOVERY使用的是otm8009a。那就要去参考它的手册了。
otm8009a.rar (10.54 KB, 下载次数: 5)
hpdell 回答时间:2017-5-23 19:28:31
本帖最后由 hpdell 于 2017-5-23 19:33 编辑
wenyangzeng 发表于 2017-5-23 09:59
这个一定可以的,关键在TFT初始化参数中关于横屏或竖屏的寄存器配置参数,比如SD1289的寄存器配置:

我现在使用的是rgb转 lvds的,没有寄存器可以设置,只有外部的 U/D, L/R 控制方向,但是这个控制方向是固定的,

那么使用硬件 解码 jpg 的话,实现四个方向的显示,该如何修改 硬件解码的显示函数啊 ??
另外我使用st官网提供的历程,使用 硬件 的dma功能解码 jpg 图片时,显示错位了,使用中断模式时,显示正常,

使用dma或者中断都是从sd卡读取相同的图片,那么这个dma模式解码出现图片错位的情况,是哪里没有对齐还是 ??????
wenyangzeng 回答时间:2017-5-23 21:40:25
本帖最后由 wenyangzeng 于 2017-5-23 22:10 编辑
hpdell 发表于 2017-5-23 19:28
我现在使用的是rgb转 lvds的,没有寄存器可以设置,只有外部的 U/D, L/R 控制方向,但是这个控制方向是固 ...

OTM8009A寄存器的操作是在对OTM8009初始化函数里的:
  1. uint8_t OTM8009A_Init(uint32_t ColorCoding, uint32_t orientation)
  2. {
  3.   /* Enable CMD2 to access vendor specific commands                               */
  4.   /* Enter in command 2 mode and set EXTC to enable address shift function (0x00) */
  5.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData1);
  6.   DSI_IO_WriteCmd( 3, (uint8_t *)lcdRegData1);

  7.   /* Enter ORISE Command 2 */
  8.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData2); /* Shift address to 0x80 */
  9.   DSI_IO_WriteCmd( 2, (uint8_t *)lcdRegData2);

  10.   /////////////////////////////////////////////////////////////////////
  11.   /* SD_PCH_CTRL - 0xC480h - 129th parameter - Default 0x00          */
  12.   /* Set SD_PT                                                       */
  13.   /* -> Source output level during porch and non-display area to GND */
  14.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData2);
  15.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData3);
  16.   OTM8009A_IO_Delay(10);
  17.   /* Not documented */
  18.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData4);
  19.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData5);
  20.   OTM8009A_IO_Delay(10);
  21.   /////////////////////////////////////////////////////////////////////

  22.   /* PWR_CTRL4 - 0xC4B0h - 178th parameter - Default 0xA8 */
  23.   /* Set gvdd_en_test                                     */
  24.   /* -> enable GVDD test mode !!!                         */
  25.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData6);
  26.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData7);

  27.   /* PWR_CTRL2 - 0xC590h - 146th parameter - Default 0x79      */
  28.   /* Set pump 4 vgh voltage                                    */
  29.   /* -> from 15.0v down to 13.0v                               */
  30.   /* Set pump 5 vgh voltage                                    */
  31.   /* -> from -12.0v downto -9.0v                               */
  32.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData8);
  33.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData9);

  34.   /* P_DRV_M - 0xC0B4h - 181th parameter - Default 0x00 */
  35.   /* -> Column inversion                                */
  36.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData10);
  37.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData11);

  38.   /* VCOMDC - 0xD900h - 1st parameter - Default 0x39h */
  39.   /* VCOM Voltage settings                            */
  40.   /* -> from -1.0000v downto -1.2625v                 */
  41.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData1);
  42.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData12);

  43.   /* Oscillator adjustment for Idle/Normal mode (LPDT only) set to 65Hz (default is 60Hz) */
  44.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData13);
  45.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData14);

  46.   /* Video mode internal */
  47.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData15);
  48.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData16);

  49.   /* PWR_CTRL2 - 0xC590h - 147h parameter - Default 0x00 */
  50.   /* Set pump 4&5 x6                                     */
  51.   /* -> ONLY VALID when PUMP4_EN_ASDM_HV = "0"           */
  52.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData17);
  53.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData18);

  54.   /* PWR_CTRL2 - 0xC590h - 150th parameter - Default 0x33h */
  55.   /* Change pump4 clock ratio                              */
  56.   /* -> from 1 line to 1/2 line                            */
  57.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData19);
  58.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData9);

  59.   /* GVDD/NGVDD settings */
  60.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData1);
  61.   DSI_IO_WriteCmd( 2, (uint8_t *)lcdRegData5);

  62.   /* PWR_CTRL2 - 0xC590h - 149th parameter - Default 0x33h */
  63.   /* Rewrite the default value !                           */
  64.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData20);
  65.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData21);

  66.   /* Panel display timing Setting 3 */
  67.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData22);
  68.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData23);

  69.   /* Power control 1 */
  70.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData24);
  71.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData25);

  72.   /* Source driver precharge */
  73.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData13);
  74.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData26);

  75.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData15);
  76.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData27);

  77.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData28);
  78.   DSI_IO_WriteCmd( 2, (uint8_t *)lcdRegData6);

  79.   /* GOAVST */
  80.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData2);
  81.   DSI_IO_WriteCmd( 6, (uint8_t *)lcdRegData7);

  82.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData29);
  83.   DSI_IO_WriteCmd( 14, (uint8_t *)lcdRegData8);

  84.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData30);
  85.   DSI_IO_WriteCmd( 14, (uint8_t *)lcdRegData9);

  86.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData31);
  87.   DSI_IO_WriteCmd( 10, (uint8_t *)lcdRegData10);

  88.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData32);
  89.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData46);

  90.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData2);
  91.   DSI_IO_WriteCmd( 10, (uint8_t *)lcdRegData11);

  92.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData33);
  93.   DSI_IO_WriteCmd( 15, (uint8_t *)lcdRegData12);

  94.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData29);
  95.   DSI_IO_WriteCmd( 15, (uint8_t *)lcdRegData13);

  96.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData30);
  97.   DSI_IO_WriteCmd( 10, (uint8_t *)lcdRegData14);

  98.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData31);
  99.   DSI_IO_WriteCmd( 15, (uint8_t *)lcdRegData15);

  100.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData32);
  101.   DSI_IO_WriteCmd( 15, (uint8_t *)lcdRegData16);

  102.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData34);
  103.   DSI_IO_WriteCmd( 10, (uint8_t *)lcdRegData17);

  104.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData35);
  105.   DSI_IO_WriteCmd( 10, (uint8_t *)lcdRegData18);

  106.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData2);
  107.   DSI_IO_WriteCmd( 10, (uint8_t *)lcdRegData19);

  108.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData33);
  109.   DSI_IO_WriteCmd( 15, (uint8_t *)lcdRegData20);

  110.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData29);
  111.   DSI_IO_WriteCmd( 15, (uint8_t *)lcdRegData21);

  112.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData30);
  113.   DSI_IO_WriteCmd( 10, (uint8_t *)lcdRegData22);

  114.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData31);
  115.   DSI_IO_WriteCmd( 15, (uint8_t *)lcdRegData23);

  116.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData32);
  117.   DSI_IO_WriteCmd( 15, (uint8_t *)lcdRegData24);

  118.   /////////////////////////////////////////////////////////////////////////////
  119.   /* PWR_CTRL1 - 0xc580h - 130th parameter - default 0x00 */
  120.   /* Pump 1 min and max DM                                */
  121.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData13);
  122.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData47);
  123.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData48);
  124.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData49);
  125.   /////////////////////////////////////////////////////////////////////////////

  126.   /* Exit CMD2 mode */
  127.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData1);
  128.   DSI_IO_WriteCmd( 3, (uint8_t *)lcdRegData25);

  129.   /*************************************************************************** */
  130.   /* Standard DCS Initialization TO KEEP CAN BE DONE IN HSDT                   */
  131.   /*************************************************************************** */

  132.   /* NOP - goes back to DCS std command ? */
  133.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData1);
  134.          
  135.   /* Gamma correction 2.2+ table (HSDT possible) */
  136.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData1);
  137.   DSI_IO_WriteCmd( 16, (uint8_t *)lcdRegData3);
  138.   
  139.   /* Gamma correction 2.2- table (HSDT possible) */
  140.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData1);
  141.   DSI_IO_WriteCmd( 16, (uint8_t *)lcdRegData4);
  142.          
  143.   /* Send Sleep Out command to display : no parameter */
  144.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData36);
  145.   
  146.   /* Wait for sleep out exit */
  147.   OTM8009A_IO_Delay(120);

  148.   switch(ColorCoding)
  149.   {
  150.   case OTM8009A_FORMAT_RBG565 :
  151.     /* Set Pixel color format to RGB565 */
  152.     DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData37);
  153.     break;
  154.   case OTM8009A_FORMAT_RGB888 :
  155.     /* Set Pixel color format to RGB888 */
  156.     DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData38);
  157.     break;
  158.   default :
  159.     break;
  160.   }

  161.   /* Send command to configure display in landscape orientation mode. By default
  162.       the orientation mode is portrait  */
  163.   if(orientation == OTM8009A_ORIENTATION_LANDSCAPE)
  164.   {
  165.     DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData39);
  166.     DSI_IO_WriteCmd( 4, (uint8_t *)lcdRegData27);
  167.     DSI_IO_WriteCmd( 4, (uint8_t *)lcdRegData28);
  168.   }

  169.   /** CABC : Content Adaptive Backlight Control section start >> */
  170.   /* Note : defaut is 0 (lowest Brightness), 0xFF is highest Brightness, try 0x7F : intermediate value */
  171.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData40);

  172.   /* defaut is 0, try 0x2C - Brightness Control Block, Display Dimming & BackLight on */
  173.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData41);

  174.   /* defaut is 0, try 0x02 - image Content based Adaptive Brightness [Still Picture] */
  175.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData42);

  176.   /* defaut is 0 (lowest Brightness), 0xFF is highest Brightness */
  177.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData43);

  178.   /** CABC : Content Adaptive Backlight Control section end << */

  179.   /* Send Command Display On */
  180.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData44);

  181.   /* NOP command */
  182.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData1);

  183.   /* Send Command GRAM memory write (no parameters) : this initiates frame write via other DSI commands sent by */
  184.   /* DSI host from LTDC incoming pixels in video mode */
  185.   DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData45);

  186.   return 0;
  187. }
复制代码
对其他型号TFT的初始化都类似,横屏或竖屏的参数就在初始化中设定。
再举一例RA8875横、竖屏:
  1. void RA8875_InitHard(void)
  2. {                        
  3.         RA8875_WriteCmd(0x88);// 初始化PLL.  晶振频率为25M
  4.         RA8875_Delaly1us();                // 延迟1us */
  5.         RA8875_WriteData(9);        // PLLDIVM [7] = 0 ;  PLLDIVN [4:0] = 10 */
  6.         RA8875_Delaly1ms();
  7.         RA8875_WriteCmd(0x89);
  8.         RA8875_Delaly1us();               
  9.         RA8875_WriteData(2);        //PLLDIVK[2:0] = 2, 除以4
  10.         /* REG[88h]或REG[89h]被设定后,为保证PLL 输出稳定,须等待一段「锁频时间」(< 100us)。*/
  11.         RA8875_Delaly1ms();
  12.         RA8875_WriteReg(0x10, (1 <<3 ) | (1 << 1));        /* 配置16位MCU并口,65K色 */
  13.   RA8875_WriteReg(0x04, 0x81);
  14.         RA8875_Delaly1ms();
  15.         /* OTD9960 & OTA7001 设置 */
  16.         RA8875_WriteReg(0x14, 0x63);
  17.         RA8875_WriteReg(0x15, 0x00);
  18.         RA8875_WriteReg(0x16, 0x03);
  19.         RA8875_WriteReg(0x17, 0x03);
  20.         RA8875_WriteReg(0x18, 0x0B);
  21.         RA8875_WriteReg(0x19, 0xDF);
  22.         RA8875_WriteReg(0x1A, 0x01);
  23.         RA8875_WriteReg(0x1B, 0x1F);
  24.         RA8875_WriteReg(0x1C, 0x00);
  25.         RA8875_WriteReg(0x1D, 0x16);
  26.         RA8875_WriteReg(0x1E, 0x00);
  27.         RA8875_WriteReg(0x1F, 0x01);
  28.         RA8875_WriteReg(0xC7, 0x01);        
  29.         RA8875_WriteReg(0x01, 0x80);
  30.         RA8875_WriteReg(0x40, 0x01);        // 选择绘图模式
  31.         RA8875_WriteReg(0x41, 0x00);        //选择绘图模式, 目的为CGRAM
  32.        RA8875_SetDispWin(0, 0, LCD_HEIGHT, LCD_WIDTH);
  33.       RA8875_WriteReg(0x20, (1 << 3));            // 水平扫描方向设定
  34. // RA8875_WriteReg(0x20, (1 << 2));            // 垂直扫描方向设定
  35.      RA8875_SetBackLight(150);

  36. }
复制代码




feixiang20 回答时间:2017-5-29 23:25:50
wenyangzeng 发表于 2017-5-23 09:59
这个一定可以的,关键在TFT初始化参数中关于横屏或竖屏的寄存器配置参数,比如SD1289的寄存器配置:

0.png
happyavr128 回答时间:2020-2-5 17:48:49
这什么图片,看着
12下一页

所属标签

相似问题

关于意法半导体
我们是谁
投资者关系
意法半导体可持续发展举措
创新和工艺
招聘信息
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
关注我们
st-img 微信公众号
st-img 手机版