SSD1306 Driver for TivaC
SSD1306 i2c driver for use with Texas Instrument TivaC
Functions
ssd1306.c File Reference

Source file implementing main ssd1306 driver function. More...

#include "ssd1306.h"
#include <assert.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include "inc/hw_i2c.h"
#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/gpio.h"
#include "driverlib/i2c.h"
#include "driverlib/interrupt.h"
#include "driverlib/pin_map.h"
#include "driverlib/sysctl.h"
#include "driverlib/uart.h"
#include "oled_font.h"
#include "ssd1306_info.h"
#include "ssd1306_utils.h"
Include dependency graph for ssd1306.c:

Functions

void ssd1306Init (void)
 Configure the hardware like I2C module to be ready for talking with SSD1306.
 
void ssd1306SwitchDisplay (const bool isOn)
 Turn display on or off. More...
 
void ssd1306TurnOn (const bool isFirstTime)
 Initialize the ssd1306. More...
 
void ssd1306AdjustContrast (const uint8_t contrastVal)
 Adjust contrast of the OLED screen. More...
 
void ssd1306ClearDisplay (void)
 Clear the display and makes it all black. More...
 
void ssd1306SwitchLine (const uint32_t lineNum)
 Change the target line to print. More...
 
void ssd1306PrintPic (const uint8_t *picBitmap, const uint32_t startColCoordinate, const uint32_t endColCoordinate, const uint32_t startPageCoordinate, const uint32_t endPageCoordinate)
 Print picture on oled screen. More...
 
void ssd1306PrintString (const char *stringToPrint, const uint32_t lineNum, const uint32_t startCol, const fontSetDesc fontSet)
 Print string onto oled screen. More...
 

Detailed Description

Source file implementing main ssd1306 driver function.

Author
Khoi Trinh
Version
0.1
Date
2018-11-03

Function Documentation

◆ ssd1306AdjustContrast()

void ssd1306AdjustContrast ( const uint8_t  contrastVal)

Adjust contrast of the OLED screen.

Parameters
contrastValThe contrast value to be set, limited up to 255

◆ ssd1306ClearDisplay()

void ssd1306ClearDisplay ( void  )

Clear the display and makes it all black.

Works by blanking the GDDRAM data with 0

◆ ssd1306PrintPic()

void ssd1306PrintPic ( const uint8_t *  picBitmap,
const uint32_t  startColCoordinate,
const uint32_t  endColCoordinate,
const uint32_t  startPageCoordinate,
const uint32_t  endPageCoordinate 
)

Print picture on oled screen.

Parameters
picBitmapArrays containing the bitmap of the picture
startColCoordinateColumn to start printing
endColCoordinateColumn to stop printing(inclusive)
startPageCoordinatePage to start printing
endPageCoordinatePage to stop printing(inclusive)

◆ ssd1306PrintString()

void ssd1306PrintString ( const char *  stringToPrint,
const uint32_t  lineNum,
const uint32_t  startCol,
const fontSetDesc  fontSet 
)

Print string onto oled screen.

Parameters
stringToPrintCharacter array containing string to print
lineNumThe line at which to print(start at 0), limited by SSD1306_MAX_LINE
startColColumn at which to start printing
fontSetThe struct containing the font set descriptor for fonts to be used

◆ ssd1306SwitchDisplay()

void ssd1306SwitchDisplay ( const bool  isOn)

Turn display on or off.

Parameters
isOnDisplay on if true

◆ ssd1306SwitchLine()

void ssd1306SwitchLine ( const uint32_t  lineNum)

Change the target line to print.

Parameters
lineNumThe line to change to, limited by SSD1306_MAX_LINE

◆ ssd1306TurnOn()

void ssd1306TurnOn ( const bool  isFirstTime)

Initialize the ssd1306.

Do things like configure charge pump, and other require settings to starting up the display