BME280 Environmental Sensor
* |----------------+---------------------|-------------|
*/
return
rslt;
}
int8_t
user_spi_write
(
uint8_t
dev_id,
uint8_t
reg_addr,
uint8_t
*reg_data,
uint16_t
len)
{
int8_t
rslt =
0
;
/* Return 0 for Success, non-zero for failure */
/*
* The parameter dev_id can be used as a variable to select which Chip
Select pin has
* to be set low to activate the relevant device on the SPI bus
*/
/*
* Data on the bus should be like
* |---------------------+--------------+-------------|
* | MOSI | MISO | Chip Select |
* |---------------------+--------------|-------------|
* | (don't care) | (don't care) | HIGH |
* | (reg_addr) | (don't care) | LOW |
* | (reg_data[0]) | (don't care) | LOW |
* | (....) | (....) | LOW |
* | (reg_data[len - 1]) | (don't care) | LOW |
* | (don't care) | (don't care) | HIGH |
* |---------------------+--------------|-------------|
*/
return
rslt;
}
int8_t
user_i2c_read
(
uint8_t
dev_id,
uint8_t
reg_addr,
uint8_t
*reg_data,
uint16_t
len)
{
int8_t
rslt =
0
;
/* Return 0 for Success, non-zero for failure */
/*
* The parameter dev_id can be used as a variable to store the I2C
address of the device
*/