Subversion Repositories group.electronics

Rev

Blame | Last modification | View Log | RSS feed

/*
 * oled.h
 *
 *  Created on: 27/11/2013
 *      Author: pfowler
 */

#ifndef OLED_H_
#define OLED_H_

#include <avr/pgmspace.h>

#define OLED_EXTERNALVCC                        0x00
#define OLED_SWITCHCAPVCC                       0x01




struct {
  uint8_t i2c_addr;

  uint8_t width;
  uint8_t height;
  uint8_t* buffer;
} oled;

void oled_drawPixel(uint8_t* buffer, uint16_t x, uint16_t y, uint8_t color);
void oled_invert(uint8_t i);
uint8_t* oled_getBuffer(void);
uint8_t* oled_init(uint8_t width, uint8_t height, uint8_t vccstate, uint8_t address);
inline void oled_cmd(uint8_t cmd);
inline void oled_data(uint8_t data);
void oled_write(uint8_t control, uint8_t data);
void oled_display(void);
void oled_clear(void);
void oled_power(uint8_t pwr);

#endif /* OLED_H_ */