Better late than never I guess. Here's the code I used for the demo.
I'll mention what happened to this project in a new thread.
There are many other AFEs available now, I would consider using something like
BQ76940 or
BQ76PL455A-Q1.
Linear also have some interesting devices such as
LTC6812-1