  In this article, we study $p$-adic torus periods for certain $p$-adic valued
functions on Shimura curves coming from classical origin. We prove a $p$-adic
Waldspurger formula for these periods, generalizing the recent work of
Bertolini, Darmon, and Prasanna. In pursuing such a formula, we construct a new
anti-cyclotomic $p$-adic $L$-function of Rankin-Selberg type. At a character of
positive weight, the $p$-adic $L$-function interpolates the central critical
value of the complex Rankin-Selberg $L$-function. Its value at a Dirichlet
character, which is outside the range of interpolation, essentially computes
the corresponding $p$-adic torus period.
