VSF Documented
Macros | Functions
ll.h File Reference

Declaration of low level functions. More...

#include "hal/arch/vsf_arch.h"

Go to the source code of this file.

Macros

#define GLOBAL_INT_START()   vsf_enable_interrupt()
 Enable interrupts globally in the system. This macro must be used when the initialization phase is over and the interrupts can start being handled by the system.
 
#define GLOBAL_INT_STOP()   vsf_disable_interrupt()
 Disable interrupts globally in the system. This macro must be used when the system wants to disable all the interrupt it could handle.
 
#define GLOBAL_INT_DISABLE()
 Disable interrupts globally in the system. This macro must be used in conjunction with the GLOBAL_INT_RESTORE macro since this last one will close the brace that the current macro opens. This means that both macros must be located at the same scope level.
 
#define GLOBAL_INT_RESTORE()
 Restore interrupts from the previous global disable.
 
#define WFI()
 Invoke the wait for interrupt procedure of the processor.
 

Functions

__STATIC_FORCEINLINE uint32_t global_irq_lock (void)
 
__STATIC_FORCEINLINE void global_irq_unlock (uint32_t pmask)
 
void critical_section_start (void)
 
void critical_section_end (void)
 

Detailed Description

Declaration of low level functions.

Macro Definition Documentation

◆ GLOBAL_INT_START

#define GLOBAL_INT_START ( )    vsf_enable_interrupt()

Enable interrupts globally in the system. This macro must be used when the initialization phase is over and the interrupts can start being handled by the system.

◆ GLOBAL_INT_STOP

#define GLOBAL_INT_STOP ( )    vsf_disable_interrupt()

Disable interrupts globally in the system. This macro must be used when the system wants to disable all the interrupt it could handle.

◆ GLOBAL_INT_DISABLE

#define GLOBAL_INT_DISABLE ( )
Value:
do { \
vsf_arch_prio_t __vsf_orig_int_state = vsf_disable_interrupt(); \
vsf_gint_state_t vsf_disable_interrupt(void)
Definition arm9_generic.c:176
vsf_arch_prio_t
Definition cortex_a_generic.h:88

Disable interrupts globally in the system. This macro must be used in conjunction with the GLOBAL_INT_RESTORE macro since this last one will close the brace that the current macro opens. This means that both macros must be located at the same scope level.

◆ GLOBAL_INT_RESTORE

#define GLOBAL_INT_RESTORE ( )
Value:
vsf_set_interrupt(__vsf_orig_int_state); \
} while(0)
vsf_gint_state_t vsf_set_interrupt(vsf_gint_state_t level)
Definition arm9_generic.c:169

Restore interrupts from the previous global disable.

See also
GLOBAL_INT_DISABLE

◆ WFI

#define WFI ( )
Value:
do { \
GLOBAL_INT_DISABLE(); \
__WFI(); \
GLOBAL_INT_RESTORE(); \
} while (0)

Invoke the wait for interrupt procedure of the processor.

Warning
It is suggested that this macro is called while the interrupts are disabled to have performed the checks necessary to decide to move to sleep mode.

Function Documentation

◆ global_irq_lock()

__STATIC_FORCEINLINE uint32_t global_irq_lock ( void  )

◆ global_irq_unlock()

__STATIC_FORCEINLINE void global_irq_unlock ( uint32_t  pmask)

◆ critical_section_start()

void critical_section_start ( void  )

Mark the start of a critical section

On the first call to enter a critical section this function MUST store the state of any interrupts or other application settings it will modify to facilitate the critical section.

◆ critical_section_end()

void critical_section_end ( void  )

Mark the end of a critical section.

The purpose of this function is to restore any state that was modified upon entering the critical section, allowing other threads or interrupts to change the processor control.