A mixed-signal multi-functional system for current measurement and stress detection