no-OS
Macros | Functions | Variables
maxim_irq.c File Reference

Implementation of external irq driver. More...

#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
#include <errno.h>
#include "rtc.h"
#include "uart.h"
#include "tmr.h"
#include "dma.h"
#include "maxim_irq.h"
#include "maxim_dma.h"
#include "max32650.h"
#include "no_os_uart.h"
#include "no_os_util.h"
#include "no_os_alloc.h"
Include dependency graph for maxim_irq.c:

Macros

#define MAX_UART_ERROR_FLAGS
 

Functions

int32_t irq_action_cmp (void *data1, void *data2)
 Action comparator function. More...
 
void UART0_IRQHandler ()
 
void DMA0_IRQHandler ()
 
void DMA1_IRQHandler ()
 
void DMA2_IRQHandler ()
 
void DMA3_IRQHandler ()
 
void DMA4_IRQHandler ()
 
void DMA5_IRQHandler ()
 
void DMA6_IRQHandler ()
 
void DMA7_IRQHandler ()
 
void DMA8_IRQHandler ()
 
void DMA9_IRQHandler ()
 
void DMA10_IRQHandler ()
 
void DMA11_IRQHandler ()
 
void DMA12_IRQHandler ()
 
void DMA13_IRQHandler ()
 
void DMA14_IRQHandler ()
 
void DMA15_IRQHandler ()
 
void RTC_IRQHandler ()
 
void USB_IRQHandler (void)
 
void max_uart_callback (mxc_uart_req_t *req, int result)
 UART callback function that sets the event and further calls the user registered callback. More...
 
int32_t max_irq_ctrl_init (struct no_os_irq_ctrl_desc **desc, const struct no_os_irq_init_param *param)
 Initialize the interrupt controller. More...
 
int32_t max_irq_ctrl_remove (struct no_os_irq_ctrl_desc *desc)
 Free the resources allocated by no_os_irq_ctrl_init() More...
 
int32_t max_irq_register_callback (struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, struct no_os_callback_desc *callback_desc)
 Register a callback function to be triggered when an interrupt occurs. More...
 
int32_t max_irq_unregister_callback (struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, struct no_os_callback_desc *cb)
 Unregister a callback function. More...
 
int32_t max_irq_trigger_level_set (struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, enum no_os_irq_trig_level trig_l)
 Unused. More...
 
int32_t max_irq_global_enable (struct no_os_irq_ctrl_desc *desc)
 Enable all interrupts. More...
 
int32_t max_irq_global_disable (struct no_os_irq_ctrl_desc *desc)
 Disable all interrupts. More...
 
int32_t max_irq_enable (struct no_os_irq_ctrl_desc *desc, uint32_t irq_id)
 Enable a specific interrupt. More...
 
int32_t max_irq_disable (struct no_os_irq_ctrl_desc *desc, uint32_t irq_id)
 Disable a specific interrupt. More...
 

Variables

mxc_uart_req_t uart_irq_state [MXC_UART_INSTANCES]
 Descriptors to hold the state of nonblocking read and writes on each port. More...
 
bool is_callback
 
const struct no_os_irq_platform_ops max_irq_ops
 maxim specific IRQ platform ops structure More...
 

Detailed Description

Implementation of external irq driver.

Author
Ciprian Regus (cipri.nosp@m.an.r.nosp@m.egus@.nosp@m.anal.nosp@m.og.co.nosp@m.m)

Copyright 2022(c) Analog Devices, Inc.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Macro Definition Documentation

◆ MAX_UART_ERROR_FLAGS

#define MAX_UART_ERROR_FLAGS
Value:
(MXC_F_UART_INT_FL_FRAME | \
MXC_F_UART_INT_FL_PARITY | \
MXC_F_UART_INT_FL_RX_OVR)

Function Documentation

◆ DMA0_IRQHandler()

void DMA0_IRQHandler ( )

◆ DMA10_IRQHandler()

void DMA10_IRQHandler ( )

◆ DMA11_IRQHandler()

void DMA11_IRQHandler ( )

◆ DMA12_IRQHandler()

void DMA12_IRQHandler ( )

◆ DMA13_IRQHandler()

void DMA13_IRQHandler ( )

◆ DMA14_IRQHandler()

void DMA14_IRQHandler ( )

◆ DMA15_IRQHandler()

void DMA15_IRQHandler ( )

◆ DMA1_IRQHandler()

void DMA1_IRQHandler ( )

◆ DMA2_IRQHandler()

void DMA2_IRQHandler ( )

◆ DMA3_IRQHandler()

void DMA3_IRQHandler ( )

◆ DMA4_IRQHandler()

void DMA4_IRQHandler ( )

◆ DMA5_IRQHandler()

void DMA5_IRQHandler ( )

◆ DMA6_IRQHandler()

void DMA6_IRQHandler ( )

◆ DMA7_IRQHandler()

void DMA7_IRQHandler ( )

◆ DMA8_IRQHandler()

void DMA8_IRQHandler ( )

◆ DMA9_IRQHandler()

void DMA9_IRQHandler ( )

◆ irq_action_cmp()

int32_t irq_action_cmp ( void *  data1,
void *  data2 
)

Action comparator function.

irq_action compare function

Parameters
data1- List element
data2- Key
Returns
0 if the two are equal, any other integer otherwise

◆ max_irq_ctrl_init()

int32_t max_irq_ctrl_init ( struct no_os_irq_ctrl_desc **  desc,
const struct no_os_irq_init_param param 
)

Initialize the interrupt controller.

Parameters
desc- Pointer where the configured instance is stored
param- Configuration information for the instance
Returns
0 in case of success, errno error codes otherwise.

◆ max_irq_ctrl_remove()

int32_t max_irq_ctrl_remove ( struct no_os_irq_ctrl_desc desc)

Free the resources allocated by no_os_irq_ctrl_init()

Parameters
desc- Interrupt controller descriptor.
Returns
0 in case of success, errno error codes otherwise.

◆ max_irq_disable()

int32_t max_irq_disable ( struct no_os_irq_ctrl_desc desc,
uint32_t  irq_id 
)

Disable a specific interrupt.

Parameters
desc- Interrupt controller descriptor.
irq_id- The interrupt vector entry id of the peripheral.
Returns
0 in case of success, -EINVAL otherwise.

◆ max_irq_enable()

int32_t max_irq_enable ( struct no_os_irq_ctrl_desc desc,
uint32_t  irq_id 
)

Enable a specific interrupt.

Parameters
desc- Interrupt controller descriptor.
irq_id- The interrupt vector entry id of the peripheral.
Returns
0 in case of success, errno error codes otherwise.

◆ max_irq_global_disable()

int32_t max_irq_global_disable ( struct no_os_irq_ctrl_desc desc)

Disable all interrupts.

Parameters
desc- Interrupt controller descriptor.
Returns
0

◆ max_irq_global_enable()

int32_t max_irq_global_enable ( struct no_os_irq_ctrl_desc desc)

Enable all interrupts.

Parameters
desc- Interrupt controller descriptor.
Returns
0

◆ max_irq_register_callback()

int32_t max_irq_register_callback ( struct no_os_irq_ctrl_desc desc,
uint32_t  irq_id,
struct no_os_callback_desc callback_desc 
)

Register a callback function to be triggered when an interrupt occurs.

Parameters
desc- The IRQ controller descriptor.
irq_id- The interrupt vector entry id of the peripheral.
callback_desc- Descriptor of the callback.
Returns
0 in case of success, errno error codes otherwise

◆ max_irq_trigger_level_set()

int32_t max_irq_trigger_level_set ( struct no_os_irq_ctrl_desc desc,
uint32_t  irq_id,
enum no_os_irq_trig_level  trig_l 
)

Unused.

Parameters
desc-irq descriptor.
irq_id- The interrupt vector entry id of the peripheral.
trig_l- the trigger condition.
Returns
-ENOSYS

◆ max_irq_unregister_callback()

int32_t max_irq_unregister_callback ( struct no_os_irq_ctrl_desc desc,
uint32_t  irq_id,
struct no_os_callback_desc cb 
)

Unregister a callback function.

Parameters
desc- Interrupt controller descriptor.
irq_id- The interrupt vector entry id of the peripheral.
cb- Callback descriptor.
Returns
0 in case of success, errno error codes otherwise.

◆ max_uart_callback()

void max_uart_callback ( mxc_uart_req_t *  req,
int  result 
)

UART callback function that sets the event and further calls the user registered callback.

Platform specific uart callback function.

Parameters
req- UART request struct
result- status of the request (error code)

◆ RTC_IRQHandler()

void RTC_IRQHandler ( )

◆ UART0_IRQHandler()

void UART0_IRQHandler ( )

◆ USB_IRQHandler()

void USB_IRQHandler ( void  )

Variable Documentation

◆ is_callback

bool is_callback

◆ max_irq_ops

const struct no_os_irq_platform_ops max_irq_ops
Initial value:
= {
.register_callback = &max_irq_register_callback,
.unregister_callback = &max_irq_unregister_callback,
.trigger_level_set = &max_irq_trigger_level_set,
.global_enable = &max_irq_global_enable,
.global_disable = &max_irq_global_disable,
.enable = &max_irq_enable,
.disable = &max_irq_disable,
.set_priority = &max_irq_set_priority,
}

maxim specific IRQ platform ops structure

maxim platform specific irq platform ops structure

◆ uart_irq_state

mxc_uart_req_t uart_irq_state[MXC_UART_INSTANCES]

Descriptors to hold the state of nonblocking read and writes on each port.

max_irq_disable
int32_t max_irq_disable(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id)
Disable a specific interrupt.
Definition: maxim_irq.c:624
max_irq_ctrl_init
int32_t max_irq_ctrl_init(struct no_os_irq_ctrl_desc **desc, const struct no_os_irq_init_param *param)
Initialize the interrupt controller.
Definition: maxim_irq.c:376
max_irq_register_callback
int32_t max_irq_register_callback(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, struct no_os_callback_desc *callback_desc)
Register a callback function to be triggered when an interrupt occurs.
Definition: maxim_irq.c:433
max_irq_unregister_callback
int32_t max_irq_unregister_callback(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, struct no_os_callback_desc *cb)
Unregister a callback function.
Definition: maxim_irq.c:529
max_irq_global_enable
int32_t max_irq_global_enable(struct no_os_irq_ctrl_desc *desc)
Enable all interrupts.
Definition: maxim_irq.c:583
max_irq_trigger_level_set
int32_t max_irq_trigger_level_set(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, enum no_os_irq_trig_level trig_l)
Unused.
Definition: maxim_irq.c:571
max_irq_enable
int32_t max_irq_enable(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id)
Enable a specific interrupt.
Definition: maxim_irq.c:608
max_irq_global_disable
int32_t max_irq_global_disable(struct no_os_irq_ctrl_desc *desc)
Disable all interrupts.
Definition: maxim_irq.c:595
max_irq_ctrl_remove
int32_t max_irq_ctrl_remove(struct no_os_irq_ctrl_desc *desc)
Free the resources allocated by no_os_irq_ctrl_init()
Definition: maxim_irq.c:407