esp32-warm-water
esp32 based project for the control of a heating element based on temperature
Macros | Functions
ssd1306_spi.c File Reference

implementations of functions for setting up, interacting with and sending commands to an ssd1306 driven screen via spi More...

#include <string.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/spi_master.h"
#include "driver/gpio.h"
#include "esp_log.h"
#include "ssd1306.h"
Include dependency graph for ssd1306_spi.c:

Go to the source code of this file.

Macros

#define tag   CONFIG_SSD1306_SPI_TAG
 tag for logging library More...
 

Functions

void spi_master_init (SSD1306_t *dev, int16_t GPIO_MOSI, int16_t GPIO_SCLK, int16_t GPIO_CS, int16_t GPIO_DC, int16_t GPIO_RESET)
 
bool spi_master_write_byte (spi_device_handle_t SPIHandle, const uint8_t *Data, size_t DataLength)
 
bool spi_master_write_command (SSD1306_t *dev, uint8_t Command)
 
bool spi_master_write_data (SSD1306_t *dev, const uint8_t *Data, size_t DataLength)
 
void spi_init (SSD1306_t *dev, int width, int height)
 
void spi_display_image (SSD1306_t *dev, int page, int seg, uint8_t *images, int width)
 
void spi_contrast (SSD1306_t *dev, int contrast)
 
void spi_hardware_scroll (SSD1306_t *dev, ssd1306_scroll_type_t scroll)
 
void spi_hardware_scroll_line (SSD1306_t *dev, int page, ssd1306_scroll_type_t scroll)
 

Detailed Description

implementations of functions for setting up, interacting with and sending commands to an ssd1306 driven screen via spi

Definition in file ssd1306_spi.c.

Macro Definition Documentation

◆ tag

#define tag   CONFIG_SSD1306_SPI_TAG

tag for logging library

Definition at line 42 of file ssd1306_spi.c.

Function Documentation

◆ spi_contrast()

void spi_contrast ( SSD1306_t dev,
int  contrast 
)

set the contrast of the screen

Parameters
devthe screen device to interact with
contrastthe level of contrast

Definition at line 258 of file ssd1306_spi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ spi_display_image()

void spi_display_image ( SSD1306_t dev,
int  page,
int  seg,
uint8_t *  images,
int  width 
)

display an image on the screen

Parameters
devthe screen device to interact with
pagethe line to display the image on
segthe segment of the image
imagesthe image data to display
widththe width of the image

Definition at line 226 of file ssd1306_spi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ spi_hardware_scroll()

void spi_hardware_scroll ( SSD1306_t dev,
ssd1306_scroll_type_t  scroll 
)

send the command for a continues scroll via hardware

Parameters
devthe screen device to interact with
scrollthe direction of the scroll

Definition at line 275 of file ssd1306_spi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ spi_hardware_scroll_line()

void spi_hardware_scroll_line ( SSD1306_t dev,
int  page,
ssd1306_scroll_type_t  scroll 
)

send the command for a continues scroll via hardware

Parameters
devthe screen device to interact with
pagethe specific page to scroll
scrollthe direction of the scroll

Definition at line 352 of file ssd1306_spi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ spi_init()

void spi_init ( SSD1306_t dev,
int  width,
int  height 
)

initialise the screen spi session

Parameters
devthe screen device to interact with
widththe width of the screen
heightthe height of the screen

Definition at line 165 of file ssd1306_spi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ spi_master_init()

void spi_master_init ( SSD1306_t dev,
int16_t  GPIO_MOSI,
int16_t  GPIO_SCLK,
int16_t  GPIO_CS,
int16_t  GPIO_DC,
int16_t  GPIO_RESET 
)

initialise an spi device

Parameters
devthe device to interact with
GPIO_MOSIthe pin to use for GPIO_MOSI
GPIO_SCLKthe pin to use for GPIO_SCLK
GPIO_CSthe pin to use for GPIO_CS
GPIO_DCthe pin to use for GPIO_DC
GPIO_RESETthe pin to use for GPIO_RESET

Definition at line 65 of file ssd1306_spi.c.

Here is the caller graph for this function:

◆ spi_master_write_byte()

bool spi_master_write_byte ( spi_device_handle_t  SPIHandle,
const uint8_t *  Data,
size_t  DataLength 
)

write a byte to the spi device

Parameters
SPIHandlethe spi device to interact with
Datathe data being sent
DataLengththe length of the data being sent

Definition at line 119 of file ssd1306_spi.c.

◆ spi_master_write_command()

bool spi_master_write_command ( SSD1306_t dev,
uint8_t  Command 
)

write a command to the screen

Parameters
devthe screen device to interact with
Commandthe command being sent

Definition at line 139 of file ssd1306_spi.c.

Here is the caller graph for this function:

◆ spi_master_write_data()

bool spi_master_write_data ( SSD1306_t dev,
const uint8_t *  Data,
size_t  DataLength 
)

write data to the screen

Parameters
devthe screen device to interact with
Datathe data being sent
DataLengththe length of the data being sent

Definition at line 153 of file ssd1306_spi.c.

Here is the caller graph for this function: