| 12345678910111213141516171819202122232425262728 |
- #include <stddef.h>
- #include <stdint.h>
- #include <stdbool.h>
- #include <cx/chlcd.h>
- chlcd_error_t chlcd_hd44780_direct_create(
- chlcd_display_t *self,
- chlcd_hd44780_direct_connector_t *connector,
- chlcd_size_t width,
- chlcd_size_t height
- ) {
- if (connector == NULL) {
- return CHLCD_BAD_ARGUMENT;
- }
- if (width == 0 || height == 0) {
- return CHLCD_BAD_ARGUMENT;
- }
- self->width = width;
- self->height = height;
- self->sender = chlcd_hd44780_direct_sender;
- self->decoder = chlcd_hd44780_decoder;
- self->connector = (void *) connector;
- return CHLCD_SUCCESS;
- }
|