#include <Arduino.h>
#include <Ain.h>
Go to the source code of this file.
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
- Copyright
- Copyright (c) 2024 - 2025 YH Choi @ JM9. All right reserved.
◆ analog_end_cal()
◆ analog_read_digital()
| bool analog_read_digital |
( |
const uint8_t | channel | ) |
|
◆ analog_read_mapped()
| uint16_t analog_read_mapped |
( |
const uint8_t | channel | ) |
|
Reads the mapped analog value.
- Parameters
-
| channel | the 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
-
| channel | the 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
-
| channel | the 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 |
( |
| ) |
|
◆ get_analog_reverse_flag()
| bool get_analog_reverse_flag |
( |
const uint8_t | channel | ) |
|
Gets the analog reverse direction flag.
- Parameters
-
| channel | the 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
-
| channel | the analog channel [1 : 16] |
| reverse_flag | true to indicate reversed direction, false to indicate not reversed direction |
- See also
- get_analog_reverse_flag(uint8_t)