|
@@ -0,0 +1,61 @@
|
|
|
|
|
+#ifndef CX_CHLCD_HAL_H_INCLUDED
|
|
|
|
|
+#define CX_CHLCD_HAL_H_INCLUDED
|
|
|
|
|
+
|
|
|
|
|
+#include <stdint.h>
|
|
|
|
|
+#include <stdbool.h>
|
|
|
|
|
+
|
|
|
|
|
+#include "chlcd/types.h"
|
|
|
|
|
+
|
|
|
|
|
+#ifdef CHLCD_ON_ESP
|
|
|
|
|
+
|
|
|
|
|
+static inline chlcd_error_t chlcd_pin_set_output(chlcd_pin_t target) {
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+static inline chlcd_error_t chlcd_pin_write(chlcd_pin_t target, bool state) {
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+static inline chlcd_error_t chlcd_pin_set_pwm(chlcd_pin_t target) {
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+static inline chlcd_error_t chlcd_pin_write_pwm(
|
|
|
|
|
+ chlcd_pin_t target,
|
|
|
|
|
+ uint16_t pwm
|
|
|
|
|
+) {
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+#else
|
|
|
|
|
+
|
|
|
|
|
+#define CHLCD_MODE_DEBUG
|
|
|
|
|
+
|
|
|
|
|
+#include <stdio.h>
|
|
|
|
|
+
|
|
|
|
|
+static inline chlcd_error_t chlcd_pin_set_output(chlcd_pin_t target) {
|
|
|
|
|
+ printf("Pin %li mode set to output.\n", (uint32_t) target);
|
|
|
|
|
+ return CHLCD_SUCCESS;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+static inline chlcd_error_t chlcd_pin_write(chlcd_pin_t target, bool state) {
|
|
|
|
|
+ printf("Pin %li set to %s.\n", (uint32_t) target, state ? "HIGH" : "LOW");
|
|
|
|
|
+ return CHLCD_SUCCESS;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+static inline chlcd_error_t chlcd_pin_set_pwm(chlcd_pin_t target) {
|
|
|
|
|
+ printf("Pin %li mode set to PWM.\n", (uint32_t) target);
|
|
|
|
|
+ return CHLCD_SUCCESS;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+static inline chlcd_error_t chlcd_pin_write_pwm(
|
|
|
|
|
+ chlcd_pin_t target,
|
|
|
|
|
+ uint16_t pwm
|
|
|
|
|
+) {
|
|
|
|
|
+ printf("Pin %li write to PWM %i.\n", (uint32_t) target, pwm);
|
|
|
|
|
+ return CHLCD_SUCCESS;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
+#endif
|