English
Language : 

OS21 Datasheet, PDF (10/16 Pages) STMicroelectronics – The API defined in the OS21 User manual
Board support packages
4
Board support packages
OS21, ARM
4.1
Board support packages overview
OS21 Board Support Packages (BSPs) are supplied for all supported platforms as both pre-
built libraries, and accompanying sources. The generic features of the BSPs can be found in
the OS21 User manual (ADCS 7358306), chapter 16.
This section describes the platform-specific features of the BSP. For the ARM, this consists
of the interrupt system description.
4.2
4.2.1
BSP interrupt system description
The BSP is responsible for describing the interrupt system to OS21. This coupled with the
platform specific interrupt code implements OS21's generic interrupt API. On ARM
platforms, this comprises the following elements:
● interrupt names
● interrupt table
● interrupt controller base address
● interrupt controller slave priority
● interrupt system initialization flags and settings
Interrupt names
A type is provided by OS21 called interrupt_name_t. Each interrupt is assigned a
unique name (interrupt_name_t) which allows it to be identified both in the BSP
interrupt tables that follow, and in the interrupt API. The BSP need only contain those
interrupts that are used by other OS21 or the application code.
If any interrupts are missing then a linker error occurs. If interrupts are declared in the BSP
but are subsequently not used, then this does no harm other than use memory. For
example:
/* Define a DMA interrupt in the BSP */
interrupt_name_t OS21_INTERRUPT_DMA_0 = 21;
Header files are provided with OS21 which complement the interrupt description in the BSP.
By including the appropriate header file, all the relevant external interrupt_name_t
declarations are obtained. User code is also free to declare only those interrupt names that
it requires. For example:
/* How to access the DMA interrupt in user code */
extern interrupt_name_t OS21_INTERRUPT_DMA_0;
The interrupt_handle() function takes an interrupt_name_t parameter and
returns a handle to the given interrupt.
8/14
8083358