|
@@ -31,12 +31,11 @@
|
|
|
/* Private variables ---------------------------------------------------------*/
|
|
|
__IO uint16_t ConversionBuffer[ADC_SMPLS];
|
|
|
__IO uint8_t BufferIndex = 0;
|
|
|
-static aht20_t Sensor;
|
|
|
|
|
|
/* Private function prototypes -----------------------------------------------*/
|
|
|
static void boardInit(void);
|
|
|
-static void showT(void);
|
|
|
-static void showH(void);
|
|
|
+static void showU(void);
|
|
|
+static void showC(void);
|
|
|
|
|
|
void main(void)
|
|
|
{
|
|
@@ -46,20 +45,22 @@ void main(void)
|
|
|
|
|
|
/* Infinite loop */
|
|
|
while (1) {
|
|
|
- Delay(100);
|
|
|
+ Delay(200);
|
|
|
+ showU();
|
|
|
+ showC();
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
/* Private functions ---------------------------------------------------------*/
|
|
|
-static void showT(void) {
|
|
|
+static void showU(void) {
|
|
|
LedDigits[0] = 0;
|
|
|
LedDigits[1] = 0;
|
|
|
LedDigits[2] = 0;
|
|
|
LedDigits[3] = led_U;
|
|
|
}
|
|
|
|
|
|
-static void showH(void) {
|
|
|
+static void showC(void) {
|
|
|
LedDigits[4] = 0;
|
|
|
LedDigits[5] = 0;
|
|
|
LedDigits[6] = 0;
|
|
@@ -107,23 +108,23 @@ static void boardInit(void) {
|
|
|
SPI_PORT->CR2 |= (uint8_t)(SPI_SCK|SPI_DATA);
|
|
|
|
|
|
/* I2C GPIO SDA SCL - HiZ, Open drain, Fast */
|
|
|
- GPIOB->DDR |= (GPIO_PIN_4 | GPIO_PIN_5);
|
|
|
- GPIOB->ODR |= (GPIO_PIN_4 | GPIO_PIN_5);
|
|
|
- GPIOB->CR2 |= (GPIO_PIN_4 | GPIO_PIN_5);
|
|
|
+ //GPIOB->DDR |= (GPIO_PIN_4 | GPIO_PIN_5);
|
|
|
+ //GPIOB->ODR |= (GPIO_PIN_4 | GPIO_PIN_5);
|
|
|
+ //GPIOB->CR2 |= (GPIO_PIN_4 | GPIO_PIN_5);
|
|
|
|
|
|
/** Configure ADC */
|
|
|
/* De-Init ADC peripheral*/
|
|
|
- //ADC1_DeInit();
|
|
|
+ ADC1_DeInit();
|
|
|
|
|
|
/* Init ADC1 peripheral */
|
|
|
- //ADC1_Init(ADC1_CONVERSIONMODE_SINGLE, ADC_CHNLU, ADC1_PRESSEL_FCPU_D12, \
|
|
|
+ ADC1_Init(ADC1_CONVERSIONMODE_SINGLE, ADC_CHNLU, ADC1_PRESSEL_FCPU_D12, \
|
|
|
ADC1_EXTTRIG_TIM, ENABLE, ADC1_ALIGN_RIGHT, ADC_SCHTU, DISABLE);
|
|
|
|
|
|
/* Enable EOC interrupt */
|
|
|
- //ADC1_ITConfig(ADC1_IT_EOCIE, ENABLE);
|
|
|
+ ADC1_ITConfig(ADC1_IT_EOCIE, ENABLE);
|
|
|
|
|
|
/*Start Conversion */
|
|
|
- ////ADC1_StartConversion();
|
|
|
+ ADC1_StartConversion();
|
|
|
|
|
|
/** Configure TIM1 */
|
|
|
//TIM1_DeInit();
|