FRDM-KW40Z Demo Software Reference Manual  Rev 0.0
NXP Semiconductors
Potentiometer

Overview

Potentiometer module implements functions to obtain the relative position in a scale from 0% to 100%.

Files

file  potentiometer_driver.h
 

Macros

#define POTENTIOMETER_ADC_INSTANCE
 
#define POTENTIOMETER_ADC_RESOLUTION
 

Enumerations

enum  potentiometer_status_t { kPotentiometerOk, kPotentiometerInitError, kPotentiometerConversionStartError }
 

Functions

potentiometer_status_t potentiometer_init (void)
 
uint8_t potentiometer_get_position (void)
 

Macro Definition Documentation

#define POTENTIOMETER_ADC_INSTANCE

ADC instance for the potentiometer input.

#define POTENTIOMETER_ADC_RESOLUTION

Expanded ADC resolution (2^n)

Enumeration Type Documentation

Potentiometer driver status.

Enumerator
kPotentiometerOk 

No error.

kPotentiometerInitError 

Initialization error.

kPotentiometerConversionStartError 

Error starting the channel conversion.

Function Documentation

potentiometer_status_t potentiometer_init ( void  )


Initializes the Potentiometer driver

Parameters
[in]None
Returns
potentiometer_status_t Error status
uint8_t potentiometer_get_position ( void  )


Returns the current potentiometer position in percentage

Parameters
[in]None
Returns
Potentiometer position in percentage (from 0 % to 100 %)