AnsweredAssumed Answered

STM32F4Discovery + STemWIN

Question asked by toth.janos on Sep 16, 2013
Latest reply on Sep 21, 2013 by Clive One
Hy guys,

I have a problem whit Stm32F4Discovery with 3,5LCD (SSD2119 LCD driver) and STemWIN port. I download the examples from the st website, and try to port to discovery but not working. I have a library to the display, where are functions to write data to the lcd.
/* Note: LCD /CS is NE1 - Bank 1 of NOR/SRAM Bank 1~4 */
#define  LCD_BASE_Data               ((u32)(0x60000000|0x00100000))
#define  LCD_BASE_Addr               ((u32)(0x60000000|0x00000000))
#define  LCD_CMD                     (*(vu16 *)LCD_BASE_Addr)
#define  LCD_Data                    (*(vu16 *)LCD_BASE_Data)
 
void LCD_WriteReg(uint8_t LCD_Reg, uint16_t LCD_RegValue)
{
  /* Write 16-bit Index, then Write Reg */
  LCD_CMD = LCD_Reg;
  /* Write 16-bit Reg */
  LCD_Data = LCD_RegValue;
}
 
/**
  * @brief  Reads the selected LCD Register.
  * @param  LCD_Reg: address of the selected register.
  * @retval LCD Register Value.
  */
uint16_t LCD_ReadReg(uint8_t LCD_Reg)
{
  /* Write 16-bit Index (then Read Reg) */
  LCD_CMD = LCD_Reg;
  /* Read 16-bit Reg */
  return (LCD_Data);
}
 
/**
  * @brief  Prepare to write to the LCD RAM.
  * @param  None
  * @retval None
  */
void LCD_WriteRAM_Prepare(void)
{
    LCD_CMD = SSD2119_RAM_DATA_REG;
}
 
/**
  * @brief  Writes to the LCD RAM.
  * @param  RGB_Code: the pixel color in RGB mode (5-6-5).
  * @retval None
  */
void LCD_WriteRAM(uint16_t RGB_Code)
{
  /* Write 16-bit GRAM Reg */
  LCD_Data = RGB_Code;
}
 
/**
  * @brief  Reads the LCD RAM.
  * @param  None
  * @retval LCD RAM Value.
  */
uint16_t LCD_ReadRAM(void)
{
  /* Write 16-bit Index (then Read Reg) */
//  LCD_CMD = SSD2119_RAM_DATA_REG; /* Select GRAM Reg */
  /* Read 16-bit Reg */
  return LCD_Data;
}

So this is working I can write text draw object.
I read the STemWIN guide and I need port this functions for working:
                                                                                                                                                                       
pfWrite16_A0void (*)(U16 Data)
pfWrite16_A1void (*)(U16 Data)
pfWriteM16_A1void (*)(U16 * pData, int NumItems)
pfReadM16_A1void (*)(U16 * pData, int NumItems)

I try this for this functions:
#define  LCD_BASE_Addr               ((u32)(0x60000000|0x00000000))
#define  LCD_BASE_Data               ((u32)(0x60000000|0x00100000))
#define  LCD_CMD                     (*(vu16 *)(LCD_BASE_Addr))
#define  LCD_Data                    (*(vu16 *)(LCD_BASE_Data))
 
/*********************************************************************
*
*       Local functions
*
**********************************************************************
*/
/********************************************************************
*
*       LcdWriteReg
*
* Function description:
*   Sets display register
*/
static void LcdWriteReg(U16 Data) {
  LCD_CMD = Data;
}
 
/********************************************************************
*
*       LcdWriteData
*
* Function description:
*   Writes a value to a display register
*/
static void LcdWriteData(U16 Data) {
  LCD_Data = Data;
}
 
/********************************************************************
*
*       LcdWriteDataMultiple
*
* Function description:
*   Writes multiple values to a display register.
*/
static void LcdWriteDataMultiple(U16 * pData, int NumItems) {
  while (NumItems--) {
    LCD_Data = *pData++;
  }
}
 
/********************************************************************
*
*       LcdReadDataMultiple
*
* Function description:
*   Reads multiple values from a display register.
*/
static void LcdReadDataMultiple(U16 * pData, int NumItems) {
  while (NumItems--) {
    *pData++ = LCD_Data;
  }

But not working. The display is black.

Anybody can help me?

Thanks

Outcomes