piadcs package¶
Subpackages¶
Submodules¶
piadcs.piadcs module¶
-
class
piadcs.piadcs.
Register
(address, setvalue)[source]¶ Bases:
object
A class used to represent a register on a TI ADC ... .. attribute:: address
byte
The address of the register
-
setvalue
¶ byte
The value that you want to write to the register. This should be set either by using the default value or the setregister function
-
setregister
(data)[source]¶ Takes a list of bytes representing different register settings and combines them into a single byte to send to the register
-
setregister
(settingsList)[source] Takes a list of bytes representing different register settings and combines them into a single byte to send to the register. Since this function uses the OR operator it is critical to include ALL settings for the given register even if some are left to the default. If a setting is not included it will be set to to 0.
Parameters: data (list) – A list of bytes where each byte represents one setting of a given register. The list should not be longer or shorter than the number of settings that exist for the register you want to send them to.
-
-
piadcs.piadcs.
readFromConsecutiveRegisters
(connection, startingreg, numbertoread)[source]¶ writes a list of values to consecutive registers on an ADC.
Parameters: - connection (SpiDev object) – See documentation for python Spidev (https://pypi.org/project/spidev/)
- startingreg (byte) – The address of the first register you want to read from
- numbertoread (byte) – The number of registers you would like to read from
Returns: Returns list of register values from consecutive registers starting with the specified register
Return type: list
-
piadcs.piadcs.
writeToConsecutiveRegisters
(connection, startingreg, data)[source]¶ writes a list of values to consecutive registers on an ADC.
Parameters: - connection (SpiDev object) – See documentation for python Spidev (https://pypi.org/project/spidev/)
- startingreg (byte) – The address of the first register you want to write to
- data (list) – The values you would like to write to the register see section 9.6 of the ADS126x datasheet for an explanations of what values have what functions at a given register
-
piadcs.piadcs.
writeToSingleRegister
(connection, reg_address, data)[source]¶ writes a value to a register on the ADS1262.
Parameters: - connection (SpiDev object) – See documentation for python Spidev (https://pypi.org/project/spidev/)
- reg_address (byte) – The address of the register you would like to write to
- data (byte) – The value you would like to write to the register see section 9.6 of the ADS1262 datasheet for an explanations of what values have what functions at a given register