Skip to content

File ns_core.c

FileList > neuralSPOT > neuralspot > ns-core > src > ns_core.c

Go to the source code of this file

Code common to all neuralSPOT. More...

  • #include "ns_core.h"

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
int __wrap__close_r (struct _reent * r, int fd)
int __wrap__fstat_r (struct _reent * r, int fd, struct stat * st)
int __wrap__getpid_r (struct _reent * r)
int __wrap__isatty_r (struct _reent * r, int fd)
int __wrap__kill_r (struct _reent * r, int pid, int sig)
int __wrap__lseek_r (struct _reent * r, int fd, int ptr, int dir)
int __wrap__read_r (struct _reent * r, int fd, void * ptr, size_t len)
int __wrap__write_r (struct _reent * r, int fd, const void * ptr, size_t len)
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.

Public Static Functions

Type Name
int semver_compare (const ns_semver_t * c, const ns_semver_t * n)

Macros

Type Name
define NS_CORE_API_ID 0xCA0000

Detailed Description

Author:

Carlos Morales

Version:

0.1

Date:

2022-11-03

Copyright:

Copyright (c) 2022

Public Attributes Documentation

variable g_ns_state

Collection of ns-wide states and desired states.

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 __wrap__close_r

int __wrap__close_r (
    struct _reent * r,
    int fd
) 

function __wrap__fstat_r

int __wrap__fstat_r (
    struct _reent * r,
    int fd,
    struct stat * st
) 

function __wrap__getpid_r

int __wrap__getpid_r (
    struct _reent * r
) 

function __wrap__isatty_r

int __wrap__isatty_r (
    struct _reent * r,
    int fd
) 

function __wrap__kill_r

int __wrap__kill_r (
    struct _reent * r,
    int pid,
    int sig
) 

function __wrap__lseek_r

int __wrap__lseek_r (
    struct _reent * r,
    int fd,
    int ptr,
    int dir
) 

function __wrap__read_r

int __wrap__read_r (
    struct _reent * r,
    int fd,
    void * ptr,
    size_t len
) 

function __wrap__write_r

int __wrap__write_r (
    struct _reent * r,
    int fd,
    const void * ptr,
    size_t len
) 

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


Public Static Functions Documentation

function semver_compare

static int semver_compare (
    const ns_semver_t * c,
    const ns_semver_t * n
) 

Compare semantic versions

param c - 'current' version param n - 'target' version return int - 0 if equal, -1 is c is less than n, 1 if c is more than n


Macro Definition Documentation

define NS_CORE_API_ID

#define NS_CORE_API_ID `0xCA0000`


The documentation for this class was generated from the following file neuralSPOT/neuralspot/ns-core/src/ns_core.c