![]() |
Serial Wombat 18AB Firmware
|
#include "serialWombat.h"
#include <stdint.h>
#include "inputProcess.h"
#include "pic24fj256ga702/mcc_generated_files/mcc.h"
Classes | |
struct | resistanceInput_n |
Macros | |
#define | resistanceInput ((resistanceInput_t*) CurrentPinRegister) |
Typedefs | |
typedef struct resistanceInput_n | resistanceInput_t |
Functions | |
uint16_t | GetADCConversion (uint8_t pin) |
void | initResistanceInputSimple (void) |
void | initResistanceInput (void) |
void | updateResistanceInput () |
Variables | |
resistanceInput_t * | debugResistance |
#define resistanceInput ((resistanceInput_t*) CurrentPinRegister) |
typedef struct resistanceInput_n resistanceInput_t |
uint16_t GetADCConversion | ( | uint8_t | pin | ) |
void initResistanceInput | ( | void | ) |
\brief Initialization routine for Analog Input
Configure the A/D using the CONFIGURE_CHANNEL_MODE_0 command before reading values.
Raw A/D conversions are stored in the Pin's 16-bit Public data area. Use the Read Pin Buffer command to retreive it.
Initialize Resistance Input. Disables averaged and filtered values.
BYTE 0 | BYTE 1 | BYTE 2 | BYTE 3 | BYTE 4 | BYTE 5 | BYTE 6 | BYTE 7 |
---|---|---|---|---|---|---|---|
0xC0 | Pin To Set | 0x02 (Resistance Input) | 0x55* | 0x55* | 0x55* | 0x55* | 0x55* |
*0x55 is recommended, but any byte is acceptable
Response:
Command is echoed back.
Examples:
Set pin 3 to Resistance Input.
0xC0 0x03 0x18 0x55 0x55 0x55 0x55 0x55
void initResistanceInputSimple | ( | void | ) |
void updateResistanceInput | ( | ) |
resistanceInput_t* debugResistance |