|
Serial Wombat 4A and 4B Firmware
|
Go to the documentation of this file.
27 #ifndef SERIALWOMBAT_H
28 #define SERIALWOMBAT_H
44 #define RXBUFFER_LENGTH 8
47 #define TXBUFFER_LENGTH 8
50 #if SIZE_OF_USER_BUFFER > 0
54 #define CLOCK_STRETCHING_MAX 10
56 #define DIGITAL_HIGH 1
57 #define DIGITAL_INPUT 2
72 void SetPin(uint8_t pin, uint8_t pinState);
void PinPullUp(uint8_t pin)
Definition: pinDigitalHwSpecific.c:115
@ SW_DATA_SOURCE_8SEC_SAW
Sawtooth wave that goes from 0 to 65535 to 0 every 8192 frames.
Definition: serialWombat.h:202
@ SW_DATA_SOURCE_PIN_4_MV
The public data of Pin 4 expressed as mV. Only applicable to Analog Input mode.
Definition: serialWombat.h:175
SW_ERROR_t
Definition: serialWombatErrors.h:24
void SetPin(uint8_t pin, uint8_t pinState)
Definition: pinDigitalHwSpecific.c:49
@ SW_DATA_SOURCE_VCC_mVOLTS
The system source voltage in mV.
Definition: serialWombat.h:167
@ SW_DATA_SOURCE_PIN_10
Definition: serialWombat.h:103
@ SW_DATA_SOURCE_PIN_4
Definition: serialWombat.h:97
@ SW_DATA_SOURCE_PIN_18
Definition: serialWombat.h:111
void CurrentPinNoPullUp(void)
Definition: pinDigitalHwSpecific.c:110
@ SW_DATA_SOURCE_PIN_0_MV
The public data of Pin 0 expressed as mV. Only applicable to Analog Input mode.
Definition: serialWombat.h:171
@ SW_DATA_SOURCE_PIN_17
Definition: serialWombat.h:110
bool CurrentPinRead(void)
Definition: pinDigitalHwSpecific.c:88
#define RXBUFFER_LENGTH
Definition: serialWombat.h:44
@ SW_DATA_SOURCE_PIN_3_MV
The public data of Pin 3 expressed as mV. Only applicable to Analog Input mode.
Definition: serialWombat.h:174
uint32_t FramesRun
Definition: main.c:52
@ SW_DATA_SOURCE_PIN_0
Definition: serialWombat.h:93
@ SW_DATA_SOURCE_2HZ_SAW
Sawtooth wave that goes from 0 to 65535 to 0 every 512 frames.
Definition: serialWombat.h:193
@ SW_DATA_SOURCE_PIN_2
Definition: serialWombat.h:95
#define SIZE_OF_USER_BUFFER
Definition: deviceSpecific.h:47
@ SW_DATA_SOURCE_PIN_19
Definition: serialWombat.h:112
@ SW_DATA_SOURCE_PIN_5
Definition: serialWombat.h:98
void ProcessPins(void)
Definition: processPins.c:33
@ SW_DATA_SOURCE_TEMPERATURE
The internal core temperature expressed in 100ths deg C.
Definition: serialWombat.h:162
void PinNoPullUp(uint8_t pin)
Definition: pinDigitalHwSpecific.c:120
pinRegister_t PinUpdateRegisters[NUMBER_OF_TOTAL_PINS]
Definition: pinRegisters.c:28
bool RunForeground
Definition: main.c:49
@ SW_DATA_SOURCE_PIN_7
Definition: serialWombat.h:100
@ SW_DATA_SOURCE_FRAMES_RUN_LSW
The number of frames run since reset, least significant 16 bits.
Definition: serialWombat.h:159
uint8_t Rxbuffer[RXBUFFER_LENGTH]
A buffer for incoming commands from the host.
Definition: protocol.c:37
void CurrentPinLow(void)
Definition: pinDigitalHwSpecific.c:45
@ SW_DATA_SOURCE_PIN_3
Definition: serialWombat.h:96
void PinOutput(uint8_t pin)
void CurrentPinNotAnalog(void)
Definition: pinDigitalHwSpecific.c:125
void ProcessRx(void)
Definition: protocol.c:1049
@ SW_DATA_SOURCE_PIN_6
Definition: serialWombat.h:99
bool ReadPin(uint8_t pin)
Definition: pinDigitalHwSpecific.c:93
@ SW_DATA_SOURCE_1HZ_SQUARE
Square wave that alternates between 0 and 65535 every 512 frames.
Definition: serialWombat.h:195
@ SW_DATA_SOURCE_LFSR
A Linear FeedBack Shift register (32,7,5,3,2,1) based pseudo-random number generator.
Definition: serialWombat.h:170
@ SW_DATA_SOURCE_PIN_16
Definition: serialWombat.h:109
@ SW_DATA_SOURCE_PIN_15
Definition: serialWombat.h:108
@ SW_DATA_SOURCE_OVERRUN_FRAMES
The number of frames that ran more than 1mS.
Definition: serialWombat.h:161
void CurrentPinOpenDrain(void)
Definition: pinDigitalHwSpecific.c:130
@ SW_DATA_SOURCE_PIN_2_MV
The public data of Pin 2 expressed as mV. Only applicable to Analog Input mode.
Definition: serialWombat.h:173
uint16_t CurrentPinBitmap(void)
@ SW_DATA_SOURCE_1HZ_SAW
Sawtooth wave that goes from 0 to 65535 to 0 every 1024 frames.
Definition: serialWombat.h:196
@ SW_DATA_SOURCE_8SEC_SQUARE
Square wave that alternates between 0 and 65535 every 4096 frames.
Definition: serialWombat.h:201
@ SW_DATA_SOURCE_PIN_14
Definition: serialWombat.h:107
@ SW_DATA_SOURCE_PIN_19_MV
The public data of Pin 19 expressed as mV. Only applicable to Analog Input mode.
Definition: serialWombat.h:190
#define NUMBER_OF_TOTAL_PINS
Definition: deviceSpecific.h:36
void CurrentPinHigh(void)
Definition: pinDigitalHwSpecific.c:40
Definition: pinRegisters.h:40
@ SW_DATA_SOURCE_PIN_13
Definition: serialWombat.h:106
void CurrentPinInput(void)
Definition: pinDigitalHwSpecific.c:34
void CurrentPinNoPullup(void)
@ SW_DATA_SOURCE_2SEC_SAW
Sawtooth wave that goes from 0 to 65535 to 0 every 2048 frames.
Definition: serialWombat.h:199
@ SW_DATA_SOURCE_65SEC_SAW
Sawtooth wave that goes from 0 to 65535 to 0 every 65536 frames.
Definition: serialWombat.h:205
@ SW_DATA_SOURCE_PIN_9
Definition: serialWombat.h:102
@ SW_DATA_SOURCE_PIN_16_MV
The public data of Pin 16 expressed as mV. Only applicable to Analog Input mode.
Definition: serialWombat.h:187
void PinHigh(uint8_t pin)
void SetCurrentPin(uint8_t pinState)
Definition: pinDigitalHwSpecific.c:61
uint8_t CurrentPin
Definition: processPins.c:25
@ SW_DATA_SOURCE_65SEC_SQUARE
Square wave that alternates between 0 and 65535 every 32768 frames.
Definition: serialWombat.h:204
void CurrentPinPullUp(void)
Definition: pinDigitalHwSpecific.c:105
@ SW_DATA_SOURCE_PACKETS_RECEIVED
The nubmer of incoming command packets that have been processed since reset (rolls over at 65535)
Definition: serialWombat.h:163
void PinInput(uint8_t pin)
@ SW_DATA_SOURCE_FRAMES_DROPPED
The number of times since reset that a frame ran so far behind that it crossed two subsequent 1ms bou...
Definition: serialWombat.h:165
@ SW_DATA_SOURCE_SYSTEM_UTILIZATION
A number between 0 and 65535 that scales to the average length of pin processing frames between 0 and...
Definition: serialWombat.h:166
@ SW_DATA_SOURCE_PIN_17_MV
The public data of Pin 17 expressed as mV. Only applicable to Analog Input mode.
Definition: serialWombat.h:188
void reset(void)
Definition: main.c:54
SW_DATA_SOURCE_t
Definition: serialWombat.h:91
@ SW_DATA_SOURCE_PIN_8
Definition: serialWombat.h:101
void CurrentPinPullup(void)
uint8_t Txbuffer[TXBUFFER_LENGTH]
A buffer for outgoing commands to the host.
Definition: protocol.c:40
uint8_t CurrentPinPort(void)
void ConfigurePinAnalog(uint8_t pin, bool makeAnalog)
@ SW_DATA_SOURCE_ERRORS
The number of incoming packets that have caused errors since reset (rolls over at 65535)
Definition: serialWombat.h:164
@ SW_DATA_SOURCE_PIN_1
Definition: serialWombat.h:94
@ SW_DATA_SOURCE_PIN_12
Definition: serialWombat.h:105
@ SW_DATA_SOURCE_PIN_1_MV
The public data of Pin 1 expressed as mV. Only applicable to Analog Input mode.
Definition: serialWombat.h:172
void CurrentPinNotOpenDrain(void)
Definition: pinDigitalHwSpecific.c:135
@ SW_DATA_SOURCE_INCREMENTING_NUMBER
An number that increments each time it is accessed.
Definition: serialWombat.h:157
@ SW_DATA_SOURCE_PIN_18_MV
The public data of Pin 18 expressed as mV. Only applicable to Analog Input mode.
Definition: serialWombat.h:189
@ SW_DATA_SOURCE_1024mvCounts
The number of ADC counts that result from a 1.024V reading.
Definition: serialWombat.h:158
void error(SW_ERROR_t errorCode)
void CurrentPinAnalog(void)
Definition: pinDigitalHwSpecific.c:98
@ SW_DATA_SOURCE_FRAMES_RUN_MSW
The number of frames run since reset, most significant 16 bits.
Definition: serialWombat.h:160
void CurrentPinOutput(void)
Definition: pinDigitalHwSpecific.c:37
@ SW_DATA_SOURCE_RESET_REGISTER
Hardware dependent reset reason register contents.
Definition: serialWombat.h:169
@ SW_DATA_SOURCE_2HZ_SQUARE
Square wave that alternates between 0 and 65535 every 256 frames.
Definition: serialWombat.h:192
@ SW_DATA_SOURCE_2SEC_SQUARE
Square wave that alternates between 0 and 65535 every 1024 frames.
Definition: serialWombat.h:198
@ SW_DATA_SOURCE_PIN_11
Definition: serialWombat.h:104
@ SW_DATA_SOURCE_VBG_COUNTS_VS_VREF
A/D conversion of VBG against VRef . Used for mfg calibration.
Definition: serialWombat.h:168
#define TXBUFFER_LENGTH
Definition: serialWombat.h:47