Hello!
As a former user of MSP430, I can tell you that the code you want almost certainly already exists
in source code, examples provided by TI. I have restarted recently just for fun, with MSP430FR5994
(FRAM based).
All their source code are named "slacxxx.zip". And there is one slac file per MSP family.
In the past it used to contain .asm and the equivalent .c file. But the slac I downloaded recently
contains only C files.
And the good thing about their examples is that they all fit in 1 page. This means that it just
focuses on 1 item. For example (1 exampe per file)
adc01.c : how to read a single sample, one shot
adc02.c : single sequence of n values
adc03.c: single sample repeated
adc03.c: sequence repeated ...
etc, etc..
It's a lot easier to understand than a full program mixing many features. So in the i2cxx.c,
you will probably find the exact configuration you are looking for.
Beside this, MSP430 has a built-in I2C engine, so you don't even have to bother bit banging
it, you configure the I2C engine and you can write your own read and write functions.
That's pretty straightforward.
What MSP are you using?
Dora