This is an old revision of the document!


LCD

The LCD character display can be used in three different ways:

  • Output ASCII characters over a simple LCD controller
  • Output binary values in HEX representation (max. 128 bit)
  • Access the display directly over the I²C interface

Each colour of the background light is controlled by a 16 bit PWM controller.

Please make sure the CT Board is in the correct mode.
Supported modes: 1, 2, 3


The integrated LCD controller must allways be accessed with 16 bit half words!

The code snippet bellow shows how to use the ASCII interface of the LCD.

#include "reg_ctboard.h"
 
CT_LCD->ASCII = (uint16_t) ((13u << 8u) | ascii_char);    /* Write ascii_char at position 13 on the LCD. */


The Registers are read / write.







The binary interface can be used to display binary values in HEX representation. A maximum of 128 bits can be displayed.

The code snippet bellow shows how to use the ASCII interface of the LCD.

#include "reg_ctboard.h"
 
CT_LCD->BIN.BYTE.B7_0 = (uint8_t) data_byte;           /* Write byte of data to LCD. */
CT_LCD->BIN.HWORD.B15_0 = (uint16_t) data_halfword;    /* Write halfword of data to LCD. */
CT_LCD->BIN.WORD.B31_0 = (uint32_t) data_word;         /* Write word of data to LCD. */
CT_LCD->BIN.DWORD = (uint64_t) data_doubleword;        /* Write doubleword of data to LCD. */


The Registers are read / write.







FIXME

Each colour of the background light is controlled by a 16 bit PWM generator.
The brightness can be regulated from 0x0000 (0% / off) to 0xffff (100%). To adapt the brightness curve to the human eye a adadption to a logarithmic scale has to be done manually.

The code snippet bellow shows how to set the background light on the LCD.

#include "reg_ctboard.h"
 
CT_LCD->BG.RED = (uint16_t) data_halfword;        /* Set PWM value for red background light. */
CT_LCD->BG.GREEN = (uint16_t) data_halfword;      /* Set PWM value for green background light. */
CT_LCD->BG.BLUE = (uint16_t) data_halfword;       /* Set PWM value for blue background light. */


The Registers are read / write.







  • ctboard/peripherals/lcd.1456397371.txt.gz
  • Last modified: 2016/02/25 10:49
  • by feur