2013-09-16 05:58 AM
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_A0
void (*)(U16 Data)pfWrite16_A1
void (*)(U16 Data)pfWriteM16_A1
void (*)(U16 * pData, int NumItems)pfReadM16_A1
void (*)(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
#lmgtfy:-stm32-resources
2013-09-19 06:41 AM
Hi. Where did you download files from?
2013-09-19 07:02 AM
Hi. Where did you download files from?
Tried Google?
http://www.st.com/web/en/catalog/tools/PF259225
2013-09-21 07:15 AM
2013-09-21 07:47 AM
Google bombing the [DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/STemWin%20GUI_Init%28%29%20crashed&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=235]infinite loop in STemWin
Add /* Enable CRC clock */ RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_CRC, ENABLE); Prior to calling the GUI_Init() function, the library is locked to the STM32 via the response of the CRC polynomial to specific input stimulus.