Page 1 of 1

[solved] doxygenfunction: Cannot find function “i2c_slave_read”

Posted: Wed Feb 21, 2018 9:51 pm
by rudi ;-)
SRC
not_found.png
not_found.png (34.74 KiB) Viewed 6764 times

Code: Select all

static int i2c_slave_read(i2c_port_t i2c_num, uint8_t* data, size_t max_size, TickType_t ticks_to_wait)
{
    i2c_obj_t* p_i2c = p_i2c_obj[i2c_num];
    size_t size = 0;
    uint8_t* pdata = (uint8_t*) xRingbufferReceiveUpTo(p_i2c->rx_ring_buf, &size, ticks_to_wait, max_size);
    if (pdata && size > 0) {
        memcpy(data, pdata, size);
        vRingbufferReturnItem(p_i2c->rx_ring_buf, pdata);
    }
    return size;
}
LINK



( i2c_slave_read point to i2c_slave_read_buffer )

Code: Select all

/**
 * @brief I2C slave read data from internal buffer. When I2C slave receive data, isr will copy received data
 *        from hardware rx fifo to internal ringbuffer. Then users can read from internal ringbuffer.
 *        @note
 *        Only call this function in I2C slave mode
 *
 * @param i2c_num I2C port number
 * @param data data pointer to write into internal buffer
 * @param max_size Maximum data size to read
 * @param ticks_to_wait Maximum waiting ticks
 *
 * @return
 *     - ESP_FAIL(-1) Parameter error
 *     - Others(>=0) The number of data bytes that read from I2C slave buffer.
 */
 int i2c_slave_read_buffer(i2c_port_t i2c_num, uint8_t* data, size_t max_size, TickType_t ticks_to_wait);
LINK for doxygen


TBD.png
TBD.png (6.61 KiB) Viewed 6756 times
TBD
sry.png
sry.png (131.28 KiB) Viewed 6756 times

Re: doxygenfunction: Cannot find function “i2c_slave_read”

Posted: Wed Feb 21, 2018 11:12 pm
by ESP_Angus
Hi rudi,

Some URLs changed between v2.0 and v2.1, when we cleaned up the documentation in general (including removing these warnings). Unfortunately RTD doesn't give us an easy way to forward the old URLs to the new ones, so switching versions sometimes gives these 404s.

v2.1.1 is a bugfix update to v2.0, so we recommend all users update.

The I2C peripherals docs for v2.1.1:
https://esp-idf.readthedocs.io/en/v2.1. ... tBASE_TYPE


Angus

Re: doxygenfunction: Cannot find function “i2c_slave_read”

Posted: Thu Feb 22, 2018 7:34 pm
by rudi ;-)
ESP_Angus wrote:Hi rudi,

Some URLs changed between v2.0 and v2.1, when we cleaned up the documentation in general (including removing these warnings). Unfortunately RTD doesn't give us an easy way to forward the old URLs to the new ones, so switching versions sometimes gives these 404s.

v2.1.1 is a bugfix update to v2.0, so we recommend all users update.

The I2C peripherals docs for v2.1.1:
https://esp-idf.readthedocs.io/en/v2.1. ... tBASE_TYPE


Angus

hi Angus ( no hurry! )
thank you! we have no standalone example for esp32 as i2c slave. only this combine with master code.

do you know, why i2c_slave_read itself is not listed? i2c_slave_read_buffer is listed - but not i2c_slave_read.
is it an privat interna function so the *f is not for using outside?
found the buffer function only.

Code: Select all

int i2c_slave_read_buffer(i2c_port_t i2c_num, uint8_t *data, size_t max_size, portBASE_TYPE ticks_to_wait)
best wishes
rudi ;-)

Re: doxygenfunction: Cannot find function “i2c_slave_read”

Posted: Thu Feb 22, 2018 10:17 pm
by ESP_Angus
rudi ;-) wrote: do you know, why i2c_slave_read itself is not listed? i2c_slave_read_buffer is listed - but not i2c_slave_read.
is it an privat interna function so the *f is not for using outside?
Correct, this is an internal function only. i2c_slave_read_buffer() and i2c_slave_write_buffer() are the API for using the driver.