ETPU - Reason of register_chan_base usage

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ETPU - Reason of register_chan_base usage

Jump to solution
1,976 Views
mertk
Contributor IV

Hi everyone, 

Nowadays, I am studying on AN4907 EngineControl demo and I notice that when we call the local variables in the local functions, we use the register_chan_base keyword as shown in below. 

mertk_0-1641361653376.png

I took the image above from the etpuc_crank.c file of the AN4907 demo and "register_chan_base" is used for register keyword. I went on the register_chan_base definition and I jumped into the ETpu_Hw.h file (below image). It specifies default type of the register_chan_base is unsigned int24. 

mertk_1-1641361792144.png

mertk_2-1641362605624.png

 

Now, this is my question; What is the purpose of the usage of register_chan_base in this demo? I mean, the size of the register_chan_base is not enough to hold the struct of CRANK_CHAN_PARAMS. 

Best regards, 

Mert. 

 

0 Kudos
Reply
1 Solution
1,963 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport
4 Replies
1,938 Views
mertk
Contributor IV

Hi again, 

I checked the documents and I accept two of your answers as solution. 

Thanks you again.

Mert KİREMİTCİ

0 Kudos
Reply
1,942 Views
mertk
Contributor IV

Hi,

Thanks a lot for your helps. 

I will check the specified documents as soon as possible.  

Mert KİREMİTCİ

0 Kudos
Reply
1,964 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport
1,955 Views
johndiener
Contributor IV

That is an interesting document with some good information, although some is ByteCraft specific.  For some more information on the same topic, I also invite a look at section 5.1.1 of https://services.ashware.com/Download_Files/compiler_ref_manual.pdf.

Note that originally the CPBA access via 'register_chan_base' had to be done as a C pointer, so "volatile register_chan_base struct CRANK_CHAN_PARAMS *crank_local", with members accessed via the '->' de-ref operator, but at some point the direct mapping of a channel frame struct to 'register_chan_base' was supported as well.  Either way results in the same executable code.

John Diener