#include <stdint.h>
#include "no_os_i2c.h"
Go to the source code of this file.
|
#define | RETURN_ON_ERR(x) |
|
#define | REG_WRITE_RETURN_ON_ERR(ret, i2c_desc, reg, writeval) |
|
#define | REG_READ_RETURN_ON_ERR(ret, i2c_desc, reg, mask, readval) |
|
#define | REG_UPDATE_RETURN_ON_ERR(ret, i2c_desc, reg, val, mask) |
|
#define | BREAK_ON_ERR(x) |
|
#define | REG_WRITE_BREAK_ON_ERR(ret, i2c_desc, reg, writeval) |
|
#define | REG_READ_BREAK_ON_ERR(ret, i2c_desc, reg, mask, readval) |
|
#define | REG_UPDATE_BREAK_ON_ERR(ret, i2c_desc, reg, val, mask) |
|
◆ BREAK_ON_ERR
#define BREAK_ON_ERR |
( |
| x | ) |
|
◆ REG_READ_BREAK_ON_ERR
#define REG_READ_BREAK_ON_ERR |
( |
| ret, |
|
|
| i2c_desc, |
|
|
| reg, |
|
|
| mask, |
|
|
| readval ) |
Value:{\
BREAK_ON_ERR(ret);\
}
int32_t gmsl_reg_read(struct no_os_i2c_desc *i2c_desc, uint16_t reg, uint8_t mask, uint8_t *readval)
Read a value from a GMSL register.
Definition gmsl_reg_access.c:51
◆ REG_READ_RETURN_ON_ERR
#define REG_READ_RETURN_ON_ERR |
( |
| ret, |
|
|
| i2c_desc, |
|
|
| reg, |
|
|
| mask, |
|
|
| readval ) |
Value: {\
if(ret)\
return ret;\
}
◆ REG_UPDATE_BREAK_ON_ERR
#define REG_UPDATE_BREAK_ON_ERR |
( |
| ret, |
|
|
| i2c_desc, |
|
|
| reg, |
|
|
| val, |
|
|
| mask ) |
Value:{\
BREAK_ON_ERR(ret);\
}
int32_t gmsl_reg_update(struct no_os_i2c_desc *i2c_desc, uint16_t reg, uint8_t val, uint8_t mask)
Update a value in a GMSL register.
Definition gmsl_reg_access.c:119
◆ REG_UPDATE_RETURN_ON_ERR
#define REG_UPDATE_RETURN_ON_ERR |
( |
| ret, |
|
|
| i2c_desc, |
|
|
| reg, |
|
|
| val, |
|
|
| mask ) |
Value: {\
if(ret)\
return ret;\
}
◆ REG_WRITE_BREAK_ON_ERR
#define REG_WRITE_BREAK_ON_ERR |
( |
| ret, |
|
|
| i2c_desc, |
|
|
| reg, |
|
|
| writeval ) |
Value:{\
BREAK_ON_ERR(ret);\
}
int32_t gmsl_reg_write(struct no_os_i2c_desc *i2c_desc, uint16_t reg, uint8_t writeval)
Write a value to a GMSL register.
Definition gmsl_reg_access.c:90
◆ REG_WRITE_RETURN_ON_ERR
#define REG_WRITE_RETURN_ON_ERR |
( |
| ret, |
|
|
| i2c_desc, |
|
|
| reg, |
|
|
| writeval ) |
Value: {\
if(ret)\
return ret;\
}
◆ RETURN_ON_ERR
#define RETURN_ON_ERR |
( |
| x | ) |
|
◆ gmsl_reg_read()
int32_t gmsl_reg_read |
( |
struct no_os_i2c_desc * | i2c_desc, |
|
|
uint16_t | reg, |
|
|
uint8_t | mask, |
|
|
uint8_t * | readval ) |
Read a value from a GMSL register.
Read a device register through the I2C interface.
- Parameters
-
i2c_desc | - Pointer to the I2C descriptor. |
reg | - Register address to read from. |
mask | - Mask to apply to the read value. |
readval | - Pointer to store the read value. |
- Returns
- 0 in case of success, negative error code in case of PAL errors.
◆ gmsl_reg_update()
int32_t gmsl_reg_update |
( |
struct no_os_i2c_desc * | i2c_desc, |
|
|
uint16_t | reg, |
|
|
uint8_t | val, |
|
|
uint8_t | mask ) |
Update a value in a GMSL register.
Read-modify-write operation on a field of a register.
- Parameters
-
i2c_desc | - Pointer to the I2C descriptor. |
reg | - Register address to update. |
val | - Value to write to the register. |
mask | - Mask to apply to the value. |
- Returns
- 0 in case of success, negative error code in case of PAL errors.
- Todo
- Revert this after removal of explicit mask being used in mission mode api's
◆ gmsl_reg_write()
int32_t gmsl_reg_write |
( |
struct no_os_i2c_desc * | i2c_desc, |
|
|
uint16_t | reg, |
|
|
uint8_t | writeval ) |
Write a value to a GMSL register.
Write a device register through the I2C interface.
- Parameters
-
i2c_desc | - Pointer to the I2C descriptor. |
reg | - Register address to write to. |
writeval | - Value to write to the register. |
- Returns
- 0 in case of success, negative error code in case of PAL errors.