Skip to content

Commit

Permalink
fix use SPI lib & analog MUX
Browse files Browse the repository at this point in the history
  • Loading branch information
Dragon-Knight committed Nov 17, 2024
1 parent 0942590 commit 8c44739
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/Analog.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ extern ADC_HandleTypeDef hadc1;

namespace Analog
{
EasyPinA mux_pin(&hadc1, GPIOB, GPIO_PIN_1, ADC_CHANNEL_9);
EasyPinA mux_pin(&hadc1, GPIOB, GPIO_PIN_1, ADC_CHANNEL_9, ADC_SAMPLETIME_55CYCLES_5);

// Хранит сырые данные АЦП полученные через мультиплексор
uint16_t adc_value[16];
Expand All @@ -26,8 +26,8 @@ namespace Analog

if(address == 15)
{
//DEBUG_LOG_TOPIC("MUX", "%04d %04d %04d %04d %04d %04d %04d %04d %04d %04d %04d %04d %04d %04d %04d %04d\n", adc_value[0], adc_value[1], adc_value[2], adc_value[3], adc_value[4],
//adc_value[5], adc_value[6], adc_value[7], adc_value[8], adc_value[9], adc_value[10], adc_value[11], adc_value[12], adc_value[13], adc_value[14], adc_value[15]);
DEBUG_LOG_TOPIC("MUX", "%04d %04d %04d %04d %04d %04d %04d %04d %04d %04d %04d %04d %04d %04d %04d %04d\n", adc_value[0], adc_value[1], adc_value[2], adc_value[3], adc_value[4],
adc_value[5], adc_value[6], adc_value[7], adc_value[8], adc_value[9], adc_value[10], adc_value[11], adc_value[12], adc_value[13], adc_value[14], adc_value[15]);
}

return;
Expand Down
3 changes: 3 additions & 0 deletions include/SPI.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#pragma once
#include <inttypes.h>
#include <SPIManager.h>
#include <drivers/SPI_ZD25Q80B.h>
#include <drivers/SPI_CAT25080.h>
#include <drivers/SPI_HC595.h>
#include "SPIFast.h"

extern SPI_HandleTypeDef hspi2;
Expand Down

0 comments on commit 8c44739

Please sign in to comment.