Driver for ST7920 display driver. This library needs you to implement interface control, providing the function pointer to library handle the display.
More...
#include <assert.h>
#include <malloc.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <stdbool.h>
#include <string.h>
#include "st7920_defs.h"
Go to the source code of this file.
|
struct | st7920_t |
| Handler of ST7920. Each display must need your own handler. Yes, this library supports multiples displays. More...
|
|
struct | st7920_params_t |
| Struct to initialize and configure the driver to control the ST7920 peripheral. More...
|
|
|
typedef void(* | fxnDelay_ms) (uint32_t ms) |
| Function pointer definition for milliseconds delay.
|
|
typedef void(* | fxn7920_mtxLock) (void) |
| Function pointer to routine that waits for the mutex and lock it. It's useful on RTOS environments.
|
|
typedef void(* | fxn7920_mtxunlock) (void) |
| Function pointer to routine that unlocks the mutex. It's useful on RTOS environments.
|
|
typedef void(* | fxn1306spi_cs) (uint8_t Signal) |
| Function pointer to routine to control the Chip Select signal. On ST7920, Chip Select is enabled on High signal.
|
|
typedef void(* | fxn1306spi_reset) (uint8_t Signal) |
| Function pointer to routine to control the Reset pin signal.
|
|
typedef uint8_t(* | fxn1306spi_write) (uint8_t *buff, uint32_t len) |
| Function pointer to routine to transmit packets to ST7920 over SPI.
|
|
|
enum | st7920_mode_e { ST7920_MODE_SPI
} |
| Set the Mode of ST7920 display. This device can work on 8bits, 4bits and spi mode, but, here, only the SPI method is implemented, for while. More...
|
|
Driver for ST7920 display driver. This library needs you to implement interface control, providing the function pointer to library handle the display.
- Author
- Pablo Jean Rozario (pablo.nosp@m..jea.nosp@m.n.eel.nosp@m.@gma.nosp@m.il.co.nosp@m.m)
- Version
- v1.0.0
- Date
- 2024-07-02
- Copyright
- Copyright (c) 2024
◆ ST7920_COLOR_BLACK
#define ST7920_COLOR_BLACK 0 |
◆ ST7920_COLOR_WHITE
#define ST7920_COLOR_WHITE 1 |
◆ ST7920_FAIL
◆ ST7920_OK
◆ fxn1306spi_cs
typedef void(* fxn1306spi_cs) (uint8_t Signal) |
Function pointer to routine to control the Chip Select signal. On ST7920, Chip Select is enabled on High signal.
- Note
- Used only in SPI mode.
◆ fxn1306spi_reset
typedef void(* fxn1306spi_reset) (uint8_t Signal) |
Function pointer to routine to control the Reset pin signal.
◆ fxn1306spi_write
typedef uint8_t(* fxn1306spi_write) (uint8_t *buff, uint32_t len) |
Function pointer to routine to transmit packets to ST7920 over SPI.
- Note
- Used only in SPI mode.
◆ fxn7920_mtxLock
typedef void(* fxn7920_mtxLock) (void) |
Function pointer to routine that waits for the mutex and lock it. It's useful on RTOS environments.
- Note
- If driver calls are made over multiple threads, do not omit this.
◆ fxn7920_mtxunlock
typedef void(* fxn7920_mtxunlock) (void) |
Function pointer to routine that unlocks the mutex. It's useful on RTOS environments.
- Note
- If driver calls are made over multiple threads, do not omit this.
◆ fxnDelay_ms
typedef void(* fxnDelay_ms) (uint32_t ms) |
Function pointer definition for milliseconds delay.
- Parameters
-
ms | Amount of milliseconds to wait. |
◆ st7920_mode_e
Set the Mode of ST7920 display. This device can work on 8bits, 4bits and spi mode, but, here, only the SPI method is implemented, for while.
Enumerator |
---|
ST7920_MODE_SPI | Initialize ST7920 in SPI mode and serial communication.
|
◆ ST7920_Fill()
uint8_t ST7920_Fill |
( |
st7920_t * | st7920, |
|
|
uint8_t | color ) |
- Parameters
-
- Returns
- uint8_t
◆ ST7920_Init()
- Parameters
-
- Returns
- uint8_t
◆ ST7920_Refresh()
uint8_t ST7920_Refresh |
( |
st7920_t * | st7920 | ) |
|
- Parameters
-
- Returns
- uint8_t
◆ ST7920_SetFrameBuffer()
uint8_t ST7920_SetFrameBuffer |
( |
st7920_t * | st7920, |
|
|
uint8_t * | pu8FrameBuffer ) |
- Parameters
-
- Returns
- uint8_t
◆ ST7920_Write()
uint8_t ST7920_Write |
( |
st7920_t * | st7920, |
|
|
uint32_t | x, |
|
|
uint32_t | y, |
|
|
bool | color ) |
- Parameters
-
- Returns
- uint8_t