annotate Small_CPU/Inc/i2c.h @ 196:2885628ab3ba div-fixes-cleaup-2

Bugfix, minor: color the overview customview correctly When using a custom color (from the SYS2 menu, layout), the overview customview was the only one presented in the wrong color. While the fix for this is rather simple (in hindsight), it was a non trivial search trough rather obfuscated code. There is a specific function to set the text color index on this page, but this only worked for a single line text string, that has the color index byte as the very first character. The original author already recognized that this function "could be extended", but left this extension as an exercise to the reader. So, the coloring is fixed by extending the function, and actually using it for the overview customview. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
author Jan Mulder <jlmulder@xs4all.nl>
date Wed, 20 Mar 2019 16:24:10 +0100
parents 9ecc2e60418d
children cb3870f79e9d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1 /* Define to prevent recursive inclusion -------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2 #ifndef I2C_H
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3 #define I2C_H
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4
165
e9cce686fe41 Minor: Some documentation for new hardware
heinrichsweikamp
parents: 38
diff changeset
5 /* Pressure Sensor */
e9cce686fe41 Minor: Some documentation for new hardware
heinrichsweikamp
parents: 38
diff changeset
6 #define DEVICE_PRESSURE 0xEE // 2019 hardware (gen 3) will use 0xEC (MS5837), all other use 0xEE (MS5803)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7
165
e9cce686fe41 Minor: Some documentation for new hardware
heinrichsweikamp
parents: 38
diff changeset
8 /* Compass/Accelerometer */
e9cce686fe41 Minor: Some documentation for new hardware
heinrichsweikamp
parents: 38
diff changeset
9 #define DEVICE_ACCELARATOR_MMA8452Q 0x38 // Hardware gen 1 (Two chip solution with MMA8452Q and HMC5883L)
e9cce686fe41 Minor: Some documentation for new hardware
heinrichsweikamp
parents: 38
diff changeset
10 #define DEVICE_COMPASS_HMC5883L 0x3C // Hardware gen 1
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
11
165
e9cce686fe41 Minor: Some documentation for new hardware
heinrichsweikamp
parents: 38
diff changeset
12 #define DEVICE_COMPASS_303D 0x3C // Hardware gen 2 (Single chip solution LSM303D)
e9cce686fe41 Minor: Some documentation for new hardware
heinrichsweikamp
parents: 38
diff changeset
13 #define DEVICE_COMPASS_303AGR 0x3C // Hardware gen 3 (Single chip solution LSM303AGR)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
14
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
15 /* Battery Gas Gauge */
165
e9cce686fe41 Minor: Some documentation for new hardware
heinrichsweikamp
parents: 38
diff changeset
16 #define DEVICE_BATTERYGAUGE 0xC8 // LTC2941 battery gauge
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
17
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
18
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
19 /* Includes ------------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
20 #include "stm32f4xx_hal.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
21
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
22 HAL_StatusTypeDef I2C_Master_Transmit( uint16_t DevAddress, uint8_t *pData, uint16_t Size);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
23 HAL_StatusTypeDef I2C_Master_TransmitNoStop( uint16_t DevAddress, uint8_t *pData, uint16_t Size);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
24 HAL_StatusTypeDef I2C_Master_Receive( uint16_t DevAddress, uint8_t *pData, uint16_t Size);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
25 HAL_StatusTypeDef MX_I2C1_Init(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
26 void I2C_DeInit(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
27 HAL_StatusTypeDef I2C1_Status(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
28
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
29 GPIO_PinState MX_I2C1_TestAndClear(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
30
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
31 //void I2C_Error(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
32
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
33
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
34 #endif /* I2C_H */