Class Configuration
- Namespace
- nanoFramework.Hardware.Stm32
- Assembly
- nanoFramework.Hardware.Stm32.dll
Class with methods to perform configuration changes in STM32.
public static class Configuration
- Inheritance
-
Configuration
- Inherited Members
Methods
AddAdcChannel(uint, uint, uint)
Add definition of an ADC channel.
public static uint AddAdcChannel(uint adc, uint adcChannel, uint pin)
Parameters
adcuintIndex of ADC block.
adcChanneluintChannel number for the ADC block.
pinuintThe pin number to connect to ADC channel.
Returns
- uint
The index of the ADC channel that has been created.
Remarks
No validation is performed on the usage of the GPIO pin. This will override any other pre-existing configuration for it.
Exceptions
- ArgumentException
If the ADC block doesn't exist.
- or -
If the ADC channel doesn't exist.
- NotSupportedException
If the target doesn't have support for ADC.
ConfigurePin(int, GpioConfiguration)
Set the configuration for a GPIO pin.
public static void ConfigurePin(int pin, GpioConfiguration configuration)
Parameters
pinintThe pin number to configure.
configurationGpioConfigurationThe configuration to apply to the GPIO pin.
Remarks
There is no validation or check performed on the configuration applied to a GPIO pin. This will override the default configuration for a pin, even if it is already use for other function, for example as a GpioPin output.
RemoveAdcChannel(uint)
Removes an existing ADC channel definition created with AddAdcChannel(uint, uint, uint).
public static void RemoveAdcChannel(uint channel)
Parameters
channeluintChannel number for an ADC definition.
Remarks
Upon return the respective GPIO pin is configured to the default configuration: input, without any other activation.
Exceptions
- ArgumentException
If the ADC
channeldoesn't exist.- NotSupportedException
If the target doesn't have support for ADC.