no-OS
Loading...
Searching...
No Matches
ssd_1306.h File Reference

Header file for ssd_1306 Driver. More...

#include <stdint.h>
#include <stdlib.h>
#include "display.h"
#include "no_os_gpio.h"
Include dependency graph for ssd_1306.h:

Classes

struct  ssd_1306_extra
 Extra parameters needed for ssd_1306 usage. More...
 

Macros

#define SSD1306_I2C_ADDR   0x3C
 
#define SSD1306_ROTATION   0
 
#define SSD1306_SEG_REMAP_CMD    (0xA0U | (((SSD1306_ROTATION) == 180) ? 0x01U : 0x00U))
 
#define SSD1306_COM_SCAN_CMD    (0xC0U | (((SSD1306_ROTATION) == 180) ? 0x08U : 0x00U))
 

Typedefs

typedef struct ssd_1306_extra ssd_1306_extra
 

Enumerations

enum  comm_type {
  SSD1306_I2C ,
  SSD1306_SPI
}
 
enum  transmit_type {
  SSD1306_CMD ,
  SSD1306_DATA
}
 

Functions

int32_t ssd_1306_init (struct display_dev *device)
 Initializes ssd_1306 for display screening.
 
int32_t ssd_1306_display_on_off (struct display_dev *device, uint8_t on_off)
 ssd_1306 turns display on/off.
 
int32_t ssd_1306_move_cursor (struct display_dev *device, uint8_t row, uint8_t column)
 Moves cursor to desired row/column.
 
int32_t ssd_1306_print_ascii (struct display_dev *device, uint8_t ascii, uint8_t row, uint8_t column)
 Prints character at selected position.
 
int32_t ssd_1306_remove (struct display_dev *device)
 Removes resources allocated by device.
 
int32_t ssd_1306_print_buffer (struct display_dev *device, char *buffer)
 Print entire screen buffer.
 

Variables

const struct display_controller_ops ssd1306_ops
 

Detailed Description

Header file for ssd_1306 Driver.

Author
Andrei Porumb (andre.nosp@m.i.po.nosp@m.rumb@.nosp@m.anal.nosp@m.og.co.nosp@m.m)

Copyright 2021(c) Analog Devices, Inc.

SPDX-License-Identifier: BSD-3-Clause

Macro Definition Documentation

◆ SSD1306_COM_SCAN_CMD

#define SSD1306_COM_SCAN_CMD    (0xC0U | (((SSD1306_ROTATION) == 180) ? 0x08U : 0x00U))

◆ SSD1306_I2C_ADDR

#define SSD1306_I2C_ADDR   0x3C

◆ SSD1306_ROTATION

#define SSD1306_ROTATION   0

◆ SSD1306_SEG_REMAP_CMD

#define SSD1306_SEG_REMAP_CMD    (0xA0U | (((SSD1306_ROTATION) == 180) ? 0x01U : 0x00U))

Typedef Documentation

◆ ssd_1306_extra

typedef struct ssd_1306_extra ssd_1306_extra

Enumeration Type Documentation

◆ comm_type

enum comm_type
Enumerator
SSD1306_I2C 
SSD1306_SPI 

◆ transmit_type

Enumerator
SSD1306_CMD 
SSD1306_DATA 

Function Documentation

◆ ssd_1306_display_on_off()

int32_t ssd_1306_display_on_off ( struct display_dev * device,
uint8_t on_off )

ssd_1306 turns display on/off.

ssd_1306 ssd_1306 turns display on/off.

Parameters
device- The device structure
on_off- Display state
Returns
Returns 0 in case of success or negative error code otherwise.

◆ ssd_1306_init()

int32_t ssd_1306_init ( struct display_dev * device)

Initializes ssd_1306 for display screening.

Initialize the ssd_1306 peripheral for display operation.

Parameters
device- The device structure.
Returns
Returns 0 in case of success or negative error code otherwise.

◆ ssd_1306_move_cursor()

int32_t ssd_1306_move_cursor ( struct display_dev * device,
uint8_t row,
uint8_t column )

Moves cursor to desired row/column.

Parameters
device- The device structure
row- row
column- column
Returns
Returns 0 in case of success or negative error code otherwise.

◆ ssd_1306_print_ascii()

int32_t ssd_1306_print_ascii ( struct display_dev * device,
uint8_t ascii,
uint8_t row,
uint8_t column )

Prints character at selected position.

Prints character at selected position.

Parameters
device- The device structure.
ascii- corresponding number to ascii table
row- row
column- column
Returns
Returns 0 in case of success or negative error code otherwise.

◆ ssd_1306_print_buffer()

int32_t ssd_1306_print_buffer ( struct display_dev * device,
char * buffer )

Print entire screen buffer.

Print entire screen buffer

Parameters
device- The device structure.
buffer- The buffer to be printed.
Returns
Returns 0 in case of success or negative error code otherwise.

◆ ssd_1306_remove()

int32_t ssd_1306_remove ( struct display_dev * device)

Removes resources allocated by device.

Removes resources allocated by device.

Parameters
device- The device structure.
Returns
Returns 0 in case of success or negative error code otherwise.

Variable Documentation

◆ ssd1306_ops

const struct display_controller_ops ssd1306_ops
extern