What's the formula for choosing FFT sample rate and window length to make sure the frequency I want is in the center of a bin?
The concept you need is to have a whole number of cycles within your sample frame.  The cycle count will be the bin index.

For the math, consider carrying units:

$$ \frac{Cycles}{Frame} = \frac{Cycles}{Second} \cdot \frac{Seconds}{Frame} $$

Where:

$$ \frac{Seconds}{Frame} = \frac{  \frac{Samples}{Frame} }{ \frac{Samples}{Second} } $$

Solving for your sampling Rate:

$$ \frac{Samples}{Second} = \frac{  \frac{Samples}{Frame} }{ \frac{Seconds}{Frame} } $$

$$ \frac{Samples}{Second} =  \frac{ \frac{Samples}{Frame} \cdot \frac{Cycles}{Second}  }{ \frac{Cycles}{Frame} }  $$

If you have a pure tone, there isn't a need to center it on a bin to find your parameters, although it is much easier to do it that way.

To find the frequency, you can use the formulas in these blog articles:


Exact Frequency Formula for a Pure Real Tone in a DFT
Two Bin Exact Frequency Formulas for a Pure Real Tone in a DFT
Improved Three Bin Exact Frequency Formula for a Pure Real Tone in a DFT


Once you have the frequency, you can calculate the amplitude and phase with the formulas in this article:


Phase and Amplitude Calculation for a Pure Real Tone in a DFT: Method 1


You should also realize that you don't need to call a full FFT.  You simply need to calculate the two or three bin values you are interested in which is generally a lot quicker.