Skip to content

Instantly share code, notes, and snippets.

@dagon666
Created May 11, 2014 15:34
Show Gist options
  • Save dagon666/44babadb8e3710e6ec4f to your computer and use it in GitHub Desktop.
Save dagon666/44babadb8e3710e6ec4f to your computer and use it in GitHub Desktop.
pcd8544 program template
#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