Skip to content

File syn_ppm.c

FileList > input > syn_ppm.c

Go to the source code of this file

Zero-Heap PPM Multi-Channel RC Receiver Decoder Implementation.

  • #include "syntropic/input/syn_ppm.h"
  • #include <string.h>

Public Functions

Type Name
uint16_t syn_ppm_get_channel (const SYN_PPM_Decoder * ppm, uint8_t channel_idx)
Get pulse width (us) for specified 0-indexed channel.
SYN_Status syn_ppm_init (SYN_PPM_Decoder * ppm)
Initialize PPM decoder instance.
SYN_Status syn_ppm_process_pulse (SYN_PPM_Decoder * ppm, uint16_t pulse_us)
Process high-resolution measured pulse width (us) from Timer Input Capture interrupt.

Public Functions Documentation

function syn_ppm_get_channel

Get pulse width (us) for specified 0-indexed channel.

uint16_t syn_ppm_get_channel (
    const SYN_PPM_Decoder * ppm,
    uint8_t channel_idx
) 

Parameters:

  • ppm Pointer to decoder struct.
  • channel_idx 0-indexed channel index (0..11).

Returns:

Pulse width in microseconds (clamped 1000..2000 us, or 1500 us default if unreceived).


function syn_ppm_init

Initialize PPM decoder instance.

SYN_Status syn_ppm_init (
    SYN_PPM_Decoder * ppm
) 

Parameters:

  • ppm Pointer to decoder struct.

Returns:

SYN_OK on success.


function syn_ppm_process_pulse

Process high-resolution measured pulse width (us) from Timer Input Capture interrupt.

SYN_Status syn_ppm_process_pulse (
    SYN_PPM_Decoder * ppm,
    uint16_t pulse_us
) 

Parameters:

  • ppm Pointer to decoder struct.
  • pulse_us Measured pulse width in microseconds (us).

Returns:

SYN_OK when a complete multi-channel PPM frame is finished, SYN_BUSY during channel reception.



The documentation for this class was generated from the following file src/syntropic/input/syn_ppm.c