123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- #pragma once
- #include "AP_HAL_Linux.h"
- #if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_POCKET
- #define RCIN_PRUSS_RAM_BASE 0x4a301000
- #else
- #define RCIN_PRUSS_RAM_BASE 0x4a303000
- #endif
- namespace Linux {
- class RCInput_AioPRU : public RCInput {
- public:
- void init() override;
- void _timer_tick(void) override;
- protected:
- static const uint32_t TICK_PER_US = 200;
- static const uint32_t NUM_RING_ENTRIES = 300;
-
- struct ring_buffer {
- volatile uint16_t ring_head;
- volatile uint16_t ring_tail;
- struct {
- volatile uint32_t s1_t;
- volatile uint32_t s0_t;
- } buffer[NUM_RING_ENTRIES];
- };
- volatile struct ring_buffer *ring_buffer;
- };
- }
|