Skip to content
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

drv: ft8xx: new coprocessor commands #82376

Closed
wants to merge 2 commits into from

Conversation

hubertmis
Copy link
Member

Implement more co-processor commands in the FT8xx display driver. The list of the new implemented commands consists of:

  • CMD_FGCOLOR
  • CMD_BGCOLOR
  • CMD_SLIDER
  • CMD_TOGGLE
  • CMD_TRACK

The ft8xx driver reported a compile-time error caused by an invalid
logging configuration of this module.

This patch intorduces FT800-specific logging configuration in Kconfig
that is used by the driver. This way the error is fixed.

Signed-off-by: Hubert Miś <hubert.mis@gmail.com>
@hubertmis hubertmis force-pushed the pr/ft8xx-update branch 3 times, most recently from 56cab5d to 6837dda Compare December 1, 2024 11:00
@@ -73,6 +78,183 @@ void ft8xx_copro_cmd_swap(void)
ft8xx_copro_cmd(CMD_SWAP);
}

void ft8xx_copro_cmd_fgcolor(uint32_t c)
Copy link
Contributor

Choose a reason for hiding this comment

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

is c for color ? would use the full term :)

Copy link
Member Author

Choose a reason for hiding this comment

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

I think so. It's how the programming guide defines it:
image

I would prefer to keep functions prototypes like in the programming guide.

const uint16_t cmd_size = sizeof(CMD_FGCOLOR) +
sizeof(c);

while (ram_cmd_freespace() < cmd_size) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this function a blocking call? Probably it should be refelected in documentation as well :) same goes for other functions as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

In an RTOS I expect a function to be blocking unless it's explicitly stated that it's asynchronous and described how the caller is notified when the operation ends.

Implement more co-processor commands in the FT8xx display driver.
The list of the new implemented commands consists of:

* CMD_FGCOLOR
* CMD_BGCOLOR
* CMD_SLIDER
* CMD_TOGGLE
* CMD_TRACK

Signed-off-by: Hubert Miś <hubert.mis@gmail.com>
Comment on lines +305 to +306
int16_t w,
int16_t h,
Copy link
Member

Choose a reason for hiding this comment

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

single letter arguments are ok for local variables, bad idea for external functions, x and y are obviously ok "w" "h" "s" should really be expanded, I imagine you did it because that's how the existing apis are declared but I'd suggest changing them all to something meaningful, it's not like it would break existing code anyway

}

ft8xx_wr32(FT800_RAM_CMD + reg_cmd_write, CMD_SLIDER);
increase_reg_cmd_write(sizeof(CMD_SLIDER));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since every instance of ft8xx_wr is always followed by increase_reg_cmd_write maybe it makes sense to combine them? The separation into more lines does not add anything of value imo.

@hubertmis
Copy link
Member Author

I've decided to add more improvement to the drivers in smaller steps. Let's start with less controversial one: #83851

@hubertmis hubertmis closed this Jan 11, 2025
@faxe1008
Copy link
Collaborator

@hubertmis please amend your commits instead of closing and opening new PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants