Pogosim
Loading...
Searching...
No Matches
pogosim.h File Reference
#include <stdbool.h>
#include "spogobot.h"
#include "colormaps.h"
#include <stddef.h>

Go to the source code of this file.

Macros

#define STATIC_STRCMP(a, b)
#define STRINGIFY_RAW(x)
#define STRINGIFY(x)
#define DECLARE_USERDATA(UDT)
#define REGISTER_USERDATA(UDT)
#define SET_CALLBACK(CALLBACK_FN, FN)
#define GET_MACRO_START(_1, _2, _3, NAME, ...)
#define pogobot_start_2(user_init, user_step)
#define pogobot_start_3(user_init, user_step, object_category)
#define pogobot_start(...)

Enumerations

enum  error_code_t { ERROR_TIME_OVERFLOW , error_code_t_last_entry }

Functions

const char * get_current_robot_category (void)
bool current_robot_category_is (const char *category)
void _pogobot_start (void(*user_init)(void), void(*user_step)(void), const char *object_category)
void clear_IR_buffers (void)
void pogo_main_loop_step (void(*user_step)(void))
uint32_t current_time_milliseconds (void)
void display_led_error_code (error_code_t const c)
void default_walls_user_init (void)
 Initialization function for the pogowalls.
void default_walls_user_step (void)
 Main control loop for the Pogowalls.

Variables

void(* callback_create_data_schema )(void)
void(* callback_export_data )(void)
void(* callback_global_setup )(void)
void(* callback_global_step )(void)
uint32_t pogobot_ticks
uint8_t main_loop_hz
uint8_t max_nb_processed_msg_per_tick
void(* msg_rx_fn )(message_t *)
bool(* msg_tx_fn )(void)
int8_t error_codes_led_idx
time_reference_t _global_timer
time_reference_t timer_main_loop
uint32_t _current_time_milliseconds
uint32_t _error_code_initial_time
uint8_t percent_msgs_sent_per_ticks
uint32_t nb_msgs_sent
uint32_t nb_msgs_recv

Macro Definition Documentation

◆ DECLARE_USERDATA

#define DECLARE_USERDATA ( UDT)
Value:
extern UDT *mydata;
void * mydata

◆ GET_MACRO_START

#define GET_MACRO_START ( _1,
_2,
_3,
NAME,
... )
Value:
NAME

◆ pogobot_start

#define pogobot_start ( ...)
Value:
GET_MACRO_START(__VA_ARGS__, pogobot_start_3, pogobot_start_2)(__VA_ARGS__)
#define GET_MACRO_START(_1, _2, _3, NAME,...)
Definition pogosim.h:109
#define pogobot_start_3(user_init, user_step, object_category)
Definition pogosim.h:119
#define pogobot_start_2(user_init, user_step)
Definition pogosim.h:116

◆ pogobot_start_2

#define pogobot_start_2 ( user_init,
user_step )
Value:
_pogobot_start((user_init), (user_step), "robots")
void _pogobot_start(void(*user_init)(void), void(*user_step)(void), const char *object_category)
Definition pogosim_sim.cpp:7

◆ pogobot_start_3

#define pogobot_start_3 ( user_init,
user_step,
object_category )
Value:
_pogobot_start((user_init), (user_step), (object_category))

◆ REGISTER_USERDATA

#define REGISTER_USERDATA ( UDT)
Value:
size_t UserdataSize = sizeof(UDT); \
UDT *mydata;
int UserdataSize

◆ SET_CALLBACK

#define SET_CALLBACK ( CALLBACK_FN,
FN )
Value:
CALLBACK_FN = FN;

◆ STATIC_STRCMP

#define STATIC_STRCMP ( a,
b )
Value:
strcmp(a,b)

◆ STRINGIFY

#define STRINGIFY ( x)
Value:
#define STRINGIFY_RAW(x)
Definition pogosim.h:23

◆ STRINGIFY_RAW

#define STRINGIFY_RAW ( x)
Value:
#x

Enumeration Type Documentation

◆ error_code_t

Enumerator
ERROR_TIME_OVERFLOW 
error_code_t_last_entry 

Function Documentation

◆ _pogobot_start()

void _pogobot_start ( void(* user_init )(void),
void(* user_step )(void),
const char * object_category )

◆ clear_IR_buffers()

void clear_IR_buffers ( void )

◆ current_robot_category_is()

bool current_robot_category_is ( const char * category)

◆ current_time_milliseconds()

uint32_t current_time_milliseconds ( void )

◆ default_walls_user_init()

void default_walls_user_init ( void )

Initialization function for the pogowalls.

This function is executed once at startup (cf 'pogobot_start' call in main()).

◆ default_walls_user_step()

void default_walls_user_step ( void )

Main control loop for the Pogowalls.

This function is called continuously at the frequency defined in walls_user_init().

◆ display_led_error_code()

void display_led_error_code ( error_code_t const c)

◆ get_current_robot_category()

const char * get_current_robot_category ( void )

◆ pogo_main_loop_step()

void pogo_main_loop_step ( void(* user_step )(void))

Variable Documentation

◆ _current_time_milliseconds

uint32_t _current_time_milliseconds
extern

◆ _error_code_initial_time

uint32_t _error_code_initial_time
extern

◆ _global_timer

time_reference_t _global_timer
extern

◆ callback_create_data_schema

void(* callback_create_data_schema) (void) ( void )
extern

◆ callback_export_data

void(* callback_export_data) (void) ( void )
extern

◆ callback_global_setup

void(* callback_global_setup) (void) ( void )
extern

◆ callback_global_step

void(* callback_global_step) (void) ( void )
extern

◆ error_codes_led_idx

int8_t error_codes_led_idx
extern

◆ main_loop_hz

uint8_t main_loop_hz
extern

◆ max_nb_processed_msg_per_tick

uint8_t max_nb_processed_msg_per_tick
extern

◆ msg_rx_fn

void(* msg_rx_fn) (message_t *) ( message_t * )
extern

◆ msg_tx_fn

bool(* msg_tx_fn) (void) ( void )
extern

◆ nb_msgs_recv

uint32_t nb_msgs_recv
extern

◆ nb_msgs_sent

uint32_t nb_msgs_sent
extern

◆ percent_msgs_sent_per_ticks

uint8_t percent_msgs_sent_per_ticks
extern

◆ pogobot_ticks

uint32_t pogobot_ticks
extern

◆ timer_main_loop

time_reference_t timer_main_loop
extern