Former Barnsley defender Jason McCarthy has hung up his boots at the age of 29 - and landed a coaching role at Brighton & Hove Albion.