Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef struct
- {
- int d4, d5, d6, d7;
- } lcd_4bits;
- typedef struct
- {
- int d0, d1, d2, d3, d4, d5, d6, d7;
- } lcd_8bits;
- void lcd_attach_4bits(lcd_4bits* lcd)
- {
- // Attach 4 bits lcd
- }
- void lcd_attach_8bits(lcd_8bits* lcd)
- {
- // Attack 8 bits lcd
- }
- void lcd_send_cmd_4bits(lcd_4bits* lcd, int cmd)
- {
- // Send 4 bits command
- }
- void lcd_send_cmd_8bits(lcd_8bits* lcd, int cmd)
- {
- // Send 8 bits command
- }
- int main(void)
- {
- lcd_4bits lcd4;
- lcd_8bits lcd8;
- // Setup
- lcd4.d4 = 1;
- lcd8.d0 = 2;
- // Etc
- // Attach
- lcd_attach_4bits(&lcd4);
- lcd_attach_8bits(&lcd8);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement