80 lines
2.6 KiB
C
80 lines
2.6 KiB
C
/*
|
|
* digole.h
|
|
*
|
|
* Created on: 27.01.2014
|
|
* Author: q242695
|
|
*/
|
|
|
|
#ifndef DIGOLE_H_
|
|
#define DIGOLE_H_
|
|
|
|
//#include "main.h"
|
|
#include <avr/io.h>
|
|
#include <util/delay.h>
|
|
|
|
/* se seriale: */
|
|
#ifdef OLED_Serial
|
|
#define BAUD 9600
|
|
#include <util/setbaud.h>
|
|
|
|
/* Definizioni per il m168p */
|
|
#ifdef m168p
|
|
#define UCSRA UCSR0A
|
|
#define UCSRB UCSR0B
|
|
#define UCSRC UCSR0C
|
|
#define UBRRH UBRR0H
|
|
#define UBRRL UBRR0L
|
|
#define U2X U2X0
|
|
#define UDRE UDRE0
|
|
#define UDR UDR0
|
|
#endif
|
|
/* fine definizioni per il m168p*/
|
|
|
|
#endif
|
|
|
|
#define OLED_SPI // Digole OLED display, SPI protocol
|
|
#ifndef _OLED_PINS_
|
|
#define _OLED_PINS_
|
|
#define SS_PIN PD0 // SS pin
|
|
#define SCLK_PIN PD1 // SCLK pin
|
|
#define SDIN_PIN PD2 // SDIN pin
|
|
#define OLED_DDR DDRD // Display Port DDR
|
|
#define OLED_PORT PORTD // Display Port PORT
|
|
#endif // _OLED_PINS_*/
|
|
|
|
/* se spi */
|
|
#ifdef OLED_SPI
|
|
#define BIT(i) (1<<i)
|
|
#define SS_set OLED_PORT|=BIT(SS_PIN) // chip select
|
|
#define SS_clr OLED_PORT&=~BIT(SS_PIN)
|
|
#define SCLK_set OLED_PORT|=BIT(SCLK_PIN) // serial clock
|
|
#define SCLK_clr OLED_PORT&=~BIT(SCLK_PIN)
|
|
#define SDIN_set OLED_PORT|=BIT(SDIN_PIN) // serial data
|
|
#define SDIN_clr OLED_PORT&=~BIT(SDIN_PIN)
|
|
#endif
|
|
|
|
void OLED_Cls (void);
|
|
void OLED_CR (void);
|
|
void OLED_DisplayMode (unsigned char mode);
|
|
void OLED_DrawBmp (unsigned char x, unsigned char y, unsigned char w, unsigned char h, const unsigned char *bitmap);
|
|
void OLED_DrawCircle (unsigned char x, unsigned char y, unsigned char radius, unsigned char mode);
|
|
void OLED_DrawLine (unsigned char x1, unsigned char y1, unsigned char x2, unsigned char y2);
|
|
void OLED_DrawRect (unsigned char x1, unsigned char y1, unsigned char x2, unsigned char y2, unsigned char mode);
|
|
void OLED_GotoXY (unsigned char x, unsigned char y, unsigned char mode);
|
|
void OLED_Init (void);
|
|
void OLED_LineTo (unsigned char x1, unsigned char y1);
|
|
void OLED_MoveArea (unsigned char x, unsigned char y, unsigned char w, unsigned char h, unsigned char offsx, unsigned char offsy);
|
|
void OLED_putc (unsigned char dat);
|
|
void OLED_SetFont (unsigned char font);
|
|
void OLED_SetLinePattern (unsigned char pattern);
|
|
void OLED_SetOutput (unsigned char output);
|
|
void OLED_ShowConfig (unsigned char mode);
|
|
void OLED_ShowCursor (unsigned char mode);
|
|
void OLED_ShowSplashScreen (unsigned char mode);
|
|
void OLED_SplashScreen (int length, const unsigned char *data);
|
|
void OLED_UserFont (unsigned char sect, int length, const unsigned char *data);
|
|
void OLED_Write (char *string);
|
|
void OLED_WriteXY (unsigned char x, unsigned char y, char *string);
|
|
|
|
#endif /* DIGOLE_H_ */
|