Skip to content

File ns_core.h

FileList > includes-api > ns_core.h

Go to the source code of this file

Code common to all neuralSPOT. More...

  • #include "am_bsp.h"
  • #include "am_mcu_apollo.h"
  • #include "am_util.h"
  • #include "ns_ambiqsuite_harness.h"

Classes

Type Name
struct ns_core_api_t
struct ns_core_config_t
Core config struct.
struct ns_desired_state_t
struct ns_semver_t

Public Attributes

Type Name
ns_desired_state_t g_ns_state
Collection of ns-wide states and desired states.
const ns_core_api_t ns_core_V0_0_1
const ns_core_api_t ns_core_V1_0_0
const ns_core_api_t ns_core_current_version
const ns_core_api_t ns_core_oldest_supported_version

Public Functions

Type Name
uint32_t ns_core_check_api (const ns_core_api_t * submitted, const ns_core_api_t * oldest, const ns_core_api_t * newest)
void ns_core_fail_loop ()
uint32_t ns_core_init (ns_core_config_t * c)
Initialize core state.
bool ns_core_initialized ()

Macros

Type Name
define NS_CORE_CURRENT_VERSION NS_CORE_V1_0_0
define NS_CORE_OLDEST_SUPPORTED_VERSION NS_CORE_V0_0_1
define NS_CORE_V0_0_1 { .major = 0, .minor = 0, .revision = 1 }
define NS_CORE_V1_0_0 { .major = 1, .minor = 0, .revision = 0 }
define NS_STATUS_FAILURE -1
define NS_STATUS_INIT_FAILED 4
define NS_STATUS_INVALID_CONFIG 3
define NS_STATUS_INVALID_HANDLE 1
define NS_STATUS_INVALID_VERSION 2
define NS_STATUS_SUCCESS 0
define NS_TRY (func, msg)

Detailed Description

Author:

Carlos Morales

Version:

0.1

Date:

2022-11-03

Copyright:

Copyright (c) 2022

Public Attributes Documentation

variable g_ns_state

ns_desired_state_t g_ns_state;

variable ns_core_V0_0_1

const ns_core_api_t ns_core_V0_0_1;

variable ns_core_V1_0_0

const ns_core_api_t ns_core_V1_0_0;

variable ns_core_current_version

const ns_core_api_t ns_core_current_version;

variable ns_core_oldest_supported_version

const ns_core_api_t ns_core_oldest_supported_version;

Public Functions Documentation

function ns_core_check_api

uint32_t ns_core_check_api (
    const ns_core_api_t * submitted,
    const ns_core_api_t * oldest,
    const ns_core_api_t * newest
) 

brief Checks API and semantic version of desired API vs. allowed APIs

param submitted param oldest param newest return uint32_t

function ns_core_fail_loop

void ns_core_fail_loop () 

function ns_core_init

Initialize core state.

uint32_t ns_core_init (
    ns_core_config_t * c
) 

Parameters:

Returns:

uint32_t

function ns_core_initialized

bool ns_core_initialized () 

Macro Definition Documentation

define NS_CORE_CURRENT_VERSION

#define NS_CORE_CURRENT_VERSION NS_CORE_V1_0_0

define NS_CORE_OLDEST_SUPPORTED_VERSION

#define NS_CORE_OLDEST_SUPPORTED_VERSION NS_CORE_V0_0_1

define NS_CORE_V0_0_1

#define NS_CORE_V0_0_1 { .major = 0, .minor = 0, .revision = 1 }

define NS_CORE_V1_0_0

#define NS_CORE_V1_0_0 { .major = 1, .minor = 0, .revision = 0 }

define NS_STATUS_FAILURE

#define NS_STATUS_FAILURE -1

define NS_STATUS_INIT_FAILED

#define NS_STATUS_INIT_FAILED 4

define NS_STATUS_INVALID_CONFIG

#define NS_STATUS_INVALID_CONFIG 3

define NS_STATUS_INVALID_HANDLE

#define NS_STATUS_INVALID_HANDLE 1

define NS_STATUS_INVALID_VERSION

#define NS_STATUS_INVALID_VERSION 2

define NS_STATUS_SUCCESS

#define NS_STATUS_SUCCESS 0

define NS_TRY

#define NS_TRY (
    func,
    msg
) if (func) {                                                                                \
            ns_lp_printf(msg);                                                                     \
            ns_core_fail_loop();                                                                   \
        }

The documentation for this class was generated from the following file neuralSPOT/neuralspot/ns-core/includes-api/ns_core.h