Giter Club home page Giter Club logo

gbj_aip1640's Introduction

gbj_aip1640

Library for utilizing 8 x 16 blue LED matrix display modules WMA451 with AiP1640 controller.

  • The controller's communication protocol is dubbed as I2C, but in fact it is a dedicated simple serial protocol utilizing serial clock and data bus. It is not official I2C protocol due to lack of a bus address and acknowledgment.
  • The serial protocol is one-way communication protocol without any feedback from the controller to an MCU for garanted transmission.
  • The library should be considered as a hardware driver for the controller, because it offers methods for utilizing only direcly implemented features of the controller, i.e., sending a byte or a stream of bytes to the controller. Displaying various patterns, symbols, fonts, etc., and manipulation with them on the matrix display is a matter of appropriate application or project libraries.

Constants

The library does not utilized any error codes, so that it has no constants for them. On the other hand it has constants for geometry of the matrix.

  • Geometry::ROWS: Number of rows on the matrix. It determines the number of LEDs in a matrix's column. A column can be represented by a single data byte.
  • Geometry::COLUMNS: Number of columns on the matrix. It determines the number of data bytes in a data byte stream.

Referencing constants

In a sketch the constants can be referenced in following forms:

  • Static constant in the form gbj_aip1640::<enumeration>::<constant> or shortly gbj_aip1640::<constant>, e.g., gbj_aip1640::Geometry::ROWS or gbj_aip1640::COLUMNS.
  • Instance constant in the form <object>.<constant>, e.g., disp.COLUMNS.

Interface

Setters

Getters

gbj_aip1640()

Description

The constructor method stores physical features of the display for the sake of a sketch to the class instance object.

Syntax

gbj_aip1640(uint8_t pinSclk, uint8_t pinDin)

Parameters

  • pinSclk: Microcontroller pin's number utilized as a serial clock of the controller.

    • Valid values: non-negative integer (according to a microcontroller datasheet)
    • Default value: 2
  • pinDin: Microcontroller pin's number utilized as a data input of the controller.

    • Valid values: non-negative integer (according to a microcontroller datasheet)
    • Default value: 3

Returns

The library instance object for display processing.

Back to interface

begin()

Description

The method sets the pins for the controller, clears the matrix and sets the default contrast of the display.

Syntax

void begin()

Parameters

None

Returns

None

Back to interface

display()

Description

The method is overloaded and sends either single byte or a byte stream to the controller.

  • The new content of the matrix stays unchanged until another data transmission.
  • The method utilizes automatic addressing mode of the driver for byte stream transmission and fixed addressing for single byte transmission.

Syntax

void display(uint8_t dataByte, uint8_t address)
void display(uint8_t *dataBuffer, uint8_t dataBytes, uint8_t address)

Parameters

  • dataByte: Single byte with the display pattern for particular column.

    • Valid values: 0 ~ 255
    • Default value: None
  • dataBuffer: Pointer to a byte array with display patterns for subsequent columns.

    • Valid values: microcontroller's addressing range
    • Default value: None
  • dataBytes: Number of bytes to be sent to the controller from the byte array. It determines the number of columns to be updated in the matrix. That number is limited to the remaining count of columns to the end of the matrix from the starting column defined by the address parameter.

  • address: Number of a column where a single byte should be displayed of where the byte array should start.

Returns

None

See also

displayOn(), displayOn(), displayToggle()

Back to interface

displayOn(), displayOff(), displayToggle()

Description

Corresponding method either turns on or off the entire display module or toggles its state without changing current contrast level.

  • All methods are suitable for making a display module blinking.

Syntax

void displayOn()
void displayOff()
void displayToggle()

Parameters

None

Returns

None

See also

display()

isDisplayOn(), isDisplayOff()

Back to interface

displayFill()

Description

The method fills the entire matrix with provided byte, i.e., column pattern.

Syntax

void displayFill(uint8_t dataByte)

Parameters

  • dataByte: Single byte with display pattern for all columns.
    • Valid values: 0 ~ 255
    • Default value: None

Returns

None

See also

displayClear()

Back to interface

displayClear()

Description

The method clears the entire matrix.

  • It is a wrapper method for method displayFill() with zero data byte.

Syntax

void displayClear()

Parameters

None

Returns

None

See also

displayFill()

Back to interface

setContrast(), setContrastMin(), setContrastMax()

Description

The corresponding method sets the respective level of the display contrast.

  • The contrast is perceived as the brightness of the display.
  • The methods for extreme contrasts are just for convenience.

Syntax

void setContrast(uint8_t contrast)
void setContrastMin()
void setContrastMax()

Parameters

  • contrast: Level of contrast/brightness.

Returns

None

See also

getContrast()

Back to interface

getContrast(), getContrastMin(), getContrastMax()

Description

The corresponding method returns the respective level of the display contrast stored in the library instance object.

  • Methods for extreme contrasts are static.

Syntax

uint8_t getContrast()
uint8_t getContrastMin()
uint8_t getContrastMax()

Parameters

None

Returns

Current or extreme contrast level.

See also

setContrast()

Back to interface

isDisplayOn(), isDisplayOff()

Description

Corresponding method returns a logical flag about current state of the display.

Syntax

bool isDisplayOn()
bool isDisplayOff()

Parameters

None

Returns

Flag about display state.

See also

displayOn(), displayOff(), displayToggle()

Back to interface

gbj_aip1640's People

Contributors

mrkale avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.