RP.ADC
Entities
Simple Types
Array Types
Subtypes
Constants
Subprograms
Description
ADC_Channel
subtype ADC_Channel is Natural range 0 .. 4;
ADC_Channels
type ADC_Channels is array (ADC_Channel) of Boolean
with Component_Size => 1,
Size => 5;
ADC_Divider_Fraction
ADC_Divider_Fraction : constant := 1.0 / (2.0 ** 8);
ADC_Mode
type ADC_Mode is (One_Shot, Free_Running);
Enumeration Literal
- One_Shot
- Free_Running
ADC_Sample_Bits
type ADC_Sample_Bits is new Positive
with Dynamic_Predicate => ADC_Sample_Bits in 8 | 12;
Analog_Value
subtype Analog_Value is HAL.UInt12;
Celsius
type Celsius is new Integer;
Configure
procedure Configure
(Channel : ADC_Channel)
Parameters
- Channel
Configure
procedure Configure
(Channels : ADC_Channels)
Parameters
- Channels
Disable
procedure Disable
Enable
procedure Enable
Enabled
function Enabled return Boolean
Return Value
FIFO_Address
function FIFO_Address
return System.Address
Return Value
Microvolts
type Microvolts is new Integer;
Read
function Read
return Analog_Value
Return Value
Read
function Read
(Channel : ADC_Channel)
return Analog_Value
Parameters
- Channel
Return Value
Read_Microvolts
function Read_Microvolts
(Channel : ADC_Channel;
VREF : Microvolts := 3_300_000)
return Microvolts
Parameters
- Channel
- VREF
Return Value
Set_Divider
procedure Set_Divider
(Div : ADC_Divider)
Parameters
- Div
Set_Mode
procedure Set_Mode
(Mode : ADC_Mode)
Parameters
- Mode
Set_Round_Robin
procedure Set_Round_Robin
(Channels : ADC_Channels)
Parameters
- Channels
Set_Sample_Bits
procedure Set_Sample_Bits
(Bits : ADC_Sample_Bits)
Parameters
- Bits
Set_Sample_Rate
procedure Set_Sample_Rate
(Rate : Hertz)
Parameters
- Rate
Temperature
function Temperature
(Ref_Temp : Celsius := 27;
Vbe : Microvolts := 706_000;
Slope : Microvolts := 1_721;
VREF : Microvolts := 3_300_000)
return Celsius
Parameters
- Ref_Temp
- Vbe
- Slope
- VREF
Return Value
Temperature_Sensor
Temperature_Sensor : constant ADC_Channel := 4;
To_ADC_Channel
function To_ADC_Channel
(Point : RP.GPIO.GPIO_Point)
return ADC_Channel
Parameters
- Point
Return Value