CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
Ardupilot

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: Ardupilot/ardupilot
Path: blob/master/Tools/Linux_HAL_Essentials/pru/rcinpru/prucomm.h
Views: 1800
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