Compare commits

..

No commits in common. "0138b7d152da90e57b5fd7b429eccddf49d04b09" and "a19c3a68bf77d7e8505ece39131b6d9e52e460f5" have entirely different histories.

4 changed files with 30 additions and 77 deletions

View File

@ -26,14 +26,14 @@ Possible choices :
* MPU6050 * MPU6050
* BMI160 * BMI160
* LSM6DS3 * LSM6DS3
* BMA456 <-- **SELECTED** i2c addr : 0x18 or 0x19 7 bit address, has the wrist tilt detection feature. * BMA456 <-- SELECTED i2c addr : 0x18 or 0x19 7 bit address, has the wrist tilt detection feature.
* A magnetometer (possible choices): * A magnetometer (possible choices):
* HMC5883L <-- After reading some comparison articles between the HMC5883L and QMC5883L and the datasheets, the later seems better in term of perfomances. * HMC5883L <-- After reading some comparison articles between the HMC5883L and QMC5883L and the datasheets, the later seems better in term of perfomances.
* QMC5883L <-- **SELECTED** i2c addr : 0x0D 7 bit address, better soldering footprint * QMC5883L <-- SELECTED i2c addr : 0x0D 7 bit address, better soldering footprint
* LSM303DLHC * LSM303DLHC
* BMM150 <-- Package with balls, hard to handle * BMM150 <-- Package with balls, hard to handle
* An air pressure/temperature sensor (to display the altitude for example) * An air pressure/temperature sensor (to display the altitude for example)
* BMP280 <-- **SELECTED** i2c addr : 0x76 or 0x77 * BMP280 <-- SELECTED i2c addr : 0x76 or 0x77
## Actuators : ## Actuators :
* A vibration motor to notify events to the user. * A vibration motor to notify events to the user.
@ -92,18 +92,16 @@ Requirements : 4 line serial interface in 8 bit mode with a dedicated Data/Comma
* Supported LCD drivers : * Supported LCD drivers :
* ILI9341 in 4-line serial mode (8 bits) with D/C pin * ILI9341 in 4-line serial mode (8 bits) with D/C pin
* ST7789 in 4-line serial mode (8 bits) with D/C pin * ST7789 in 4-line serial mode (8 bits) with D/C pin
* GC9A01 in 4-line serial mode (8 bits) with D/C pin * Two screens designed and working with LVGL :
* Three screens designed and working with LVGL : * 1 watch face based on a casio watch
* 1 watch face based on a casio watch. * 1 menu list with icons.
* 1 menu list screen with icons.
* 1 setting screen with basic settings (date and time + display brightness) (work in progress).
## To do : ## To do :
* Write I2C drivers for the : * Write I2C drivers for the :
* [X] BMA456 * [ ] BMA456
* [ ] BMP280 * [ ] BMP280
* [X] QMC5883L * [X] QMC5883L
* [X] Write the init sequence for the GC9A01 LCD driver. * [ ] Write the init sequence for the GC9A01 LCD driver.
* [ ] Finish to design the settings page. * [ ] Finish to design the settings page.
* [ ] Test the charge circuit. * [ ] Test the charge circuit.
* Design and test the : * Design and test the :

View File

@ -29,8 +29,8 @@ static void lcd_set_data_command(LCDConfig_t * const LCDConfig, LCDDataCommand_e
static void lcd_write_cmd_data_bytes(LCDConfig_t * const LCDConfig, const uint8_t *cmdAndData, uint32_t dataLengthInBytes); static void lcd_write_cmd_data_bytes(LCDConfig_t * const LCDConfig, const uint8_t *cmdAndData, uint32_t dataLengthInBytes);
// ST7789初始化 // ST7789初始化
const uint8_t st7789_init_seq[] = { /*const uint8_t st7789_init_seq[] = {
// len, delay, cmd, data ... // len , delay, cmd, data ...
0x01, 0x14, 0x01, // Software reset 0x01, 0x14, 0x01, // Software reset
0x01, 0x0A, 0x11, // Exit sleep mode 0x01, 0x0A, 0x11, // Exit sleep mode
0x02, 0x02, 0x3A, 0x55, // Set colour mode to 16 bit 0x02, 0x02, 0x3A, 0x55, // Set colour mode to 16 bit
@ -41,10 +41,24 @@ const uint8_t st7789_init_seq[] = {
0x01, 0x02, 0x13, // Normal display on, then 10 ms delay 0x01, 0x02, 0x13, // Normal display on, then 10 ms delay
0x01, 0x02, 0x29, // Main screen turn on, then wait 500 ms 0x01, 0x02, 0x29, // Main screen turn on, then wait 500 ms
0 // Terminate list 0 // Terminate list
};*/
const uint8_t st7789_init_seq[] = {
/* len , delay, cmd, data ... */
0x01, // Software reset
0x11, // Exit sleep mode
//0x02, 0x02, 0x3A, 0x05, // Set colour mode to 16 bit
//0x02, 0x0A, 0x36, 0x00, // Set MADCTL: row then column, refresh is bottom to top ????
//0x05, 0x0A, 0x2A, 0x00, 0x00, 0x00, 0xf0, // CASET: column addresses from 0 to 240 (f0)
//0x05, 0x0A, 0x2B, 0x00, 0x00, 0x01, 0x40, // RASET: row addresses from 0 to 240 (f0)
//0x01, 0x0A, 0x21, // Inversion on, then 10 ms delay (supposedly a hack?)
0x13, // Normal display on, then 10 ms delay
0x29, // Main screen turn on, then wait 500 ms
0 // Terminate list
}; };
/*const uint8_t st7789_init_seq_9_bit[] = { const uint8_t st7789_init_seq_9_bit[] = {
// len, delay, cmd, data ... /* len , delay, cmd, data ... */
0x01, 0x14, 0x01, // Software reset 0x01, 0x14, 0x01, // Software reset
0x01, 0x0A, 0x11, // Exit sleep mode 0x01, 0x0A, 0x11, // Exit sleep mode
//0x02, 0x02, 0x3A, 0x05, // Set colour mode to 16 bit //0x02, 0x02, 0x3A, 0x05, // Set colour mode to 16 bit
@ -55,62 +69,6 @@ const uint8_t st7789_init_seq[] = {
0x01, 0x0A, 0x13, // Normal display on, then 10 ms delay 0x01, 0x0A, 0x13, // Normal display on, then 10 ms delay
0x01, 0x0A, 0x29, // Main screen turn on, then wait 500 ms 0x01, 0x0A, 0x29, // Main screen turn on, then wait 500 ms
0 // Terminate list 0 // Terminate list
};*/
const uint8_t gc9a01_init_seq[] = {
// len, delay, cmd, data ...
0x01, 5, 0x01,
0x01, 0, 0xEF,
0x02, 0, 0xEB, 0x14,
0x01, 0, 0xFE,
0x01, 0, 0xEF,
0x02, 0, 0xEB, 0x14,
0x02, 0, 0x84, 0x40,
0x02, 0, 0x85, 0xFF,
0x02, 0, 0x86, 0xFF,
0x02, 0, 0x87, 0xFF,
0x02, 0, 0x88, 0x0A,
0x02, 0, 0x89, 0x21,
0x02, 0, 0x8A, 0x00,
0x02, 0, 0x8B, 0x80,
0x02, 0, 0x8C, 0x01,
0x02, 0, 0x8D, 0x01,
0x02, 0, 0x8E, 0xFF,
0x02, 0, 0x8F, 0xFF,
0x03, 0, 0xB6, 0x00, 0x00,
0x02, 0, 0x36, 0x48,
0x02, 0, 0x3A, 0x55,
0x05, 0, 0x90, 0x08, 0x08, 0x08, 0x08,
0x02, 0, 0xBD, 0x06,
0x02, 0, 0xBC, 0x00,
0x04, 0, 0xFF, 0x60, 0x01, 0x04,
0x02, 0, 0xC3, 0x13,
0x02, 0, 0xC4, 0x13,
0x02, 0, 0xC9, 0x22,
0x02, 0, 0xBE, 0x11,
0x03, 0, 0xE1, 0x10, 0x0E,
0x04, 0, 0xDF, 0x21, 0x0C, 0x02,
0x07, 0, 0xF0, 0x45, 0x09, 0x08, 0x08, 0x26, 0x2A,
0x07, 0, 0xF1, 0x43, 0x70, 0x72, 0x36, 0x37, 0x6F,
0x07, 0, 0xF2, 0x45, 0x09, 0x08, 0x08, 0x26, 0x2A,
0x07, 0, 0xF3, 0x43, 0x70, 0x72, 0x36, 0x37, 0x6F,
0x03, 0, 0xED, 0x1B, 0x0B,
0x02, 0, 0xAE, 0x77,
0x02, 0, 0xCD, 0x63,
0x0A, 0, 0x70, 0x07, 0x07, 0x04, 0x0E, 0x0F, 0x09, 0x07, 0x08, 0x03,
0x02, 0, 0xE8, 0x34,
0x0D, 0, 0x62, 0x18, 0x0D, 0x71, 0xED, 0x70, 0x70, 0x18, 0x0F, 0x71, 0xEF, 0x70, 0x70,
0x0D, 0, 0x63, 0x18, 0x11, 0x71, 0xF1, 0x70, 0x70, 0x18, 0x13, 0x71, 0xF3, 0x70, 0x70,
0x08, 0, 0x64, 0x28, 0x29, 0xF1, 0x01, 0xF1, 0x00, 0x07,
0x0B, 0, 0x66, 0x3C, 0x00, 0xCD, 0x67, 0x45, 0x45, 0x10, 0x00, 0x00, 0x00,
0x0B, 0, 0x67, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x01, 0x54, 0x10, 0x32, 0x98,
0x08, 0, 0x74, 0x10, 0x85, 0x80, 0x00, 0x00, 0x4E, 0x00,
0x03, 0, 0x98, 0x3E, 0x07,
0x01, 0, 0x35,
0x01, 0, 0x21,
0x01, 5, 0x11, // Exit from sleep
0x01, 0, 0x29, // Display on
0 // Terminate list
}; };
/** /**
@ -122,7 +80,7 @@ const uint8_t gc9a01_init_seq[] = {
*/ */
// ILI9341初始化 // ILI9341初始化
const uint8_t ili9341_init_seq[] = { const uint8_t ili9341_init_seq[] = {
/* len, delay, cmd, data ... */ /* len , delay, cmd, data ... */
0x01, 0x14, 0x01, // Software reset 0x01, 0x14, 0x01, // Software reset
0x04, 0x00, 0xCF, 0x00, 0xD9, 0x30, 0x04, 0x00, 0xCF, 0x00, 0xD9, 0x30,
0x05, 0x00, 0xED, 0x64, 0x03, 0x12, 0x81, 0x05, 0x00, 0xED, 0x64, 0x03, 0x12, 0x81,
@ -154,7 +112,7 @@ const uint8_t ili9341_init_seq[] = {
// ILI9488初始化 // ILI9488初始化
const uint8_t ili9488_init_seq[] = { const uint8_t ili9488_init_seq[] = {
/* len, delay, cmd, data ... */ /* len , delay, cmd, data ... */
0x05, 0x00, 0xF7, 0xA9, 0x51, 0x2C, 0x82, 0x05, 0x00, 0xF7, 0xA9, 0x51, 0x2C, 0x82,
0x03, 0x00, 0xC0, 0x11, 0x09, 0x03, 0x00, 0xC0, 0x11, 0x09,
0x02, 0x00, 0xC1, 0x41, 0x02, 0x00, 0xC1, 0x41,
@ -176,7 +134,7 @@ const uint8_t ili9488_init_seq[] = {
// ST7796S初始化 // ST7796S初始化
const uint8_t ST7796S_init_seq[] = { const uint8_t ST7796S_init_seq[] = {
/* len, delay, cmd, data ... */ /* len , delay, cmd, data ... */
0x02, 0x00, 0xF0, 0xC3, 0x02, 0x00, 0xF0, 0xC3,
0x02, 0x00, 0xF0, 0x96, 0x02, 0x00, 0xF0, 0x96,
0x02, 0x00, 0x36, 0x68, 0x02, 0x00, 0x36, 0x68,
@ -334,8 +292,6 @@ void lcd_init(LCDConfig_t * const LCDConfig)
const u8 *cmd = ili9341_init_seq; const u8 *cmd = ili9341_init_seq;
#elif DISPLAY_CONTROLLER == 1 #elif DISPLAY_CONTROLLER == 1
const u8 *cmd = st7789_init_seq; const u8 *cmd = st7789_init_seq;
#elif DISPLAY_CONTROLLER == 2
const u8 *cmd = gc9a01_init_seq;
#endif #endif
// We send the init sequence to the screen : // We send the init sequence to the screen :

View File

@ -9,8 +9,7 @@
/* Display drive controller */ /* Display drive controller */
#define ILI9341 0 #define ILI9341 0
#define ST7789V 1 #define ST7789V 1
#define GC9A01 2 #define DISPLAY_CONTROLLER ILI9341
#define DISPLAY_CONTROLLER GC9A01
//#define DISPLAY_CONTROLLER ST7789V //#define DISPLAY_CONTROLLER ST7789V
/* Display properties */ /* Display properties */