Skip to content

Commit

Permalink
[stm32] f469 disco :b-08 flag to select nt35510
Browse files Browse the repository at this point in the history
  • Loading branch information
hshose committed Apr 20, 2023
1 parent a4f2484 commit 085e43f
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 64 deletions.
47 changes: 0 additions & 47 deletions src/modm/board/disco_f469ni/board.cpp

This file was deleted.

6 changes: 3 additions & 3 deletions src/modm/board/disco_f469ni/board_display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <algorithm>

extern void
board_initialize_display_nt35510(uint8_t);
board_initialize_display(uint8_t);

// Basic implementation of display running on memory mapped buffer
class DsiDisplay : public modm::ColorGraphicDisplay
Expand Down Expand Up @@ -86,14 +86,14 @@ class DsiDisplay : public modm::ColorGraphicDisplay
void
Board::initializeDisplay()
{
board_initialize_display_nt35510(2);
board_initialize_display(2);
}

void
Board::setDisplayBuffer(void * buffer)
{
// ColorCoding: 0 = ARGB8888, 2 = RGB565
board_initialize_display_nt35510(2);
board_initialize_display(2);
// Configures the color frame buffer start address
LTDC_Layer1->CFBAR = uint32_t(buffer);
// Enable LTDC_Layer by setting LEN bit
Expand Down
4 changes: 2 additions & 2 deletions src/modm/board/disco_f469ni/board_dsi_nt35510.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ nt35510_init(uint8_t);

// ---------------------------------- DISPLAY ----------------------------------
void
board_initialize_display_nt35510(uint8_t ColorCoding)
board_initialize_display(uint8_t ColorCoding)
{
using namespace modm::platform;
if (Rcc::isEnabled<Peripheral::Ltdc>()) return;
Expand Down Expand Up @@ -187,4 +187,4 @@ board_initialize_display_nt35510(uint8_t ColorCoding)
LTDC->SRCR = LTDC_SRCR_IMR;
*/
}
}
}
12 changes: 6 additions & 6 deletions src/modm/board/disco_f469ni/board_dsi_otm8009a.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ board_initialize_display(uint8_t ColorCoding)
DSI->IER[1] = 0;
}

constexpr uint32_t VSA = 240;
constexpr uint32_t VBP = 255;
constexpr uint32_t VSA = 12;
constexpr uint32_t VBP = 12;
constexpr uint32_t VFP = 12;
constexpr uint32_t HSA = 800;
constexpr uint32_t HBP = 12;
constexpr uint32_t HFP = 12;
constexpr uint32_t HSA = 120;
constexpr uint32_t HBP = 120;
constexpr uint32_t HFP = 120;
constexpr uint32_t HACT = 800;
constexpr uint32_t VACT = 480;
const uint8_t pixel_size = (ColorCoding == 0) ? sizeof(uint32_t) : sizeof(uint16_t);
Expand Down Expand Up @@ -185,4 +185,4 @@ board_initialize_display(uint8_t ColorCoding)
LTDC->SRCR = LTDC_SRCR_IMR;
*/
}
}
}
2 changes: 1 addition & 1 deletion src/modm/board/disco_f469ni/board_otm8009a.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,4 +452,4 @@ void otm8009a_init(uint8_t ColorCoding)
/* Send Command GRAM memory write (no parameters) : this initiates frame write via other DSI commands sent by */
/* DSI host from LTDC incoming pixels in video mode */
dsi_write_command(0, ShortRegData45);
}
}
14 changes: 9 additions & 5 deletions src/modm/board/disco_f469ni/module.lb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
def init(module):
module.name = ":board:disco-f469ni"
module.description = FileReader("module.md")
# Revisions = [b-03, b-02, b-01]
# Revisions = [c-01, b-08, b-03, b-02, b-01]

def prepare(module, options):
if not options[":target"].partname.startswith("stm32f469nih"):
Expand Down Expand Up @@ -45,11 +45,15 @@ def build(env):
}
env.template("../board.cpp.in", "board.cpp")
env.copy("board_display.cpp")
# env.copy("board_dsi.cpp")
env.copy("board_dsi_nt35510.cpp")

if env[":disco-f469ni"] in ["b-08", "c-01"]:
env.copy("board_dsi_nt35510.cpp")
env.copy("board_nt35510.cpp")
else:
env.copy("board_dsi_otm8009a.cpp")
env.copy("board_otm8009a.cpp")

env.copy("board_init.cpp")
# env.copy("board_otm8009a.cpp")
env.copy("board_nt35510.cpp")
env.copy("board_sdram.cpp")
env.template("board.hpp.in")
env.collect(":build:openocd.source", "board/stm32f469discovery.cfg")
Expand Down

0 comments on commit 085e43f

Please sign in to comment.