forked from Elron_dev/elbear_arduino_bsp
добавлена поддержка платы Start-MIK32
This commit is contained in:
1 parent
8c82685f37
commit
f06650400b
46 files changed
+1813
-163
No files matched your search
@@ -42,18 +42,8 @@ uint32_t analogRead(uint32_t PinNumber)
|
||||
uint32_t adcChannel = analogInputToChannelNumber(PinNumber);
|
||||
if (adcChannel != NC)
|
||||
{
|
||||
// if we use pin A5, we need to set SELA45 (1.15) to 1 to switch the output from A4 to A5
|
||||
if (PinNumber == A5)
|
||||
{
|
||||
HAL_GPIO_PinConfig(GPIO_1, GPIO_PIN_15, HAL_GPIO_MODE_GPIO_OUTPUT, HAL_GPIO_PULL_NONE, HAL_GPIO_DS_2MA);
|
||||
HAL_GPIO_WritePin(GPIO_1, GPIO_PIN_15, GPIO_PIN_HIGH);
|
||||
}
|
||||
else if(PinNumber == A4)
|
||||
{
|
||||
// return the switch to A4 in case A5 was previously read
|
||||
HAL_GPIO_PinConfig(GPIO_1, GPIO_PIN_15, HAL_GPIO_MODE_GPIO_OUTPUT, HAL_GPIO_PULL_NONE, HAL_GPIO_DS_2MA);
|
||||
HAL_GPIO_WritePin(GPIO_1, GPIO_PIN_15, GPIO_PIN_LOW);
|
||||
}
|
||||
additionalPinsInit(PinNumber);
|
||||
|
||||
// init channel
|
||||
hadc.Init.Sel = adcChannel;
|
||||
HAL_ADC_Init(&hadc);
|
||||
@@ -147,8 +137,6 @@ void analogWrite(uint32_t PinNumber, uint32_t writeVal)
|
||||
HAL_Timer32_Start(&htimer32);
|
||||
pwmIsInited++; // increase inited channels qty
|
||||
}
|
||||
else if(PinNumber == 10) // pin d10 has pwm, but you cannot use it while spi is running
|
||||
ErrorMsgHandler("analogWrite(): D10 cannot be used as PWM pin while SPI is running");
|
||||
else
|
||||
ErrorMsgHandler("analogWrite(): invalid pwm pin number");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user