mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-30 22:05:21 +00:00
feat(i2c): Add pure hal i2c master driver example
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -757,6 +757,20 @@ static inline void i2c_ll_slave_clear_stretch(i2c_dev_t *dev)
|
||||
// Not supported on esp32
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check if i2c command is done.
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param cmd_idx The index of the command register, must be less than 16
|
||||
*
|
||||
* @return True if the `cmd_idx` command is done. Otherwise false.
|
||||
*/
|
||||
__attribute__((always_inline))
|
||||
static inline bool i2c_ll_master_is_cmd_done(i2c_dev_t *hw, int cmd_idx)
|
||||
{
|
||||
return hw->command[cmd_idx].done;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////Deprecated Functions//////////////////////////////////////////////////////////
|
||||
/////////////////////////////The following functions are only used by the legacy driver/////////////////////////////////
|
||||
/////////////////////////////They might be removed in the next major release (ESP-IDF 6.0)//////////////////////////////
|
||||
|
Reference in New Issue
Block a user