Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions CMakeLists.txt
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should take this opportunity to move away from CMakeLists and use Meson as upstream modules are using meson to speed up compilation.

Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,14 @@ if (NOT DEFINED CPACK_PACKAGE_CONTACT)
endif()

if (NOT DEFINED CPACK_PACKAGE_DESCRIPTION_SUMMARY)
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY
"GENOA™ LCD display Interface library")
# Conditionally set the description summary based on the selected version
if (USE_OLED_VERSION)
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY
"SP7 LCD display Interface library")
else()
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY
"GENOA™ LCD display Interface library")
endif()
endif()

set(CPACK_PACKAGE_FILE_NAME "lcdlib_lib32-${BUILD_VERSION_STRING}")
Expand All @@ -81,7 +87,24 @@ else ()
endif ()

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
set(LCDLIB_SRC_LIST ${LCDLIB_SRC_LIST} "${SRC_DIR}/lcdlib_common.c")
# Conditionally include source and header files based on the selected version
if (USE_OLED_VERSION)
set(LCDLIB_SRC_LIST
"${SRC_DIR}/lcdlib_common_oled.c"
)
set(LCD_INC_LIST
"${INC_DIR}/lcdlib_common_oled.h"
)
message(STATUS "Building the OLED version of lcdlib")
else()
set(LCDLIB_SRC_LIST
"${SRC_DIR}/lcdlib_common.c"
)
set(LCD_INC_LIST
"${INC_DIR}/lcdlib_common.h"
)
message(STATUS "Building the legacy version of lcdlib")
endif()


#set(LCD_TOOL "lcdlib_tool")
Expand Down
47 changes: 47 additions & 0 deletions include/lcdlib/lcdlib_common_oled.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#ifdef __cplusplus
extern "C"
{
#endif
#ifndef INCLUDE_LCDLIB_COMMON_OLED_H_
#define INCLUDE_LCDLIB_COMMON_OLED_H_

/* Error Code */
#define LCD_ERR_OPEN 0x80
#define LCD_ERR_OPEN_I2C 0x81
#define LCD_ERR_SET_CURSOR 0x82
#define LCD_ERR_BAD_PARAM 0x83
#define LCD_ERR_CLEAR_SCREEN 0x84
#define LCD_ERR_WRITE 0x85
#define LCD_ERR_IOCTL 0x86
#define LCD_ERR_READ 0x87

#define LINE_HEIGHT_PX 9
#define CHARACTER_WIDTH_PX 6
#define CHARACTER_HEIGHT_PX 8

#define OLED_HEIGHT_PX 64
#define OLED_WIDTH_PX 128
#define OLED_HEIGHT_BYTES 64
#define OLED_WIDTH_BYTES 64

/* LCD Message type */
typedef enum
{
POST_CODE = 1,
BMC_IPADDR,
BMC_VER,
BIOS_VER,
HPM_FPGA
} LCD_msgType_t;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

int lcdlib_enable_dev(int lcdDeviceNum);
int lcdlib_disable_dev(int lcdDeviceNum);
would be required to extend beyond a single display/oled.

int lcdlib_open_dev(void);
int lcdlib_close_dev(void);
int lcdlib_write_string(LCD_msgType_t msgType, unsigned char *buffer, int str_len);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a re-look to see if it needs to include deviceNumber as a parameter to write to the right display.

int lcdlib_clearScreen(void);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a re-look to see if it needs to include deviceNumber as a parameter to clear the right display.


extern const unsigned char font6x8_ascii[128][6];

#endif // INCLUDE_LCDLIB_COMMON_OLED_H_
#ifdef __cplusplus
}
#endif
Loading