#include "Output.h"
#include "../Utils/Constants.h"
#include <stdio.h>
#include <string.h>
#include <stdint.h>
Go to the source code of this file.
◆ TORQUE_LOW_MARGIN
#define TORQUE_LOW_MARGIN 2.0 |
◆ initAnalogOutput()
void initAnalogOutput |
( |
AnalogOutput * |
analogoutput, |
|
|
const char * |
name, |
|
|
int |
hz, |
|
|
int |
channel |
|
) |
| |
Initializes an analog output.
- Parameters
-
output | Pointer to the AnalogOutput structure to initialize |
name | Name of the output (string) |
hz | Sampling frequency in Hertz |
channel | ADC channel number for the output (0-16) |
This function initializes the base output properties, sets the ADC channel, and configures the corresponding GPIO pin based on the channel number.
Definition at line 11 of file AnalogOutput.c.
11 {
13 analogOutput->channel = channel;
14 analogOutput->buffer_index = 0;
15}
void initOutput(Output *output, const char *name, int hz, OutputType type)
Initializes an output with the given parameters.
◆ writeAnalogOutputData()
int writeAnalogOutputData |
( |
AnalogOutput * |
output, |
|
|
float |
data |
|
) |
| |
Writes data to the analog output.
- Parameters
-
output | Pointer to the AnalogOutput structure. |
data | Data to write to the output. |
- Returns
- int _SUCCESS or _FAILURE.
Definition at line 17 of file AnalogOutput.c.
17 {
18 #ifdef DEBUGn
20 #endif
21
23
26 }
else if (output->
channel == 2) {
27
30 } else {
31
32 #ifdef DEBUGn
34 #endif
35
37 }
39}
uint32_t dac2_buffer[DAC2_BUFFER_SIZE]
uint32_t dac1_buffer[DAC1_BUFFER_SIZE]
char name[MAX_NAME_LENGTH]
◆ dac1_buffer
◆ dac2_buffer