Classes | Defines | Typedefs | Functions | Variables

irc.c File Reference

#include "irc.h"
Include dependency graph for irc.c:

Classes

struct  deglitcher_t

Defines

#define DEGLITCH_MEDIAN_LEN   31
#define DEGLITCH_PULSE_LEN   00

Typedefs

typedef uint32_t deglitch_buf_t
typedef struct deglitcher_t deglitcher_t

Functions

void irc_deglitch_init (deglitcher_t *dg)
int irc_deglitch (deglitcher_t *dg, char inp)
void irc_init ()
 update IRC1, IRC2 deglitchers' state structs, initialize IRC1,2 as GPIO inputs
int irc_read ()
 -!- to be called @ approx.

Variables

deglitcher_t dg1
deglitcher_t dg2
int32_t volatile irc1_count = 0
int32_t volatile irc2_count = 0

Define Documentation

#define DEGLITCH_MEDIAN_LEN   31
#define DEGLITCH_PULSE_LEN   00

Typedef Documentation

typedef uint32_t deglitch_buf_t
typedef struct deglitcher_t deglitcher_t

Function Documentation

int irc_deglitch ( deglitcher_t dg,
char  inp 
)

Here is the caller graph for this function:

void irc_deglitch_init ( deglitcher_t dg  ) 

Here is the caller graph for this function:

void irc_init (  ) 

update IRC1, IRC2 deglitchers' state structs, initialize IRC1,2 as GPIO inputs

Here is the call graph for this function:

Here is the caller graph for this function:

int irc_read (  ) 

-!- to be called @ approx.

100kHz fixed period -!-

read IRC1,2 inputs, deglitch signal, update irc*_count variables increments on falling edge

Returns:
r; r==0: no change, r&1: IRC1 increment, r&2: IRC2 increment

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

int32_t volatile irc1_count = 0
int32_t volatile irc2_count = 0