Skip to content

Commit

Permalink
Merge pull request #136 from raul-ortega/SH-1106_support_by_pmarkiewicz
Browse files Browse the repository at this point in the history
Sh 1106 support by pmarkiewicz & Avegawanderer
  • Loading branch information
raul-ortega authored Nov 10, 2024
2 parents 8e47fb2 + 6a42c00 commit 9e6bda3
Show file tree
Hide file tree
Showing 14 changed files with 1,049 additions and 837 deletions.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ HIGHEND_SRC = \
common/colorconversion.c \
io/gps.c \
io/ledstrip.c \
io/display_lib.c \
io/display.c \
telemetry/telemetry.c \
telemetry/frsky.c \
Expand Down Expand Up @@ -330,7 +331,7 @@ NAZE_SRC = startup_stm32f10x_md_gcc.S \
drivers/bus_i2c_stm32f10x.c \
drivers/compass_hmc5883l.c \
drivers/compass_qmc5883l.c \
drivers/display_ug2864hsweg01.h \
drivers/display_ug2864hsweg01.c \
drivers/flash_m25p16.c \
drivers/gpio_stm32f10x.c \
drivers/inverter.c \
Expand Down Expand Up @@ -362,7 +363,7 @@ BLUEPILL_SRC = startup_stm32f10x_md_gcc.S \
drivers/bus_i2c_stm32f10x.c \
drivers/compass_hmc5883l.c \
drivers/compass_qmc5883l.c \
drivers/display_ug2864hsweg01.h \
drivers/display_ug2864hsweg01.c \
drivers/flash_m25p16.c \
drivers/gpio_stm32f10x.c \
drivers/inverter.c \
Expand Down Expand Up @@ -616,7 +617,7 @@ SPRACINGF3_SRC = \
drivers/compass_ak8975.c \
drivers/compass_hmc5883l.c \
drivers/compass_qmc5883l.c \
drivers/display_ug2864hsweg01.h \
drivers/display_ug2864hsweg01.c \
drivers/flash_m25p16.c \
drivers/serial_softserial.c \
drivers/sonar_hcsr04.c \
Expand Down
13 changes: 13 additions & 0 deletions docs/configuration-display.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Display

u360gts support OLED diplays SSD_1306 and SH_1106 to present information.



## Configuration

There is cli option oled_type
value 0 set display type to SSD 1306 (default)
value 1 set display type to SH 1106

[<< Go back](README.md)
Binary file not shown.
4 changes: 2 additions & 2 deletions src/main/config/config.c
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,9 @@ static void resetConf(void)
masterConfig.mixerMode = MIXER_QUADX;
#endif
featureClearAll();
//////// Nueva Líneas
//////// Nueva L�neas
featureSet(FEATURE_SERVO_TILT);
//////// Fin Nuevas Líneas
//////// Fin Nuevas L�neas
#if defined(CJMCU) || defined(SPARKY) || defined(COLIBRI_RACE) || defined(MOTOLAB)
//featureSet(FEATURE_RX_PPM);
#endif
Expand Down
1 change: 1 addition & 0 deletions src/main/config/config_master.h
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ typedef struct master_t {
uint8_t max_speed_filter;
uint8_t altitude_priority;
uint8_t pan_inverted;
uint8_t oled_type;
uint8_t restore_last_home;
int32_t home_lat;
int32_t home_lon;
Expand Down
11 changes: 11 additions & 0 deletions src/main/drivers/bus_i2c_stm32f30x.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,17 @@ bool i2cWrite(uint8_t addr_, uint8_t reg, uint8_t data)
return true;
}

bool i2cWriteBuffer(uint8_t addr_, uint8_t reg_, uint8_t len_, uint8_t *data)
{
bool status = true;

for (uint8_t i = 0; i < len_; i++) {
status &= i2cWrite(addr_, reg_ + i, data[i]);
}

return status;
}

bool i2cRead(uint8_t addr_, uint8_t reg, uint8_t len, uint8_t* buf)
{
addr_ <<= 1;
Expand Down
396 changes: 116 additions & 280 deletions src/main/drivers/display_ug2864hsweg01.c

Large diffs are not rendered by default.

32 changes: 4 additions & 28 deletions src/main/drivers/display_ug2864hsweg01.h
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,8 @@

#pragma once

#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64

#define FONT_WIDTH 5
#define FONT_HEIGHT 7
#define HORIZONTAL_PADDING 1
#define VERTICAL_PADDING 1

#define CHARACTER_WIDTH_TOTAL (FONT_WIDTH + HORIZONTAL_PADDING)
#define CHARACTER_HEIGHT_TOTAL (FONT_HEIGHT + VERTICAL_PADDING)

#define SCREEN_CHARACTER_COLUMN_COUNT (SCREEN_WIDTH / CHARACTER_WIDTH_TOTAL)
#define SCREEN_CHARACTER_ROW_COUNT (SCREEN_HEIGHT / CHARACTER_HEIGHT_TOTAL)

#define VERTICAL_BARGRAPH_ZERO_CHARACTER (128 + 32)
#define VERTICAL_BARGRAPH_CHARACTER_COUNT 7

bool ug2864hsweg01InitI2C(void);

void i2c_OLED_set_xy(uint8_t col, uint8_t row);
void i2c_OLED_set_line(uint8_t row);
void i2c_OLED_send_char(unsigned char ascii);
void i2c_OLED_send_string(const char *string);
void i2c_OLED_send_charH(unsigned char ascii, bool hightlight);
void i2c_OLED_send_stringH(const char *string, bool hightlight);
bool i2c_OLED_send_byte(uint8_t val);
void i2c_OLED_clear_display(void);
void i2c_OLED_clear_display_quick(void);
#define OLED_WIDTH 128
#define OLED_HEIGHT 64

bool ug2864hsweg01_Init(uint8_t oled_type);
void ug2864hsweg01_Display(const uint8_t *buffer);
Loading

0 comments on commit 9e6bda3

Please sign in to comment.