diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-04-18 23:39:55 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-04-18 23:39:55 +0000 |
commit | 123d61ce39246ece3017648f51740df4b29dbf87 (patch) | |
tree | 66024d779751907068bd5035807d2240ad1dcb27 /nuttx/configs/sam3u-ek/src | |
parent | 344b60cd882276b803415ecbcbc08234feb66b35 (diff) | |
download | px4-nuttx-123d61ce39246ece3017648f51740df4b29dbf87.tar.gz px4-nuttx-123d61ce39246ece3017648f51740df4b29dbf87.tar.bz2 px4-nuttx-123d61ce39246ece3017648f51740df4b29dbf87.zip |
Add HX834x register access routines
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2617 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs/sam3u-ek/src')
-rwxr-xr-x | nuttx/configs/sam3u-ek/src/up_lcd.c | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/nuttx/configs/sam3u-ek/src/up_lcd.c b/nuttx/configs/sam3u-ek/src/up_lcd.c index 9ead815b9..b201e33e8 100755 --- a/nuttx/configs/sam3u-ek/src/up_lcd.c +++ b/nuttx/configs/sam3u-ek/src/up_lcd.c @@ -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 @@ -237,6 +246,34 @@ static struct lcd_dev_s g_lcddev_s = **************************************************************************************/ /************************************************************************************** + * 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 * * Description: |