Created
May 11, 2014 15:34
-
-
Save dagon666/44babadb8e3710e6ec4f to your computer and use it in GitHub Desktop.
pcd8544 program template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <avr/io.h> | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <util/delay.h> | |
#include <math.h> | |
#include "main.h" | |
#include "pca.h" | |
int main(void) | |
{ | |
struct dev_pcd8544_ctx lcd; | |
struct bus_t spi_bus; | |
uint8_t buff = 0; | |
uint8_t i = 0; | |
spi_bus = spi_hw_poll_bus_get(); | |
lcd.bus = &spi_bus; | |
lcd.sce.port = &PORTB; | |
lcd.sce.pin = PORTB0; | |
lcd.dc.port = &PORTB; | |
lcd.dc.pin = PORTB1; | |
lcd.res.port = &PORTB; | |
lcd.res.pin = PORTB2; | |
spi_hw_poll_init(E_SPI_MODE_MASTER, E_SPI_SPEED_F2); | |
pcd8544_init(&lcd); | |
pcd8544_clrscr(&lcd); | |
pcd8544_install_stdout(&lcd); | |
printf("Hello world !!!"); | |
while (1); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment