mirror of
https://github.com/raspberrypi/pico-sdk.git
synced 2025-02-11 00:39:55 +00:00
Add some missing i2c function documentation (#1650)
Add i2c_get_index for consistency - just calls i2c_hw_index
This commit is contained in:
parent
f1f3bd6bf6
commit
0d56f52b7b
@ -148,11 +148,33 @@ static inline uint i2c_hw_index(i2c_inst_t *i2c) {
|
||||
return i2c == i2c1 ? 1 : 0;
|
||||
}
|
||||
|
||||
/*! \brief Convert I2C instance to hardware instance number
|
||||
* \ingroup hardware_i2c
|
||||
*
|
||||
* \param i2c I2C instance
|
||||
* \return Number of I2C, 0 or 1.
|
||||
*/
|
||||
static inline uint i2c_get_index(i2c_inst_t *i2c) {
|
||||
return i2c_hw_index(i2c);
|
||||
}
|
||||
|
||||
/*! \brief Return pointer to structure containing i2c hardware registers
|
||||
* \ingroup hardware_i2c
|
||||
*
|
||||
* \param i2c I2C instance
|
||||
* \return pointer to \ref i2c_hw_t
|
||||
*/
|
||||
static inline i2c_hw_t *i2c_get_hw(i2c_inst_t *i2c) {
|
||||
i2c_hw_index(i2c); // check it is a hw i2c
|
||||
return i2c->hw;
|
||||
}
|
||||
|
||||
/*! \brief Convert I2C hardware instance number to I2C instance
|
||||
* \ingroup hardware_i2c
|
||||
*
|
||||
* \param Number of I2C, 0 or 1
|
||||
* \return I2C hardware instance
|
||||
*/
|
||||
static inline i2c_inst_t *i2c_get_instance(uint instance) {
|
||||
static_assert(NUM_I2CS == 2, "");
|
||||
invalid_params_if(I2C, instance >= NUM_I2CS);
|
||||
|
Loading…
x
Reference in New Issue
Block a user