Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stm8s.h"
- #ifndef hd44780_h
- #define hd44780_h
- #define MAX_WIDTH 20
- #define MAX_HEIGHT 4
- typedef struct {
- void (*delay_w)(void);
- void (*set_data)(uint8_t);
- void (*set_RS)(uint8_t);
- void (*set_E)(uint8_t);
- uint8_t width;
- uint8_t height;
- uint8_t cursor_x;
- uint8_t cursor_y;
- uint8_t data[MAX_WIDTH][MAX_HEIGHT];
- } hd44780_state_t;
- void hd44780_init(hd44780_state_t *state,
- uint8_t width,
- uint8_t height,
- void (*delay_w)(void),
- void (*set_data)(uint8_t),
- void (*set_RS)(uint8_t),
- void (*set_E)(uint8_t));
- void hd44780_update(hd44780_state_t *state);
- void hd44780_putc(hd44780_state_t *state, uint8_t xpos, uint8_t ypos, char ch);
- void hd44780_putstring(hd44780_state_t *state, uint8_t xpos, uint8_t ypos, char *str);
- #endif
Add Comment
Please, Sign In to add comment