The device includes a cardiac therapy circuit with a first terminal, and a peripheral therapy circuit with a second terminal. These terminals can either receive a cardiac detection/stimulation lead and a peripheral detection/stimulation lead of an anatomical structure. The device is configured to recognize the leads and automatically configure the connection terminals. This includes discrimination methods for identifying the terminal on which a cardiac signal is detected, and switching methods for coupling the cardiac therapy circuit to the terminal and the peripheral therapy circuit to the other terminal.