Skip to content

Commit

Permalink
xx
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertGawron committed Dec 12, 2024
1 parent 348cc75 commit 150809d
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 4 deletions.
4 changes: 4 additions & 0 deletions Documentation/Diagrams/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.png
*.jpg
*.jpeg
*.gif
49 changes: 49 additions & 0 deletions Documentation/Diagrams/DisplaySequenceDiagram.plantuml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
@startuml

box "MVC pattern"
participant "Controller" as CONTROLLER
participant "View" as VIEW
end box

participant "Device::Display" as DISPLAY
note right of DISPLAY
Device::Display
inherits from U8G2
end note

box "U8G2 library"
participant MUIU8G2
participant U8G2
end box

participant "Driver::St7735DisplayDriver" as DRIVER
box "STM library"
participant "stm32-st7735" as ST7735_LIB
end box

== Initialization ==

CONTROLLER --> DISPLAY : onInitialize
DISPLAY --> DRIVER : onInitialize
DISPLAY --> U8G2 : u8g2_Setup_st7735

DRIVER --> ST7735_LIB : Initialize hardware (TBD)
CONTROLLER --> VIEW: onInitialize
== Start ==

CONTROLLER --> DISPLAY : onStart
DISPLAY --> DRIVER : onStart
DRIVER --> ST7735_LIB : Configure settings (TBD)

CONTROLLER --> U8G2 : begin
CONTROLLER --> MUIU8G2 : begin

== Main Loop ==

VIEW --> MUIU8G2 : draw
MUIU8G2 --> U8G2 : u8x8_d_st7735
U8G2 --> DISPLAY : u8x8_d_st7735
DISPLAY --> DRIVER : drawBitmap
DRIVER --> ST7735_LIB : Send Data (TBD)

@enduml
1 change: 1 addition & 0 deletions Documentation/Diagrams/DisplaySequenceDiagram.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions Software/STM32F103RBTx/Application/Device/Inc/Display.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ namespace Device

void check();

// void my_u8g2_ll_hvline_vertical_top_lsb(u8g2_t *u8g2, u8g2_uint_t x, u8g2_uint_t y, u8g2_uint_t len, uint8_t dir);
// void my_u8g2_Setup_uc1617_jlx128128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
bool init();

private:
Driver::IDisplayDriver &displayDriver;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ namespace Device
{
public:
// todo
// IDisplay() = default;
// IDisplay() : U8G2(U8G2_R0) {}
IDisplay() : U8G2() {};

bool init();
};

};
Expand Down
4 changes: 4 additions & 0 deletions Software/STM32F103RBTx/Application/Device/Src/Display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ namespace Device
u8g2_Setup_st7735(&u8g2, rotation, u8x8_byte_rtthread_4wire_hw_spi, u8x8_gpio_and_delay_rtthread);
}

bool Display::init()
{
return true;
}
void Display::check()
{
// printf("curr: %d", u8g2->tile_curr_row);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ namespace Driver
*/
virtual ~IDisplayDriver() = default;

// IDisplayDriver(const IDisplayDriver &) = delete;

// IDisplayDriver &operator=(const IDisplayDriver &) = delete;

virtual Status displayOn() = 0;
virtual Status displayOff() = 0;
virtual Status setOrientation(Orientation orientation) = 0;
Expand Down

0 comments on commit 150809d

Please sign in to comment.