Serial Wombat 18AB Firmware
Classes | Typedefs | Enumerations | Functions
pulseInputDMA.c File Reference
#include "SerialWombat.h"
#include <stdint.h>

Classes

struct  linear_n
 
struct  lookup2D_n
 
struct  pulseIn_n
 

Typedefs

typedef struct linear_n linear_t
 
typedef struct lookup2D_n lookup2D_t
 
typedef struct pulseIn_n pulseOut_t
 

Enumerations

enum  transformType_t { TRANSFORM_TYPE_DIRECT = 0, TRANSFORM_TYPE_LINEAR = 1 }
 

Functions

void initPulseIn (void)
 
void updatePulseIn (void)
 

Typedef Documentation

◆ linear_t

typedef struct linear_n linear_t

◆ lookup2D_t

typedef struct lookup2D_n lookup2D_t

◆ pulseOut_t

typedef struct pulseIn_n pulseOut_t

Enumeration Type Documentation

◆ transformType_t

Enumerator
TRANSFORM_TYPE_DIRECT 
TRANSFORM_TYPE_LINEAR 

Function Documentation

◆ initPulseIn()

void initPulseIn ( void  )
\brief Initialization routine for Servo.

CONFIGURE_CHANNEL_MODE_0:

Initialize Servo. This command causes the pulse width to default to 500uS to 2500uS.

BYTE 0 BYTE 1 BYTE 2 BYTE 3 BYTE 4 BYTE 5 BYTE 6 BYTE 7
0xC0 Pin To Set 0x03 (servo mode) Pin To Set (Required for compatability with SW19) Position Value Low Byte Position Value High Byte 0x00 or 0x01 (Normal or Reverse) 0x55*

*0x55 is recommended, but any byte is acceptable

Response:

Command is echoed back.

Examples:

Set pin 2 to Servo, Position 0x4080, no reverse

0xC0 0x02 0x03 0x02 0x80 0x40 0x00 0x55


CONFIGURE_CHANNEL_MODE_1:

Set Pulse widths. This command must come after a servo CONFIGURE_CHANNEL_MODE_0 command for the same pin. Units are microseconds

BYTE 0 BYTE 1 BYTE 2 BYTE 3 BYTE 4 BYTE 5 BYTE 6 BYTE 7
0xC1 Pin To Set 0x03 (servo mode) Fixed pulse time low byte Fixed pulse time high byte Variable pulse time low byte variable pulse time high byte 0x55*

*0x55 is recommended, but any byte is acceptable

Response:

Command is echoed back.

Examples:

Set pin 2 Servo Pulse width to range between 750 and 1750 uS.
Fixed period is 750 = 0x02EE, variable period is (1750 - 750) = 1000 = 0x03E8

0xC1 0x02 0x03 0xEE 0x02 0xE8 0x03 0x55

◆ updatePulseIn()

void updatePulseIn ( void  )