0

I'm trying to draw a single pixel using DMA2D. I did the following code it's not working at all. LCD Display Width is 320, Height is 240.

I assumed a 1x1 pixel rect as a pixel.

  DMA2D_HandleTypeDef hdma2d;
  hdma2d.Instance = DMA2D;
  hdma2d.Init.Mode = DMA2D_R2M;
  hdma2d.Init.ColorMode = DMA2D_OUTPUT_RGB565;
  hdma2d.Init.OutputOffset = 320-1;


  if (PIXELWINDOW.pos.x <= PIXELWINDOW.end.x &&

      PIXELWINDOW.pos.y <= PIXELWINDOW.end.y) {
      HAL_DMA2D_Init(&hdma2d);
      HAL_DMA2D_Start(&hdma2d, c, (uint16_t)OLED_BUFFER[0] + (PIXELWINDOW.pos.x + PIXELWINDOW.pos.y*320)*2, 1, 1);
      HAL_DMA2D_PollForTransfer(&hdma2d, 10);                    
  }
  • There is an example C project provided by STMicro for some models of EVAL boards. Why not using it ? – Guillaume Petitjean Oct 21 at 8:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.