Edge states in trimer lattices