Ignore:
Timestamp:
Feb 1, 2019, 9:57:09 PM (5 years ago)
Author:
coas-nagasima
Message:

TINETとSocket APIなどを更新

Location:
asp3_tinet_ecnl_arm/trunk/asp3_dcre/gdic
Files:
4 added
2 edited

Legend:

Unmodified
Added
Removed
  • asp3_tinet_ecnl_arm/trunk/asp3_dcre/gdic/adafruit_st7735/adafruit_st7735.c

    r352 r364  
    354354
    355355/*
     356 *  LCDへのRGBデータ送信関数
     357 */
     358ER
     359lcd_writedata4(LCD_Handler_t *hlcd, uint8_t *pbmp, uint16_t width, uint16_t height)
     360{
     361        ER  ercd = E_OK;
     362        int index, i;
     363
     364        if(width == 0 || height == 0)
     365                return ercd;
     366        if(hlcd->spi_lock != 0){
     367                if((ercd = wai_sem(hlcd->spi_lock)) != E_OK)
     368                        return ercd;
     369        }
     370        rs_set(PORT_HIGH);
     371        cs_set(PORT_LOW);
     372        //dly_tsk(100/*us*/);
     373        for(index=0; index < height; index++){
     374                uint8_t *p = pbmp;
     375                for (i = 0; i < width; i++){
     376                        spi_master_write(&hlcd->hspi, *p++);
     377                        spi_master_write(&hlcd->hspi, *p++);
     378                }
     379                pbmp -= width*2;
     380        }
     381        //dly_tsk(100/*us*/);
     382        cs_set(PORT_HIGH);
     383        if(hlcd->spi_lock != 0)
     384                sig_sem(hlcd->spi_lock);
     385        return ercd;
     386}
     387
     388/*
    356389 *  ST7735へのコマンドリスト送信
    357390 */
     
    590623        lcd_setAddrWindow(hlcd, x0, y0, x0+width-1, y0+height-1);
    591624        lcd_writedata3(hlcd, pbmp, width, height);
     625}
     626
     627void
     628lcd_drawImage(LCD_Handler_t *hlcd, uint16_t x0, uint16_t y0, int16_t w, int16_t h, uint8_t *pbmp)
     629{
     630        lcd_setAddrWindow(hlcd, x0, y0, x0+w-1, y0+h-1);
     631        pbmp += w * (h - 1) * 3; 
     632        lcd_writedata3(hlcd, pbmp, w, h);
    592633}
    593634
  • asp3_tinet_ecnl_arm/trunk/asp3_dcre/gdic/adafruit_st7735/adafruit_st7735.h

    r352 r364  
    5959#endif
    6060
     61#include <stdbool.h>
    6162#include "device.h"
    6263#include "pinmap.h"
     
    145146#ifndef TOPPERS_MACRO_ONLY
    146147
     148typedef struct GFXfont GFXfont;
     149
    147150/*
    148151 *  LCDハンドラ構造体定義
     
    153156        uint16_t                _width;         /* 幅ピクセル数 */
    154157        uint16_t                                _height;        /* 高さピクセル数 */
     158        int16_t cursor_x, cursor_y;
     159        uint16_t textcolor, textbgcolor;
     160        uint8_t textsize, rotation;
     161        bool wrap;
     162        GFXfont *gfxFont;
    155163        uint8_t                 colstart;
    156164        uint8_t                 rowstart;
     
    188196extern ER lcd_writedata2(LCD_Handler_t *hlcd, uint16_t c, int cnt);
    189197extern ER lcd_writedata3(LCD_Handler_t *hlcd, uint8_t *pbmp, uint16_t width, uint16_t height);
     198extern ER lcd_writedata4(LCD_Handler_t *hlcd, uint8_t *pbmp, uint16_t width, uint16_t height);
    190199
    191200extern void lcd_initB(LCD_Handler_t *hlcd);
     
    198207extern void lcd_drawFastHLine(LCD_Handler_t *hlcd, int16_t x, int16_t y, int16_t w, uint16_t color);
    199208extern void lcd_drawBitmap(LCD_Handler_t *hlcd, uint16_t x0, uint16_t y0, uint8_t *pbmp);
     209extern void lcd_drawImage(LCD_Handler_t *hlcd, uint16_t x0, uint16_t y0, int16_t w, int16_t h, uint8_t *pbmp);
    200210extern void lcd_invertDisplay(LCD_Handler_t *hlcd, bool_t i);
    201211
Note: See TracChangeset for help on using the changeset viewer.