coinespy API calls: Sensor communication¶
For the definition of SPIBus, refer to 11.3.6.11. For the definition of I2CBus, refer to 11.3.6.10.
config_i2c_bus¶
Configures the I2C bus
For the definition of I2CMode, refer to 11.3.6.4.
config_spi_bus¶
Configures the SPI bus of the board.
coinesboard.config_spi_bus(bus: SPIBus, cs_pin: MultiIOPin, spi_speed=SPISpeed,
spi_mode=SPIMode) -> ErrorCodes
deconfig_i2c_bus¶
This API is used to de-configure the I2C bus
deconfig_spi_bus¶
This API is used to de-configure the SPI bus
write_i2c¶
Writes 8-bit register data to the I2C
coinesboard.write_i2c(bus: I2CBus, register_address: int, register_value: int,
sensor_interface_detail: int = None) -> ErrorCodes
read_i2c¶
Reads 8-bit register data from the I2C
register_data = coinesboard.read_i2c(bus: I2CBus, register_address: int, number_of_reads=1, sensor_interface_detail: int = None)
write_spi¶
Writes 8-bit register data to the SPI device.
coinesboard.write_spi(bus: SPIBus, register_address: int, register_value: int,
sensor_interface_detail: int = None) -> ErrorCodes
read_spi¶
Reads 8-bit register data from the SPI device.
register_data = coinesboard.read_spi(bus: SPIBus, register_address: int,
number_of_reads=1, sensor_interface_detail: int = None)
config_word_spi_bus¶
Configures the SPI bus parameters.
coinesboard.config_word_spi_bus(bus: SPIBus, cs_pin: MultiIOPin,
spi_speed=SPISpeed.SPI_1_MHZ, spi_mode=SPIMode.MODE0,
spi_bits=SPITransferBits.SPI16BIT) -> ErrorCodes
write_16bit_spi¶
Writes 16-bit register data to the SPI device.
coinesboard.write_16bit_spi(bus: SPIBus, register_address: int, register_value:
List[int], sensor_interface_detail: int = None) -> ErrorCodes
read_16bit_spi¶
Reads 16-bit register data from the SPI device.
register_data = coinesboard.read_16bit_spi(bus: SPIBus, register_address: int,
number_of_reads=2, sensor_interface_detail: int = None)
delay_milli_sec¶
Introduces delay in millisecond.
delay_micro_sec¶
Introduces delay in microsecond.