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

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

?? osram96x16.c

?? FreeRTOS is a portable, open source, mini Real Time Kernel - a free to download and royalty free RTO
?? C
?? 第 1 頁 / 共 2 頁
字號:
    // Write the final byte to the controller.
    //
    I2CMasterDataPut(I2C_MASTER_BASE, ucChar);

    //
    // Finish the transfer.
    //
    I2CMasterControl(I2C_MASTER_BASE, I2C_MASTER_CMD_BURST_SEND_FINISH);

    //
    // Wait until the final byte has been transferred.
    //
    while(I2CMasterIntStatus(I2C_MASTER_BASE, false) == 0)
    {
    }

    //
    // Provide the required inter-byte delay.
    //
    OSRAMDelay(g_ulDelay);
}

//*****************************************************************************
//
//! Clears the OLED display.
//!
//! This function will clear the display.  All pixels in the display will be
//! turned off.
//!
//! \return None.
//
//*****************************************************************************
void
OSRAMClear(void)
{
    static const unsigned char pucRow1[] =
    {
        0xb0, 0x80, 0x04, 0x80, 0x12, 0x40
    };
    static const unsigned char pucRow2[] =
    {
        0xb1, 0x80, 0x04, 0x80, 0x12, 0x40
    };
    unsigned long ulIdx;

    //
    // Move the display cursor to the first column of the first row.
    //
    OSRAMWriteFirst(0x80);
    OSRAMWriteArray(pucRow1, sizeof(pucRow1));

    //
    // Fill this row with zeros.
    //
    for(ulIdx = 0; ulIdx < 95; ulIdx++)
    {
        OSRAMWriteByte(0x00);
    }
    OSRAMWriteFinal(0x00);

    //
    // Move the display cursor to the first column of the second row.
    //
    OSRAMWriteFirst(0x80);
    OSRAMWriteArray(pucRow2, sizeof(pucRow2));

    //
    // Fill this row with zeros.
    //
    for(ulIdx = 0; ulIdx < 95; ulIdx++)
    {
        OSRAMWriteByte(0x00);
    }
    OSRAMWriteFinal(0x00);
}

//*****************************************************************************
//
//! Displays a string on the OLED display.
//!
//! \param pcStr is a pointer to the string to display.
//! \param ulX is the horizontal position to display the string, specified in
//! columns from the left edge of the display.
//! \param ulY is the vertical position to display the string, specified in
//! eight scan line blocks from the top of the display (i.e. only 0 and 1 are
//! valid).
//!
//! This function will draw a string on the display.  Only the ASCII characters
//! between 32 (space) and 126 (tilde) are supported; other characters will
//! result in random data being draw on the display (based on whatever appears
//! before/after the font in memory).  The font is mono-spaced, so characters
//! such as "i" and "l" have more white space around them than characters such
//! as "m" or "w".
//!
//! If the drawing of the string reaches the right edge of the display, no more
//! characters will be drawn.  Therefore, special care is not required to avoid
//! supplying a string that is "too long" to display.
//!
//! \return None.
//
//*****************************************************************************
void
OSRAMStringDraw(const char *pcStr, unsigned long ulX, unsigned long ulY)
{
    //
    // Check the arguments.
    //
    ASSERT(ulX < 96);
    ASSERT(ulY < 2);

    //
    // Move the display cursor to the requested position on the display.
    //
    OSRAMWriteFirst(0x80);
    OSRAMWriteByte((ulY == 0) ? 0xb0 : 0xb1);
    OSRAMWriteByte(0x80);
    OSRAMWriteByte((ulX + 36) & 0x0f);
    OSRAMWriteByte(0x80);
    OSRAMWriteByte(0x10 | (((ulX + 36) >> 4) & 0x0f));
    OSRAMWriteByte(0x40);

    //
    // Loop while there are more characters in the string.
    //
    while(*pcStr != 0)
    {
        //
        // See if there is enough space on the display for this entire
        // character.
        //
        if(ulX <= 90)
        {
            //
            // Write the contents of this character to the display.
            //
            OSRAMWriteArray(g_pucFont[*pcStr - ' '], 5);

            //
            // See if this is the last character to display (either because the
            // right edge has been reached or because there are no more
            // characters).
            //
            if((ulX == 90) || (pcStr[1] == 0))
            {
                //
                // Write the final column of the display.
                //
                OSRAMWriteFinal(0x00);

                //
                // The string has been displayed.
                //
                return;
            }

            //
            // Write the inter-character padding column.
            //
            OSRAMWriteByte(0x00);
        }
        else
        {
            //
            // Write the portion of the character that will fit onto the
            // display.
            //
            OSRAMWriteArray(g_pucFont[*pcStr - ' '], 95 - ulX);
            OSRAMWriteFinal(g_pucFont[*pcStr - ' '][95 - ulX]);

            //
            // The string has been displayed.
            //
            return;
        }

        //
        // Advance to the next character.
        //
        pcStr++;

        //
        // Increment the X coordinate by the six columns that were just
        // written.
        //
        ulX += 6;
    }
}

//*****************************************************************************
//
//! Displays an image on the OLED display.
//!
//! \param pucImage is a pointer to the image data.
//! \param ulX is the horizontal position to display this image, specified in
//! columns from the left edge of the display.
//! \param ulY is the vertical position to display this image, specified in
//! eight scan line blocks from the top of the display (i.e. only 0 and 1 are
//! valid).
//! \param ulWidth is the width of the image, specified in columns.
//! \param ulHeight is the height of the image, specified in eight row blocks
//! (i.e. only 1 and 2 are valid).
//!
//! This function will display a bitmap graphic on the display.  The image to
//! be displayed must be a multiple of eight scan lines high (i.e. one row) and
//! will be drawn at a vertical position that is a multiple of eight scan lines
//! (i.e. scan line zero or scan line eight, corresponding to row zero or row
//! one).
//!
//! The image data is organized with the first row of image data appearing left
//! to right, followed immediately by the second row of image data.  Each byte
//! contains the data for the eight scan lines of the column, with the top scan
//! line being in the least significant bit of the byte and the bottom scan
//! line being in the most significant bit of the byte.
//!
//! For example, an image four columns wide and sixteen scan lines tall would
//! be arranged as follows (showing how the eight bytes of the image would
//! appear on the display):
//!
//! \verbatim
//!     +-------+  +-------+  +-------+  +-------+
//!     |   | 0 |  |   | 0 |  |   | 0 |  |   | 0 |
//!     | B | 1 |  | B | 1 |  | B | 1 |  | B | 1 |
//!     | y | 2 |  | y | 2 |  | y | 2 |  | y | 2 |
//!     | t | 3 |  | t | 3 |  | t | 3 |  | t | 3 |
//!     | e | 4 |  | e | 4 |  | e | 4 |  | e | 4 |
//!     |   | 5 |  |   | 5 |  |   | 5 |  |   | 5 |
//!     | 0 | 6 |  | 1 | 6 |  | 2 | 6 |  | 3 | 6 |
//!     |   | 7 |  |   | 7 |  |   | 7 |  |   | 7 |
//!     +-------+  +-------+  +-------+  +-------+
//!
//!     +-------+  +-------+  +-------+  +-------+
//!     |   | 0 |  |   | 0 |  |   | 0 |  |   | 0 |
//!     | B | 1 |  | B | 1 |  | B | 1 |  | B | 1 |
//!     | y | 2 |  | y | 2 |  | y | 2 |  | y | 2 |
//!     | t | 3 |  | t | 3 |  | t | 3 |  | t | 3 |
//!     | e | 4 |  | e | 4 |  | e | 4 |  | e | 4 |
//!     |   | 5 |  |   | 5 |  |   | 5 |  |   | 5 |
//!     | 4 | 6 |  | 5 | 6 |  | 6 | 6 |  | 7 | 6 |
//!     |   | 7 |  |   | 7 |  |   | 7 |  |   | 7 |
//!     +-------+  +-------+  +-------+  +-------+
//! \endverbatim
//!
//! \return None.
//
//*****************************************************************************
void
OSRAMImageDraw(const unsigned char *pucImage, unsigned long ulX,
               unsigned long ulY, unsigned long ulWidth,
               unsigned long ulHeight)
{
    //
    // Check the arguments.
    //
    ASSERT(ulX < 96);
    ASSERT(ulY < 2);
    ASSERT((ulX + ulWidth) <= 96);
    ASSERT((ulY + ulHeight) <= 2);

    //
    // The first 36 columns of the LCD buffer are not displayed, so increment
    // the X coorddinate by 36 to account for the non-displayed frame buffer
    // memory.
    //
    ulX += 36;

    //
    // Loop while there are more rows to display.
    //
    while(ulHeight--)
    {
        //
        // Write the starting address within this row.
        //
        OSRAMWriteFirst(0x80);
        OSRAMWriteByte((ulY == 0) ? 0xb0 : 0xb1);
        OSRAMWriteByte(0x80);
        OSRAMWriteByte(ulX & 0x0f);
        OSRAMWriteByte(0x80);
        OSRAMWriteByte(0x10 | ((ulX >> 4) & 0x0f));
        OSRAMWriteByte(0x40);

        //
        // Write this row of image data.
        //
        OSRAMWriteArray(pucImage, ulWidth - 1);
        OSRAMWriteFinal(pucImage[ulWidth - 1]);

        //
        // Advance to the next row of the image.
        //
        pucImage += ulWidth;
        ulY++;
    }
}

//*****************************************************************************
//
//! Initialize the OLED display.
//!
//! \param bFast is a boolean that is \e true if the I2C interface should be
//! run at 400 kbps and \e false if it should be run at 100 kbps.
//!
//! This function initializes the I2C interface to the OLED display and
//! configures the SSD0303 controller on the panel.
//!
//! \return None.
//
//*****************************************************************************
void
OSRAMInit(tBoolean bFast)
{
    unsigned long ulIdx;

    //
    // Enable the I2C and GPIO port B blocks as they are needed by this driver.
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);

    //
    // Configure the I2C SCL and SDA pins for I2C operation.
    //
    GPIOPinTypeI2C(GPIO_PORTB_BASE, GPIO_PIN_2 | GPIO_PIN_3);

    //
    // Initialize the I2C master.
    //
    I2CMasterInitExpClk(I2C_MASTER_BASE, SysCtlClockGet(), bFast);

    //
    // Compute the inter-byte delay for the SSD0303 controller.  This delay is
    // dependent upon the I2C bus clock rate; the slower the clock the longer
    // the delay required.
    //
    // The derivation of this formula is based on a measured delay of
    // OSRAMDelay(1700) for a 100 kHz I2C bus with the CPU running at 50 MHz
    // (referred to as C).  To scale this to the delay for a different CPU
    // speed (since this is just a CPU-based delay loop) is:
    //
    //           f(CPU)
    //     C * ----------
    //         50,000,000
    //
    // To then scale this to the actual I2C rate (since it won't always be
    // precisely 100 kHz):
    //
    //           f(CPU)     100,000
    //     C * ---------- * -------
    //         50,000,000    f(I2C)
    //
    // This equation will give the inter-byte delay required for any
    // configuration of the I2C master.  But, as arranged it is impossible to
    // directly compute in 32-bit arithmetic (without loosing a lot of
    // accuracy).  So, the equation is simplified.
    //
    // Since f(I2C) is generated by dividing down from f(CPU), replace it with
    // the equivalent (where TPR is the value programmed into the Master Timer
    // Period Register of the I2C master, with the 1 added back):
    //
    //                        100,000
    //           f(CPU)       -------
    //     C * ---------- *    f(CPU)
    //         50,000,000   ------------
    //                      2 * 10 * TPR
    //
    // Inverting the dividend in the last term:
    //
    //           f(CPU)     100,000 * 2 * 10 * TPR
    //     C * ---------- * ----------------------
    //         50,000,000          f(CPU)
    //
    // The f(CPU) now cancels out.
    //
    //         100,000 * 2 * 10 * TPR
    //     C * ----------------------
    //               50,000,000
    //
    // Since there are no clock frequencies left in the equation, this equation
    // also works for 400 kHz bus operation as well, since the 100,000 in the
    // numerator becomes 400,000 but C is 1/4, which cancel out each other.
    // Reducing the constants gives:
    //
    //         TPR              TPR             TPR
    //     C * ---   =   1700 * ---   =   340 * ---
    //         25               25               5
    //
    // Note that the constant C is actually a bit larger than it needs to be in
    // order to provide some safety margin.
    //
    // When the panel is being initialized, the value of C actually needs to be
    // a bit longer (3200 instead of 1700).  So, set the larger value for now.
    //
    g_ulDelay = (640 * (HWREG(I2C_MASTER_BASE + I2C_MASTER_O_TPR) + 1)) / 5;

    //
    // Initialize the SSD0303 controller.  Loop through the initialization
    // sequence doing a single I2C transfer for each command.
    //
    for(ulIdx = 0; ulIdx < sizeof(g_pucOSRAMInit);
        ulIdx += g_pucOSRAMInit[ulIdx] + 1)
    {
        //
        // Send this command.
        //
        OSRAMWriteFirst(g_pucOSRAMInit[ulIdx + 1]);
        OSRAMWriteArray(g_pucOSRAMInit + ulIdx + 2, g_pucOSRAMInit[ulIdx] - 2);
        OSRAMWriteFinal(g_pucOSRAMInit[ulIdx + g_pucOSRAMInit[ulIdx]]);
    }

    //
    // Now, switch to the actual value of C.
    //
    g_ulDelay = (340 * (HWREG(I2C_MASTER_BASE + I2C_MASTER_O_TPR) + 1)) / 5;

    //
    // Clear the frame buffer.
    //
    OSRAMClear();
}

//*****************************************************************************
//
//! Turns on the OLED display.
//!
//! This function will turn on the OLED display, causing it to display the
//! contents of its internal frame buffer.
//!
//! \return None.
//
//*****************************************************************************
void
OSRAMDisplayOn(void)
{
    //
    // Turn on the DC-DC converter and the display.
    //
    OSRAMWriteFirst(0x80);
    OSRAMWriteByte(0xad);
    OSRAMWriteByte(0x80);
    OSRAMWriteByte(0x8b);
    OSRAMWriteByte(0x80);
    OSRAMWriteFinal(0xaf);
}

//*****************************************************************************
//
//! Turns off the OLED display.
//!
//! This function will turn off the OLED display.  This will stop the scanning
//! of the panel and turn off the on-chip DC-DC converter, preventing damage to
//! the panel due to burn-in (it has similar characters to a CRT in this
//! respect).
//!
//! \return None.
//
//*****************************************************************************
void
OSRAMDisplayOff(void)
{
    //
    // Turn off the DC-DC converter and the display.
    //
    OSRAMWriteFirst(0x80);
    OSRAMWriteByte(0xad);
    OSRAMWriteByte(0x80);
    OSRAMWriteByte(0x8a);
    OSRAMWriteByte(0x80);
    OSRAMWriteFinal(0xae);
}

//*****************************************************************************
//
// Close the Doxygen group.
//! @}
//
//*****************************************************************************

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91免费版pro下载短视频| 一区二区三区成人| 国内精品自线一区二区三区视频| 欧美一二三区在线观看| 久久精品国产亚洲aⅴ| 久久人人97超碰com| 成人禁用看黄a在线| 最新中文字幕一区二区三区 | 91在线丨porny丨国产| 国产精品久线观看视频| 99久久婷婷国产综合精品| 亚洲男女一区二区三区| 欧美日本一道本| 国产主播一区二区三区| 18欧美乱大交hd1984| 欧美日韩在线不卡| 国产麻豆91精品| 亚洲一区二区成人在线观看| 欧美一区二区三区精品| 国产91精品一区二区麻豆网站 | 欧美成人vr18sexvr| 国产成人av影院| 午夜欧美电影在线观看| 久久久久成人黄色影片| 在线精品视频小说1| 国内精品视频666| 亚洲精品国产第一综合99久久| 91精品婷婷国产综合久久性色| 国产精品66部| 日一区二区三区| 亚洲国产成人在线| 欧美日韩精品一区二区天天拍小说| 精品一区二区三区蜜桃| 一级做a爱片久久| 精品国产精品一区二区夜夜嗨| 91美女蜜桃在线| 精品一二三四在线| 亚洲欧美国产毛片在线| 久久精品一区四区| 在线播放一区二区三区| 成人国产精品免费观看| 九九精品一区二区| 性做久久久久久免费观看| 国产欧美精品一区二区三区四区| 欧美色图片你懂的| 北条麻妃国产九九精品视频| 麻豆精品视频在线| 亚洲成av人**亚洲成av**| 中文字幕在线观看一区二区| 精品国产一区二区三区忘忧草| 欧美综合天天夜夜久久| 成人免费视频网站在线观看| 乱一区二区av| 日韩高清在线不卡| 亚洲国产cao| 亚洲激情校园春色| 国产精品国产三级国产a| 欧美精品一区二区三区四区 | 岛国av在线一区| 久色婷婷小香蕉久久| 亚洲一区二区影院| 亚洲日本青草视频在线怡红院| 久久久国产午夜精品| 久久亚洲综合av| 91麻豆精品久久久久蜜臀| 91成人在线观看喷潮| av成人动漫在线观看| 成人a区在线观看| 风间由美一区二区av101 | 日韩精品欧美成人高清一区二区| 亚洲精品中文在线观看| 成人欧美一区二区三区在线播放| 国产欧美日本一区视频| 欧美激情艳妇裸体舞| 欧美国产日韩一二三区| 国产精品无码永久免费888| 国产亚洲精品免费| 中文字幕av一区二区三区高| 欧美国产日韩a欧美在线观看| 国产午夜精品久久久久久久| 国产婷婷色一区二区三区四区| 久久综合九色欧美综合狠狠| 久久久一区二区| 中文字幕不卡三区| 亚洲精品视频在线| 天堂一区二区在线| 日韩国产欧美视频| 激情综合色综合久久综合| 久久成人久久鬼色| 国产专区综合网| 成人成人成人在线视频| 一本一本大道香蕉久在线精品 | 中日韩av电影| 日韩一区有码在线| 一区二区三区资源| 麻豆精品精品国产自在97香蕉| 国产一区二区三区免费观看| 粉嫩一区二区三区性色av| 91玉足脚交白嫩脚丫在线播放| 色视频成人在线观看免| 7777精品伊人久久久大香线蕉完整版 | 美国三级日本三级久久99| 国产一区二区在线免费观看| av爱爱亚洲一区| 91精品欧美久久久久久动漫| 久久久久久电影| 亚洲自拍另类综合| 国产永久精品大片wwwapp| 91蜜桃免费观看视频| 欧美一级精品大片| 国产精品久久久久久久久免费丝袜 | 欧美日韩的一区二区| 久久综合色婷婷| 日韩主播视频在线| 国产一区二区在线视频| 91福利国产精品| 久久久久久久久久久久久夜| 亚洲欧美日韩一区二区| 日韩av电影免费观看高清完整版| 国产91精品露脸国语对白| 在线免费av一区| 久久久www免费人成精品| 中文字幕一区av| 蜜桃视频一区二区三区在线观看| www.欧美日韩| 2023国产精品自拍| 洋洋成人永久网站入口| 国产成人免费xxxxxxxx| 欧美肥妇毛茸茸| 欧美激情一区二区三区不卡| 日本美女视频一区二区| 色悠悠久久综合| 欧美激情在线一区二区| 毛片av一区二区| 欧美日韩一区二区在线观看| 国产精品免费网站在线观看| 奇米综合一区二区三区精品视频| 91美女视频网站| 国产欧美日韩激情| 久久精品国产久精国产| 欧美日韩一区二区三区免费看| 国产精品护士白丝一区av| 国内一区二区视频| 91精品在线一区二区| 亚洲主播在线观看| 97se亚洲国产综合在线| 欧美激情一区二区三区不卡| 精品一区二区三区不卡| 欧美一级在线观看| 午夜在线电影亚洲一区| 色综合中文字幕| 国产精品久久久久久久午夜片| 国产精品一级片| 精品国产1区2区3区| 久久99国产精品麻豆| 欧美一区二区视频在线观看| 亚洲一区二区三区四区在线| 色狠狠色狠狠综合| 亚洲欧美日韩国产综合| 99re8在线精品视频免费播放| 欧美激情综合在线| 成人黄色网址在线观看| 国产日韩影视精品| 精品一区二区三区在线播放视频| 日韩欧美在线不卡| 男男成人高潮片免费网站| 91麻豆精品91久久久久同性| 日产国产欧美视频一区精品| 欧美人狂配大交3d怪物一区| 亚洲va天堂va国产va久| 欧美日韩美少妇| 日韩精品1区2区3区| 日韩一区二区在线看| 久久精品国产一区二区三区免费看 | 欧美sm极限捆绑bd| 韩国欧美国产1区| 国产欧美精品一区二区三区四区| 成人精品视频一区二区三区| 中文字幕成人av| 91黄色免费版| 日本美女视频一区二区| 欧美精品一区二区三区蜜桃视频| 国产综合久久久久久鬼色| 国产欧美日韩激情| 日本高清视频一区二区| 亚欧色一区w666天堂| 精品三级在线看| 成人av在线观| 午夜精品影院在线观看| www成人在线观看| 99久久免费精品高清特色大片| 亚洲国产日韩一区二区| 欧美电影免费观看完整版| 成人午夜av影视| 亚洲国产wwwccc36天堂| 久久久久久久久久看片| 91福利在线观看| 久久99久久99| 亚洲欧美日韩国产另类专区| 337p亚洲精品色噜噜噜|