APM:Libraries
libraries
AP_HAL_Linux
RCInput_PRU.h
Go to the documentation of this file.
1
#pragma once
2
3
/*
4
This class implements RCInput on the BeagleBoneBlack with a PRU
5
doing the edge detection of the PPM sum input
6
*/
7
8
#include "
RCInput.h
"
9
10
// we use 300 ring buffer entries to guarantee that a full 25 byte
11
// frame of 12 bits per byte
12
13
namespace
Linux
{
14
15
class
RCInput_PRU
:
public
RCInput
{
16
public
:
17
void
init
();
18
void
_timer_tick
(
void
);
19
20
private
:
21
static
const
unsigned
int
NUM_RING_ENTRIES
=300;
22
// shared ring buffer with the PRU which records pin transitions
23
struct
ring_buffer
{
24
volatile
uint16_t
ring_head
;
// owned by ARM CPU
25
volatile
uint16_t
ring_tail
;
// owned by the PRU
26
struct
{
27
uint16_t
pin_value
;
28
uint16_t
delta_t
;
29
}
buffer
[
NUM_RING_ENTRIES
];
30
};
31
volatile
struct
ring_buffer
*
ring_buffer
;
32
33
// time spent in the low state
34
uint16_t
_s0_time
;
35
};
36
37
}
Linux::RCInput_PRU::ring_buffer::pin_value
uint16_t pin_value
Definition:
RCInput_PRU.h:27
Linux::RCInput_PRU::ring_buffer
Definition:
RCInput_PRU.h:23
Linux::RCInput
Definition:
RCInput.h:11
Linux::RCInput_PRU::NUM_RING_ENTRIES
static const unsigned int NUM_RING_ENTRIES
Definition:
RCInput_PRU.h:21
Linux::RCInput_PRU::_timer_tick
void _timer_tick(void)
Definition:
RCInput_PRU.cpp:47
Linux::RCInput_PRU::ring_buffer::ring_head
volatile uint16_t ring_head
Definition:
RCInput_PRU.h:24
Linux::RCInput_PRU::_s0_time
uint16_t _s0_time
Definition:
RCInput_PRU.h:34
RCInput.h
Linux::buffer
Definition:
VideoIn.h:23
Linux::RCInput_PRU::ring_buffer::delta_t
uint16_t delta_t
Definition:
RCInput_PRU.h:28
Linux::RCInput_PRU::init
void init()
Definition:
RCInput_PRU.cpp:27
Linux::RCInput_PRU::ring_buffer::ring_tail
volatile uint16_t ring_tail
Definition:
RCInput_PRU.h:25
Linux
Definition:
CameraSensor.h:19
Linux::RCInput_PRU
Definition:
RCInput_PRU.h:15
Linux::RCInput_PRU::ring_buffer
volatile struct ring_buffer * ring_buffer
Definition:
RCInput_PRU.h:31
Generated on Sun Jun 17 2018 14:18:49 for APM:Libraries by
1.8.13