1 /**
2   ******************************************************************************
3   * @file    ll_sys_cs.c
4   * @author  MCD Application Team
5   * @brief   Link Layer IP system interface critical sections management
6   ******************************************************************************
7   * @attention
8   *
9   * Copyright (c) 2022 STMicroelectronics.
10   * All rights reserved.
11   *
12   * This software is licensed under terms that can be found in the LICENSE file
13   * in the root directory of this software component.
14   * If no LICENSE file comes with this software, it is provided AS-IS.
15   *
16   ******************************************************************************
17   */
18 
19 #include "linklayer_plat.h"
20 #include "ll_sys.h"
21 #include <stdint.h>
22 
23 /**
24   * @brief  Enable interrupts
25   * @param  None
26   * @retval None
27   */
ll_sys_enable_irq(void)28 void ll_sys_enable_irq(void) {
29   LINKLAYER_PLAT_EnableIRQ();
30 }
31 
32 /**
33   * @brief  Disable interrupts
34   * @param  None
35   * @retval None
36   */
ll_sys_disable_irq(void)37 void ll_sys_disable_irq(void) {
38   LINKLAYER_PLAT_DisableIRQ();
39 }
40 
41 /**
42   * @brief  Set the Current Interrupt Priority Mask.
43   *         All interrupts with low priority level will be masked.
44   * @param  None
45   * @retval None
46   */
ll_sys_enable_specific_irq(uint8_t isr_type)47 void ll_sys_enable_specific_irq(uint8_t isr_type)
48 {
49   LINKLAYER_PLAT_EnableSpecificIRQ(isr_type);
50 }
51 
52 /**
53   * @brief  Restore the previous interrupt priority level
54   * @param  None
55   * @retval None
56   */
ll_sys_disable_specific_irq(uint8_t isr_type)57 void ll_sys_disable_specific_irq(uint8_t isr_type)
58 {
59   LINKLAYER_PLAT_DisableSpecificIRQ(isr_type);
60 }
61 
ll_sys_enable_os_context_switch(void)62 void ll_sys_enable_os_context_switch(void)
63 {
64   LINKLAYER_PLAT_EnableOSContextSwitch();
65 }
66 
ll_sys_disable_os_context_switch(void)67 void ll_sys_disable_os_context_switch(void)
68 {
69   LINKLAYER_PLAT_DisableOSContextSwitch();
70 }