Skip to content

Adding FB OLED Support #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JacobLevinson
Copy link

@JacobLevinson JacobLevinson commented Aug 27, 2024

Added files to support FB OLED for future platform, and modified the CMakeLists.txt to add OLED build option.

To enable, use the cmake -DUSE_OLED_VERSION=ON flag (off by default). This will build the new version.

In bb recipie for amd-lcd-lib, will likely need to add EXTRA_OECMAKE += "-DUSE_OLED_VERSION=ON", and also remove DEPENDS += "i2c-tools" (this doesn't use i2c).

@JacobLevinson JacobLevinson marked this pull request as draft August 27, 2024 17:32
@JacobLevinson
Copy link
Author

Marking as draft until I test it all once more tomorrow

@JacobLevinson JacobLevinson marked this pull request as ready for review August 27, 2024 20:06
@JacobLevinson
Copy link
Author

Tested

Copy link
Collaborator

@supven01 supven01 left a comment

Choose a reason for hiding this comment

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

Instead of creating the separate commit for addressing comments, please rebase and squash changes and force push to the same branch and then create/update pull request

print_err("1 Writing string to display at (%d, %d): %s\n", x, y, buffer);

// Maximum allowable string length
int max_length = (OLED_WIDTH_PX - 7) / CHARACTER_WIDTH_PX; // 128 pixels, 6x8 glyphs
Copy link
Collaborator

Choose a reason for hiding this comment

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

magic number 7

Copy link
Collaborator

@supven01 supven01 left a comment

Choose a reason for hiding this comment

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

Instead of creating the separate commit for addressing comments, please rebase and squash changes and force push to the same branch and then create/update pull request

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.

BMC_VER,
BIOS_VER
} 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.

return 0;
}

int lcdlib_open_dev(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 API signature needs change to extend beyond single buffer.
something like int lcdlib_open_dev(char *deviceName) or int lcdlib_open_dev(int deviceId)


return 0;
}
int lcdlib_close_dev(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 API signature needs change to extend beyond single buffer.
something like int lcdlib_close_dev(char *deviceName) or int lcdlib_close_dev(int deviceId)

#define print_err(fmt, args...)
#endif

static int fb_fd = -1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Global file pointer will cause extensibility issues.

#endif

static int fb_fd = -1;
static unsigned char *fb_buffer = NULL;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Need to find a way to avoid global variables in general. This will come in the way of supporting more than one display.


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_open_dev(void);
int lcdlib_close_dev(void);
int lcdlib_write_string(LCD_msgType_t msgType, unsigned char *buffer, int str_len);
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.

This commit just adds the files to support the FB OLED device,
128x64px with each pixel being 1 nibble (4 bits), so FB is 64x64.

Updated CMakeLists.txt to add option for OLED version

Use -DUSE_OLED_VERSION=ON to build new OLED version
(off by default)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants