36 lines
1.2 KiB
C
36 lines
1.2 KiB
C
|
#ifndef __ADC_H
|
|||
|
#define __ADC_H
|
|||
|
|
|||
|
#include "stm32h7xx.h"
|
|||
|
|
|||
|
|
|||
|
//<2F><><EFBFBD>Ŷ<EFBFBD><C5B6><EFBFBD>
|
|||
|
#define RHEOSTAT_ADC_PIN GPIO_PIN_4
|
|||
|
#define RHEOSTAT_ADC_GPIO_PORT GPIOA
|
|||
|
#define RHEOSTAT_ADC_GPIO_CLK_ENABLE() __GPIOA_CLK_ENABLE()
|
|||
|
|
|||
|
// ADC_MASTER<45><52><EFBFBD>ź궨<C5BA><EAB6A8>
|
|||
|
#define RHEOSTAT_ADC_MASTER ADC1
|
|||
|
#define RHEOSTAT_ADC_MASTER_CLK_ENABLE() __ADC12_CLK_ENABLE()
|
|||
|
#define RHEOSTAT_ADC_MASTER_CHANNEL ADC_CHANNEL_18
|
|||
|
|
|||
|
// ADC_SLAVE<56><45><EFBFBD>ź궨<C5BA><EAB6A8>
|
|||
|
#define RHEOSTAT_ADC_SLAVE ADC2
|
|||
|
#define RHEOSTAT_ADC_SLAVE_CLK_ENABLE() __ADC12_CLK_ENABLE()
|
|||
|
#define RHEOSTAT_ADC_SLAVE_CHANNEL ADC_CHANNEL_18
|
|||
|
|
|||
|
//DMAʱ<41><CAB1>ʹ<EFBFBD><CAB9>
|
|||
|
#define RHEOSTAT_ADC_DMA_CLK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE();
|
|||
|
#define RHEOSTAT_ADC_DMA_Base DMA1_Stream1
|
|||
|
#define RHEOSTAT_ADC_DMA_Request DMA_REQUEST_ADC1
|
|||
|
//DMA<4D>жϷ<D0B6><CFB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
#define RHEOSTAT_ADC_DMA_IRQHandler DMA1_Stream1_IRQHandler
|
|||
|
|
|||
|
#define Rheostat_ADC12_IRQ ADC_IRQn
|
|||
|
|
|||
|
void ADC_Init(void);
|
|||
|
|
|||
|
uint16_t ADC_GetValue(void);
|
|||
|
void Rheostat_ADC_NVIC_Config(void);
|
|||
|
#endif /* __ADC_H */
|