AnsweredAssumed Answered

Port Stm32F4-Discovery(SSD2119) STEmwin driver to stm32cube

Question asked by toth.janos on Mar 4, 2014
Latest reply on Mar 4, 2014 by Clive One
Hello everybody+

I try to port my old stemwin driver for ssd2119 to the new stm32cube version.
My bug is at LCD conf file:
My version like this:
#define  LCD_BASE_Addr               ((U32)(0x60000000|0x00000000))
#define  LCD_BASE_Data               ((U32)(0x60000000|0x00100000))
#define  LCD_CMD                     (*(U16 *)(LCD_BASE_Addr))
#define  LCD_Data                    (*(U16 *)(LCD_BASE_Data))
 
/********************************************************************
*
*       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;
  }
}

I try this version but not working:
typedef struct
{
  __IO uint16_t LCD_REG;
  __IO uint16_t LCD_RAM;
} LCD_TypeDef;
 
#define LCD_BASE           ((uint32_t)(0x60000000 | 0x00000000))
#define LCD                ((LCD_TypeDef *) LCD_BASE)
 
/********************************************************************
*
*       LcdWriteReg
*
* Function description:
*   Sets display register
*/
static void LcdWriteReg(U16 Data) {
  LCD_BASE->LCD_REG = Data;
}
 
/********************************************************************
*
*       LcdWriteData
*
* Function description:
*   Writes a value to a display register
*/
static void LcdWriteData(U16 Data) {
  LCD_BASE->LCD_RAM = Data;
}
 
/********************************************************************
*
*       LcdWriteDataMultiple
*
* Function description:
*   Writes multiple values to a display register.
*/
static void LcdWriteDataMultiple(U16 * pData, int NumItems) {
  while (NumItems--) {
    LCD_BASE->LCD_RAM= *pData++;
  }
}
 
/********************************************************************
*
*       LcdReadDataMultiple
*
* Function description:
*   Reads multiple values from a display register.
*/
static void LcdReadDataMultiple(U16 * pData, int NumItems) {
  while (NumItems--) {
    *pData++ =LCD_BASE->LCD_RAM;
  }
}

I try this at Base address: (0x60000000|0x00100000) but not working.
What is the problem?

Thanks

Outcomes