2013-01-03 4 views
1

저는 Stellaris® LM3S6965 평가 보드 인 Cortex M3를 사용하고 있습니다. 작동중인 oled 화면에 텍스트를 표시하려고합니다. 하지만 텍스트 크기를 늘리는 방법을 모르겠습니다.oled에서 텍스트 크기 늘리기 (Cortex M3, Stellaris LM3S6965)

아무도 그 방법을 알고 있습니까?

내 현재 코드 :

#include "inc/hw_types.h" 
#include "driverlib/debug.h" 
#include "driverlib/sysctl.h" 
#include "drivers/rit128x96x4.h" 


//***************************************************************************** 
// 
// The error routine that is called if the driver library encounters an error. 
// 
//***************************************************************************** 
#ifdef DEBUG 
void 
__error__(char *pcFilename, unsigned long ulLine) 
{ 
} 
#endif 

//***************************************************************************** 
// 
// Display scrolling text plus graphics on the OLED display. 
// 
//***************************************************************************** 
int 
main(void) 
{ 
    unsigned long ulRow, ulCol, ulWidth, ulHeight; 
    volatile int iDelay; 
    unsigned char *pucRow; 
    static char pucHello[] = 
    { 
     "      " 
     "Current selected timezone: +2 GMT - Brussels" 
     "      " 
    }; 

    // 
    // Set the clocking to run directly from the crystal. 
    // 
    SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | 
        SYSCTL_XTAL_8MHZ); 

    // 
    // Initialize the OLED display. 
    // 
    RIT128x96x4Init(1000000); 

    // Simple scrolling text display 
    // 
    ulCol = 0; 
    while(1) 
    { 
     // 
     // Display the text. 
     // 
     RIT128x96x4StringDraw(&pucHello[ulCol++], 8, 8, 11); 

     // 
     // Delay for a bit. 
     // 
     for(iDelay = 0; iDelay < 100000; iDelay++) 
     { 
     } 

     // 
     // Wrap the index back to the beginning of the string. 
     // 
     if(ulCol > 53) 
     { 
      ulCol = 0; 
     } 
    } 
} 
+2

글꼴이'drivers/rit128x96x4.h ''에 설명되어 있다고 가정합니다. 똑같은 다른 헤더를 찾으십시오. – leppie

답변

2

보장 할 수 있습니다, 물론 없습니다.

임베디드 시스템은 일반적으로 글꼴 사용과 관련하여 매우 자유롭지 않습니다. 동적 인 스케일링은 꽤 비싸고 많은 폰트는 특정 크기의 미리 렌더링 된 이진 비트 맵으로 처리됩니다.

rit128x96x4.h 헤더로 정의 된 API를 살펴 봐야하는데, 이는 디스플레이 관련 기능인 것처럼 보이기 때문입니다.

현재 현재 글꼴 크기가 얼마나 큰지는 알 수 없습니다. 128x96 크기의 디스플레이에서는 일반적으로 화면에 표시 할 수있는 텍스트의 양을 최대화하기 위해 작은 글꼴을 제공하는 것이 더 유용 할 것이므로 어떤 초대형 글꼴도있을 것으로 기대하지는 않습니다.

업데이트 : this random Google hit이 정확하면 제공된 그래픽 API가 풍부하지 않고 글꼴을 전환 할 방법이없는 것으로 보입니다.

1

글꼴은 일반적으로 비트 맵 배열입니다. 원하는 글꼴에 대해 비트 맵을 다시 정의 할 수 있습니다. 크기를 늘리려면 변경해야하는 다른 상수가있을 수 있으므로 드로잉 루틴은 문자가 렌더링 될 때 공백을 구분하는 방법을 알고 있습니다.

2

StellarisWare의 grlib \ fonts 폴더에는 글꼴 번호가 있습니다. API 호출을 사용하여 글꼴을 변경할 수 있습니다. GrContextFontSet()