ardupilot/Tools/Linux_HAL_Essentials/rcinpru/prucomm.h
bugobliterator d8e36fee41 Tools:HAL_Linux_Essentials: Add PRU side of code for RCinput to run on PRU0
PRU0 with rcinpru0 firmware will be timing pin state changes and loading it inside ring buffer maintained inside SHARED_RAM at 0x12000 offset
2014-08-19 10:08:16 +10:00

28 lines
553 B
C

/*
* prucomm.h - structure definitions for communication
*
*/
#ifndef PRUCOMM_H
#define PRUCOMM_H
#include "pru_defs.h"
#define NUM_RING_ENTRIES 200
#define PWM_CMD_MAGIC 0xf00fbaaf
#define PWM_REPLY_MAGIC 0xbaaff00f
struct ring_buffer {
volatile uint16_t ring_head;
volatile uint16_t ring_tail;
struct {
uint16_t pin_value;
uint16_t delta_t;
} buffer[NUM_RING_ENTRIES];
};
/* the command is at the start of shared DPRAM */
#define RBUFF ((volatile struct ring_buffer *)DPRAM_SHARED)
#endif