Implementation of ssd_1306 Driver.
More...
#include <stdbool.h>
#include "ssd_1306.h"
#include "no_os_error.h"
#include "no_os_spi.h"
#include "no_os_i2c.h"
#include "no_os_delay.h"
#include <string.h>
|
| int32_t | ssd1306_buffer_transmit (ssd_1306_extra *extra_param, uint8_t *command, int length, enum transmit_type is_data) |
| |
| 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.
|
| |
Implementation of 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
◆ SSD1306_CHARSZ
| #define SSD1306_CHARSZ 8U |
◆ SSD1306_DC_CMD
| #define SSD1306_DC_CMD 0U |
◆ SSD1306_DC_DATA
| #define SSD1306_DC_DATA 1U |
◆ SSD1306_DISP_OFF
| #define SSD1306_DISP_OFF 0xAEU |
◆ SSD1306_DISP_ON
| #define SSD1306_DISP_ON 0xAFU |
◆ SSD1306_RST_OFF
| #define SSD1306_RST_OFF 1U |
◆ SSD1306_RST_ON
| #define SSD1306_RST_ON 0U |
◆ ssd1306_buffer_transmit()
◆ 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.
- Parameters
-
| device | - The device structure |
| on_off | - Display state |
- Returns
- Returns 0 in case of success or negative error code otherwise.
◆ ssd_1306_init()
Initializes ssd_1306 for display screening.
- 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.
- 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.
- 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()
Removes resources allocated by device.
- Parameters
-
| device | - The device structure. |
- Returns
- Returns 0 in case of success or negative error code otherwise.
◆ no_os_chr_8x8
| const uint8_t no_os_chr_8x8[128][8] |
|
extern |
◆ ssd1306_ops
Initial value:= {
}
int32_t ssd_1306_print_ascii(struct display_dev *device, uint8_t ascii, uint8_t row, uint8_t column)
Prints character at selected position.
Definition ssd_1306.c:283
int32_t ssd_1306_print_buffer(struct display_dev *device, char *buffer)
Print entire screen buffer.
Definition ssd_1306.c:337
int32_t ssd_1306_remove(struct display_dev *device)
Removes resources allocated by device.
Definition ssd_1306.c:305
int32_t ssd_1306_display_on_off(struct display_dev *device, uint8_t on_off)
ssd_1306 turns display on/off.
Definition ssd_1306.c:231
int32_t ssd_1306_move_cursor(struct display_dev *device, uint8_t row, uint8_t column)
Moves cursor to desired row/column.
Definition ssd_1306.c:250
int32_t ssd_1306_init(struct display_dev *device)
Initializes ssd_1306 for display screening.
Definition ssd_1306.c:81