-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
905d0d8
commit fc054ff
Showing
12 changed files
with
220 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,25 @@ | ||
#ifndef APPLICATION_INC_ADC | ||
#define APPLICATION_INC_ADC | ||
|
||
#include "array" | ||
#include "cmath" | ||
#include "main.h" | ||
|
||
#ifndef ADC_BUFFER | ||
#define ADC_BUFFER 10 | ||
#endif | ||
|
||
class CustomADC { | ||
public: | ||
CustomADC(); | ||
virtual ~CustomADC(); | ||
void setPort(ADC_HandleTypeDef *); | ||
CustomADC(); | ||
virtual ~CustomADC(); | ||
|
||
uint32_t sample(); | ||
uint32_t getValue(); | ||
double getVolt(); | ||
void saveSample(uint8_t); | ||
|
||
uint32_t m_buffer; | ||
std::array <uint32_t, 1> m_buffer; | ||
|
||
private: | ||
uint32_t m_value{}; | ||
ADC_HandleTypeDef *m_port; | ||
// Public Data | ||
uint32_t volt_from_dac{}; | ||
}; | ||
|
||
#endif /* APPLICATION_INC_ADC */ | ||
#endif /* APPLICATION_INC_ADC */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,59 @@ | ||
#ifndef APPLICATION_INC_THREAD | ||
#define APPLICATION_INC_THREAD | ||
|
||
#include "main.h" | ||
#include "FreeRTOS.h" | ||
#include "main.h" | ||
#include "task.h" | ||
|
||
class Thread { | ||
public: | ||
Thread(); | ||
virtual ~Thread(); | ||
|
||
TaskHandle_t parse_handle; | ||
void parse(); | ||
TaskHandle_t telemetry_human_handle; | ||
void telemetry_human(); | ||
|
||
TaskHandle_t telemetry_human_handle; | ||
void telemetry_human(); | ||
/*--------------------------------------------------------------------------- | ||
TaskHandle_t init_handle; | ||
void init(); | ||
Applications | ||
---------------------------------------------------------------------------*/ | ||
|
||
TaskHandle_t idle_handle; | ||
void idle(); | ||
|
||
TaskHandle_t dac_handle; | ||
void dacUpdate(); | ||
|
||
/*--------------------------------------------------------------------------- | ||
TaskHandle_t utilities_handle; | ||
void utilities(); | ||
System initialization and periodic update | ||
TaskHandle_t app_dac_handle; | ||
void app_dac(); | ||
---------------------------------------------------------------------------*/ | ||
|
||
TaskHandle_t init_handle; | ||
void init(); | ||
|
||
TaskHandle_t schedule_20Hz_handle; | ||
void schedule_20Hz(); | ||
|
||
TaskHandle_t serial_send_handle; | ||
void serial_send(); | ||
|
||
TaskHandle_t parse_handle; | ||
void parse(); | ||
|
||
/*--------------------------------------------------------------------------- | ||
Thread Settings | ||
---------------------------------------------------------------------------*/ | ||
|
||
void idling_start(); | ||
void dac_start(); | ||
void dac_shutdown(); | ||
|
||
// Settings | ||
uint16_t m_stream_freq{500}; | ||
uint16_t m_stream_freq{2000}; | ||
}; | ||
|
||
#endif /* APPLICATION_INC_THREAD */ | ||
#endif /* APPLICATION_INC_THREAD */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.