Skip to content

Commit

Permalink
Update LittleOLED to use new I2C convention
Browse files Browse the repository at this point in the history
  • Loading branch information
Xasin committed Dec 3, 2021
1 parent 3e61f51 commit e2e7acc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions ESP32/LittleOLED/SSD1306.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ void SSD1306::initialize() {
puts("SSD initialized!");
}

XaI2C::MasterAction* SSD1306::start_cmd_set() {
XNM::I2C::MasterAction* SSD1306::start_cmd_set() {
assert(currentAction == nullptr);
this->currentAction = new XaI2C::MasterAction(0b0111100);
this->currentAction = new XNM::I2C::MasterAction(0b0111100);

return currentAction;
}
Expand Down Expand Up @@ -106,7 +106,7 @@ void SSD1306::end_cmd_set() {
void SSD1306::data_write(void *data, size_t length) {
assert(currentAction == nullptr);

currentAction = new XaI2C::MasterAction(0b0111100);
currentAction = new XNM::I2C::MasterAction(0b0111100);

currentAction->write(DATA_STREAM, data, length);
currentAction->execute();
Expand Down
6 changes: 3 additions & 3 deletions ESP32/LittleOLED/SSD1327.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ void SSD1327::initialize() {
puts("SSD1327 initialized!");
}

XaI2C::MasterAction* SSD1327::start_cmd_set() {
XNM::I2C::MasterAction* SSD1327::start_cmd_set() {
assert(currentAction == nullptr);
this->currentAction = new XaI2C::MasterAction(0b0111101);
this->currentAction = new XNM::I2C::MasterAction(0b0111101);

return currentAction;
}
Expand Down Expand Up @@ -90,7 +90,7 @@ void SSD1327::end_cmd_set() {
void SSD1327::data_write(void *data, size_t length) {
assert(currentAction == nullptr);

currentAction = new XaI2C::MasterAction(0b0111101);
currentAction = new XNM::I2C::MasterAction(0b0111101);

currentAction->write(DATA_STREAM, data, length);
currentAction->execute();
Expand Down
6 changes: 3 additions & 3 deletions ESP32/LittleOLED/include/SSD1306.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"

#include "MasterAction.h"
#include "xnm/i2c/MasterAction.h"

#include "DrawBox.h"

Expand Down Expand Up @@ -61,15 +61,15 @@ class SSD1306 : public DrawBox {
private:
static void call_raw_update(void *args);

XaI2C::MasterAction *currentAction;
XNM::I2C::MasterAction *currentAction;

std::vector<char> cmdBuffer;

std::array<std::array<uint8_t, 64>, 4> screenBuffer;

TaskHandle_t updateTask;

XaI2C::MasterAction* start_cmd_set();
XNM::I2C::MasterAction* start_cmd_set();

void send_cmd(uint8_t cmdVal);
void send_cmd(uint8_t cmdVal, uint8_t extraByte);
Expand Down
6 changes: 3 additions & 3 deletions ESP32/LittleOLED/include/SSD1327.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"

#include "MasterAction.h"
#include "xnm/i2c/MasterAction.h"

#include "DrawBox.h"

Expand Down Expand Up @@ -57,7 +57,7 @@ class SSD1327 : public DrawBox {
private:
static void call_raw_update(void *args);

XaI2C::MasterAction *currentAction;
XNM::I2C::MasterAction *currentAction;

std::vector<char> cmdBuffer;

Expand All @@ -68,7 +68,7 @@ class SSD1327 : public DrawBox {

TaskHandle_t updateTask;

XaI2C::MasterAction* start_cmd_set();
XNM::I2C::MasterAction* start_cmd_set();

void send_cmd(uint8_t cmdVal);
void send_cmd(uint8_t cmdVal, uint8_t extraByte);
Expand Down

0 comments on commit e2e7acc

Please sign in to comment.