accessing peripherals in assembler

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

accessing peripherals in assembler

874件の閲覧回数
ianbenton
Senior Contributor I

In C the header file chip.h which include such things as adc15xx.h sets up the addresses for all the peripheral registers.

When writing a function in assembler, is there a way of accessing this information?

example: C knows that ADC->CTRL refers to the control register of the ADC converter and compiles the correct value for the address of this register, but can I access that information from assember, by writing something similar to LDR R3,=ADC->CTRL instead of first having to look up its address in the manual and define ADC_CTRL again  as .equ ADC_CTRL, 0x40000000 ?

ラベル(3)
0 件の賞賛
返信
1 返信

787件の閲覧回数
jeremyzhou
NXP Employee
NXP Employee

Hi Ian Benton,
Thank you for your interest in NXP Semiconductor products and the opportunity to serve you.
When debugging the demo, you can see assemble codes which seems like the interpretation of C codes.
I'd highly recommend you refer to these assemble codes for details.
Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信