Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* first send the master write cmd to slave */
- master_write_req = MASTER_WRITE_CMD;
- hal_i2c_master_tx(&i2c_handle,SLAVE_ADDRESS_WRITE,(uint8_t*)&master_write_req,1);
- while(i2c_handle.State != HAL_I2C_STATE_READY);
- master_write_req = WRITE_LEN;
- /* Now send the number of bytes to be written */
- hal_i2c_master_tx(&i2c_handle,SLAVE_ADDRESS_WRITE,(uint8_t*)&master_write_req,1);
- while(i2c_handle.State != HAL_I2C_STATE_READY);
- /* NOW send the data stream */
- hal_i2c_master_tx(&i2c_handle,SLAVE_ADDRESS_WRITE,master_tx_buffer,WRITE_LEN);
- while(i2c_handle.State != HAL_I2C_STATE_READY);
Add Comment
Please, Sign In to add comment