SSD1306 Driver for TivaC
SSD1306 i2c driver for use with Texas Instrument TivaC
|
Driver for the SSD1306 OLED controller for the TivaC.
This a pretty simple driver, communication with the ssd1306 is detailed in the datasheet and most functions simply follow that. The font creator script was designed to be easy to use and require almost no work to integrate the result.
This project is a ccs project, setting up ccs is outside the scope of this README so consult TI documentation for that
This driver uses the Tivaware support package from TI for the low level works so to run this you need to have this in the compile PATH
Icon and Images are recommended to have black background and be mainly black and white, icons like this have a better chance of working well:
Credits: Icons made by Google from https://www.flaticon.com/ (a very good site to get black background icons)
Making the dimension symmetric like 16x16 gives good results, this driver does support drawing partial image but it's recommended to pre-crop before inserting the bit map into the firmware
Resize your picture if you need to, then go to this site, depending on your picture, pick Horizontal or Vertical in the Output section(just do trial and error if you are not sure), copy the images in to a bitmap array and use it like this:
This driver comes with a python script called create_new_font.py that allows converting a c array bitmap to a struct that is used by the firmware
The python script will take a raw c bitmap file and converts to struct used by firmware, the struct you will be interested in will be in the form of font_name_set, where font_name is supplied as the second argument of the python script and is declared in src/oled_font_font_name.h
By default, the raw c font file has incosistent whitespace in them, the script will remove those whitespace as well as put the raw array into source files ready to be integrated into the firmware
This repo comes with an example font called source_pro.
Steps:
Huge thanks to Adafruit SSD1306 library for providing the detailed steps needed for initializing the ssd1306 as well as for the macro definitions