Giter VIP home page Giter VIP logo

lcd's Introduction

Arsen Gharagyozyan (arsdever) Arsen Gharagyozyan (arsdever)

Switch to Dark mode for better experience 😊

By the time mostly focused on Gamify

Find me on social networks

Tools and technologies

Now listening to 🎧

spotify-github-profile

lcd's People

Contributors

arsdever avatar sirinoks avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

sirinoks

lcd's Issues

Log output in GUI

Provide a widget that will allow the user to see the logs from the components. It will enable the user to troubleshoot the issues they are facing.

Dependencies

Acceptance criteria

  • the log window button shows up on the status bar
  • when clicking on the log window button, the log viewer widget pops up
  • the log viewer widget shows already logged and still incoming messages

[bug] `log_history_model` causes the app to crash

Describe the bug

The app sometimes just crashes when the mouse is hovering at the log viewer widget when the app is started. The mouse position may have nothing to do with the actual crash. One of the causes is the internal pointer of the data is pointing to an invalid address when it's being interpreted as a string

To Reproduce

Start the application while having the mouse pointer at the place where the log viewer widget should be spawned.

Expected behavior

There is no crash.

Desktop (please complete the following information):

  • OS Windows 11
  • OS version 10.0.22000
  • Commit hash 0e6fbf3

`function_set`

From HD44780U documentation

Function Set

DL

Sets the interface data length. Data is sent or received in 8-bit lengths (DB7 to DB0) when DL is 1,
and in 4-bit lengths (DB7 to DB4) when DL is 0.When 4-bit length is selected, data must be sent or
received twice.

N

Sets the number of display lines.

F

Sets the character font.
Note: Perform the function at the head of the program before executing any instructions (except for the
read busy flag and address instruction). From this point, the function set instruction cannot be
executed unless the interface data length is changed.

Table 8

N F No. of Display Lines Character Font Duty Factor Remarks
0 0 1 5 Γ— 8 dots 1/8
0 1 1 5 Γ— 10 dots 1/11
1 * 2 5 Γ— 8 dots 1/16 Cannot display two lines for 5 Γ— 10 dot character font

Note: * Indicates don’t care

[imp] Add some documentation

Description

The code lacks in-code documentation and it's necessary to be added. It will not only improve the development process of the other contributors but also can be used later for the documentation generation process. Proper guidelines should be defined on where and how to put the in-code documentation and the format which needs to be followed.

Expectation

The code is properly documented with in-code documentation.

Improve callback connection mechanism

As for now, connections (non Qt) are made by holding a pointer of the callback function and calling it back as required. A better solution is needed for handling that behavior, which will enable multiple connections to a single event and availability to be disconnected when required.

[qt_gui] Improve the display drawings

Improve the visuals of the widget by implementing the following

  • draw a PCB like design as the background
  • draw a encloser for the display
  • update the paddings/margins
  • implement the contrast adjustment
  • implement the brightness adjustment

`lcd_controller` class lacks tests

Introduce some tests which covers the basic functionality of the class, including:

  • the instructions
  • timing
  • symbols
  • edge cases
  • flags
  • behavior

Provide logos for log viewer widget

The following icons are required for the log viewer widget

  • for info log messages
  • for warning log messages
  • for error log messages
  • for the clear all button

[ftr] Add `4 bit` interface support

Description

As the HD44780 datasheet states, it's possible to have 2 types of interfaces to interact with the display:

  • 4 bit
  • 8 bit

The 8 bit one is already implemented, but 4 bit one is missing.

Acceptance criteria

It's possible to manipulate the display using 4 bit interface and the display behaves as the datasheet specifies.

`return_home`

From HD44780U documentation

Return Home

Return home sets DDRAM address 0 into the address counter, and returns the display to its original status
if it was shifted. The DDRAM contents do not change.
The cursor or blinking go to the left edge of the display (in the first line if 2 lines are displayed).

`cursor_or_display_shift`

From HD44780U documentation

Cursor or Display Shift

Cursor or display shift shifts the cursor position or display to the right or left without writing or reading
display data (Table 7). This function is used to correct or search the display. In a 2-line display, the cursor
moves to the second line when it passes the 40th digit of the first line. Note that the first and second line
displays will shift at the same time.
When the displayed data is shifted repeatedly each line moves only horizontally. The second line display
does not shift into the first line position.
The address counter (AC) contents will not change if the only action performed is a display shift.

Table 7

S/C R/L Details
0 0 Shifts the cursor position to the left. (AC is decremented by one.)
0 1 Shifts the cursor position to the right. (AC is incremented by one.)
1 0 Shifts the entire display to the left. The cursor follows the display shift.
1 1 Shifts the entire display to the right. The cursor follows the display shift.

Step function for timer

In order to better diagnose/debug the behavior of the module, a step functionality is needed. This functionality will allow the customer to run the simulation with discrete steps and investigate the state of the module (CGRAM, DDRAM and etc).

Dependencies

Acceptance criteria

  • on the timer control toolbar there are 3 buttons and the slider
  • the slider changes the timer prescaler
  • one of the buttons pauses the simulation
  • one of the buttons resumes the simulation
  • one of the buttons steps through the simulation by an increment set by prescaler
  • the icons should match the provided ones

[bug] Weird outline on the `voltage` info of the pin tooltip

Describe the bug

The voltage text on pin tooltip gets an outline.

To Reproduce

Steps to reproduce the behavior:

  1. Start the application
  2. Hover on a pin that is changing its voltage
  3. Wait until the pin gets its voltage changed

Expected behavior

The voltage text is updated without any outlines

Screenshots

outline_bug_highlight

Desktop (please complete the following information):

  • OS: any
  • OS version: -
  • Commit hash: 952a83a

`set_ddram_address`

From HD44780U documentation

Set DDRAM Address

Set DDRAM address sets the DDRAM address binary AAAAAAA into the address counter.
Data is then written to or read from the MPU for DDRAM.
However, when N is 0 (1-line display), AAAAAAA can be 00H to 4FH. When N is 1 (2-line display),
AAAAAAA can be 00H to 27H for the first line, and 40H to 67H for the second line.

`read_data_from_cg_or_ddram`

From HD44780U documentation

Read Data from CG or DDRAM

Read data from CG or DDRAM reads 8-bit binary data DDDDDDDD from CG or DDRAM.

The previous designation determines whether CG or DDRAM is to be read. Before entering this read
instruction, either CGRAM or DDRAM address set instruction must be executed. If not executed, the first
read data will be invalid. When serially executing read instructions, the next address data is normally read
from the second read. The address set instructions need not be executed just before this read instruction
when shifting the cursor by the cursor shift instruction (when reading out DDRAM). The operation of the
cursor shift instruction is the same as the set DDRAM address instruction.

After a read, the entry mode automatically increases or decreases the address by 1. However, display shift
is not executed regardless of the entry mode.

Note:
The address counter (AC) is automatically incremented or decremented by 1 after the write
instructions to CGRAM or DDRAM are executed. The RAM data selected by the AC cannot be
read out at this time even if read instructions are executed. Therefore, to correctly read data,
execute either the address set instruction or cursor shift instruction (only with DDRAM), then just
before reading the desired data, execute the read instruction from the second time the read
instruction is sent.

`entry_mode_set`

From HD44780U documentation

Entry Mode Set

I/D

Increments (I/D = 1) or decrements (I/D = 0) the DDRAM address by 1 when a character code is
written into or read from DDRAM.

The cursor or blinking moves to the right when incremented by 1 and to the left when decremented by 1.
The same applies to writing and reading of CGRAM.

S

Shifts the entire display either to the right (I/D = 0) or to the left (I/D = 1) when S is 1. The display does
not shift if S is 0.

If S is 1, it will seem as if the cursor does not move but the display does. The display does not shift when
reading from DDRAM. Also, writing into or reading out from CGRAM does not shift the display.

Improve the logging

The logging of the base should be improved in the way that it better uses the flexibility of the logger, so it uses the log levels in a more accurate way. As for now, lcd_controller traces every time it has an incoming signal and some high level debugging is missing in order to filter out necessary and unnecessary information.

Further refine this task and add subtasks as needed:

[imp] Cleanup warnings in the code

Description

The build process throws some warnings. It's needed to clean those warnings and bump up the warning level and prepare the build to treat the warnings as errors for clean coding.

Expectation

No warnings are thrown when the app is built.

[imp] Make the timer/scheduler to have precision alongside real-time speed

Description

There are 2 types of timers:

  • realtime_timer
  • step_timer
    Each one of them has its own role. What is required is kind of the combination of those two timers: a timer, which runs in real time but also has a bigger precision. This is achievable with the introduction of fps in the scheduler's loop. With that, the scheduler tick will be triggered with custom frequency, and with each tick, a dedicated amount of timesteps may be simulated.

Expectation

It's possible to set real-time simulation speed and simulation accuracy.

Improve the mechanism of connecting ports/pins

In order to further develop the project, we will need a better way of connecting a port to another one. This will also improve the way the pinout visualization implementation is given.

`read_busy_flag_and_address`

From HD44780U documentation

Read Busy Flag and Address

Read busy flag and address reads the busy flag (BF) indicating that the system is now internally operating
on a previously received instruction. If BF is 1, the internal operation is in progress. The next instruction
will not be accepted until BF is reset to 0. Check the BF status before the next write operation. At the same
time, the value of the address counter in binary AAAAAAA is read out. This address counter is used by
both CG and DDRAM addresses, and its value is determined by the previous instruction. The address
contents are the same as for instructions set CGRAM address and set DDRAM address.

Prototypes file

Create a prototypes file for each one of the projects which will contain the forward declarations of the classes and typedefs of their pointer types in that project.

// <project_name>_prototypes.h
class project_class;
using project_class_ptr = std::shared_ptr<project_class>;
using project_class_wptr = std::weak_ptr<project_class>;
using project_class_uptr = std::unique_ptr<project_class>;

[imp] Improve the testing framework

Description

Boost tests are not found by the Visual Studio. Also, when running cmake test it doesn't see any tests. For that purpose, it's needed to improve the test framework.

Expectation

cmake test executes the test app and reports the results.

Create a log viewer widget

To enable the user to see the log messages, a log viewer widget is required.

Dependencies

Acceptance criteria

  • the widget is able to be notified for incoming messages and update its content correspondingly
  • the widget shows the date/time of the message separate from the message itself
  • the widget always stays on top of the main application screen
  • the user is able to copy the log message
  • the user is able to clear the message stack
  • different levels of logs have different icons

Tooltips for pins

Description

Create a custom tooltip widget, which will show up when the mouse is hovering a pin. This tooltip should show some information about the pin, such as:

  • the pin number in the port (pinout index)
  • the pin name
  • the connection name
  • the connected pin name
  • the connected pin id
  • current voltage
  • logic state

Acceptance criteria

  • the tooltip shows up when the mouse is hovering a pin for some time
  • the above-listed information is available
  • the tooltip design matches the design of the application

`clear`

From HD44780U documentation

Clear Display

Clear display writes space code 20H (character pattern for character code 20H must be a blank pattern) into
all DDRAM addresses. It then sets DDRAM address 0 into the address counter, and returns the display to
its original status if it was shifted. In other words, the display disappears and the cursor or blinking goes to
the left edge of the display (in the first line if 2 lines are displayed). It also sets I/D to 1 (increment mode)
in entry mode. S of entry mode does not change

Cleanup the `port` class

  • move out the pin class from port class
  • improve the pin class by adding name, index, connections fields into it

[ftr] Add support for `linux`

Description

The project needs to be built for linux OS as well.

Acceptance criteria

  • It's possible to build and run the app on linux machine.

Implement cursor_or_display_shift instruction

From HD44780U documentation

Cursor or Display Shift

Cursor or display shift shifts the cursor position or display to the right or left without writing or reading
display data (Table 7). This function is used to correct or search the display. In a 2-line display, the cursor
moves to the second line when it passes the 40th digit of the first line. Note that the first and second line
displays will shift at the same time.
When the displayed data is shifted repeatedly each line moves only horizontally. The second line display
does not shift into the first line position.
The address counter (AC) contents will not change if the only action performed is a display shift.

Table 7

S/C R/L Details
0 0 Shifts the cursor position to the left. (AC is decremented by one.)
0 1 Shifts the cursor position to the right. (AC is incremented by one.)
1 0 Shifts the entire display to the left. The cursor follows the display shift.
1 1 Shifts the entire display to the right. The cursor follows the display shift.

`display_on_off_control`

From HD44780U documentation

Display On/Off Control

D

The display is on when D is 1 and off when D is 0. When off, the display data remains in DDRAM, but
can be displayed instantly by setting D to 1.

C

The cursor is displayed when C is 1 and not displayed when C is 0. Even if the cursor disappears, the
function of I/D or other specifications will not change during display data write. The cursor is displayed
using 5 dots in the 8th line for 5 Γ— 8 dot character font selection and in the 11th line for the 5 Γ— 10 dot
character font selection (Figure 13).

B

The character indicated by the cursor blinks when B is 1 (Figure 13). The blinking is displayed as
switching between all blank dots and displayed characters at a speed of 409.6-ms intervals when fcp or fOSC
is 250 kHz. The cursor and blinking can be set to display simultaneously. (The blinking frequency changes
according to fOSC or the reciprocal of fcp. For example, when fcp is 270 kHz, 409.6 Γ— 250/270 = 379.2 ms.)

[imp] Enable testing and coverage reporting on the CI

Description

The tests should be run on github events to maintain the code quality. This will prevent later issues and bugs from being introduced.
Also, the code coverage report will exploit untested places and also will indicate the code quality.

Expectation

  • The pipeline runs the tests on events being triggered
  • The tests badge is shown in the main readme file
  • A code coverage report is generated
  • The code coverage report badge is added to the main readme file

`write_data_to_cg_or_ddram`

From HD44780U documentation

Write Data to CG or DDRAM

Write data to CG or DDRAM writes 8-bit binary data DDDDDDDD to CG or DDRAM.
To write into CG or DDRAM is determined by the previous specification of the CGRAM or DDRAM
address setting. After a write, the address is automatically incremented or decremented by 1 according to
the entry mode. The entry mode also determines the display shift.

[CI] Add a github job to build and test the project

The goal

The goal is to have a running pipeline, which will build and test the project to make sure that no commit will break the builds. Later it will be used to avoid direct pushes to the main branch.

Steps to achieve the goal

  1. prepare a docker image that is able to build the solution (no longer needed due to windows machine restrictions)
  2. have a build script that builds for all configurations and platforms (debug/release, x86/x64)
  3. configure a github pipeline job to run the script and report the results
  4. #64 #66
  5. add support for macOS
  6. #82

Note 1: arm and armv8 are planned for the future

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.