Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Ardupilot
GitHub Repository: Ardupilot/ardupilot
Path: blob/master/Tools/Linux_HAL_Essentials/pru/rcinpru/prucomm.h
9807 views
1
/*
2
* prucomm.h - structure definitions for communication
3
*
4
*/
5
#pragma once
6
7
#include "pru_defs.h"
8
9
#define NUM_RING_ENTRIES 300
10
11
#define PWM_CMD_MAGIC 0xf00fbaaf
12
#define PWM_REPLY_MAGIC 0xbaaff00f
13
14
struct ring_buffer {
15
volatile uint16_t ring_head;
16
volatile uint16_t ring_tail;
17
struct {
18
uint16_t pin_value;
19
uint16_t delta_t;
20
} buffer[NUM_RING_ENTRIES];
21
};
22
23
/* the command is at the start of shared DPRAM */
24
#define RBUFF ((volatile struct ring_buffer *)DPRAM_SHARED)
25
26