Algorithm to generate ECDSA keys with random number generator I have a certified random number generator (TRNG, it does not matter what it is for the question).

I would like to use it as a source to generate secp384r1 ECDSA keys. What is the algorithm I should use? Is it possible?

I know that it is generally not a good idea to implement one's own cryptographic algorithms, so is there any library that can be used for this? (something like Bouncy Castle?)
Many libraries allow you to specify your own random number generator. In BouncyCastle, for example, you can specify a SecureRandom in the initialize method of the KeyPairGenerator class; while in Go you can specify a io.Reader to the GenerateKey function.

Therefore, you would need to write a class that implements SecureRandom or io.Reader and reads the specified number of bytes from your TRNG, assuming your TRNG actually produces uniformly distributed random output.  Be careful though, if you mess it up, the whole security of your system is compromised.

(A safer approach would be to make a program that reads from the TRNG and writes to /dev/random, mixing up the system PRNG, assuming it's Linux)