|
|
@@ -0,0 +1,28 @@
|
|
|
+#include <stddef.h>
|
|
|
+#include <stdint.h>
|
|
|
+#include <stdbool.h>
|
|
|
+
|
|
|
+#include <cx/chlcd.h>
|
|
|
+
|
|
|
+chlcd_error_t chlcd_hd44780_shift_register_create(
|
|
|
+ chlcd_display_t *self,
|
|
|
+ chlcd_hd44780_shift_register_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_shift_register_sender;
|
|
|
+ self->decoder = chlcd_hd44780_decoder;
|
|
|
+ self->connector = (void *) connector;
|
|
|
+
|
|
|
+ return CHLCD_SUCCESS;
|
|
|
+}
|