亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? formike128x128x16.c

?? FreeRTOS - V5.1.1 Last Update: Nov 20 2008 http://sourceforge.net/projects/freertos/
?? C
?? 第 1 頁 / 共 2 頁
字號:
//*****************************************************************************
//
// formike128x128x16.c - Display driver for the Formike Electronic
//                       KWH015C04-F01 CSTN panel with an ST7637 controller.
//
// Copyright (c) 2008 Luminary Micro, Inc.  All rights reserved.
// 
// Software License Agreement
// 
// Luminary Micro, Inc. (LMI) is supplying this software for use solely and
// exclusively on LMI's microcontroller products.
// 
// The software is owned by LMI and/or its suppliers, and is protected under
// applicable copyright laws.  All rights are reserved.  You may not combine
// this software with "viral" open-source software in order to form a larger
// program.  Any use in violation of the foregoing restrictions may subject
// the user to criminal sanctions under applicable laws, as well as to civil
// liability for the breach of the terms and conditions of this license.
// 
// THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES, WHETHER EXPRESS, IMPLIED
// OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
// LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
// CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
// 
// This is part of revision 2523 of the Stellaris Peripheral Driver Library.
//
//*****************************************************************************

//*****************************************************************************
//
//! \addtogroup ek_lm3s3748_api
//! @{
//
//*****************************************************************************

#include "hw_gpio.h"
#include "hw_memmap.h"
#include "hw_types.h"
#include "gpio.h"
#include "sysctl.h"
#include "rom.h"
#include "grlib.h"
#include "formike128x128x16.h"
#include <string.h>

//*****************************************************************************
//
// Defines for the pins that are used to communicate with the ST7637.
//
//*****************************************************************************
#define LCD_A0_BASE            GPIO_PORTB_BASE
#define LCD_A0_PIN             GPIO_PIN_2
#define LCD_WR_BASE            GPIO_PORTC_BASE
#define LCD_WR_PIN             GPIO_PIN_4
#define LCD_RD_BASE            GPIO_PORTC_BASE
#define LCD_RD_PIN             GPIO_PIN_5
#define LCD_BL_BASE            GPIO_PORTF_BASE
#define LCD_BL_PIN             GPIO_PIN_1
#define LCD_DATA_BASE          GPIO_PORTG_BASE

//*****************************************************************************
//
// Translates a 24-bit RGB color to a display driver-specific color.
//
// \param c is the 24-bit RGB color.  The least-significant byte is the blue
// channel, the next byte is the green channel, and the third byte is the red
// channel.
//
// This macro translates a 24-bit RGB color into a value that can be written
// into the display's frame buffer in order to reproduce that color, or the
// closest possible approximation of that color.
//
// \return Returns the display-driver specific color.
//
//*****************************************************************************
#define DPYCOLORTRANSLATE(c)    ((((c) & 0x00ff0000) >> 19) |               \
                                 ((((c) & 0x0000ff00) >> 5) & 0x000007e0) | \
                                 ((((c) & 0x000000ff) << 8) & 0x0000f800))

//*****************************************************************************
//
// Writes a data word to the ST7637.
//
//*****************************************************************************
static void
WriteData(unsigned char ucData)
{
    //
    // Write the data to the data bus.
    //
    HWREG(LCD_DATA_BASE + GPIO_O_DATA + (0xff << 2)) = ucData;

    //
    // Assert the write enable signal.
    //
    HWREG(LCD_WR_BASE + GPIO_O_DATA + (LCD_WR_PIN << 2)) = 0;

    //
    // Deassert the write enable signal.
    //
    HWREG(LCD_WR_BASE + GPIO_O_DATA + (LCD_WR_PIN << 2)) = LCD_WR_PIN;
}

//*****************************************************************************
//
// Writes a command to the ST7637.
//
//*****************************************************************************
static void
WriteCommand(unsigned char ucData)
{
    //
    // Write the command to the data bus.
    //
    HWREG(LCD_DATA_BASE + GPIO_O_DATA + (0xff << 2)) = ucData;

    //
    // Set the A0 signal low, indicating a command.
    //
    HWREG(LCD_A0_BASE + GPIO_O_DATA + (LCD_A0_PIN << 2)) = 0;

    //
    // Assert the write enable signal.
    //
    HWREG(LCD_WR_BASE + GPIO_O_DATA + (LCD_WR_PIN << 2)) = 0;

    //
    // Deassert the write enable signal.
    //
    HWREG(LCD_WR_BASE + GPIO_O_DATA + (LCD_WR_PIN << 2)) = LCD_WR_PIN;

    //
    // Set the A0 signal high, indicating that following writes are data.
    //
    HWREG(LCD_A0_BASE + GPIO_O_DATA + (LCD_A0_PIN << 2)) = LCD_A0_PIN;
}

//*****************************************************************************
//
//! Initializes the display driver.
//!
//! This function initializes the ST7637 display controller on the panel,
//! preparing it to display data.
//!
//! \return None.
//
//*****************************************************************************
void
Formike128x128x16Init(void)
{
    unsigned long ulClockMS, ulCount;

    //
    // Get the value to pass to SysCtlDelay() in order to delay for 1 ms.
    //
    ulClockMS = SysCtlClockGet() / (3 * 1000);

    //
    // Enable the GPIO peripherals used to interface to the ST7637.
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOG);

    //
    // Configure the pins that connect to the LCD as GPIO outputs.
    //
    GPIOPinTypeGPIOOutput(LCD_A0_BASE, LCD_A0_PIN);
    GPIOPinTypeGPIOOutput(LCD_WR_BASE, LCD_WR_PIN);
    GPIOPinTypeGPIOOutput(LCD_RD_BASE, LCD_RD_PIN);
    GPIOPinTypeGPIOOutput(LCD_BL_BASE, LCD_BL_PIN);
    GPIOPinTypeGPIOOutput(LCD_DATA_BASE, 0xff);

    //
    // Set the LCD control pins to their default values.
    //
    GPIOPinWrite(LCD_A0_BASE, LCD_A0_PIN, LCD_A0_PIN);
    GPIOPinWrite(LCD_WR_BASE, LCD_WR_PIN | LCD_RD_PIN,
                     LCD_WR_PIN | LCD_RD_PIN);
    GPIOPinWrite(LCD_BL_BASE, LCD_BL_PIN, 0);
    GPIOPinWrite(LCD_DATA_BASE, 0xff, 0x00);

    //
    // Perform a software reset of the ST7637.
    //
    WriteCommand(0x01);

    //
    // Delay for 120ms.
    //
    SysCtlDelay(ulClockMS * 120);

    //
    // Disable auto-load of mask rom data.
    //
    WriteCommand(0xD7);
    WriteData(0xBF);

    //
    // Set the OTP control mode to read.
    //
    WriteCommand(0xE0);
    WriteData(0x00);

    //
    // Delay for 10ms.
    //
    SysCtlDelay(ulClockMS * 10);

    //
    // Start the OTP read.
    //
    WriteCommand(0xE3);

    //
    // Delay for 20ms.
    //
    SysCtlDelay(ulClockMS * 20);

    //
    // Cancel the OTP read (it should have finished by now).
    //
    WriteCommand(0xE1);

    //
    // Turn off the display.
    //
    WriteCommand(0x28);

    //
    // Exit sleep mode.
    //
    WriteCommand(0x11);

    //
    // Delay for 50ms.
    //
    SysCtlDelay(ulClockMS * 50);

    //
    // Program the LCD supply voltage V0 to 14V.
    //
    WriteCommand(0xC0);
    WriteData(0x04);
    WriteData(0x01);

    //
    // Select an LCD bias voltage ratio of 1/12.
    //
    WriteCommand(0xC3);
    WriteData(0x00);

    //
    // Enable the x8 booster circuit.
    //
    WriteCommand(0xC4);
    WriteData(0x07);

    //
    // Invert the column scan direction for the panel.
    //
    WriteCommand(0xB7);
    WriteData(0xC0);

    //
    // Select 16bpp, 5-6-5 data input mode.
    //
    WriteCommand(0x3A);
    WriteData(0x05);

    //
    // Select the memory scanning direction.  The scanning mode does not matter
    // for this driver since the row/column selects will constrain the writes
    // to the desired area of the display.
    //
    WriteCommand(0x36);
    WriteData(0x00);

    //
    // Turn on the display.
    //
    WriteCommand(0x29);

    //
    // Clear the contents of the display buffer.
    //
    WriteCommand(0x2A);
    WriteData(0x00);
    WriteData(0x7F);
    WriteCommand(0x2B);
    WriteData(0x01);
    WriteData(0x80);
    WriteCommand(0x2c);
    for(ulCount = 0; ulCount < (128 * 128); ulCount++)
    {
        WriteData(0x00);
        WriteData(0x00);
    }

    //
    // Enable normal operation of the LCD.
    //
    WriteCommand(0x13);
}

//*****************************************************************************
//
//! Turns on the backlight.
//!
//! This function turns on the backlight on the display.
//!
//! \return None.
//
//*****************************************************************************
void
Formike128x128x16BacklightOn(void)
{
    //
    // Assert the signal that turns on the backlight.
    //
    HWREG(LCD_BL_BASE + GPIO_O_DATA + (LCD_BL_PIN << 2)) = LCD_BL_PIN;
}

//*****************************************************************************
//
//! Turns off the backlight.
//!
//! This function turns off the backlight on the display.
//!
//! \return None.
//
//*****************************************************************************
void
Formike128x128x16BacklightOff(void)
{
    //
    // Deassert the signal that turns on the backlight.
    //
    HWREG(LCD_BL_BASE + GPIO_O_DATA + (LCD_BL_PIN << 2)) = 0;
}

//*****************************************************************************
//
//! Draws a pixel on the screen.
//!
//! \param pvDisplayData is a pointer to the driver-specific data for this
//! display driver.
//! \param lX is the X coordinate of the pixel.
//! \param lY is the Y coordinate of the pixel.
//! \param ulValue is the color of the pixel.
//!
//! This function sets the given pixel to a particular color.  The coordinates
//! of the pixel are assumed to be within the extents of the display.
//!
//! \return None.
//
//*****************************************************************************
static void
Formike128x128x16PixelDraw(void *pvDisplayData, long lX, long lY,
                           unsigned long ulValue)
{
    //
    // Set the X address of the display cursor.
    //
    WriteCommand(0x2a);
    WriteData(lX);
    WriteData(lX);

    //
    // Set the Y address of the display cursor.
    //
    WriteCommand(0x2b);
    WriteData(lY + 1);
    WriteData(lY + 1);

    //
    // Write the pixel value.
    //
    WriteCommand(0x2c);
    WriteData(ulValue >> 8);
    WriteData(ulValue);
}

//*****************************************************************************
//
//! Draws a horizontal sequence of pixels on the screen.
//!
//! \param pvDisplayData is a pointer to the driver-specific data for this
//! display driver.
//! \param lX is the X coordinate of the first pixel.
//! \param lY is the Y coordinate of the first pixel.
//! \param lX0 is sub-pixel offset within the pixel data, which is valid for 1
//! or 4 bit per pixel formats.
//! \param lCount is the number of pixels to draw.
//! \param lBPP is the number of bits per pixel; must be 1, 4, or 8.
//! \param pucData is a pointer to the pixel data.  For 1 and 4 bit per pixel
//! formats, the most significant bit(s) represent the left-most pixel.
//! \param pucPalette is a pointer to the palette used to draw the pixels.
//!
//! This function draws a horizontal sequence of pixels on the screen, using
//! the supplied palette.  For 1 bit per pixel format, the palette contains
//! pre-translated colors; for 4 and 8 bit per pixel formats, the palette
//! contains 24-bit RGB values that must be translated before being written to
//! the display.
//!
//! \return None.
//
//*****************************************************************************
static void
Formike128x128x16PixelDrawMultiple(void *pvDisplayData, long lX, long lY,
                                   long lX0, long lCount, long lBPP,
                                   const unsigned char *pucData,
                                   const unsigned char *pucPalette)
{
    unsigned long ulByte;

    //
    // Set the extent of the line along the X axis.
    //
    WriteCommand(0x2a);
    WriteData(lX);
    WriteData(lX + lCount - 1);

    //
    // Set the Y address of the display cursor.
    //
    WriteCommand(0x2b);
    WriteData(lY + 1);
    WriteData(lY + 1);

    //
    // Write the data RAM write command.
    //
    WriteCommand(0x2c);

    //
    // Determine how to interpret the pixel data based on the number of bits
    // per pixel.
    //
    switch(lBPP)
    {
        //
        // The pixel data is in 1 bit per pixel format.
        //
        case 1:
        {
            //
            // Loop while there are more pixels to draw.
            //
            while(lCount)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品一卡二| 免费精品99久久国产综合精品| 欧美一区在线视频| 在线电影一区二区三区| 欧美日韩日日摸| 欧美精品黑人性xxxx| 91精品国产品国语在线不卡| 在线综合+亚洲+欧美中文字幕| 精品视频全国免费看| 7777精品伊人久久久大香线蕉| 欧美一区二区三区影视| 欧美sm美女调教| 国产三级精品三级在线专区| 国产精品短视频| 亚洲自拍偷拍欧美| 午夜精品久久久| 精品一区二区三区久久| 国产一区二区毛片| 色综合天天性综合| 欧美挠脚心视频网站| 2024国产精品| 中文字幕一区二区三区色视频| 亚洲综合丁香婷婷六月香| 日韩电影免费在线看| 国产美女精品人人做人人爽| 97se狠狠狠综合亚洲狠狠| 欧美性感一类影片在线播放| 日韩免费高清视频| 国产精品毛片久久久久久久| 午夜亚洲国产au精品一区二区| 精品一区二区三区免费视频| 99国产精品久久久久久久久久| 欧美日韩成人激情| 亚洲国产高清在线| 天堂蜜桃91精品| 成人精品电影在线观看| 在线成人小视频| 中文字幕亚洲欧美在线不卡| 日韩av二区在线播放| 不卡欧美aaaaa| 日韩亚洲欧美在线| 亚洲一区二区三区中文字幕在线 | 国产精品一区二区三区四区| 99在线视频精品| 欧美xxxxx牲另类人与| 亚洲欧美日韩在线| 国产大片一区二区| 日韩一区二区在线看| 亚洲精品免费在线播放| 国产成人亚洲综合a∨猫咪| 欧美日韩国产123区| 国产精品久久国产精麻豆99网站| 久久av老司机精品网站导航| 91视频在线看| 中文字幕欧美区| 久久99精品网久久| 欧美一区二区国产| 天堂影院一区二区| 欧美亚洲图片小说| 亚洲日本va午夜在线影院| 丁香天五香天堂综合| 欧美变态tickle挠乳网站| 午夜精品久久久久久久99水蜜桃| 91在线精品秘密一区二区| 中文字幕第一区综合| 国产伦理精品不卡| 精品成人佐山爱一区二区| 青青国产91久久久久久| 欧美精品日日鲁夜夜添| 亚洲v日本v欧美v久久精品| 欧美亚洲一区二区在线观看| 亚洲激情图片一区| 在线观看国产日韩| 亚洲一区二区三区视频在线| 欧美三级三级三级爽爽爽| 亚洲综合网站在线观看| 欧美吞精做爰啪啪高潮| 亚洲一区在线看| 欧美日韩国产成人在线免费| 午夜精品123| 日韩欧美123| 国产中文一区二区三区| 国产女主播一区| 成人av影视在线观看| 成人免费一区二区三区视频| 94-欧美-setu| 亚洲成av人片一区二区| 欧美一级爆毛片| 国产综合久久久久影院| 国产精品理论片| 在线免费观看日本欧美| 亚洲丰满少妇videoshd| 日韩一卡二卡三卡四卡| 国产精品亚洲人在线观看| 国产精品视频观看| 欧美日韩精品一区二区三区蜜桃 | 精品嫩草影院久久| 高清不卡一区二区| 亚洲激情综合网| 337p亚洲精品色噜噜| 韩国精品在线观看| 亚洲视频一区二区免费在线观看| 欧美综合天天夜夜久久| 青青国产91久久久久久| 国产精品久久久一本精品| 欧美亚洲国产一区二区三区 | 久久久国产午夜精品| 成人免费视频视频| 日韩在线一区二区| 国产午夜精品美女毛片视频| 在线观看日韩一区| 激情小说亚洲一区| 一区二区在线观看免费| 久久久青草青青国产亚洲免观| 92精品国产成人观看免费| 日本vs亚洲vs韩国一区三区二区| 亚洲国产精品av| 日韩欧美国产小视频| 97久久超碰国产精品| 精品一区二区三区在线视频| 亚洲另类中文字| 国产日产精品一区| 欧美一区二区三区的| 91老师国产黑色丝袜在线| 精彩视频一区二区| 日韩国产精品久久久| 亚洲欧美日韩国产成人精品影院| 91精品国产综合久久精品性色 | 一区二区三区不卡在线观看| 久久久久久久久久久99999| 欧美男男青年gay1069videost| 不卡免费追剧大全电视剧网站| 狠狠狠色丁香婷婷综合久久五月| 亚洲成人自拍一区| 亚洲精选视频免费看| 亚洲国产精华液网站w | 中文字幕中文字幕中文字幕亚洲无线| 欧美麻豆精品久久久久久| 97国产一区二区| 成人app软件下载大全免费| 国产综合久久久久久久久久久久| 石原莉奈一区二区三区在线观看| 一区二区三区中文字幕电影| 日本一区二区视频在线| 国产亚洲欧美日韩日本| 精品国产网站在线观看| 欧美大胆人体bbbb| 日韩欧美一区二区免费| 欧美一区二区三区小说| 91精品欧美久久久久久动漫| 欧美二区在线观看| 91麻豆精品国产自产在线| 欧美伦理电影网| 欧美伦理电影网| 欧美日韩国产色站一区二区三区| 91福利在线观看| 欧美日韩免费在线视频| 欧美性一级生活| 欧美日韩亚州综合| 欧美一卡2卡三卡4卡5免费| 91精品国产综合久久精品性色| 欧美一区二区三区公司| 久久综合狠狠综合久久综合88| 久久品道一品道久久精品| 日本一区二区三区免费乱视频| 欧美韩国日本综合| 亚洲人成精品久久久久| 亚洲国产综合色| 石原莉奈在线亚洲二区| 国内外成人在线视频| 国产精品一区二区久久精品爱涩 | 亚洲日本乱码在线观看| 亚洲高清中文字幕| 六月丁香综合在线视频| 国产不卡视频在线观看| 91久久一区二区| 日韩亚洲欧美在线| 国产精品国产三级国产普通话99 | 免费一级欧美片在线观看| 激情欧美一区二区| www.欧美精品一二区| 欧美日韩mp4| 国产视频一区在线观看| 亚洲精品自拍动漫在线| 免费成人性网站| aa级大片欧美| 日韩欧美一区在线观看| 国产精品免费人成网站| 日日夜夜一区二区| 国产91色综合久久免费分享| 欧美视频在线一区| 国产夜色精品一区二区av| 亚洲一区在线观看网站| 国产最新精品免费| 精品视频免费看| 中文字幕成人网| 久久国产免费看| 在线观看视频一区| 欧美国产综合一区二区| 日本强好片久久久久久aaa|