Serial Wombat 18AB Firmware
Classes | Macros | Typedefs | Functions
throughputConsumer.c File Reference
#include "serialWombat.h"
#include <stdint.h>
#include "pic24fj256ga702/mcc_generated_files/mcc.h"
#include <libpic30.h>

Classes

struct  throughputConsumer_n
 

Macros

#define FCY   2000000UL
 

Typedefs

typedef struct throughputConsumer_n throughputConsumer_t
 

Functions

void initThroughputConsumer ()
 
void updateThroughputConsumer ()
 

Macro Definition Documentation

◆ FCY

#define FCY   2000000UL

Typedef Documentation

◆ throughputConsumer_t

Function Documentation

◆ initThroughputConsumer()

void initThroughputConsumer ( )
\brief Initialization routine for ThroughputConsumer 


Initialize Throutput Consumer. Sets all values to zero

BYTE 0 BYTE 1 BYTE 2 BYTE 3 BYTE 4 BYTE 5 BYTE 6 BYTE 7
0xC0 Pin To Set 0x04 (ThroughputConsumer) 0x55* 0x55* 0x55* 0x55* 0x55*

*0x55 is recommended, but any byte is acceptable

Response:

Command is echoed back.

Examples:

Initialize Throughput Consumer on pin 2

0xC0 0x02 0x04 0x55 0x55 0x55 0x55 0x55


CONFIGURE_CHANNEL_MODE_1:

Set up a frame mod 16 to consume a given amount of throughput in uS Pin will go high while consuming, low otherwise

BYTE 0 BYTE 1 BYTE 2 BYTE 3 BYTE 4 BYTE 5 BYTE 6 BYTE 7
0xC1 Pin To Set 0x04 (ThroughputConsumer) Slot (0-15) microseconds LSB microseconds MSB 0x55* 0x55*

*0x55 is recommended, but any byte is acceptable

Response:

Command is echoed back.

Examples:

Configure pin 2 frame % 16 = 7 to consume 400 uS

0xC1 0x02 0x04 0x07 0x90 0x01 0x55 0x55


CONFIGURE_CHANNEL_MODE_2:

Consume indicated number of microseconds during command processing

BYTE 0 BYTE 1 BYTE 2 BYTE 3 BYTE 4 BYTE 5 BYTE 6 BYTE 7
0xC2 Pin To Set 0x04 (ThroughputConsumer) microseconds LSB microseconds MSB 0x55* 0x55* 0x55*

*0x55 is recommended, but any byte is acceptable

Response:

Command is echoed back after delay.

Examples:

Consume 400 microseconds upon receipt

0xC2 0x02 0x04 0x90 0x01 0x55 0x55 0x55

◆ updateThroughputConsumer()

void updateThroughputConsumer ( )