mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
Wreorder: Fixed a subset of reorder errors
This commit addresses warnings emitted from -Wreorder in the C++ src. Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit is contained in:
parent
2f31aede0e
commit
c63692b5fd
@ -160,26 +160,26 @@ namespace upm {
|
|||||||
* @param rst Reset pin
|
* @param rst Reset pin
|
||||||
*/
|
*/
|
||||||
ILI9341(uint8_t csLCD, uint8_t csSD, uint8_t dc, uint8_t rst);
|
ILI9341(uint8_t csLCD, uint8_t csSD, uint8_t dc, uint8_t rst);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the name of the component
|
* Returns the name of the component
|
||||||
*/
|
*/
|
||||||
std::string name() {
|
std::string name() {
|
||||||
return m_name;
|
return m_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes GPIOs used to talk to the LCD
|
* Initializes GPIOs used to talk to the LCD
|
||||||
*/
|
*/
|
||||||
void initModule();
|
void initModule();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configures the LCD driver chip via SPI
|
* Configures the LCD driver chip via SPI
|
||||||
*/
|
*/
|
||||||
void configModule();
|
void configModule();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the window size inside the screen where pixel data is
|
* Sets the window size inside the screen where pixel data is
|
||||||
* written. Concrete implementation from GFX interface.
|
* written. Concrete implementation from GFX interface.
|
||||||
*
|
*
|
||||||
* @param x0 First coordinate
|
* @param x0 First coordinate
|
||||||
@ -187,11 +187,11 @@ namespace upm {
|
|||||||
* @param x1 Second coordinate
|
* @param x1 Second coordinate
|
||||||
* @param y1 Second coordinate
|
* @param y1 Second coordinate
|
||||||
*/
|
*/
|
||||||
void setAddrWindow(uint16_t x0,
|
void setAddrWindow(uint16_t x0,
|
||||||
uint16_t y0,
|
uint16_t y0,
|
||||||
uint16_t x1,
|
uint16_t x1,
|
||||||
uint16_t y1);
|
uint16_t y1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends a pixel color (RGB) to the driver chip. Concrete
|
* Sends a pixel color (RGB) to the driver chip. Concrete
|
||||||
* implementation from GFX interface.
|
* implementation from GFX interface.
|
||||||
@ -211,7 +211,7 @@ namespace upm {
|
|||||||
* @param color RGB (16-bit) color (R[0-4], G[5-10], B[11-15]
|
* @param color RGB (16-bit) color (R[0-4], G[5-10], B[11-15]
|
||||||
*/
|
*/
|
||||||
void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
|
void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draws a horizontal line using minimal SPI writes.
|
* Draws a horizontal line using minimal SPI writes.
|
||||||
*
|
*
|
||||||
@ -221,7 +221,7 @@ namespace upm {
|
|||||||
* @param color RGB (16-bit) color (R[0-4], G[5-10], B[11-15]
|
* @param color RGB (16-bit) color (R[0-4], G[5-10], B[11-15]
|
||||||
*/
|
*/
|
||||||
void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
|
void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draw a filled rectangle.
|
* Draw a filled rectangle.
|
||||||
*
|
*
|
||||||
@ -231,33 +231,33 @@ namespace upm {
|
|||||||
* @param h Height of rectangle in pixels
|
* @param h Height of rectangle in pixels
|
||||||
* @param color RGB (16-bit) color (R[0-4], G[5-10], B[11-15]
|
* @param color RGB (16-bit) color (R[0-4], G[5-10], B[11-15]
|
||||||
*/
|
*/
|
||||||
void fillRect(int16_t x,
|
void fillRect(int16_t x,
|
||||||
int16_t y,
|
int16_t y,
|
||||||
int16_t w,
|
int16_t w,
|
||||||
int16_t h,
|
int16_t h,
|
||||||
uint16_t color);
|
uint16_t color);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fill the screen with a single color.
|
* Fill the screen with a single color.
|
||||||
*
|
*
|
||||||
* @param color RGB (16-bit) color (R[0-4], G[5-10], B[11-15]
|
* @param color RGB (16-bit) color (R[0-4], G[5-10], B[11-15]
|
||||||
*/
|
*/
|
||||||
void fillScreen(uint16_t color);
|
void fillScreen(uint16_t color);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the screen to one of four 90 deg rotations.
|
* Sets the screen to one of four 90 deg rotations.
|
||||||
*
|
*
|
||||||
* @param r Rotation setting: 0, 1, 2, 3
|
* @param r Rotation setting: 0, 1, 2, 3
|
||||||
*/
|
*/
|
||||||
void setRotation(uint8_t r);
|
void setRotation(uint8_t r);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invert colors on the display.
|
* Invert colors on the display.
|
||||||
*
|
*
|
||||||
* @param i True or false to invert colors
|
* @param i True or false to invert colors
|
||||||
*/
|
*/
|
||||||
void invertDisplay(bool i);
|
void invertDisplay(bool i);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pass 8-bit R, G, B values and get back 16-bit packed color.
|
* Pass 8-bit R, G, B values and get back 16-bit packed color.
|
||||||
*
|
*
|
||||||
@ -267,77 +267,78 @@ namespace upm {
|
|||||||
* @return 16-bit packed color (RGB) value
|
* @return 16-bit packed color (RGB) value
|
||||||
*/
|
*/
|
||||||
uint16_t color565(uint8_t r, uint8_t g, uint8_t b);
|
uint16_t color565(uint8_t r, uint8_t g, uint8_t b);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Executes a set of commands and data.
|
* Executes a set of commands and data.
|
||||||
*
|
*
|
||||||
* @param addr Pointer to the start of the commands/data section
|
* @param addr Pointer to the start of the commands/data section
|
||||||
*/
|
*/
|
||||||
void executeCMDList(const uint8_t *addr);
|
void executeCMDList(const uint8_t *addr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends a command to the display driver via SPI.
|
* Sends a command to the display driver via SPI.
|
||||||
*
|
*
|
||||||
* @param c Command to be written
|
* @param c Command to be written
|
||||||
*/
|
*/
|
||||||
void writecommand(uint8_t c);
|
void writecommand(uint8_t c);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends data to the display driver via SPI
|
* Sends data to the display driver via SPI
|
||||||
*
|
*
|
||||||
* @param d Data to be written
|
* @param d Data to be written
|
||||||
*/
|
*/
|
||||||
void writedata(uint8_t d);
|
void writedata(uint8_t d);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set LCD chip select to LOW
|
* Set LCD chip select to LOW
|
||||||
*/
|
*/
|
||||||
mraa::Result lcdCSOn();
|
mraa::Result lcdCSOn();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set LCD chip select to HIGH
|
* Set LCD chip select to HIGH
|
||||||
*/
|
*/
|
||||||
mraa::Result lcdCSOff();
|
mraa::Result lcdCSOff();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set SD card chip select to LOW
|
* Set SD card chip select to LOW
|
||||||
*/
|
*/
|
||||||
mraa::Result sdCSOn();
|
mraa::Result sdCSOn();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set SD card chip select to HIGH
|
* Set SD card chip select to HIGH
|
||||||
*/
|
*/
|
||||||
mraa::Result sdCSOff();
|
mraa::Result sdCSOff();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set data/command line to HIGH
|
* Set data/command line to HIGH
|
||||||
*/
|
*/
|
||||||
mraa::Result dcHigh();
|
mraa::Result dcHigh();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set data/command line to LOW
|
* Set data/command line to LOW
|
||||||
*/
|
*/
|
||||||
mraa::Result dcLow();
|
mraa::Result dcLow();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set reset line to HIGH
|
* Set reset line to HIGH
|
||||||
*/
|
*/
|
||||||
mraa::Result rstHigh();
|
mraa::Result rstHigh();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set reset line to LOW
|
* Set reset line to LOW
|
||||||
*/
|
*/
|
||||||
mraa::Result rstLow();
|
mraa::Result rstLow();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
mraa::Spi m_spi;
|
|
||||||
uint8_t m_spiBuffer[32];
|
uint8_t m_spiBuffer[32];
|
||||||
|
|
||||||
mraa::Gpio m_csLCDPinCtx;
|
mraa::Gpio m_csLCDPinCtx;
|
||||||
mraa::Gpio m_csSDPinCtx;
|
mraa::Gpio m_csSDPinCtx;
|
||||||
mraa::Gpio m_dcPinCtx;
|
mraa::Gpio m_dcPinCtx;
|
||||||
mraa::Gpio m_rstPinCtx;
|
mraa::Gpio m_rstPinCtx;
|
||||||
|
|
||||||
|
mraa::Spi m_spi;
|
||||||
|
|
||||||
std::string m_name;
|
std::string m_name;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -364,11 +364,10 @@ namespace upm
|
|||||||
mraa::Result setAddressingMode(displayAddressingMode mode);
|
mraa::Result setAddressingMode(displayAddressingMode mode);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
mraa::Spi m_spi;
|
||||||
mraa::Gpio m_gpioCD; // command(0)/data(1)
|
mraa::Gpio m_gpioCD; // command(0)/data(1)
|
||||||
mraa::Gpio m_gpioRST; // reset pin
|
mraa::Gpio m_gpioRST; // reset pin
|
||||||
|
|
||||||
mraa::Spi m_spi;
|
|
||||||
|
|
||||||
uint8_t m_cursorX;
|
uint8_t m_cursorX;
|
||||||
uint8_t m_cursorY;
|
uint8_t m_cursorY;
|
||||||
uint8_t m_textSize;
|
uint8_t m_textSize;
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
using namespace upm;
|
using namespace upm;
|
||||||
|
|
||||||
Jhd1313m1::Jhd1313m1(int bus, int lcdAddress, int rgbAddress)
|
Jhd1313m1::Jhd1313m1(int bus, int lcdAddress, int rgbAddress)
|
||||||
: m_i2c_lcd_rgb(bus), Lcm1602(bus, lcdAddress, false)
|
: Lcm1602(bus, lcdAddress, false), m_i2c_lcd_rgb(bus)
|
||||||
{
|
{
|
||||||
m_rgb_address = rgbAddress;
|
m_rgb_address = rgbAddress;
|
||||||
m_name = "Jhd1313m1";
|
m_name = "Jhd1313m1";
|
||||||
|
@ -251,10 +251,20 @@ class Lcm1602 : public LCD
|
|||||||
uint8_t m_displayControl;
|
uint8_t m_displayControl;
|
||||||
uint8_t m_entryDisplayMode;
|
uint8_t m_entryDisplayMode;
|
||||||
|
|
||||||
|
mraa::I2c* m_i2c_lcd_control;
|
||||||
|
|
||||||
|
// gpio operation
|
||||||
|
mraa::Gpio* m_gpioRS;
|
||||||
|
mraa::Gpio* m_gpioEnable;
|
||||||
|
mraa::Gpio* m_gpioD0;
|
||||||
|
mraa::Gpio* m_gpioD1;
|
||||||
|
mraa::Gpio* m_gpioD2;
|
||||||
|
mraa::Gpio* m_gpioD3;
|
||||||
|
|
||||||
// Display size
|
// Display size
|
||||||
uint8_t m_numColumns;
|
uint8_t m_numColumns;
|
||||||
uint8_t m_numRows;
|
uint8_t m_numRows;
|
||||||
|
|
||||||
// Backlight
|
// Backlight
|
||||||
uint8_t m_backlight;
|
uint8_t m_backlight;
|
||||||
|
|
||||||
@ -266,19 +276,10 @@ class Lcm1602 : public LCD
|
|||||||
virtual mraa::Result data(uint8_t data);
|
virtual mraa::Result data(uint8_t data);
|
||||||
|
|
||||||
int m_lcd_control_address;
|
int m_lcd_control_address;
|
||||||
mraa::I2c* m_i2c_lcd_control;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// true if using i2c, false otherwise (gpio)
|
// true if using i2c, false otherwise (gpio)
|
||||||
bool m_isI2C;
|
bool m_isI2C;
|
||||||
|
|
||||||
// gpio operation
|
|
||||||
mraa::Gpio* m_gpioRS;
|
|
||||||
mraa::Gpio* m_gpioEnable;
|
|
||||||
mraa::Gpio* m_gpioD0;
|
|
||||||
mraa::Gpio* m_gpioD1;
|
|
||||||
mraa::Gpio* m_gpioD2;
|
|
||||||
mraa::Gpio* m_gpioD3;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
using namespace upm;
|
using namespace upm;
|
||||||
|
|
||||||
LPD8806::LPD8806 (uint16_t pixelCount, uint8_t csn) : m_csnPinCtx(csn), m_spi(0) {
|
LPD8806::LPD8806 (uint16_t pixelCount, uint8_t csn) :m_spi(0), m_csnPinCtx(csn) {
|
||||||
mraa::Result error = mraa::SUCCESS;
|
mraa::Result error = mraa::SUCCESS;
|
||||||
m_name = "LPD8806";
|
m_name = "LPD8806";
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
using namespace upm;
|
using namespace upm;
|
||||||
|
|
||||||
MAX31723::MAX31723 (int csn) : m_csnPinCtx(csn), m_spi(0) {
|
MAX31723::MAX31723 (int csn) : m_spi(0), m_csnPinCtx(csn) {
|
||||||
mraa::Result error = mraa::SUCCESS;
|
mraa::Result error = mraa::SUCCESS;
|
||||||
m_name = "MAX31723";
|
m_name = "MAX31723";
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
using namespace upm;
|
using namespace upm;
|
||||||
|
|
||||||
MAX5487::MAX5487 (int csn) : m_csnPinCtx(csn), m_spi(0) {
|
MAX5487::MAX5487 (int csn) :m_spi(0), m_csnPinCtx(csn) {
|
||||||
mraa::Result error = mraa::SUCCESS;
|
mraa::Result error = mraa::SUCCESS;
|
||||||
m_name = "MAX5487";
|
m_name = "MAX5487";
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ using namespace upm;
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
MPU9150::MPU9150 (int bus, int address, int magAddress, bool enableAk8975) :
|
MPU9150::MPU9150 (int bus, int address, int magAddress, bool enableAk8975) :
|
||||||
m_mag(0), MPU60X0(bus, address)
|
MPU60X0(bus, address), m_mag(0)
|
||||||
{
|
{
|
||||||
m_magAddress = magAddress;
|
m_magAddress = magAddress;
|
||||||
m_i2cBus = bus;
|
m_i2cBus = bus;
|
||||||
|
@ -35,7 +35,7 @@ using namespace upm;
|
|||||||
|
|
||||||
|
|
||||||
NRF24L01::NRF24L01 (uint8_t cs, uint8_t ce)
|
NRF24L01::NRF24L01 (uint8_t cs, uint8_t ce)
|
||||||
: m_csnPinCtx(cs), m_cePinCtx(ce), m_spi(0)
|
:m_spi(0), m_csnPinCtx(cs), m_cePinCtx(ce)
|
||||||
{
|
{
|
||||||
init (cs, ce);
|
init (cs, ce);
|
||||||
}
|
}
|
||||||
|
@ -35,8 +35,8 @@
|
|||||||
using namespace upm;
|
using namespace upm;
|
||||||
|
|
||||||
ST7735::ST7735 (uint8_t csLCD, uint8_t cSD, uint8_t rs, uint8_t rst)
|
ST7735::ST7735 (uint8_t csLCD, uint8_t cSD, uint8_t rs, uint8_t rst)
|
||||||
: GFX (160, 128, m_map, font), m_csLCDPinCtx(csLCD), m_cSDPinCtx(cSD),
|
: GFX (160, 128, m_map, font), m_spi(0), m_csLCDPinCtx(csLCD), m_cSDPinCtx(cSD),
|
||||||
m_rSTPinCtx(rst), m_rSPinCtx(rs), m_spi(0) {
|
m_rSTPinCtx(rst), m_rSPinCtx(rs) {
|
||||||
|
|
||||||
initModule ();
|
initModule ();
|
||||||
configModule ();
|
configModule ();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user