This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/LAUNCHXL2-TMS57012: Understanding callback function ( Notifications in halcogen API )

Part Number: LAUNCHXL2-TMS57012
Other Parts Discussed in Thread: HALCOGEN

Tool/software: TI C/C++ Compiler

currently i'm using halcogen as a driver to MCU components .... in it's api there are several functions which will be called upon an interrupt event (assuming VIM module appropriate settings ) .... i'm wondering which part of the codes which generated by the halcogen cause that for example sciNotification() function to be called when SCI/LIN module receive a character.

i'm skim include header files but find nothing ... 

if the question is unclear just tell me to provide more information .... thanks in advance .

  • Hello,

    The SCI/LIN module has two interrupt lines, level 0 and level 1, to the vectored interrupt manager (VIM) module (channel 13 for level 0, and channel 27 for level 1. By default, interrupts are in interrupt level 0. SCISETINTLVL sets a given interrupt to level1. SCICLEARINTLVL resets a given interrupt level to the default level 0. The interrupt vector registers SCIINTVECT0 and SCIINTVECT1 return the vector of the pending interrupt line INT0 or INT1. If more than one interrupt is pending, the interrupt vector register holds the highest priority interrupt.

    Example in HALCoGen:

    1. Enable SCI driver

    2. Enable RX Interrupt, and priority as level 0 (high level)

    3. In VIM Channel 0-31, enable channel 13 (level 0 as selected in step 2).

        In VIM RAM: the SCI ISR for channel 13 is linHighLevelInterrupt


    4. generate code, the ISR is in sci.c


    5. After transmit and receive, it will jump to sciNotification for data process


    6. The sciNotification() generated by HALCoGen is empty, you need to add your code to process the data.

     

  • hi QJ ... tnx for the reply ...
    i notice the linHighLevelInterrupt() . first it's arises another question , how linHighLevelInterrupt() function called in event of an interrupt . this question takes an answer by #pragma Interrupt statement or gcc arm attribute (reference spnu151p : ARM Optimizing C/C++ Compiler).
    tnx again .