PololuOLED library
Public Member Functions | List of all members
PololuSH1106Core Class Reference

SH1106 core class implemented using Arduino I/O functions. More...

#include <PololuSH1106.h>

Public Member Functions

void setPins (uint8_t clk, uint8_t mos, uint8_t res=255, uint8_t dc=255, uint8_t cs=255)
 Configures what pins this class will use. More...
 
void initPins ()
 This function is called by PololuSH1106Main to perform any initializations that might be needed for the other functions to work properly. More...
 
void reset ()
 This function is called by PololuSH1106Main to reset the SH1106. More...
 
void sh1106TransferStart ()
 This function is called by PololuSH1106Main to start a data transfer to the SH1106. More...
 
void sh1106TransferEnd ()
 This function is called by PololuSH1106Main to end a data transfer to the SH1106. More...
 
void sh1106CommandMode ()
 This function is called by PololuSH1106Main to indicate that the bytes it is about to pass to sh1106Write are command bytes. More...
 
void sh1106DataMode ()
 This function is called by PololuSH1106Main to indicate that the bytes it is about to pass to sh1106Write are data bytes. More...
 
void sh1106Write (uint8_t d)
 This function is called by PololuSH1106Main to write commands or data to the SH1106. More...
 

Detailed Description

SH1106 core class implemented using Arduino I/O functions.

This is a core class for use as the template parameter for PololuSH1106Main. It shows how to implement the low-level SH1106 communication routines needed by PololuSH1106Main using standard Arduino I/O functions.

This class should work on any Arduino-compatible board, but it does not have ideal performance. In 8x2 text+graphics mode on an ATmega32U4 running at 16 MHz, updating the full screen takes about 110 ms. You can speed this up by about 15 times by using an optimized class that directly writes to specific I/O registers instead of using this class.

Definition at line 20 of file PololuSH1106.h.

Member Function Documentation

◆ initPins()

void PololuSH1106Core::initPins ( )
inline

This function is called by PololuSH1106Main to perform any initializations that might be needed for the other functions to work properly.

Definition at line 42 of file PololuSH1106.h.

◆ reset()

void PololuSH1106Core::reset ( )
inline

This function is called by PololuSH1106Main to reset the SH1106.

Definition at line 53 of file PololuSH1106.h.

◆ setPins()

void PololuSH1106Core::setPins ( uint8_t  clk,
uint8_t  mos,
uint8_t  res = 255,
uint8_t  dc = 255,
uint8_t  cs = 255 
)
inline

Configures what pins this class will use.

This function should be called at the beginning of your program before any functions that use the pins.

For documentation of each parameter, see PololuSH1106::PololuSH1106().

Definition at line 29 of file PololuSH1106.h.

◆ sh1106CommandMode()

void PololuSH1106Core::sh1106CommandMode ( )
inline

This function is called by PololuSH1106Main to indicate that the bytes it is about to pass to sh1106Write are command bytes.

Definition at line 85 of file PololuSH1106.h.

◆ sh1106DataMode()

void PololuSH1106Core::sh1106DataMode ( )
inline

This function is called by PololuSH1106Main to indicate that the bytes it is about to pass to sh1106Write are data bytes.

Definition at line 93 of file PololuSH1106.h.

◆ sh1106TransferEnd()

void PololuSH1106Core::sh1106TransferEnd ( )
inline

This function is called by PololuSH1106Main to end a data transfer to the SH1106.

Definition at line 78 of file PololuSH1106.h.

◆ sh1106TransferStart()

void PololuSH1106Core::sh1106TransferStart ( )
inline

This function is called by PololuSH1106Main to start a data transfer to the SH1106.

After calling this function, PololuSH1106Main will call sh1106CommandMode(), sh1106DataMode(), and sh1106Write() to send data to the SH1106, and then it will call sh1106TransferEnd() when it is done.

Definition at line 68 of file PololuSH1106.h.

◆ sh1106Write()

void PololuSH1106Core::sh1106Write ( uint8_t  d)
inline

This function is called by PololuSH1106Main to write commands or data to the SH1106.

Definition at line 101 of file PololuSH1106.h.


The documentation for this class was generated from the following file: