MSPM0_ValvanoWare  1.0
ECE445L starter code
Files | Macros | Functions
MKII

I2C and MKII boosterpack sensors. More...

Files

file  I2C.h
 Software driver functions for I2C and MKII boosterpack.
 
file  LCD.h
 LCD on MKII boosterpack.
 

Macros

#define LCD_BLACK   0x0000
 The following constants are possible colors for the LCD in RGB format.
 
#define LCD_BLUE   0x001F
 
#define LCD_DARKBLUE   0x34BF
 
#define LCD_RED   0xF800
 
#define LCD_GREEN   0x07E0
 
#define LCD_LIGHTGREEN   0x07EF
 
#define LCD_ORANGE   0xFD60
 
#define LCD_CYAN   0x07FF
 
#define LCD_MAGENTA   0xF81F
 
#define LCD_YELLOW   0xFFE0
 
#define LCD_WHITE   0xFFFF
 
#define LCD_GREY   0x8410
 
#define STANDARD_GALACTIC_ALPHABET   0
 Set STANDARD_GALACTIC_ALPHABET to 1 for Commander Keen alphabet.
 

Functions

void I2C_Init (void)
 Initialize I2C. More...
 
uint8_t I2C_Recv1 (int8_t slave)
 Receive one byte. More...
 
uint16_t I2C_Recv2 (int8_t slave)
 Receive two bytes. More...
 
int I2C_Send (uint8_t slave, uint8_t *pData, uint32_t count)
 write 1 to 8 bytes to I2C. More...
 
int I2C_SendData (uint8_t slave, uint8_t *pData, uint32_t count)
 send large buffer to I2C. More...
 
int I2C_Send1 (int8_t slave, uint8_t data)
 Send one byte. More...
 
int I2C_Send2 (int8_t slave, uint8_t data1, uint8_t data2)
 Send two bytes. More...
 
int I2C_Send3 (int8_t slave, uint8_t data1, uint8_t data2, uint8_t data3)
 Send three bytes. More...
 
void I2C_LightSensor_Init (void)
 Initialize OPT3001. More...
 
uint32_t I2C_LightSensor_Input (void)
 Input from OPT3001. More...
 
void I2C_LightSensor_Start (void)
 Start OPT3001. More...
 
int I2C_LightSensor_End (uint32_t *light)
 Finish OPT3001. More...
 
void I2C_TempSensor_Init (void)
 Initialize TMP006. More...
 
void I2C_TempSensor_Input (int32_t *sensorV, int32_t *localT)
 Input from TMP006. More...
 
void I2C_TempSensor_Start (void)
 Start TMP006. More...
 
int I2C_TempSensor_End (int32_t *sensorV, int32_t *localT)
 Finish TMP006. More...
 
void LCD_Init (void)
 Initialize MKII LCD. More...
 
void LCD_DrawPixel (int16_t x, int16_t y, uint16_t color)
 Color one pixel. More...
 
void LCD_DrawFastVLine (int16_t x, int16_t y, int16_t h, uint16_t color)
 Draw a vertical line. More...
 
void LCD_DrawFastHLine (int16_t x, int16_t y, int16_t w, uint16_t color)
 Draw a horizontal line. More...
 
void LCD_FillScreen (uint16_t color)
 Fill the screen. More...
 
void LCD_FillRect (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color)
 Draw a filled rectangle. More...
 
uint16_t LCD_Color565 (uint8_t r, uint8_t g, uint8_t b)
 RGB to color creation. More...
 
uint16_t LCD_SwapColor (uint16_t x)
 Swaps red and blue. More...
 
void LCD_DrawBitmap (int16_t x, int16_t y, const uint16_t *image, int16_t w, int16_t h)
 Displays a BMP image. More...
 
void LCD_DrawCharS (int16_t x, int16_t y, char c, int16_t textColor, int16_t bgColor, uint8_t size)
 Draw a character. More...
 
void LCD_DrawChar (int16_t x, int16_t y, char c, int16_t textColor, int16_t bgColor, uint8_t size)
 Draw a character. More...
 
uint32_t LCD_DrawString (uint16_t x, uint16_t y, char *pt, int16_t textColor)
 Draw a string. More...
 
void LCD_SetCursor (uint32_t newX, uint32_t newY)
 Move the cursor. More...
 
void LCD_OutUDec (uint32_t n, int16_t textColor)
 Output an unsigned decimal. More...
 
void LCD_OutUDec4 (uint32_t n, int16_t textColor)
 Output a 4-digit unsigned decimal. More...
 
void LCD_OutUDec5 (uint32_t n, int16_t textColor)
 Output a 5-digit unsigned decimal. More...
 
void LCD_OutUFix2_1 (uint32_t n, int16_t textColor)
 Output a 2-digit fixed-point decimal. More...
 
void LCD_OutUHex2 (uint32_t n, int16_t textColor)
 Output a 2-digit hexadecimal number. More...
 
void LCD_OutChar (char ch)
 Output a character. More...
 
void LCD_OutString (char *ptr)
 Output a string. More...
 
void LCD_SetTextColor (uint16_t color)
 sets the text color More...
 
void LCD_Drawaxes (uint16_t axisColor, uint16_t bgColor, char *xLabel, char *yLabel1, uint16_t label1Color, char *yLabel2, uint16_t label2Color, int32_t ymax, int32_t ymin)
 Initializes a plot. More...
 
void LCD_PlotPoint (int32_t data1, uint16_t color1)
 Plot one point. More...
 
void LCD_PlotIncrement (void)
 Moves the plot cursor in time. More...
 

Detailed Description

I2C and MKII boosterpack sensors.

MKII boosterpack LCD.

MKII sensor pins
Pin FunctionDescription
PA27GPIO J1.8 ambient light (OPT3001) interrupt (digital)
PB2 I2C1-SCLJ1.9 ambient light (OPT3001) and temperature sensor (TMP006)
PB3 I2C1-SDAJ1.10 ambient light (OPT3001) and temperature sensor (TMP006)
PB16GPIO J2.11 temperature sensor (TMP006) interrupt (digital)
MKII LCD pins
Pin Function Description
PB9 SPI1 SCLK J1.7 LCD SPI clock (SPI)
PB6 SPI1 CS0 J2.13 LCD SPI CS (SPI)
PB8 SPI1 PICO J2.15 LCD SPI data (SPI)
PB15GPIO J2.17 LCD !RST (digital)
PA13GPIO J4.31 LCD RS (digital)

Function Documentation

◆ I2C_Init()

void I2C_Init ( void  )

Initialize I2C.

Initialize PB2 and PB3 for I2C for 400kHz clock. Uses busy-wait synchronization

Parameters
none
Returns
none
Note
Assumes 80MHz bus clock
Assumes GPIOB have been reset and powered previously

◆ I2C_LightSensor_End()

int I2C_LightSensor_End ( uint32_t *  light)

Finish OPT3001.

Finish a measurement using the OPT3001. Query the OPT3001 light sensor for a measurement. If no measurement is currently in progress, start one and return zero immediately. If the measurement is not yet complete, return zero immediately. If the measurement is complete, store the result in the pointer provided and return one.

Parameters
lightpointer to a place to return data
Returns
1 if measurement is ready and pointer is valid, 0 if measurement is not ready and pointer unchanged
See also
I2C_LightSensor_Init I2C_LightSensor_End
Note
Assumes: I2C_LightSensor_Start() has been called

◆ I2C_LightSensor_Init()

void I2C_LightSensor_Init ( void  )

Initialize OPT3001.

Initialize OPT3001 on MKII boosterpack. PA27 is GPIO pin for input, which corresponds with BoosterPack pins J1.8 (Light Sensor interrupt). Initialize PB2 and PB3 for I2C pins, which correspond with BoosterPack pins J1.9 (SCL) and J1.10 (SDA)

Parameters
none
Returns
none
Note
Assumes 80MHz bus clock
Assumes GPIOB have been reset and powered previously

◆ I2C_LightSensor_Input()

uint32_t I2C_LightSensor_Input ( void  )

Input from OPT3001.

Query the OPT3001 light sensor for a measurement. Wait until the measurement is ready, which may take 800 ms

Parameters
none
Returns
light intensity (units 100*lux)
See also
I2C_LightSensor_Start I2C_LightSensor_End
Note
Assumes: I2C_LightSensor_Init() has been called

◆ I2C_LightSensor_Start()

void I2C_LightSensor_Start ( void  )

Start OPT3001.

Start a measurement using the OPT3001. If a measurement is currently in progress, return without starting another measurement

Parameters
none
Returns
none
See also
I2C_LightSensor_Init I2C_LightSensor_End
Note
Assumes: I2C_LightSensor_Init() has been called

◆ I2C_Recv1()

uint8_t I2C_Recv1 ( int8_t  slave)

Receive one byte.

Receive one byte from specified slave. Uses busy-wait synchronization
[send address][read data]

Parameters
slaveis slave address
Returns
8-bit data received
Note
Does not check for errors

◆ I2C_Recv2()

uint16_t I2C_Recv2 ( int8_t  slave)

Receive two bytes.

Receive two bytes from specified slave. Uses busy-wait synchronization
[send address][read data][read data]

Parameters
slaveis slave address
Returns
16-bit data received
Note
Does not check for errors

◆ I2C_Send()

int I2C_Send ( uint8_t  slave,
uint8_t *  pData,
uint32_t  count 
)

write 1 to 8 bytes to I2C.

I2C_Send

Parameters
slaveaddress of slave device.
pDatadata address of data to be writen.

@param count number of bytes to be written, must be less than 8.

◆ I2C_Send1()

int I2C_Send1 ( int8_t  slave,
uint8_t  data 
)

Send one byte.

Send one byte to specified slave. Uses busy-wait synchronization
[send address][send data]

Parameters
slaveslave address
databyte to be sent
Returns
0 if successful, nonzero if error
Note
Does check for errors

◆ I2C_Send2()

int I2C_Send2 ( int8_t  slave,
uint8_t  data1,
uint8_t  data2 
)

Send two bytes.

Send two bytes to specified slave. Uses busy-wait synchronization
[send address][send data1][send data2]

Parameters
slaveis slave address
data1is first byte to be sent
data2is second byte to be sent
Returns
0 if successful, nonzero if error
Note
Does check for errors

◆ I2C_Send3()

int I2C_Send3 ( int8_t  slave,
uint8_t  data1,
uint8_t  data2,
uint8_t  data3 
)

Send three bytes.

Send three bytes to specified slave. Uses busy-wait synchronization
[send address][send data1][send data2][send data3]

Parameters
slaveis slave address
data1is first byte to be sent
data2is second byte to be sent
data3is third byte to be sent
Returns
0 if successful, nonzero if error
Note
Does check for errors

◆ I2C_SendData()

int I2C_SendData ( uint8_t  slave,
uint8_t *  pData,
uint32_t  count 
)

send large buffer to I2C.

I2C_SendData

Parameters
slaveaddress of slave device.
pDatadata address of data to be writen.

@param count number of bytes to be written, must be from 2 to 4095.

◆ I2C_TempSensor_End()

int I2C_TempSensor_End ( int32_t *  sensorV,
int32_t *  localT 
)

Finish TMP006.

Finish a measurement using the OPT3001. Query the TMP006 temperature sensor for a measurement. If no measurement is currently in progress, start one and return zero immediately. If the measurement is not yet complete, return zero immediately. If the measurement is complete, store the result in the pointers provided and return one.

Parameters
sensorVis signed pointer to store sensor voltage (units 100*nV)
localTis signed pointer to store local temperature (units 100,000*C)
Returns
1 if measurement is ready and pointer is valid, 0 if measurement is not ready and pointer unchanged
See also
I2C_TempSensor_Start
Note
Assumes: I2C_TempSensor_Start has been called

◆ I2C_TempSensor_Init()

void I2C_TempSensor_Init ( void  )

Initialize TMP006.

Initialize TMP006 on MKII boosterpack. PB16 is GPIO pin for input, which corresponds with BoosterPack pins J1.8 (Light Sensor interrupt). Initialize PB2 and PB3 for I2C pins, which correspond with BoosterPack pins J1.9 (SCL) and J1.10 (SDA)

Parameters
none
Returns
none
Note
Assumes 80MHz bus clock
Assumes GPIOB have been reset and powered previously

◆ I2C_TempSensor_Input()

void I2C_TempSensor_Input ( int32_t *  sensorV,
int32_t *  localT 
)

Input from TMP006.

Query the TMP006 temperature sensor for a measurement. Wait until the measurement is ready, which may take 4 seconds

Parameters
sensorVis signed pointer to store sensor voltage (units 100*nV)
localTis signed pointer to store local temperature (units 100,000*C)
Returns
none
Note
TMP006 was discontinued and not populated on most MKII

◆ I2C_TempSensor_Start()

void I2C_TempSensor_Start ( void  )

Start TMP006.

Start a measurement using the TMP006. If a measurement is currently in progress, return without starting another measurement

Parameters
none
Returns
none
See also
I2C_LightSensor_Init I2C_LightSensor_End
Note
Assumes: I2C_LightSensor_Init() has been called

◆ LCD_Color565()

uint16_t LCD_Color565 ( uint8_t  r,
uint8_t  g,
uint8_t  b 
)

RGB to color creation.

Pass 8-bit (each) R,G,B and get back 16-bit packed color.

Parameters
rred value
ggreen value
bblue value
Returns
16-bit color

◆ LCD_Drawaxes()

void LCD_Drawaxes ( uint16_t  axisColor,
uint16_t  bgColor,
char *  xLabel,
char *  yLabel1,
uint16_t  label1Color,
char *  yLabel2,
uint16_t  label2Color,
int32_t  ymax,
int32_t  ymin 
)

Initializes a plot.

Set up the axes, labels, and other variables to allow data to be plotted in a chart using the functions LCD_PlotPoint() and LCD_PlotIncrement(). If yLabel2 is empty string, no yLabel2 is printed, and yLabel1 is centered

Parameters
axisColor16-bit color for axes, which can be produced by LCD_Color565()
bgColor16-bit color for plot background, which can be produced by LCD_Color565()
xLabelpointer to a null terminated string for x-axis (~4 character space)
yLabel1pointer to a null terminated string for top of y-axis (~3-5 character space)
label1Color16-bit color for y-axis label1, which can be produced by LCD_Color565()
yLabel2pointer to a null terminated string for bottom of y-axis (~3 character space)
label2Color16-bit color for y-axis label2, which can be produced by LCD_Color565()
ymaxmaximum value to be printed
yminminimum value to be printed
Returns
none
Note
Assumes: LCD_Init() has been called

◆ LCD_DrawBitmap()

void LCD_DrawBitmap ( int16_t  x,
int16_t  y,
const uint16_t *  image,
int16_t  w,
int16_t  h 
)

Displays a BMP image.

Displays a 16-bit color BMP image. A bitmap file that is created by a PC image processing program has a header and may be padded with dummy columns so the data have four byte alignment. This function assumes that all of that has been stripped out, and the array image[] has one 16-bit halfword for each pixel to be displayed on the screen (encoded in reverse order, which is standard for bitmap files). An array can be created in this format from a 24-bit-per-pixel .bmp file using the associated BmpConvert16.exe converter program. (x,y) is the screen location of the lower left corner of BMP image
Requires (11 + 2*w*h) bytes of transmission (assuming image fully on screen)

Parameters
xhorizontal position of the bottom left corner of the image, columns from the left edge
yvertical position of the bottom left corner of the image, rows from the top edge
imagepointer to a 16-bit color BMP image
wnumber of pixels wide
hnumber of pixels tall
Note
Must be less than or equal to 128 pixels wide by 128 pixels high
Returns
none

◆ LCD_DrawChar()

void LCD_DrawChar ( int16_t  x,
int16_t  y,
char  c,
int16_t  textColor,
int16_t  bgColor,
uint8_t  size 
)

Draw a character.

Advanced character draw function. This is similar to the function from Adafruit_GFX.c but adapted for this processor. However, this function only uses one call to setAddrWindow(), which allows it to run at least twice as fast.
Requires (11 + size*size*6*8) bytes of transmission (assuming image fully on screen)

Parameters
xhorizontal position of the top left corner of the character, columns from the left edge
yvertical position of the top left corner of the character, rows from the top edge
ccharacter to be printed
textColor16-bit color of the character
bgColor16-bit color of the background
sizenumber of pixels per character pixel (e.g. size==2 prints each pixel of font as 2x2 square)
Returns
none

◆ LCD_DrawCharS()

void LCD_DrawCharS ( int16_t  x,
int16_t  y,
char  c,
int16_t  textColor,
int16_t  bgColor,
uint8_t  size 
)

Draw a character.

Simple character draw function. This is the same function from Adafruit_GFX.c but adapted for this processor. However, each call to LCD_DrawPixel() calls setAddrWindow(), which needs to send many extra data and commands. If the background color is the same as the text color, no background will be printed, and text can be drawn right over existing images without covering them with a box.
Requires (11 + 2*size*size)*6*8 bytes of transmission (image fully on screen; textcolor != bgColor)

Parameters
xhorizontal position of the top left corner of the character, columns from the left edge
yvertical position of the top left corner of the character, rows from the top edge
ccharacter to be printed
textColor16-bit color of the character
bgColor16-bit color of the background
sizenumber of pixels per character pixel (e.g. size==2 prints each pixel of font as 2x2 square)
Returns
none

◆ LCD_DrawFastHLine()

void LCD_DrawFastHLine ( int16_t  x,
int16_t  y,
int16_t  w,
uint16_t  color 
)

Draw a horizontal line.

Draw a horizontal line at the given coordinates with the given width and color. A horizontal line is parallel to the shorter side of the rectangular display
Requires (11 + 2*w) bytes of transmission (assuming image fully on screen)

Parameters
xhorizontal position of the start of the line, columns from the left edge
yvertical position of the start of the line, rows from the top edge
whorizontal width of the line
color16-bit color, which can be produced by LCD_Color565()
Returns
none

◆ LCD_DrawFastVLine()

void LCD_DrawFastVLine ( int16_t  x,
int16_t  y,
int16_t  h,
uint16_t  color 
)

Draw a vertical line.

Draw a vertical line at the given coordinates with the given height and color.
A vertical line is parallel to the longer side of the rectangular display
Requires (11 + 2*h) bytes of transmission (assuming image fully on screen)

Parameters
xhorizontal position of the start of the line, columns from the left edge
yvertical position of the start of the line, rows from the top edge
hvertical height of the line
color16-bit color, which can be produced by LCD_Color565()
Returns
none

◆ LCD_DrawPixel()

void LCD_DrawPixel ( int16_t  x,
int16_t  y,
uint16_t  color 
)

Color one pixel.

Color the pixel at the given coordinates with the given color.
Requires 13 bytes of transmission
x must be less than 128
x 0 is on the left, 126 is near the right
y must be less than 128 y 126 is near the wires, 0 is the side opposite the wires

Parameters
xhorizontal position of the pixel, columns from the left edge
yvertical position of the pixel, rows from the top edge
color16-bit color, which can be produced by LCD_Color565()
Returns
none

◆ LCD_DrawString()

uint32_t LCD_DrawString ( uint16_t  x,
uint16_t  y,
char *  pt,
int16_t  textColor 
)

Draw a string.

String draw function. 13 rows (0 to 12) and 21 characters (0 to 20)
Requires (11 + size*size*6*8) bytes of transmission for each character

Parameters
xcolumns from the left edge (0 to 20)
yrows from the top edge (0 to 12)
ptpointer to a null terminated string to be printed
textColor16-bit color of the characters
Returns
number of characters printed
Note
bgColor is Black and size is 1

◆ LCD_FillRect()

void LCD_FillRect ( int16_t  x,
int16_t  y,
int16_t  w,
int16_t  h,
uint16_t  color 
)

Draw a filled rectangle.

Draw a filled rectangle at the given coordinates with the given width, height, and color.
Requires (11 + 2*w*h) bytes of transmission (assuming image fully on screen)

Parameters
xhorizontal position of the top left corner of the rectangle, columns from the left edge
yvertical position of the top left corner of the rectangle, rows from the top edge
whorizontal width of the rectangle
hvertical height of the rectangle
color16-bit color, which can be produced by LCD_Color565()
Returns
none

◆ LCD_FillScreen()

void LCD_FillScreen ( uint16_t  color)

Fill the screen.

Fill the screen with the given color.
Requires 33,293 bytes of transmission

Parameters
color16-bit color, which can be produced by LCD_Color565()
Returns
none

◆ LCD_Init()

void LCD_Init ( void  )

Initialize MKII LCD.

Initialize Crystalfontz CFAF128128B-0145T color 128x128-pixel TFT LCD BoosterPack pins

  • J1.7 PB9 (SPI CLK)
  • J2.13 PB6 (SPI CS)
  • J2.15 PB8 (SPI MOSI)
  • J2.17 PB15(LCD ~RST) and
  • J4.31 PA13(LCD DC)
    Parameters
    none
    Returns
    none
    Note
    assumes GPIOA and GPIOB are reset and powered previously

◆ LCD_OutChar()

void LCD_OutChar ( char  ch)

Output a character.

Output one character to the LCD Position determined by LCD_SetCursor command Color set by LCD_SetTextColor

Parameters
ch8-bit ASCII character
Returns
none

◆ LCD_OutString()

void LCD_OutString ( char *  ptr)

Output a string.

Print a string of characters to the ST7735 LCD. Position determined by LCD_SetCursor command Color set by LCD_SetTextColor The string will not automatically wrap.

Parameters
ptrpointer to NULL-terminated ASCII string
Returns
none

◆ LCD_OutUDec()

void LCD_OutUDec ( uint32_t  n,
int16_t  textColor 
)

Output an unsigned decimal.

Output a 32-bit number in unsigned decimal format Position determined by LCD_SetCursor command

Parameters
n32-bit number to be transferred
textColor16-bit color of the numbers
Returns
none
Note
Variable format 1-10 digits with no space before or after

◆ LCD_OutUDec4()

void LCD_OutUDec4 ( uint32_t  n,
int16_t  textColor 
)

Output a 4-digit unsigned decimal.

Output a 32-bit number in unsigned 4-digit decimal format with no space before or after. Position determined by LCD_SetCursor command

Parameters
n32-bit number to be transferred
textColor16-bit color of the numbers
Returns
none
Note
Fixed format 4 digits with no space before or after

◆ LCD_OutUDec5()

void LCD_OutUDec5 ( uint32_t  n,
int16_t  textColor 
)

Output a 5-digit unsigned decimal.

Output a 32-bit number in unsigned 5-digit decimal format Position determined by LCD_SetCursor command

Parameters
n32-bit number to be transferred
textColor16-bit color of the numbers
Returns
none
Note
Fixed format 5 digits with no space before or after

◆ LCD_OutUFix2_1()

void LCD_OutUFix2_1 ( uint32_t  n,
int16_t  textColor 
)

Output a 2-digit fixed-point decimal.

Output a 32-bit number in unsigned 3-digit fixed point, 0.1 resolution numbers 0 to 999 printed as " 0.0" to "99.9" Position determined by LCD_SetCursor command

Parameters
n32-bit number to be transferred
textColor16-bit color of the numbers
Returns
none
Note
Fixed format 4 characters with no space before or after

◆ LCD_OutUHex2()

void LCD_OutUHex2 ( uint32_t  n,
int16_t  textColor 
)

Output a 2-digit hexadecimal number.

Output a 32-bit number in unsigned 2-digit hexadecimal format numbers 0 to 255 printed as "00," to "FF," Position determined by LCD_SetCursor command

Parameters
n32-bit number to be transferred
textColor16-bit color of the numbers
Returns
none
Note
Fixed format 3 characters with comma after

◆ LCD_PlotIncrement()

void LCD_PlotIncrement ( void  )

Moves the plot cursor in time.

Increment the plot between subsequent calls to LCD_PlotPoint(). Automatically wrap and clear the column to be printed to.

Parameters
none
Returns
none
Note
Assumes: LCD_Init() and LCD_Drawaxes() have been called

◆ LCD_PlotPoint()

void LCD_PlotPoint ( int32_t  data1,
uint16_t  color1 
)

Plot one point.

Plot a point on the chart. To plot several points in the same column, call this function repeatedly before calling LCD_PlotIncrement(). The units of the data are the same as the ymax and ymin values specified in the initialization function.

Parameters
data1value to be plotted (units not specified)
color116-bit color for the point, which can be produced by LCD_Color565()
Returns
none
Note
Assumes: LCD_Init() and LCD_Drawaxes() have been called

◆ LCD_SetCursor()

void LCD_SetCursor ( uint32_t  newX,
uint32_t  newY 
)

Move the cursor.

Move the cursor to the desired X- and Y-position. The next character of the next unsigned decimal will be printed here. X=0 is the leftmost column. Y=0 is the top row. The cursor is used by the "Out" functions, but not the "Draw" functions

Parameters
newXnew X-position of the cursor (0<=newX<=20)
newYnew Y-position of the cursor (0<=newY<=12)
Returns
none

◆ LCD_SetTextColor()

void LCD_SetTextColor ( uint16_t  color)

sets the text color

Sets the color in which the characters will be printed Background color is fixed at black

Parameters
color16-bit packed color
Returns
none

◆ LCD_SwapColor()

uint16_t LCD_SwapColor ( uint16_t  x)

Swaps red and blue.

Swaps the red and blue values of the given 16-bit packed color; green is unchanged.

Parameters
x16-bit color in format B, G, R
Returns
16-bit color in format R, G, B