diff options
author | Andy Wortman <ixineeringeverywhere@gmail.com> | 2019-03-14 15:52:30 -0700 |
---|---|---|
committer | Andy Wortman <ixineeringeverywhere@gmail.com> | 2019-03-14 15:52:30 -0700 |
commit | 9a607474bdd66dd716635cfed7f2c832c39b4523 (patch) | |
tree | c5f65b4cecd6376a3b99646679f9714d5f9213a2 /include/qhy/ssd1306.h | |
parent | ac7604616ab2e44ad12a9d8d5dd90dec15feb5cc (diff) |
add qhy headers.........
Diffstat (limited to 'include/qhy/ssd1306.h')
-rw-r--r-- | include/qhy/ssd1306.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/include/qhy/ssd1306.h b/include/qhy/ssd1306.h new file mode 100644 index 0000000..3535f21 --- /dev/null +++ b/include/qhy/ssd1306.h @@ -0,0 +1,62 @@ +/*___________________________________________________ + | _____ _____ _ _ _ | + | | __ \ | __ (_) | | | | + | | |__) |__ _ __ __ _ _ _| |__) || | ___ | |_ | + | | ___/ _ \ '_ \ / _` | | | | ___/ | |/ _ \| __| | + | | | | __/ | | | (_| | |_| | | | | | (_) | |_ | + | |_| \___|_| |_|\__, |\__,_|_| |_|_|\___/ \__| | + | __/ | | + | GNU/Linux based |___/ Multi-Rotor UAV Autopilot | + |___________________________________________________| + + Adafruit 128x64 SSD1307 Linux I2C Driver Interface + + Copyright (C) 2013 Tobias Simon, Ilmenau University of Technology + Based on code written by Limor Fried/Ladyada. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. */ + + +#ifndef __SSD1306_H__ +#define __SSD1306_H__ + +#include "i2c.h" +#include <stdint.h> + + +typedef struct +{ + i2c_dev_t *i2c_dev; + uint8_t *buf; + int16_t width; + int16_t height; +} +ssd1306_t; + + +/* initializes display */ +void ssd1306_init(ssd1306_t *ssd, i2c_dev_t *i2c_dev); + +/* inverts display */ +void ssd1306_invert(ssd1306_t *ssd, uint8_t inv); + +/* writes buffer contents to display */ +void ssd1306_update(ssd1306_t *ssd); + +/* clears buffer */ +void ssd1306_clear(ssd1306_t *ssd); + +/* sets pixel in buffer */ +void ssd1306_set_pixel(ssd1306_t *ssd, int16_t x, int16_t y, uint16_t color); + + +#endif /* __SSD1306_H__ */ + |