Merge branch 'lvgl' of https://github.com/Zaltora/esp-open-rtos into lvgl
This commit is contained in:
commit
75d149a2dc
4 changed files with 32 additions and 3 deletions
|
@ -606,9 +606,9 @@ sysparam_status_t sysparam_create_area(uint32_t base_addr, uint16_t num_sectors,
|
|||
if (!force) {
|
||||
// First, scan through the area and make sure it's actually empty and
|
||||
// we're not going to be clobbering something else important.
|
||||
for (addr = base_addr; addr < base_addr + region_size * 2; addr += SCAN_BUFFER_SIZE) {
|
||||
for (addr = base_addr; addr < base_addr + region_size * 2; addr += SCAN_BUFFER_SIZE * sizeof(uint32_t)) {
|
||||
debug(3, "read %d words @ 0x%08x", SCAN_BUFFER_SIZE, addr);
|
||||
CHECK_FLASH_OP(spiflash_read(addr, (uint8_t*)buffer, SCAN_BUFFER_SIZE * 4));
|
||||
CHECK_FLASH_OP(spiflash_read(addr, (uint8_t*)buffer, SCAN_BUFFER_SIZE * sizeof(uint32_t)));
|
||||
for (i = 0; i < SCAN_BUFFER_SIZE; i++) {
|
||||
if (buffer[i] != 0xffffffff) {
|
||||
// Uh oh, not empty.
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
* Required for buffered drawing, opacity and anti-aliasing
|
||||
* VDB makes the double buffering, you don't need to deal with it!
|
||||
* Typical size: ~1/10 screen */
|
||||
#define LV_VDB_SIZE (LV_VER_RES * LV_HOR_RES / 2) /*Size of VDB in pixel count (1/10 screen size is good for first)*/
|
||||
#define LV_VDB_SIZE (LV_VER_RES * LV_HOR_RES) /*Size of VDB in pixel count (1/10 screen size is good for first)*/
|
||||
#define LV_VDB_PX_BPP 1 /*Bit-per-pixel of VDB. Useful for monochrome or non-standard color format displays. (Set `disp_drv->vdb_wr` and `disp_drv->vdb_rd` too)*/
|
||||
#define LV_VDB_ADR 0 /*Place VDB to a specific address (e.g. in external RAM) (0: allocate automatically into RAM; LV_VDB_ADR_INV: to replace it later with `lv_vdb_set_adr()`)*/
|
||||
|
||||
|
|
|
@ -93,6 +93,18 @@ int16_t ads111x_get_value(i2c_dev_t *dev)
|
|||
return read_reg(dev, REG_CONVERSION);
|
||||
}
|
||||
|
||||
int16_t ads101x_get_value(i2c_dev_t *dev)
|
||||
{
|
||||
uint16_t res = read_reg(dev, REG_CONVERSION) >> 4;
|
||||
if (res > 0x07FF)
|
||||
{
|
||||
// negative number - extend the sign to 16th bit
|
||||
res |= 0xF000;
|
||||
}
|
||||
return (int16_t)res;
|
||||
}
|
||||
|
||||
|
||||
ads111x_gain_t ads111x_get_gain(i2c_dev_t *dev)
|
||||
{
|
||||
return read_conf_bits(dev, PGA_OFFSET, PGA_MASK);
|
||||
|
|
|
@ -22,6 +22,16 @@ extern "C" {
|
|||
#define ADS111X_ADDR_SCL 0x4b
|
||||
|
||||
#define ADS111X_MAX_VALUE 0x7fff
|
||||
#define ADS101X_MAX_VALUE 0x7ff
|
||||
|
||||
// ADS101X overrides
|
||||
#define ADS101X_DATA_RATE_128 ADS111X_DATA_RATE_8
|
||||
#define ADS101X_DATA_RATE_250 ADS111X_DATA_RATE_16
|
||||
#define ADS101X_DATA_RATE_490 ADS111X_DATA_RATE_32
|
||||
#define ADS101X_DATA_RATE_920 ADS111X_DATA_RATE_64
|
||||
#define ADS101X_DATA_RATE_1600 ADS111X_DATA_RATE_128
|
||||
#define ADS101X_DATA_RATE_2400 ADS111X_DATA_RATE_250
|
||||
#define ADS101X_DATA_RATE_3300 ADS111X_DATA_RATE_475
|
||||
|
||||
/**
|
||||
* Gain amplifier
|
||||
|
@ -140,6 +150,13 @@ void ads111x_start_conversion(i2c_dev_t *dev);
|
|||
*/
|
||||
int16_t ads111x_get_value(i2c_dev_t *dev);
|
||||
|
||||
/**
|
||||
* Read last conversion result for 101x
|
||||
* @param addr
|
||||
* @return Last conversion result
|
||||
*/
|
||||
int16_t ads101x_get_value(i2c_dev_t *dev);
|
||||
|
||||
/**
|
||||
* Read the programmable gain amplifier configuration
|
||||
* (ADS1114 and ADS1115 only).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue