Skip to content

Commit

Permalink
Merge branch 'master' into test_sendtritium_macro_rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanielDelgado committed Sep 25, 2023
2 parents f555aab + 2eab2d7 commit 8ad6f41
Show file tree
Hide file tree
Showing 68 changed files with 3,387 additions and 196 deletions.
64 changes: 64 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Read the Docs configuration file for Sphinx projects

# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details


# Required

version: 2


# Set the OS, Python version and other tools you might need

build:

os: ubuntu-22.04

apt_packages:
- doxygen

tools:

python: "3.11"

jobs:
post_install:
- make docs



# Build documentation in the "docs/" directory with Sphinx

sphinx:

configuration: Docs/source/conf.py

# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs

# builder: "dirhtml"

# Fail on all warnings to avoid broken references

# fail_on_warning: true


# Optionally build your docs in additional formats such as PDF and ePub

# formats:

# - pdf

# - epub


# Optional but recommended, declare the Python requirements required

# to build your documentation

# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html

python:

install:

- requirements: Docs/source/requirements.txt
14 changes: 11 additions & 3 deletions Apps/Inc/CAN_Queue.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
/* Copyright (c) 2021 UT Longhorn Racing Solar */
/** CAN_Queue.c
* Queue that holds all CAN messages that Task_CANBusConsumer needs to send.
/**
* @copyright Copyright (c) 2018-2023 UT Longhorn Racing Solar
* @file CAN_Queue.h
* @brief Queue that holds all CAN messages that Task_CANBusConsumer needs to send.
*
* @defgroup CAN_Queue
* @addtogroup CAN_Queue
* @{
*/

#ifndef CAN_QUEUE_H
Expand All @@ -15,3 +20,6 @@ ErrorStatus CAN_Queue_Post(CANDATA_t message);
ErrorStatus CAN_Queue_Pend(CANDATA_t *message);

#endif


/* @} */
15 changes: 14 additions & 1 deletion Apps/Inc/FaultState.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
/**
* @copyright Copyright (c) 2018-2023 UT Longhorn Racing Solar
* @file FaultState.h
* @brief
*
* @defgroup FaultState
* @addtogroup FaultState
* @{
*/
#ifndef __FAULT_STATE_H
#define __FAULT_STATE_H


void EnterFaultState(void);

#endif
#endif


/* @} */
12 changes: 11 additions & 1 deletion Apps/Inc/MedianFilter.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
// Copyright (c) 2022 Longhorn Racing Solar
/**
* @copyright Copyright (c) 2018-2023 UT Longhorn Racing Solar
* @file MedianFilter.h
* @brief
*
* @defgroup MedianFilter
* @addtogroup MedianFilter
* @{
*/

/*
* This file implements a median filter.
*
Expand Down Expand Up @@ -209,3 +218,4 @@ GETSINGLE (MF_TYPE_NAME *filter, uint32_t channel) {
#undef PUT
#undef GETSINGLE

/* @} */
15 changes: 13 additions & 2 deletions Apps/Inc/ReadCarCAN.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
/* Copyright (c) 2020 UT Longhorn Racing Solar */
/**
* @copyright Copyright (c) 2018-2023 UT Longhorn Racing Solar
* @file ReadCarCAN.h
* @brief
*
* @defgroup ReadCarCAN
* @addtogroup ReadCarCAN
* @{
*/

#ifndef __READ_CAR_CAN_H
#define __READ_CAR_CAN_H
Expand All @@ -17,4 +25,7 @@
*/
bool ChargeEnable_Get();

#endif
#endif


/* @} */
93 changes: 52 additions & 41 deletions Apps/Inc/ReadTritium.h
Original file line number Diff line number Diff line change
@@ -1,41 +1,52 @@
/* Copyright (c) 2021 UT Longhorn Racing Solar */

#ifndef __READ_TRITIUM_H
#define __READ_TRITIUM_H

#include "os.h"
#include "common.h"
#include "Tasks.h"

#define CAR_STOPPED 0

/**
* Motor Error States
* Read messages from motor in ReadTritium and trigger appropriate error messages as needed based on bits
*
*/
typedef enum{
T_HARDWARE_OVER_CURRENT_ERR = (1<<0),
T_SOFTWARE_OVER_CURRENT_ERR = (1<<1),
T_DC_BUS_OVERVOLT_ERR = (1<<2),
T_HALL_SENSOR_ERR = (1<<3),
T_WATCHDOG_LAST_RESET_ERR = (1<<4),
T_CONFIG_READ_ERR = (1<<5),
T_UNDER_VOLTAGE_LOCKOUT_ERR = (1<<6),
T_DESAT_FAULT_ERR = (1<<7),
T_MOTOR_OVER_SPEED_ERR = (1<<8),
T_INIT_FAIL = (1<<9), //motor controller fails to restart or initialize
T_NONE = 0x00,
} tritium_error_code_t;
#define NUM_TRITIUM_ERRORS 9 //9 errors, and 1 entry for no error

/**
* @brief Returns the current error status of the tritium controller
*/
tritium_error_code_t MotorController_getTritiumError(void);

float Motor_RPM_Get();
float Motor_Velocity_Get();
void MotorController_Restart();

#endif
/**
* @copyright Copyright (c) 2018-2023 UT Longhorn Racing Solar
* @file ReadTritium.h
* @brief
*
* @defgroup ReadTritium
* @addtogroup ReadTritium
* @{
*/

#ifndef __READ_TRITIUM_H
#define __READ_TRITIUM_H

#include "os.h"
#include "common.h"
#include "Tasks.h"

#define CAR_STOPPED 0

/**
* Motor Error States
* Read messages from motor in ReadTritium and trigger appropriate error messages as needed based on bits
*
*/
typedef enum{
T_HARDWARE_OVER_CURRENT_ERR = (1<<0),
T_SOFTWARE_OVER_CURRENT_ERR = (1<<1),
T_DC_BUS_OVERVOLT_ERR = (1<<2),
T_HALL_SENSOR_ERR = (1<<3),
T_WATCHDOG_LAST_RESET_ERR = (1<<4),
T_CONFIG_READ_ERR = (1<<5),
T_UNDER_VOLTAGE_LOCKOUT_ERR = (1<<6),
T_DESAT_FAULT_ERR = (1<<7),
T_MOTOR_OVER_SPEED_ERR = (1<<8),
T_INIT_FAIL = (1<<9), //motor controller fails to restart or initialize
T_NONE = 0x00,
} tritium_error_code_t;
#define NUM_TRITIUM_ERRORS 9 //9 errors, and 1 entry for no error

/**
* @brief Returns the current error status of the tritium controller
*/
tritium_error_code_t MotorController_getTritiumError(void);

float Motor_RPM_Get();
float Motor_Velocity_Get();
void MotorController_Restart();

#endif


/* @} */
12 changes: 12 additions & 0 deletions Apps/Inc/SendTritium.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/**
* @copyright Copyright (c) 2018-2023 UT Longhorn Racing Solar
* @file SendTritium.h
* @brief
*
* @defgroup SendTritium
* @addtogroup SendTritium
* @{
*/
#ifndef __SENDTRITIUM_H
#define __SENDTRITIUM_H

Expand Down Expand Up @@ -71,3 +80,6 @@ EXPOSE_SETTER(float, velocitySetpoint)
#endif

#endif


/* @} */
13 changes: 12 additions & 1 deletion Apps/Inc/Tasks.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
/* Copyright (c) 2020 UT Longhorn Racing Solar */
/**
* @copyright Copyright (c) 2018-2023 UT Longhorn Racing Solar
* @file Tasks.h
* @brief
*
* @defgroup Tasks
* @addtogroup Tasks
* @{
*/


#ifndef __TASKS_H
#define __TASKS_H
Expand Down Expand Up @@ -198,3 +207,5 @@ void _assertOSError(uint16_t OS_err_loc, OS_ERR err); //TODO: This should be cha
#endif

#endif

/* @} */
17 changes: 10 additions & 7 deletions Apps/Inc/UpdateDisplay.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
/**
* @copyright Copyright (c) 2022 UT Longhorn Racing Solar
/**
* @copyright Copyright (c) 2018-2023 UT Longhorn Racing Solar
* @file UpdateDisplay.h
* @brief Function prototypes for the display application.
*
* This contains function prototypes relevant to the UpdateDisplay
* application. Call assertUpdateDisplayError after calling any of the
* functions in this application.
*
* @author Ishan Deshpande (IshDeshpa)
* @author Roie Gal (Cam0Cow)
* @author Nathaniel Delgado (NathanielDelgado)
*/
*
* @defgroup UpdateDisplay
* @addtogroup UpdateDisplay
* @{
*/

#ifndef __UPDATE_DISPLAY_H
#define __UPDATE_DISPLAY_H
Expand Down Expand Up @@ -129,4 +130,6 @@ UpdateDisplayError_t UpdateDisplay_SetRegenState(TriState_t state);
*/
UpdateDisplayError_t UpdateDisplay_SetCruiseState(TriState_t state);

#endif
#endif

/* @} */
12 changes: 11 additions & 1 deletion Apps/Inc/common.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
/* Copyright (c) 2020 UT Longhorn Racing Solar */
/**
* @copyright Copyright (c) 2018-2023 UT Longhorn Racing Solar
* @file common.h
* @brief
*
* @defgroup common
* @addtogroup common
* @{
*/

#ifndef __COMMON_H
#define __COMMON_H
Expand Down Expand Up @@ -56,3 +64,5 @@ inline float mpsToRpm(float velocity_mps){
}

#endif

/* @} */
14 changes: 12 additions & 2 deletions Apps/Inc/fifo.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
// Copyright (c) 2021 Longhorn Racing Solar
/**
* @copyright Copyright (c) 2018-2023 UT Longhorn Racing Solar
* @file fifo.h
* @brief
*
* @defgroup fifo
* @addtogroup fifo
* @{
*/

/*
* This file implements a fifo.
*
Expand Down Expand Up @@ -234,4 +243,5 @@ POPBACK (FIFO_TYPE_NAME *fifo, FIFO_TYPE *elem) {
#undef PEEK
#undef POPBACK
#undef CONCAT
#undef _CONCAT
#undef _CONCAT
/* @} */
9 changes: 5 additions & 4 deletions Apps/Src/CAN_Queue.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/* Copyright (c) 2020 UT Longhorn Racing Solar */
/** CAN_Queue.c
* Queue that holds all CAN messages that Task_CANBusConsumer needs to send.
/**
* @copyright Copyright (c) 2018-2023 UT Longhorn Racing Solar
* @file CAN_Queue.c
* @brief
*
*/

#include "CAN_Queue.h"
Expand Down Expand Up @@ -65,4 +67,3 @@ ErrorStatus CAN_Queue_Pend(CANDATA_t *message) {
assertOSError(OS_SEND_CAN_LOC, err);
return result ? SUCCESS : ERROR;
}

Loading

0 comments on commit 8ad6f41

Please sign in to comment.