JM9 XRCU Board 0.1.2
Libraries API Reference
Loading...
Searching...
No Matches
Ain.h File Reference
#include <Arduino.h>
#include <Ain.h>

Go to the source code of this file.

Functions

uint16_t analog_read_raw (const uint8_t channel)
 Reads the raw analog value.
 
uint16_t analog_read_threshold (const uint8_t channel)
 Reads the white/black threshold.
 
uint16_t analog_read_mapped (const uint8_t channel)
 Reads the mapped analog value.
 
bool analog_read_digital (const uint8_t channel)
 Reads the analog value in boolean.
 
bool get_analog_reverse_flag (const uint8_t channel)
 Gets the analog reverse direction flag.
 
void set_analog_reverse_flag (const uint8_t channel, const bool reverse_flag)
 Sets the analog reverse direction flag.
 
void analog_start_cal ()
 Starts a new calibration of all analog channels.
 
bool analog_single_cal ()
 Processes 1 cycle of calibration for all analog channels.
 
void analog_end_cal ()
 Ends the calibration of all analog channels and store the data back into EEPROM.
 

Detailed Description

Ain.h - The ADC library for XRCU.

Note
This file is kept for API referencing only. For actual declarations, see JM9_XRCU_Board/stm32/cores/arduino/Ain.h

Function Documentation

◆ analog_end_cal()

void analog_end_cal ( )

Ends the calibration of all analog channels and store the data back into EEPROM.

See also
analog_start_cal()
analog_single_cal()

◆ analog_read_digital()

bool analog_read_digital ( const uint8_t channel)

Reads the analog value in boolean.

Parameters
channelthe analog channel [1 : 16]
Returns
true if the analog value of certain channel is at the uncommon side of the threshold, else false
See also
analog_read_mapped(uint8_t)
analog_read_threshold(uint8_t)

◆ analog_read_mapped()

uint16_t analog_read_mapped ( const uint8_t channel)

Reads the mapped analog value.

Parameters
channelthe analog channel [1 : 16]
Returns
the analog value remapped (i.e. scaled) to measure the distance of grayscale to white or black [0 : 4000]
See also
get_analog_reverse_flag(uint8_t)

◆ analog_read_raw()

uint16_t analog_read_raw ( const uint8_t channel)

Reads the raw analog value.

Parameters
channelthe analog channel [1 : 16]
Returns
the raw analog value of a certain channel [0 : 4095]
See also
analog_read_mapped(uint8_t)

◆ analog_read_threshold()

uint16_t analog_read_threshold ( const uint8_t channel)

Reads the white/black threshold.

Parameters
channelthe analog channel [1 : 16]
Returns
the threshold to determine white or black from value returned by analogReadRaw() [0 : 4095]

◆ analog_single_cal()

bool analog_single_cal ( )

Processes 1 cycle of calibration for all analog channels.

Returns
true if the max or min of any analog channel is updated in this calibration, else false
See also
analog_start_cal()
analog_end_cal()

◆ analog_start_cal()

void analog_start_cal ( )

Starts a new calibration of all analog channels.

See also
analog_single_cal()
analog_end_cal()

◆ get_analog_reverse_flag()

bool get_analog_reverse_flag ( const uint8_t channel)

Gets the analog reverse direction flag.

Parameters
channelthe analog channel [1 : 16]
Returns
true if the analog value has reversed direction, false if the analog value has not reversed direction
See also
set_analog_reverse_flag(uint8_t,bool)

◆ set_analog_reverse_flag()

void set_analog_reverse_flag ( const uint8_t channel,
const bool reverse_flag )

Sets the analog reverse direction flag.

Parameters
channelthe analog channel [1 : 16]
reverse_flagtrue to indicate reversed direction, false to indicate not reversed direction
See also
get_analog_reverse_flag(uint8_t)