MCMGR API

This section describes the Multicore Manager component API. More...

## Overview

This section describes the Multicore Manager component API.

## Macros

#define | MCMGR_HANDLE_EXCEPTIONS (0)
| Set to 1 to enable exception handling.

## Typedefs

typedef enum _mcmgr_status | mcmgr_status_t
| Enumeration that defines MCMGR function return status codes.
typedef enum _mcmgr_core_property | mcmgr_core_property_t
| Enumeration that defines property of core.
typedef enum _mcmgr_core_type | mcmgr_core_type_t
| Enumeration that defines property value of core type.
typedef enum _mcmgr_core | mcmgr_core_t
| Enumeration that defines core.
typedef enum _mcmgr_start_mode | mcmgr_start_mode_t
| Enumeration that defines start type.
typedef enum _mcmgr_event_type_t | mcmgr_event_type_t
| Type definition of event types.
typedef void(* | mcmgr_event_callback_t) (uint16_t data, void *context)
| Type definition of event callback function pointer.

## Enumerations

enum | _mcmgr_status { kStatus_MCMGR_Success, kStatus_MCMGR_Error, kStatus_MCMGR_NotImplemented, kStatus_MCMGR_NotReady }
| Enumeration that defines MCMGR function return status codes. More...
enum | _mcmgr_core_property { kMCMGR_CoreStatus, kMCMGR_CoreType, kMCMGR_CorePowerMode }
| Enumeration that defines property of core. More...
enum | _mcmgr_core_type { kMCMGR_CoreTypeCortexM0, kMCMGR_CoreTypeCortexM0Plus, kMCMGR_CoreTypeCortexM4, kMCMGR_CoreTypeCortexM33 }
| Enumeration that defines property value of core type. More...
enum | _mcmgr_core { kMCMGR_Core0, kMCMGR_Core1 }
| Enumeration that defines core. More...
enum | _mcmgr_start_mode { kMCMGR_Start_Synchronous, kMCMGR_Start_Asynchronous }
| Enumeration that defines start type. More...
enum | _mcmgr_event_type_t { kMCMGR_RemoteCoreUpEvent = 1, kMCMGR_RemoteCoreDownEvent, kMCMGR_RemoteExceptionEvent, kMCMGR_StartupDataEvent, kMCMGR_FeedStartupDataEvent, kMCMGR_RemoteRPMsgEvent, kMCMGR_RemoteApplicationEvent, kMCMGR_EventTableLength }
| Type definition of event types.
enum | mcmgr_version_enum { kMCMGR_Version = 0x00040003 }
| Version of MCMGR. More...

## Functions

mcmgr_status_t | MCMGR_EarlyInit (void)
| Initialize the multicore manager, early init. More...
mcmgr_status_t | MCMGR_Init (void)
| Initialize the multicore manager. More...
mcmgr_status_t | MCMGR_StartCore (mcmgr_core_t coreNum, void *bootAddress, uint32_t startupData, mcmgr_start_mode_t mode)
| Start a selected core. More...
mcmgr_status_t | MCMGR_GetStartupData (uint32_t *startupData)
| Get startup data for the slave core. More...
mcmgr_status_t | MCMGR_StopCore (mcmgr_core_t coreNum)
| Stop a selected core. More...
int32_t | MCMGR_GetVersion (void)
| Get version of MCMGR. More...
mcmgr_status_t | MCMGR_GetCoreProperty (mcmgr_core_t coreNum, mcmgr_core_property_t property, void *value, uint32_t *length)
| Get property of the CPU core. More...
uint32_t | MCMGR_GetCoreCount (void)
| Return the count of cores in a multicore system. More...
mcmgr_core_t | MCMGR_GetCurrentCore (void)
| Get current CPU core. More...
mcmgr_status_t | MCMGR_RegisterEvent (mcmgr_event_type_t type, mcmgr_event_callback_t callback, void *callbackData)
| Register event handler. More...
mcmgr_status_t | MCMGR_TriggerEvent (mcmgr_event_type_t type, uint16_t eventData)
| Trigger event handler. More...
mcmgr_status_t | MCMGR_TriggerEventForce (mcmgr_event_type_t type, uint16_t eventData)
| Trigger event handler, force version. More...

## Enumeration Type Documentation

enum _mcmgr_core

Enumeration that defines core.

Enumerator
kMCMGR_Core0 | Enum value for Core 0.
kMCMGR_Core1 | Enum value for Core 1.

enum _mcmgr_core_property

Enumeration that defines property of core.

Enumerator
kMCMGR_CoreStatus | Status of core read from hardware core status flag.
kMCMGR_CoreType | Type of Core.
kMCMGR_CorePowerMode | Power Mode of Core - implementation is hardware-specific.

enum _mcmgr_core_type

Enumeration that defines property value of core type.

Enumerator
kMCMGR_CoreTypeCortexM0 | Cortex M0.
kMCMGR_CoreTypeCortexM0Plus | Cortex M0+.
kMCMGR_CoreTypeCortexM4 | Cortex M4.
kMCMGR_CoreTypeCortexM33 | Cortex M33.

enum _mcmgr_start_mode

Enumeration that defines start type.

Enumerator
kMCMGR_Start_Synchronous | Enum value for starting synchronously.
kMCMGR_Start_Asynchronous | Enum value for starting asynchronously.

enum _mcmgr_status

Enumeration that defines MCMGR function return status codes.

Enumerator
kStatus_MCMGR_Success | Operation was successful.
kStatus_MCMGR_Error | Operation was not successful.
kStatus_MCMGR_NotImplemented | Function is not implemented.
kStatus_MCMGR_NotReady | Operation result not ready.

enum mcmgr_version_enum

Version of MCMGR.

Version 1.0.0, for version 1.2.3 it will be 0x00010203

## Function Documentation

mcmgr_status_t MCMGR_EarlyInit | ( | void |  | ) |

Initialize the multicore manager, early init.

After calling this function, MCMGR_TriggerEvent() and/or MCMGR_Init() can be called.

Returns
  kStatus_MCMGR_Success on success or kStatus_MCMGR_Error on failure.

uint32_t MCMGR_GetCoreCount | ( | void |  | ) |

Return the count of cores in a multicore system.

This function returns the count of cores in a multicore system.

Returns
  the count of cores in a system.

mcmgr_status_t MCMGR_GetCoreProperty | ( | mcmgr_core_t | coreNum,
|  | mcmgr_core_property_t | property,
|  | void * | value,
|  | uint32_t * | length
| ) |  |

Get property of the CPU core.

This function provides the property of the CPU core.

Parameters

  [in] | coreNum | Enum of core.
  [in] | property | Requested property type.
  [in,out] | value | Parameter for value of property.
  [in,out] | length | Parameter for size of property value in bytes.

Returns
  kStatus_MCMGR_Success on success or kStatus_MCMGR_Error on failure.

mcmgr_core_t MCMGR_GetCurrentCore | ( | void |  | ) |

Get current CPU core.

This function returns enum of current core.

Returns
  Enum of current core.

mcmgr_status_t MCMGR_GetStartupData | ( | uint32_t * | startupData | ) |

Get startup data for the slave core.

This function read startup data provided by the master core. Use only on the slave core during the startup.

Parameters

  [out] | startupData | Data to read by this function.

Returns
  kStatus_MCMGR_Success on success or kStatus_MCMGR_Error on failure.

int32_t MCMGR_GetVersion | ( | void |  | ) |

Get version of MCMGR.

This function returns a number of MCMGR version.

Returns
  a number of MCMGR version.

mcmgr_status_t MCMGR_Init | ( | void |  | ) |

Initialize the multicore manager.

After calling this function, all API can be used.

Returns
  kStatus_MCMGR_Success on success or kStatus_MCMGR_Error on failure.

mcmgr_status_t MCMGR_RegisterEvent | ( | mcmgr_event_type_t | type,
|  | mcmgr_event_callback_t | callback,
|  | void * | callbackData
| ) |  |

Register event handler.

This function registers an event handler. for remote processor events handling.

Parameters

  [in] | type | Type of the event.
  [in] | callback | User callback.
  [in] | callbackData | Data/context for user callback.

Returns
  kStatus_MCMGR_Success on success or kStatus_MCMGR_Error on failure.

mcmgr_status_t MCMGR_StartCore | ( | mcmgr_core_t | coreNum,
|  | void * | bootAddress,
|  | uint32_t | startupData,
|  | mcmgr_start_mode_t | mode
| ) |  |

Start a selected core.

This function causes a selected core to initialize and start the code execution. If the secondary core application boots from RAM, then there is a need to call the function, which copies this app. Image to RAM prior this function.

Parameters

  [in] | coreNum | Enum of the core to be started.
  [in] | bootAddress | Boot address of the core to be started application.
  [in] | startupData | Data which can be get by the other core on startup.
  [in] | mode | Start mode, use kMCMGR_Start_Synchronous for synchronous mode (wait until the core is started), kMCMGR_Start_Asynchronous for asynchronous mode (do not wait).

Returns
  kStatus_MCMGR_Success on success or kStatus_MCMGR_Error on failure.

mcmgr_status_t MCMGR_StopCore | ( | mcmgr_core_t | coreNum | ) |

Stop a selected core.

This function causes a selected core to halt code execution.

Parameters

  [in] | coreNum | Enum of core to be stopped.

Returns
  kStatus_MCMGR_Success on success or kStatus_MCMGR_Error on failure.

mcmgr_status_t MCMGR_TriggerEvent | ( | mcmgr_event_type_t | type,
|  | uint16_t | eventData
| ) |  |

Trigger event handler.

This function triggers an event handler on the remote core.

Parameters

  [in] | type | Type of the event.
  [in] | eventData | Data to send to remote core.

Returns
  kStatus_MCMGR_Success on success or kStatus_MCMGR_Error on failure.

mcmgr_status_t MCMGR_TriggerEventForce | ( | mcmgr_event_type_t | type,
|  | uint16_t | eventData
| ) |  |

Trigger event handler, force version.

This function triggers an event handler on the remote core, force version that does not check the consumption of previously sent data.

Parameters

  [in] | type | Type of the event.
  [in] | eventData | Data to send to remote core.

Returns
  kStatus_MCMGR_Success on success or kStatus_MCMGR_Error on failure.