Generalise udp for sam7