The DHT12 temperature and humidity sensor uses the I2C interface for communication, so you need to use the I2C interface on the RVB2601 development board. By default, the I2C interface on the board is connected to the onboard ES7210 and ES8156 through a jumper cap, so you need to remove the jumper cap. The positions of I2C, power, and ground are as follows.
RVB2601 provides I2C driver functions. When using it, you need to import the header file: __#include <drv/iic.h>__. The functions you need to use include:
csi_error_t csi_iic_init(csi_iic_t *iic, uint32_t idx), initializes a handle of an I2C device, where iic is a variable created by the user and idx is the number of the I2C device, starting from 0. Remember to set the PIN function before initialization ;
csi_error_t csi_iic_mode(csi_iic_t *iic, csi_iic_mode_t mode), configure the working mode of the I2C device. Here it is used as a host, so it needs to be configured as IIC_MODE_MASTER ;
csi_error_t csi_iic_addr_mode(csi_iic_t *iic, csi_iic_addr_mode_t addr_mode), set the address mode of I2C communication, including 7-bit address and 10-bit address, here use 7-bit address, IIC_ADDRESS_7BIT ;
csi_error_t csi_iic_speed(csi_iic_t *iic, csi_iic_speed_t speed), set the I2C communication speed, here use the standard speed, IIC_BUS_SPEED_STANDARD ;
int32_t csi_iic_master_send(csi_iic_t iic,uint32_t devaddr,const void data,uint32_t size,uint32_t timeout), send data. Note that the second parameter devaddr is a 7-bit address. For example, the address 0xB8 given in the DHT12 manual contains the lowest read/write flag bit. Therefore, 0xB8 needs to be shifted left by one bit to get 0x5C .
The driver function of RVB2601 is very simple to use, and the use of I2C is also very simple. It is just stuck at the slave address, which should be a 7-bit address.