Formula Student Electronics & Software
The code for the embedded software
Loading...
Searching...
No Matches
test_digitalReceiver.cpp File Reference
#include "model/digitalData.hpp"
#include "unity.h"
#include "embedded/digitalReceiver.hpp"
#include "model/systemData.hpp"
Include dependency graph for test_digitalReceiver.cpp:

Go to the source code of this file.

Macros

#define GREEN_LED_1   4
 
#define GREEN_LED_2   5
 
#define GREEN_LED_3   6
 
#define RED_LED_1   0
 
#define RED_LED_2   1
 
#define YELLOW_LED_1   2
 
#define YELLOW_LED_2   3
 
#define BUTTON_1   7
 
#define BUTTON_2   8
 
#define BUTTON_3   9
 
#define BUTTON_4   10
 
#define BUTTON_5   11
 
#define BUTTON_6   12
 
#define ASMS_IN_PIN   BUTTON_1
 
#define SDC_STATE_PIN   BUTTON_2
 
#define SDC_LOGIC_WATCHDOG_IN_PIN   BUTTON_3
 
#define SENSOR_PRESSURE_1_PIN   BUTTON_4
 
#define SENSOR_PRESSURE_2_PIN   BUTTON_5
 
#define LWSS_PIN   BUTTON_6
 
#define WHEEL_MEASUREMENT_INTERVAL_MS   1000
 
#define WHEEL_MEASUREMENT_INTERVAL_MIN   (WHEEL_MEASUREMENT_INTERVAL_MS / 60000.0)
 
#define PULSES_PER_ROTATION   60
 

Functions

void setUp ()
 Test the Left Wheel Speed Sensor Check the Left wheel Speed Sensor is being well calculated PROTOCOL:
 
int main ()
 

Variables

SystemData system_data
 
auto digitalRecv = DigitalReceiver(&system_data.digital_data_, &system_data.mission_)
 

Macro Definition Documentation

◆ ASMS_IN_PIN

#define ASMS_IN_PIN   BUTTON_1

Definition at line 18 of file test_digitalReceiver.cpp.

◆ BUTTON_1

#define BUTTON_1   7

Definition at line 11 of file test_digitalReceiver.cpp.

◆ BUTTON_2

#define BUTTON_2   8

Definition at line 12 of file test_digitalReceiver.cpp.

◆ BUTTON_3

#define BUTTON_3   9

Definition at line 13 of file test_digitalReceiver.cpp.

◆ BUTTON_4

#define BUTTON_4   10

Definition at line 14 of file test_digitalReceiver.cpp.

◆ BUTTON_5

#define BUTTON_5   11

Definition at line 15 of file test_digitalReceiver.cpp.

◆ BUTTON_6

#define BUTTON_6   12

Definition at line 16 of file test_digitalReceiver.cpp.

◆ GREEN_LED_1

#define GREEN_LED_1   4

Definition at line 4 of file test_digitalReceiver.cpp.

◆ GREEN_LED_2

#define GREEN_LED_2   5

Definition at line 5 of file test_digitalReceiver.cpp.

◆ GREEN_LED_3

#define GREEN_LED_3   6

Definition at line 6 of file test_digitalReceiver.cpp.

◆ LWSS_PIN

#define LWSS_PIN   BUTTON_6

Definition at line 23 of file test_digitalReceiver.cpp.

◆ PULSES_PER_ROTATION

#define PULSES_PER_ROTATION   60

Definition at line 27 of file test_digitalReceiver.cpp.

◆ RED_LED_1

#define RED_LED_1   0

Definition at line 7 of file test_digitalReceiver.cpp.

◆ RED_LED_2

#define RED_LED_2   1

Definition at line 8 of file test_digitalReceiver.cpp.

◆ SDC_LOGIC_WATCHDOG_IN_PIN

#define SDC_LOGIC_WATCHDOG_IN_PIN   BUTTON_3

Definition at line 20 of file test_digitalReceiver.cpp.

◆ SDC_STATE_PIN

#define SDC_STATE_PIN   BUTTON_2

Definition at line 19 of file test_digitalReceiver.cpp.

◆ SENSOR_PRESSURE_1_PIN

#define SENSOR_PRESSURE_1_PIN   BUTTON_4

Definition at line 21 of file test_digitalReceiver.cpp.

◆ SENSOR_PRESSURE_2_PIN

#define SENSOR_PRESSURE_2_PIN   BUTTON_5

Definition at line 22 of file test_digitalReceiver.cpp.

◆ WHEEL_MEASUREMENT_INTERVAL_MIN

#define WHEEL_MEASUREMENT_INTERVAL_MIN   (WHEEL_MEASUREMENT_INTERVAL_MS / 60000.0)

Definition at line 26 of file test_digitalReceiver.cpp.

◆ WHEEL_MEASUREMENT_INTERVAL_MS

#define WHEEL_MEASUREMENT_INTERVAL_MS   1000

Definition at line 25 of file test_digitalReceiver.cpp.

◆ YELLOW_LED_1

#define YELLOW_LED_1   2

Definition at line 9 of file test_digitalReceiver.cpp.

◆ YELLOW_LED_2

#define YELLOW_LED_2   3

Definition at line 10 of file test_digitalReceiver.cpp.

Function Documentation

◆ main()

int main ( void  )

Definition at line 95 of file test_digitalReceiver.cpp.

◆ setUp()

void setUp ( void  )

Test the Left Wheel Speed Sensor Check the Left wheel Speed Sensor is being well calculated PROTOCOL:

Attention
PROTOCOL TEST
  1. Click Button 6 once
  2. Wait 1 second
  3. Verify LED1 Green Turning On (High) = 1 click (1 rpm with test settings)
  4. Click Button 6 twice
  5. Wait 1 second
  6. Verify LED1 & LED2 Green Turning On (High) = 2 click (2 rpm with test settings)
  7. Click Button 6 twice
  8. Wait 1 second
  9. Verify LED1 & LED2 & LED3 Green Turning On (High) = 3+ click (3+ rpm with test settings) NOTE: do this inside 10 seconds NOTE: moved to C1 Teensy

Definition at line 85 of file test_digitalReceiver.cpp.

Variable Documentation

◆ digitalRecv

auto digitalRecv = DigitalReceiver(&system_data.digital_data_, &system_data.mission_)

Definition at line 34 of file test_digitalReceiver.cpp.

◆ system_data

SystemData system_data

Definition at line 33 of file test_digitalReceiver.cpp.