AM261x MCU+ SDK: APIs for SDL DPL

| AM261x MCU+ SDK 26.00.00 |

Files | Data Structures | Functions | Typedefs
APIs for SDL DPL
APIs for SDL Module

## Introduction

This module contains APIs for using configuring the DPL function pointers to be used by SDL, and also defines the DPL APIs used by SDL for services such as interrupt registration.

## Files
file | sdl_dpl.h
| This file contains the SDL DPL API's.

## Data Structures
struct | SDL_DPL_HwipParams
| This structure contains the parameters for interrupt registration through the SDL DPL interface. More...
struct | SDL_DPL_Interface
| This structure contains the pointers for the DPL interfaces provided by the application to SDL_DPL_init. More...

## Functions
int32_t | SDL_DPL_init (SDL_DPL_Interface *dplInterface)
| DPL init. More...
int32_t | SDL_DPL_enableInterrupt (int32_t intNum)
| DPL enable interrupt. More...
int32_t | SDL_DPL_disableInterrupt (int32_t intNum)
| DPL disable interrupt. More...
int32_t | SDL_DPL_registerInterrupt (SDL_DPL_HwipParams *pParams, pSDL_DPL_HwipHandle *handle)
| DPL register interrupt. More...
int32_t | SDL_DPL_deregisterInterrupt (pSDL_DPL_HwipHandle handle)
| DPL deregister interrupt. More...
int32_t | SDL_DPL_delay (int32_t ndelay)
| DPL delay. More...
void * | SDL_DPL_addrTranslate (uint64_t addr, uint32_t size)
| DPL Address translation function. More...
int32_t | SDL_DPL_globalDisableInterrupts (uintptr_t *key)
| DPL globally disable interrupts. More...
int32_t | SDL_DPL_globalRestoreInterrupts (uintptr_t key)
| DPL globally enable interrupts. More...

## Typedefs
typedef void(* | pSDL_DPL_InterruptCallbackFunction) (void *arg)
| Prototype for the interrupt callback function. More...
typedef void * | pSDL_DPL_HwipHandle
typedef int32_t(* | pSDL_DPL_InterruptFunction) (int32_t intNum)
| Prototype for the interrupt enable/disable functions. More...
typedef pSDL_DPL_HwipHandle(* | pSDL_DPL_RegisterFunction) (SDL_DPL_HwipParams *pParams)
| Prototype for the interrupt registration function. More...
typedef int32_t(* | pSDL_DPL_DeregisterFunction) (pSDL_DPL_HwipHandle handle)
| Prototype for the interrupt de-register function. More...
typedef int32_t(* | pSDL_DPL_DelayFunction) (int32_t ndelay)
| Prototype for the delay function. More...
typedef void *(* | pSDL_DPL_AddrTranslateFunction) (uint64_t addr, uint32_t size)
| Prototype for address translation function. More...
typedef int32_t(* | pSDL_DPL_globalDisableInterruptsFunction) (uintptr_t *key)
| Prototype for the interrupt global disable function. More...
typedef int32_t(* | pSDL_DPL_globalRestoreInterruptsFunction) (uintptr_t key)
| Prototype for the interrupt global restore function. More...

## Typedef Documentation

## ◆ pSDL_DPL_InterruptCallbackFunction

typedef void(* pSDL_DPL_InterruptCallbackFunction) (void *arg)

Prototype for the interrupt callback function.

## ◆ pSDL_DPL_HwipHandle

typedef void* pSDL_DPL_HwipHandle

## ◆ pSDL_DPL_InterruptFunction

typedef int32_t(* pSDL_DPL_InterruptFunction) (int32_t intNum)

Prototype for the interrupt enable/disable functions.

## ◆ pSDL_DPL_RegisterFunction

typedef pSDL_DPL_HwipHandle(* pSDL_DPL_RegisterFunction) (SDL_DPL_HwipParams *pParams)

Prototype for the interrupt registration function.

## ◆ pSDL_DPL_DeregisterFunction

typedef int32_t(* pSDL_DPL_DeregisterFunction) (pSDL_DPL_HwipHandle handle)

Prototype for the interrupt de-register function.

## ◆ pSDL_DPL_DelayFunction

typedef int32_t(* pSDL_DPL_DelayFunction) (int32_t ndelay)

Prototype for the delay function.

## ◆ pSDL_DPL_AddrTranslateFunction

typedef void*(* pSDL_DPL_AddrTranslateFunction) (uint64_t addr, uint32_t size)

Prototype for address translation function.

## ◆ pSDL_DPL_globalDisableInterruptsFunction

typedef int32_t(* pSDL_DPL_globalDisableInterruptsFunction) (uintptr_t *key)

Prototype for the interrupt global disable function.

## ◆ pSDL_DPL_globalRestoreInterruptsFunction

typedef int32_t(* pSDL_DPL_globalRestoreInterruptsFunction) (uintptr_t key)

Prototype for the interrupt global restore function.

## Function Documentation

## ◆ SDL_DPL_init()

int32_t SDL_DPL_init | ( | SDL_DPL_Interface * | dplInterface | ) |

DPL init.

This function initializes the DPL interface structure with the functions provided by the application. These functions are application dependent, so it is required to be passed by the user.

Parameters

  dplInterface | [IN] DPL interface structure.

Returns
  The SDL error code for the API. If dplInterface is NULL: SDL_EBADARGS If other error happened: SDL_EFAIL Success: SDL_PASS

## ◆ SDL_DPL_enableInterrupt()

int32_t SDL_DPL_enableInterrupt | ( | int32_t | intNum | ) |

DPL enable interrupt.

This function will enable the specific interrupt number passed.

Parameters

  intNum | [IN] Interrupt Number

Returns
  The SDL error code for the API. If function pointer in interface is NULL: SDL_EBADARGS If other error happened: SDL_EFAIL Success: SDL_PASS

## ◆ SDL_DPL_disableInterrupt()

int32_t SDL_DPL_disableInterrupt | ( | int32_t | intNum | ) |

DPL disable interrupt.

This function will disable the specific interrupt number passed.

Parameters

  intNum | [IN] Interrupt Number

Returns
  The SDL error code for the API. If function pointer in interface is NULL: SDL_EBADARGS If other error happened: SDL_EFAIL Success: SDL_PASS

## ◆ SDL_DPL_registerInterrupt()

int32_t SDL_DPL_registerInterrupt | ( | SDL_DPL_HwipParams * | pParams,
|  | pSDL_DPL_HwipHandle * | handle
| ) |  |

DPL register interrupt.

This function will register the specific interrupt number passed.

Parameters

  pParams | [IN] Parameters for interrupt registration
  handle | [OUT] Handle for this registered interrupt

Returns
  The SDL error code for the API. If function pointer in interface is NULL: SDL_EBADARGS If other error happened: SDL_EFAIL Success: SDL_PASS

## ◆ SDL_DPL_deregisterInterrupt()

int32_t SDL_DPL_deregisterInterrupt | ( | pSDL_DPL_HwipHandle | handle | ) |

DPL deregister interrupt.

This function will deregister the specific interrupt number passed.

Parameters

  handle | [IN] Handle for the registered interrupt

Returns
  The SDL error code for the API. If function pointer in interface is NULL: SDL_EBADARGS If other error happened: SDL_EFAIL Success: SDL_PASS

## ◆ SDL_DPL_delay()

int32_t SDL_DPL_delay | ( | int32_t | ndelay | ) |

DPL delay.

This function is used assign delay in the function

Parameters

  ndelay | [IN] delay in microseconds

Returns
  The SDL error code for the API. If function pointer in interface is NULL: SDL_EBADARGS If other error happened: SDL_EFAIL Success: SDL_PASS

## ◆ SDL_DPL_addrTranslate()

void* SDL_DPL_addrTranslate | ( | uint64_t | addr,
|  | uint32_t | size
| ) |  |

DPL Address translation function.

This function is used by the SDL to get a translation for a 64-bit address to local address space. It is expected that the requested adddress will remain available at the returned address and not be removed.

Parameters

  addr | [IN] Memory address to be translated
  size | [IN] Size of the memory

Returns
  The translated address or (-1) for failure.

## ◆ SDL_DPL_globalDisableInterrupts()

int32_t SDL_DPL_globalDisableInterrupts | ( | uintptr_t * | key | ) |

DPL globally disable interrupts.

This function will disable interrupts globally. Interrupts can be enabled with the globalRestoreInterrupts() function. Usually used for critical sections.

The returned key is used to restore the context once interrupts are restored.

Parameters

  key | [OUT] key to use when restoring interrupts

Returns
  The SDL error code for the API. If function pointer in interface is NULL: SDL_EBADARGS If other error happened: SDL_EFAIL Success: SDL_PASS

## ◆ SDL_DPL_globalRestoreInterrupts()

int32_t SDL_DPL_globalRestoreInterrupts | ( | uintptr_t | key | ) |

DPL globally enable interrupts.

This function will enable interrupts globally. Usually used for critical sections.

The key is used to restore the context.

Parameters

  key | [IN] key to use when restoring interrupts

Returns
  The SDL error code for the API. If function pointer in interface is NULL: SDL_EBADARGS If other error happened: SDL_EFAIL Success: SDL_PASS