disable and enable all interrupt in stm32mp1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2022-03-25 9:46 AM
Is there any way to disable and enable all interrupts in a assembly way, because i need to manually switch on and OFF particular GPIO before UBOOT SPL start
uboot-source/board/st/stm32mp1/board.c
void board_debug_uart_init(void)
{
// disable interrupts ---- need support here
//PWM self logic written
// enable interrupts ---- need support here
}
Labels:
- Labels:
-
STM32MP15 Lines
This discussion is locked. Please start a new topic to ask your question.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2022-04-15 5:47 AM
Hi @Ara.1
is that you asked for ?
void Enable_Irq(void)
{
unsigned long temp;
__asm__ __volatile__("mrs %0, cpsr\n"
"bic %0, %0, #0x80\n"
"msr cpsr_c, %0"
: "=r" (temp)
:
: "memory");
}
void Disable_Irq(void)
{
unsigned long temp;
__asm__ __volatile__("mrs %0, cpsr\n"
"orr %0, %0, #0x80\n"
"msr cpsr_c, %0"
: "=r" (temp)
:
: "memory");
}
void Enable_Fiq(void)
{
unsigned long temp;
__asm__ __volatile__("mrs %0, cpsr\n"
"bic %0, %0, #0x40\n"
"msr cpsr_c, %0"
: "=r" (temp)
:
: "memory");
}
void Disable_Fiq(void)
{
unsigned long temp;
__asm__ __volatile__("mrs %0, cpsr\n"
"orr %0, %0, #0x40\n"
"msr cpsr_c, %0"
: "=r" (temp)
:
: "memory");
}
Regards
In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
