Skip to content

Commit cc7ee8a

Browse files
committed
es8388_read_reg
1 parent d4f4f6d commit cc7ee8a

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/Driver/es8388/es8388.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ error_t es8388_write_reg(uint8_t reg_add, uint8_t data)
6060
return es_write_reg(ES8388_ADDR, reg_add, data);
6161
}
6262

63+
error_t es8388_read_reg(uint8_t reg_add, uint8_t *p_data)
64+
{
65+
return i2c_bus_read_bytes(i2c_handle, ES8388_ADDR, &reg_add, sizeof(reg_add), p_data, 1);
66+
}
67+
6368
/**
6469
* @brief Configure ES8388 ADC and DAC volume. Basicly you can consider this as ADC and DAC gain
6570
*

src/Driver/es8388/es8388.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,19 @@ error_t es8388_config_output_device(es_output_device_t output);
262262
*/
263263
error_t es8388_write_reg(uint8_t reg_add, uint8_t data);
264264

265+
/**
266+
* @brief Reads ES8388 register
267+
*
268+
* @param reg_add address of register
269+
* @param data data of register
270+
*
271+
* @return
272+
* - RESULT_FAIL Parameter error
273+
* - RESULT_OK Success
274+
*/
275+
276+
error_t es8388_read_reg(uint8_t reg_add, uint8_t *p_data);
277+
265278
/**
266279
* @brief Print all ES8388 registers
267280
*

0 commit comments

Comments
 (0)