Table of Contents

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

adc uint

Index of ADC block.

adcChannel uint

Channel number for the ADC block.

pin uint

The 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

pin int

The pin number to configure.

configuration GpioConfiguration

The 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

channel uint

Channel 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 channel doesn't exist.

NotSupportedException

If the target doesn't have support for ADC.