An integrated interface for peripheral neural system recording and stimulation: system design, electrical tests and in-vivo results