Add HX834x register access routines
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@2617 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
parent
17b86a93d9
commit
fac21ae4ca
|
@ -138,10 +138,19 @@
|
|||
#define SAM3UEK_BPP 16
|
||||
#define SAM3UEK_RGBFMT FB_FMT_RGB16_565
|
||||
|
||||
/* HX834x register select */
|
||||
|
||||
#define HX843X_LCD_RS (1 << 1)
|
||||
|
||||
/**************************************************************************************
|
||||
* Private Function Protototypes
|
||||
**************************************************************************************/
|
||||
|
||||
/* Low-level HX834x Register access */
|
||||
|
||||
static void sam3u_putreg(uint16_t reg, uint16_t data);
|
||||
static uint16_t sam3u_getreg(uint16_t reg);
|
||||
|
||||
/* LCD Data Transfer Methods */
|
||||
|
||||
static int sam3u_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buffer,
|
||||
|
@ -176,7 +185,7 @@ static int sam3u_getcontrast(struct lcd_dev_s *dev);
|
|||
static int sam3u_setcontrast(struct lcd_dev_s *dev, unsigned int contrast);
|
||||
|
||||
/**************************************************************************************
|
||||
* Private Function Protototypes
|
||||
* Private Data
|
||||
**************************************************************************************/
|
||||
|
||||
/* This is working memory allocated by the LCD driver for each LCD device
|
||||
|
@ -236,6 +245,34 @@ static struct lcd_dev_s g_lcddev_s =
|
|||
* Private Functions
|
||||
**************************************************************************************/
|
||||
|
||||
/**************************************************************************************
|
||||
* Name: sam3u_putreg
|
||||
*
|
||||
* Description:
|
||||
* Write to a HX834x register
|
||||
*
|
||||
**************************************************************************************/
|
||||
|
||||
static void sam3u_putreg(uint16_t reg, uint16_t data)
|
||||
{
|
||||
putreg16(reg, LCD_BASE);
|
||||
putreg16(data, LCD_BASE + HX843X_LCD_RS);
|
||||
}
|
||||
|
||||
/**************************************************************************************
|
||||
* Name: sam3u_getreg
|
||||
*
|
||||
* Description:
|
||||
* Read from a HX834x register
|
||||
*
|
||||
**************************************************************************************/
|
||||
|
||||
static uint16_t sam3u_getreg(uint16_t reg)
|
||||
{
|
||||
putreg16(reg, LCD_BASE);
|
||||
return getreg16(LCD_BASE + HX843X_LCD_RS);
|
||||
}
|
||||
|
||||
/**************************************************************************************
|
||||
* Name: sam3u_putrun
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue