I am porting Arduino to atXmega128A1

Nope. Don't no if Rene' has. Any such API would need the involvement of the "big 5".

First order of business is a simple port of the current Arduino features. Then there's all sorts of fun stuff on the xmega to explore.

Event system lets you do a lot of stuff with very little CPU involvement.