Embedded Wireless Framework
Data Structures | Macros
ewf_platform_bare_metal.h File Reference

The Embedded Wireless Framework bare metal platform. More...

#include "ewf_platform.h"
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  _ewf_platform_queue
 The platform queue structure. More...
 

Macros

#define EWF_PLATFORM_TICKS_PER_SECOND   (1000)
 
#define EWF_PLATFORM_BUSY_WAIT(count)
 The default platform busy wait macro. More...
 
#define EWF_PLATFORM_QUEUE_STATIC_DECLARE(queue_ptr, queue_name_symb, item_type, item_count)
 Declare statically a queue for the platform and initialize its data. More...
 

Detailed Description

The Embedded Wireless Framework bare metal platform.

Version
Preview

Macro Definition Documentation

◆ EWF_PLATFORM_BUSY_WAIT

#define EWF_PLATFORM_BUSY_WAIT (   count)
Value:
do { \
static volatile uint32_t i, j, x; \
for (i = 0, x = 0; i < count; i++) \
for (j = 0; j < 1024; j++) \
x += i + j; \
} while(0)

The default platform busy wait macro.

This default implementation is not time accurate and very wasteful (power hungry, bus hungry). Override it with an implementation valid for your system, ideally sleeping the CPU for the requested number of ticks.

◆ EWF_PLATFORM_QUEUE_STATIC_DECLARE

#define EWF_PLATFORM_QUEUE_STATIC_DECLARE (   queue_ptr,
  queue_name_symb,
  item_type,
  item_count 
)
Value:
do { \
static uint8_t ewf_platform_queue__buffer__##queue_name_symb[sizeof(item_type) * item_count]; \
static ewf_platform_queue ewf_platform_queue__##queue_name_symb = {0}; \
ewf_platform_queue__##queue_name_symb.data = ewf_platform_queue__buffer__##queue_name_symb; \
ewf_platform_queue__##queue_name_symb.item_size = sizeof(item_type); \
ewf_platform_queue__##queue_name_symb.queue_size = item_count; \
ewf_platform_queue__##queue_name_symb.tail_index = 0; \
ewf_platform_queue__##queue_name_symb.used_count = 0; \
queue_ptr = &(ewf_platform_queue__##queue_name_symb); \
} while(0)
The platform queue structure.
Definition: ewf_platform_bare_metal.h:74

Declare statically a queue for the platform and initialize its data.

Parameters
[in,out]queue_ptra pointer to a _ewf_platform_queue structure that will be made to point to the statically declared queue
[in]queue_name_symba symbol that will be used to uniquely declare and name the queue
[in]item_typetype queue item type
[in]item_countthe maximum number item the queue can contain

◆ EWF_PLATFORM_TICKS_PER_SECOND

#define EWF_PLATFORM_TICKS_PER_SECOND   (1000)

Define the number of ticks per second in the platform; this is used to calculate absolute times. This default value is only a recommendation, override with the right value for your system.