STM32F767 ZI, Trouble understanding how HAL_I2C_MASTER transmit works. Trying to send 32 bit adc data over I2C
So I am trying to send an ADC value that I receiving on the board over I2C to another device.
I have adc_Value as a 32 bit one since the ADC read function on HAL is 32 bits.
I want to send this over i2c.
Currently I have this.
HAL_ADC_Start(&hadc1); // starts the adc
HAL_ADC_PollForConversion(&hadc1, 1); //
// HAL_Delay(2000);
ADC_Value = HAL_ADC_GetValue(&hadc1);
HAL_I2C_Master_Transmit(&hi2c4, slave_addr, (uint8_t*)ADC_Value, 4, 50); // issue with (uint8_t *)
so I was confused about the casting here, I know that they want to send 8 bits but I was wondering since you can select the size as 4 bytes if it would send all 4.
I was thinking then of splitting my adc value into 4 bytes then just sending them one at a time.
Am i able to just send 32bits over I2c?