-
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
fe15adf
commit 5b21585
Showing
15 changed files
with
126 additions
and
278 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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -65,4 +65,8 @@ namespace Mode { | |
LOG | ||
}; | ||
} | ||
|
||
namespace ADCParam { | ||
const int SENSOR_COUNT = 4; | ||
} | ||
#endif // INC_PARAMS_HPP |
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,22 +1,24 @@ | ||
#ifndef INC_PHOTO_TRANS_HPP_ | ||
#define INC_PHOTO_TRANS_HPP_ | ||
|
||
|
||
#include "../../Core/Inc/main.h" | ||
#include "adc.h" | ||
#include "tim.h" | ||
#include "stm32f4xx_hal.h" | ||
#include "stm32f405xx.h" | ||
#include "led.hpp" | ||
#include "params.hpp" | ||
|
||
class PhotoTransSensor { | ||
public: | ||
|
||
GPIO_TypeDef* LED_PORTS[4] = {LL_LED_GPIO_Port, RF_LED_GPIO_Port, LF_LED_GPIO_Port, RR_LED_GPIO_Port}; | ||
uint16_t LED_PINS[4] = {LL_LED_Pin, RF_LED_Pin, LF_LED_Pin, RR_LED_Pin}; | ||
uint32_t adc_value = 0; | ||
float adc_val[4]; | ||
void getWallSensorData(); | ||
LedSensor led_sensor; | ||
uint32_t adc_channels[4] = {ADC_CHANNEL_9, ADC_CHANNEL_13, ADC_CHANNEL_15, ADC_CHANNEL_11}; | ||
void configureADCChannel(uint32_t channel); | ||
uint16_t getCurrentADC(int i) const; | ||
void updateADC(int i); | ||
uint16_t adc_val[4] = {0}; | ||
}; | ||
|
||
#endif /* INC_PHOTO_TRANS_HPP_ */ |
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 |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
#include "motor.hpp" | ||
#include "log.hpp" | ||
#include "adc.h" | ||
#include "photo_trans.hpp" | ||
|
||
|
||
// TODO: | ||
|
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
Oops, something went wrong.