X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=examples%2Flm3s1968%2Fhw%2Fhw_lcd.h;fp=examples%2Flm3s1968%2Fhw%2Fhw_lcd.h;h=0000000000000000000000000000000000000000;hb=7ded58114194b75f629e0ddfafafc44083cad17c;hp=ed2ede9e251cdc4b3e04d79059c043221fd10b48;hpb=2f91d0006f90e1dada0ac16bcc606ec0ea498ddc;p=bertos.git diff --git a/examples/lm3s1968/hw/hw_lcd.h b/examples/lm3s1968/hw/hw_lcd.h deleted file mode 100644 index ed2ede9e..00000000 --- a/examples/lm3s1968/hw/hw_lcd.h +++ /dev/null @@ -1,132 +0,0 @@ -/** - * \file - * - * - * \brief LM3S1986: OLED-RIT-128x96 (P14201) low-level hardware macros - * - * \author Andrea Righi - */ - -#ifndef HW_LCD_H -#define HW_LCD_H - -#include "cfg/macros.h" /* BV() */ -#include "cfg/debug.h" -#include "cfg/cfg_lcd.h" /* CONFIG_LCD_4BIT */ - -#include -#include -#include - -#include -#include -#include - -#include - -/** - * \name LCD I/O pins/ports - * @{ - */ -/* OLED Data/Command control pin */ -#define GPIO_OLEDDC_PIN BV(2) - -/* OLED enable pin */ -#define GPIO_OLEDEN_PIN BV(3) -/*@}*/ - -/** - * \name LCD bus control macros - * @{ - */ -/* Enter command mode */ -#define LCD_SET_COMMAND() \ - lm3s_gpioPinWrite(GPIO_PORTH_BASE, GPIO_OLEDDC_PIN, 0) - -/* Enter data mode */ -#define LCD_SET_DATA() \ - lm3s_gpioPinWrite(GPIO_PORTH_BASE, GPIO_OLEDDC_PIN, GPIO_OLEDDC_PIN) - -/* Send data to the display */ -#define LCD_WRITE(x) lm3s_ssiWriteFrame(SSI0_BASE, x) - -/* Read data from the display */ -#define LCD_READ \ - ({ \ - uint32_t frame; \ - lm3s_ssiReadFrame(SSI0_BASE, &frame); \ - frame; \ - }) -/*@}*/ - -INLINE void lcd_bus_init(void) -{ - cpu_flags_t flags; - uint32_t dummy; - - IRQ_SAVE_DISABLE(flags); - - /* Enable the peripheral clock */ - SYSCTL_RCGC1_R |= SYSCTL_RCGC1_SSI0; - SYSCTL_RCGC2_R |= SYSCTL_RCGC2_GPIOA; - SYSCTL_RCGC2_R |= SYSCTL_RCGC2_GPIOH; - lm3s_busyWait(512); - - /* Configure the SSI0CLK and SSIOTX pins for SSI operation. */ - lm3s_gpioPinConfig(GPIO_PORTA_BASE, BV(2) | BV(3) | BV(5), - GPIO_DIR_MODE_HW, GPIO_STRENGTH_8MA, GPIO_PIN_TYPE_STD_WPU); - /* - * Configure the GPIO port pin used as a D/C# signal (data/command - * control) for OLED device, and the port pin used to enable power to - * the OLED panel. - */ - lm3s_gpioPinConfig(GPIO_PORTH_BASE, GPIO_OLEDDC_PIN | GPIO_OLEDEN_PIN, - GPIO_DIR_MODE_OUT, GPIO_STRENGTH_8MA, GPIO_PIN_TYPE_STD); - lm3s_gpioPinWrite(GPIO_PORTH_BASE, GPIO_OLEDDC_PIN | GPIO_OLEDEN_PIN, - GPIO_OLEDDC_PIN | GPIO_OLEDEN_PIN); - - /* Configure the SSI0 port for master mode */ - lm3s_ssiOpen(SSI0_BASE, SSI_FRF_MOTO_MODE_2, - SSI_MODE_MASTER, CPU_FREQ / 2, 8); - /* - * Configure the GPIO port pin used as a D/Cn signal for OLED device, - * and the port pin used to enable power to the OLED panel. - */ - lm3s_gpioPinConfig(GPIO_PORTA_BASE, GPIO_OLEDEN_PIN, - GPIO_DIR_MODE_HW, GPIO_STRENGTH_8MA, GPIO_PIN_TYPE_STD_WPU); - - /* Drain the SSI RX FIFO */ - while (lm3s_ssiReadFrameNonBlocking(SSI0_BASE, &dummy)); - - IRQ_RESTORE(flags); -} - -#endif /* HW_LCD_H */