Where can I find aac file structure/format?

I need to make an aac decoder in an embedded system chip
I am looking for a clear explanation for the AAC file format, perhaps a diagram similar to this wav file format chart (https://www.mathworks.com/matlabcentral/fileexchange/28028-mpeg-4-aac-lc-decoder) , but for AAC
I have also seen this matlab project for m4a decoder
https://www.mathworks.com/matlabcentral/fileexchange/28028-mpeg-4-aac-lc-decoder
and it looks like the project reads m4a file, somehow separates the aac audio information from this file, and then applies decoding on the aac audio information part to get raw audio output, but it’s not giving a clear idea of what the aac file structure is like

What I ideally want to have happen, is be able to read in an aac file directly in the matlab program (instead of m4a file), then decode this aac information using the decoder given in the matlab program (which I then be used as basis to create the aac decoder for the embedded processor)

Where can I find detail information about the aac file structure?

(I have also seen the faad2 aac decoder project’s C source code, but it’s more complicated and that’s why I want to go with the matlab approach. The matlab project I linked does not use faad2 or any other library to perform the actual aac decoding. The downside is that it only shows how to read from an m4a file, and I need to read an aac file)

There’s general information on Wikipedia: Advanced Audio Coding - Wikipedia

I note that in the Licensing and patents section it says:

a patent license is required for all manufacturers or developers of AAC codecs.[41] For this reason, free and open source software implementations such as FFmpeg and FAAC may be distributed in source form only, in order to avoid patent infringement.

(This is why Audacity is not allowed to ship with built-in AAC support and users have to obtain FFmpeg binaries from third parties if they wish to use them).

There may also be some useful information here: audio - Is there a specification for AAC-LC (de)compression? - Stack Overflow