VSF Documented
vsf_swi_template.h
Go to the documentation of this file.
1/*******************************************************************************
2 How to expand user priority
3Follow the steps below in order:
4
5Tutorials for end users:
6 1.Create a "user_swi" folder under the project folder.
7
8 2.Create two files "user_swi.h" and "user_swi.c" under the "user_swi" folder.
9
10 3.Create a "group" under the project.
11
12 4.Add the "user_swi.h" file and "user_swi.c" file to the "group" created in
13 the third step.
14
15 5.Include the "vsf_swi_template.h" file in the "user_swi.h" file.
16 The path is "hal/driver/common/vsf_swi_template.h".
17
18 6.Include the register header file of the specific chip in the "user_swi.c"
19 file.
20
21 7.Include the "vsf_swi_template.inc" file in the "user_swi.c" file.
22 The path is "hal/driver/common/vsf_swi_template.inc".
23
24 8.Modify the interrupt vector table of the specific chip.
25 For specific methods, please refer to Chapter 7 of this document:
26 https://github.com/vsfteam/vsf/tree/master/source/vsf/documents/porting
27
28Tutorials for driver developers:
29 1.Create the "interrupt_swi.h" file and "interrupt_swi.c" file in the
30 specific chip folder under the driver folder.
31
32 2.Include the following file path in the "interrupt_swi.h" file:
33 "hal/vsf_hal_cfg.h"
34 "./device.h"
35 "hal/driver/common/vsf_swi_template.h"
36
37 3.Include the following file paths in the "interrupt_swi.c" file:
38 "hal/vsf_hal_cfg.h"
39 "./device.h"
40 "hal/driver/common/vsf_swi_template.inc"
41
42 4.Include the "interrupt_swi.h" file in the "driver.h" file in the same folder.
43
44 5.Check whether the following macro definitions exist in the file "device.h"
45 included in the third operation. If not, you need to complete it according
46 to the specific chip resources and requirements:
47 "VSF_ARCH_PRI_BIT"
48 meaning:The number of interrupt nesting levels supported by the chip is
49 converted into a binary number.
50
51 "VSF_ARCH_PRI_NUM"
52 meaning:The number of interrupt nesting levels supported by the chip.
53
54 "VSF_DEV_SWI_NUM"
55 meaning:Number of user priorities expected to expand.
56
57 "VSF_DEV_SWI_LIST"
58 meaning:The number of the interrupt used by the user extended priority
59 in the interrupt vector table.
60
61 6.Modify the interrupt vector table of the specific chip.
62 For specific methods, please refer to Chapter 7 of this document:
63 https://github.com/vsfteam/vsf/tree/master/source/vsf/documents/porting
64*******************************************************************************/
65
66#ifndef __VSF_USER_SWI_H__
67#define __VSF_USER_SWI_H__
68
69#include "hal/vsf_hal_cfg.h"
70#include "hal/arch/vsf_arch.h"
71
72typedef void vsf_swi_handler_t(void *p);
73
75 vsf_arch_prio_t priority,
76 vsf_swi_handler_t *handler,
77 void *param);
79#endif
vsf_err_t
Definition __type.h:42
vsf_arch_prio_t
Definition cortex_a_generic.h:88
unsigned char uint_fast8_t
Definition stdint.h:23
vsf_irq_handler_t vsf_swi_handler_t
Definition vsf_arch_abstraction.h:51
void vsf_drv_usr_swi_trigger(uint_fast8_t idx)
Definition vsf_arch_abstraction.c:459
void vsf_swi_handler_t(void *p)
Definition vsf_swi_template.h:72
vsf_err_t vsf_drv_usr_swi_init(uint_fast8_t idx, vsf_arch_prio_t priority, vsf_swi_handler_t *handler, void *param)
Definition vsf_arch_abstraction.c:493