main/SigmaStudioFW.h
void SIGMA_WRITE_REGISTER_BLOCK(int devAddress, int address, int length, ADI_REG_TYPE *pData )
{
		i2c_cmd_handle_t cmd = i2c_cmd_link_create();

      // START I2C
		i2c_master_start(cmd);

      // Send Device ID
		i2c_master_write_byte(cmd, (devAddress << 1) | I2C_MASTER_WRITE, true);

      // mask,shift by one byte, and send upper address byte
		i2c_master_write_byte(cmd, HI(address), true);
//		printf("CMD: %X", HI(address));

      // mask and send lower address byte
		i2c_master_write_byte(cmd, LO(address), true);
//		printf(" %X ", LO(address));

	// Add extra dummy bit if this call is a safe load procedure.
		//|| 0x0811 || 0x0812 || 0x0813 || 0x0814
		if(address>0x0809 && address<=0x0819) {
			i2c_master_write_byte(cmd, 0x00, true);
//			printf(" 00 " );
		}


      // send data byte by byte
		for(int i=0 ; i<length ; i++){
			i2c_master_write_byte(cmd, *pData, true);
//			printf(" %X", *pData);
			pData++;
		}
//		printf("\n");
	  // Send ACK bit on I2C bus

      // STOP I2C
		i2c_master_stop(cmd);

		esp_err_t ret = i2c_master_cmd_begin(I2C_NUM_0, cmd, 1000 / portTICK_RATE_MS);
		i2c_cmd_link_delete(cmd);

		  if (ret == ESP_FAIL) {
		     printf("ESP_I2C_WRITE ERROR : %d\n",ret);
		  } else {
			  printf("ESP32 I2C worked with return: %X\n", ret);
		  }


}
/* 
 * TODO: CUSTOM MACRO IMPLEMENTATION
 * Write to multiple Device registers 
 */
CUSTOM MACRO IMPLEMENTATION
Write to multiple Device registers
CUSTOM MACRO IMPLEMENTATION Write to multiple Device registers
void SIGMA_WRITE_REGISTER_BLOCK(int devAddress, int address, int length, ADI_REG_TYPE *pData )
{
		i2c_cmd_handle_t cmd = i2c_cmd_link_create();
		i2c_master_start(cmd);
		i2c_master_write_byte(cmd, (devAddress << 1) | I2C_MASTER_WRITE, true);
		i2c_master_write_byte(cmd, HI(address), true);
		i2c_master_write_byte(cmd, LO(address), true);
		if(address>0x0809 && address<=0x0819) {
			i2c_master_write_byte(cmd, 0x00, true);
		}
		for(int i=0 ; i<length ; i++){
			i2c_master_write_byte(cmd, *pData, true);
			pData++;
		}
		i2c_master_stop(cmd);
		esp_err_t ret = i2c_master_cmd_begin(I2C_NUM_0, cmd, 1000 / portTICK_RATE_MS);
		i2c_cmd_link_delete(cmd);
		  if (ret == ESP_FAIL) {
		     printf("ESP_I2C_WRITE ERROR : %d\n",ret);
		  } else {
			  printf("ESP32 I2C worked with return: %X\n", ret);
		  }
}
void SIGMA_WRITE_REGISTER_BLOCK ( int devAddress , int address , int length , ADI_REG_TYPE * pData ) { i2c_cmd_handle_t cmd = i2c_cmd_link_create ( ) ; i2c_master_start ( cmd ) ; i2c_master_write_byte ( cmd , ( devAddress << 1 ) | I2C_MASTER_WRITE , true ) ; i2c_master_write_byte ( cmd , HI ( address ) , true ) ; i2c_master_write_byte ( cmd , LO ( address ) , true ) ; if ( address > 0x0809 && address <= 0x0819 ) { i2c_master_write_byte ( cmd , 0x00 , true ) ; } for ( int i = 0 ; i < length ; i ++ ) { i2c_master_write_byte ( cmd , * pData , true ) ; pData ++ ; } i2c_master_stop ( cmd ) ; esp_err_t ret = i2c_master_cmd_begin ( I2C_NUM_0 , cmd , 1000 / portTICK_RATE_MS ) ; i2c_cmd_link_delete ( cmd ) ; if ( ret == ESP_FAIL ) { printf ( " \n " , ret ) ; } else { printf ( " \n " , ret ) ; } }
TODO: CUSTOM MACRO IMPLEMENTATION
 Write to multiple Device registers
TODO : CUSTOM MACRO IMPLEMENTATION Write to multiple Device registers
// START I2C // Send Device ID // mask,shift by one byte, and send upper address byte //		printf("CMD: %X", HI(address)); // mask and send lower address byte //		printf(" %X ", LO(address)); // Add extra dummy bit if this call is a safe load procedure. //|| 0x0811 || 0x0812 || 0x0813 || 0x0814 //			printf(" 00 " ); // send data byte by byte //			printf(" %X", *pData); //		printf("\n"); // Send ACK bit on I2C bus // STOP I2C