HPM APP
HPMicro Application solution
monitor_kconfig.h File Reference
#include "board.h"
#include <stdint.h>
#include <stdbool.h>

Go to the source code of this file.

Data Structures

struct  monitor_var_info_t
 

Macros

#define MONITOR_PID   (0xFFFF)
 
#define MONITOR_VID   (0x34B7) /* HPMicro VID */
 
#define MONITOR_PROFILE_MAXSIZE   (4096)
 
#define MONITOR_MEM_SIZE   (40*1024)
 
#define CONFIG_MONITOR_PRINTF(...)   printf(__VA_ARGS__)
 
#define CONFIG_MONITOR_DBG_LEVEL   MONITOR_DBG_INFO
 
#define CONFIG_MONITOR_PRINTF_COLOR_ENABLE
 
#define MONITOR_NOCACHE_RAM_SECTION   __attribute__((section(".fast_ram")))
 
#define MONITOR_NOCACHE_AHB_SECTION   __attribute__((section(".ahb_sram")))
 
#define MONITOR_ATTR_ALIGN(alignment)   ATTR_ALIGN(alignment)
 
#define CONFIG_MONITOR_RUNNING_CORE   HPM_CORE0
 
#define MONITOR_REPORT_MAXCOUNT   (16)
 
#define MONITOR_STREAM_BUFFER_MAXCOUNT   MONITOR_REPORT_MAXCOUNT
 
#define MONITOR_CHANNEL_MAXCOUNT   MONITOR_REPORT_MAXCOUNT
 
#define MONITOR_TRIGGER_MAXCOUNT   (16)
 
#define MONITOR_DATA_LIST_MAXCOUNT   (20)
 
#define MONITOR_SAMPLE_GPTMR_1_BASE   HPM_GPTMR0
 
#define MONITOR_SAMPLE_GPTMR_1_IRQ   IRQn_GPTMR0
 
#define MONITOR_SAMPLE_GPTMR_1_CLOCK   clock_gptmr0
 
#define MONITOR_SAMPLE_GPTMR_4_BASE   HPM_GPTMR3
 
#define MONITOR_SAMPLE_GPTMR_4_IRQ   IRQn_GPTMR3
 
#define MONITOR_SAMPLE_GPTMR_4_CLOCK   clock_gptmr3
 
#define MONITOR_SAMPLE_GPTMR_3_BASE   HPM_GPTMR2
 
#define MONITOR_SAMPLE_GPTMR_3_IRQ   IRQn_GPTMR2
 
#define MONITOR_SAMPLE_GPTMR_3_CLOCK   clock_gptmr2
 
#define MONITOR_SAMPLE_GPTMR_2_BASE   HPM_GPTMR1
 
#define MONITOR_SAMPLE_GPTMR_2_IRQ   IRQn_GPTMR1
 
#define MONITOR_SAMPLE_GPTMR_2_CLOCK   clock_gptmr1
 
#define MONITOR_SAMPLE_DMA_1_BASE   HPM_HDMA_BASE
 
#define MONITOR_SAMPLE_DMA_1   HPM_HDMA
 
#define MONITOR_SAMPLE_DMA_2_BASE   HPM_HDMA_BASE
 
#define MONITOR_SAMPLE_DMA_2   HPM_HDMA
 
#define MONITOR_SAMPLE_DMAMUX_BASE   HPM_DMAMUX
 
#define MONITOR_VERSION   0x010000
 
#define MONITOR_VERSION_STR   "v1.0.0"
 
#define MONITOR_RINGBUFFSER_SIZE   (MONITOR_PROFILE_MAXSIZE*2)
 
#define ALIGN_4(x)   (((x) + 3) & ~3)
 
#define MONITOR_PRIVATE_VAR_NAME(name)   b5e21f8a3d709c4f6a82e1b90c367d2a_##name
 
#define MONITOR_SPECIAL_VAR_NAME(name)   d73a1f4e8c02b59e61f807ac45d316ba_##name
 
#define TYPE_INDEX(type)
 
#define MONITOR_DEFINE_GLOBAL_VAR(name, channel, type, frequency, count)
 

Functions

const monitor_var_info_tfind_monitor_by_name (const char *name)
 
const monitor_var_info_tfind_monitor_by_channel (uint8_t channel)
 
bool monitor_send_is_idle (void)
 

Variables

monitor_var_info_t b5e21f8a3d709c4f6a82e1b90c367d2a_monitor_registry [(16)]
 
uint32_t b5e21f8a3d709c4f6a82e1b90c367d2a_monitor_registry_count
 

Macro Definition Documentation

◆ ALIGN_4

#define ALIGN_4 (   x)    (((x) + 3) & ~3)

◆ CONFIG_MONITOR_DBG_LEVEL

#define CONFIG_MONITOR_DBG_LEVEL   MONITOR_DBG_INFO

◆ CONFIG_MONITOR_PRINTF

#define CONFIG_MONITOR_PRINTF (   ...)    printf(__VA_ARGS__)

◆ CONFIG_MONITOR_PRINTF_COLOR_ENABLE

#define CONFIG_MONITOR_PRINTF_COLOR_ENABLE

◆ CONFIG_MONITOR_RUNNING_CORE

#define CONFIG_MONITOR_RUNNING_CORE   HPM_CORE0

◆ MONITOR_ATTR_ALIGN

#define MONITOR_ATTR_ALIGN (   alignment)    ATTR_ALIGN(alignment)

◆ MONITOR_CHANNEL_MAXCOUNT

#define MONITOR_CHANNEL_MAXCOUNT   MONITOR_REPORT_MAXCOUNT

◆ MONITOR_DATA_LIST_MAXCOUNT

#define MONITOR_DATA_LIST_MAXCOUNT   (20)

◆ MONITOR_DEFINE_GLOBAL_VAR

#define MONITOR_DEFINE_GLOBAL_VAR (   name,
  channel,
  type,
  frequency,
  count 
)
Value:
__attribute__((section(".rodata"), used)) \
const uint64_t c1f8a3d2b7e1de45a8f1c4b32e3f0b7d_##name = \
(((uint64_t)(frequency) << 32) | \
((uint64_t)(count & 0xFFFF) << 16) | \
((uint64_t)TYPE_INDEX(type) & 0xFF) << 8 | \
((uint64_t)(channel) & 0xFF)); \
\
__attribute__((constructor, used)) \
static void __register_monitor_##name(void) { \
extern uint32_t MONITOR_PRIVATE_VAR_NAME(monitor_registry_count); \
/* Inform the compiler about variables c1f8a3d2b7e1de45a8f1c4b32e3f0b7d_##name is being used, and memory may change */ \
__asm__ volatile ("" : : "r"(&c1f8a3d2b7e1de45a8f1c4b32e3f0b7d_##name) : "memory"); \
\
if (MONITOR_PRIVATE_VAR_NAME(monitor_registry_count) < MONITOR_CHANNEL_MAXCOUNT) { \
MONITOR_PRIVATE_VAR_NAME(monitor_registry)[MONITOR_PRIVATE_VAR_NAME(monitor_registry_count)].name_t = #name; \
MONITOR_PRIVATE_VAR_NAME(monitor_registry)[MONITOR_PRIVATE_VAR_NAME(monitor_registry_count)].channel_t = (channel); \
MONITOR_PRIVATE_VAR_NAME(monitor_registry)[MONITOR_PRIVATE_VAR_NAME(monitor_registry_count)].type_index_t = TYPE_INDEX(type); \
MONITOR_PRIVATE_VAR_NAME(monitor_registry)[MONITOR_PRIVATE_VAR_NAME(monitor_registry_count)].count_t = (count); \
MONITOR_PRIVATE_VAR_NAME(monitor_registry)[MONITOR_PRIVATE_VAR_NAME(monitor_registry_count)].freq_t = (frequency); \
MONITOR_PRIVATE_VAR_NAME(monitor_registry)[MONITOR_PRIVATE_VAR_NAME(monitor_registry_count)].encoded_value = c1f8a3d2b7e1de45a8f1c4b32e3f0b7d_##name; \
MONITOR_PRIVATE_VAR_NAME(monitor_registry_count)++; \
} else { \
printf("bad! monitor define global var overflow!"); \
while(1); \
} \
}
#define MONITOR_PRIVATE_VAR_NAME(name)
Definition: monitor_kconfig.h:183
#define MONITOR_CHANNEL_MAXCOUNT
Definition: monitor_kconfig.h:123
#define TYPE_INDEX(type)
Definition: monitor_kconfig.h:202
Definition: monitor_kconfig.h:186

◆ MONITOR_MEM_SIZE

#define MONITOR_MEM_SIZE   (40*1024)

◆ MONITOR_NOCACHE_AHB_SECTION

#define MONITOR_NOCACHE_AHB_SECTION   __attribute__((section(".ahb_sram")))

◆ MONITOR_NOCACHE_RAM_SECTION

#define MONITOR_NOCACHE_RAM_SECTION   __attribute__((section(".fast_ram")))

◆ MONITOR_PID

#define MONITOR_PID   (0xFFFF)

◆ MONITOR_PRIVATE_VAR_NAME

#define MONITOR_PRIVATE_VAR_NAME (   name)    b5e21f8a3d709c4f6a82e1b90c367d2a_##name

◆ MONITOR_PROFILE_MAXSIZE

#define MONITOR_PROFILE_MAXSIZE   (4096)

◆ MONITOR_REPORT_MAXCOUNT

#define MONITOR_REPORT_MAXCOUNT   (16)

◆ MONITOR_RINGBUFFSER_SIZE

#define MONITOR_RINGBUFFSER_SIZE   (MONITOR_PROFILE_MAXSIZE*2)

◆ MONITOR_SAMPLE_DMA_1

#define MONITOR_SAMPLE_DMA_1   HPM_HDMA

◆ MONITOR_SAMPLE_DMA_1_BASE

#define MONITOR_SAMPLE_DMA_1_BASE   HPM_HDMA_BASE

◆ MONITOR_SAMPLE_DMA_2

#define MONITOR_SAMPLE_DMA_2   HPM_HDMA

◆ MONITOR_SAMPLE_DMA_2_BASE

#define MONITOR_SAMPLE_DMA_2_BASE   HPM_HDMA_BASE

◆ MONITOR_SAMPLE_DMAMUX_BASE

#define MONITOR_SAMPLE_DMAMUX_BASE   HPM_DMAMUX

◆ MONITOR_SAMPLE_GPTMR_1_BASE

#define MONITOR_SAMPLE_GPTMR_1_BASE   HPM_GPTMR0

◆ MONITOR_SAMPLE_GPTMR_1_CLOCK

#define MONITOR_SAMPLE_GPTMR_1_CLOCK   clock_gptmr0

◆ MONITOR_SAMPLE_GPTMR_1_IRQ

#define MONITOR_SAMPLE_GPTMR_1_IRQ   IRQn_GPTMR0

◆ MONITOR_SAMPLE_GPTMR_2_BASE

#define MONITOR_SAMPLE_GPTMR_2_BASE   HPM_GPTMR1

◆ MONITOR_SAMPLE_GPTMR_2_CLOCK

#define MONITOR_SAMPLE_GPTMR_2_CLOCK   clock_gptmr1

◆ MONITOR_SAMPLE_GPTMR_2_IRQ

#define MONITOR_SAMPLE_GPTMR_2_IRQ   IRQn_GPTMR1

◆ MONITOR_SAMPLE_GPTMR_3_BASE

#define MONITOR_SAMPLE_GPTMR_3_BASE   HPM_GPTMR2

◆ MONITOR_SAMPLE_GPTMR_3_CLOCK

#define MONITOR_SAMPLE_GPTMR_3_CLOCK   clock_gptmr2

◆ MONITOR_SAMPLE_GPTMR_3_IRQ

#define MONITOR_SAMPLE_GPTMR_3_IRQ   IRQn_GPTMR2

◆ MONITOR_SAMPLE_GPTMR_4_BASE

#define MONITOR_SAMPLE_GPTMR_4_BASE   HPM_GPTMR3

◆ MONITOR_SAMPLE_GPTMR_4_CLOCK

#define MONITOR_SAMPLE_GPTMR_4_CLOCK   clock_gptmr3

◆ MONITOR_SAMPLE_GPTMR_4_IRQ

#define MONITOR_SAMPLE_GPTMR_4_IRQ   IRQn_GPTMR3

◆ MONITOR_SPECIAL_VAR_NAME

#define MONITOR_SPECIAL_VAR_NAME (   name)    d73a1f4e8c02b59e61f807ac45d316ba_##name

◆ MONITOR_STREAM_BUFFER_MAXCOUNT

#define MONITOR_STREAM_BUFFER_MAXCOUNT   MONITOR_REPORT_MAXCOUNT

◆ MONITOR_TRIGGER_MAXCOUNT

#define MONITOR_TRIGGER_MAXCOUNT   (16)

◆ MONITOR_VERSION

#define MONITOR_VERSION   0x010000

◆ MONITOR_VERSION_STR

#define MONITOR_VERSION_STR   "v1.0.0"

◆ MONITOR_VID

#define MONITOR_VID   (0x34B7) /* HPMicro VID */

◆ TYPE_INDEX

#define TYPE_INDEX (   type)
Value:
(_Generic((type){0}, \
bool: 0x00, \
uint8_t: 0x01, \
int8_t: 0x02, \
uint16_t: 0x03, \
int16_t: 0x04, \
uint32_t: 0x05, \
int32_t: 0x06, \
uint64_t: 0x07, \
int64_t: 0x08, \
float: 0x09, \
double: 0x0A, \
default: -1 \
))

Function Documentation

◆ find_monitor_by_channel()

const monitor_var_info_t* find_monitor_by_channel ( uint8_t  channel)

◆ find_monitor_by_name()

const monitor_var_info_t* find_monitor_by_name ( const char *  name)

◆ monitor_send_is_idle()

bool monitor_send_is_idle ( void  )

Variable Documentation

◆ b5e21f8a3d709c4f6a82e1b90c367d2a_monitor_registry

monitor_var_info_t b5e21f8a3d709c4f6a82e1b90c367d2a_monitor_registry[(16)]
extern

◆ b5e21f8a3d709c4f6a82e1b90c367d2a_monitor_registry_count

uint32_t b5e21f8a3d709c4f6a82e1b90c367d2a_monitor_registry_count
extern