mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Basic OLED working
* OLED * Buttons
This commit is contained in:
@@ -10,8 +10,8 @@
|
||||
#ifndef OLED_HPP_
|
||||
#define OLED_HPP_
|
||||
#include "Font.h"
|
||||
#include "I2C_Wrapper.hpp"
|
||||
#include <BSP.h>
|
||||
#include "Model_Config.h"
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#ifdef __cplusplus
|
||||
@@ -21,6 +21,16 @@ extern "C" {
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef OLED_I2CBB
|
||||
#include "I2CBB.hpp"
|
||||
#define I2C_CLASS I2CBB
|
||||
#else
|
||||
#define I2C_CLASS FRToSI2C
|
||||
#include "I2C_Wrapper.hpp"
|
||||
#endif
|
||||
|
||||
#define DEVICEADDR_OLED (0x3c << 1)
|
||||
#define OLED_WIDTH 96
|
||||
#define OLED_HEIGHT 16
|
||||
@@ -40,7 +50,7 @@ public:
|
||||
static bool isInitDone();
|
||||
// Draw the buffer out to the LCD using the DMA Channel
|
||||
static void refresh() {
|
||||
FRToSI2C::Transmit(DEVICEADDR_OLED, screenBuffer, FRAMEBUFFER_START + (OLED_WIDTH * 2));
|
||||
I2C_CLASS::Transmit(DEVICEADDR_OLED, screenBuffer, FRAMEBUFFER_START + (OLED_WIDTH * 2));
|
||||
// DMA tx time is ~ 20mS Ensure after calling this you delay for at least 25ms
|
||||
// or we need to goto double buffering
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user