Skip to main content

Embedded Tester Protocol (ETP) Tool

Project description

Embedded Tester Protocol (ETP) Tool - etptool

NOTE: This project is still in development and is not yet ready for production use.

Setup

pip install etptool

Manual

Usage

Flash ETP firmware

See etplib README for instructions on flashing the ETP firmware.

Configure transport

etptool cfg save transport serial:COM4:115200

Replace COM4 with the serial port of the ETP device.

Verify connection & firmware version

etptool fw info

GPIO

Get GPIO information

etptool gpio info

Initialize GPIO

  • Configure GPIO pin _13 as output
etptool gpio init _13:output
  • Configure GPIO pin _3 as input
etptool gpio init _3:input

Read GPIO

  • Read GPIO pin _3
etptool gpio read _3
  • Monitor GPIO pin _3
etptool gpio read --monitor _3

Write GPIO

  • Write 1 to GPIO pin _13
etptool gpio write _13:1
  • Write 0 to GPIO pin _13
etptool gpio write _13:0

NOTE: On an Arduino board, 1 will turn OFF the LED and 0 will turn ON the LED.

ADC

Get ADC information

etptool adc info

Initialize ADC

  • Enable ADC pin a0
etptool adc init a0:en
  • Disable ADC pin a0
etptool adc init a0:dis

Read ADC

  • Read ADC pin a0
etptool adc read a0
  • Monitor ADC pin a0
etptool adc read --monitor a0

PWM

Get PWM information

etptool pwm info

Initialize PWM

etptool pwm init _3:en

Set PWM duty cycle

etptool pwm ctrl _3:50

I2C

Get I2C information

etptool i2c info

Initialize I2C bus

  • Initialize I2C bus 0 with 100 kHz speed
etptool i2c init 0 100

Alternatively, you can use --bus and --speed options

etptool i2c init --bus 0 --speed 100

Scan I2C bus

etptool i2c scan 0

or

etptool i2c scan --bus 0

I2C read

  • Read 2 bytes from I2C device 0x68
etptool i2c read 0 104 2

or

etptool i2c read --bus 0 --addr 104 --len 2

I2C Write

  • Write 2 bytes to I2C device 0x68
etptool i2c write 0 104 10 20

or

etptool i2c write --bus 0 --addr 104 --data 10 20

Register read I2C

  • Read 4 bytes from I2C device 0x68 register 0x02
etptool i2c read_reg 0 104 2 4

or

etptool i2c read_reg --bus 0 --addr 104 --reg 2 --len 4

Register write I2C

  • Write 4 bytes to I2C device 0x68 register 0x02

etptool i2c write_reg 0 104 2 10 20 30 40

or

etptool i2c write_reg --bus 0 --addr 104 --reg 2 --data 10 20 30 40

SPI

Get SPI information

etptool spi info

Initialize SPI bus

  • Initialize SPI bus 0 with 1 MHz speed and mode 0
etptool spi init 0 1000000 0

Alternatively, you can use --bus, --speed, and --mode options

etptool spi init --bus 0 --speed 1000000 --mode 0

SPI transfer

  • Transfer 2 bytes on SPI bus 0
etptool spi transfer 0 10 20

or

etptool spi transfer --bus 0 --data 10 20

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

etptool-0.0.1.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

etptool-0.0.1-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file etptool-0.0.1.tar.gz.

File metadata

  • Download URL: etptool-0.0.1.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for etptool-0.0.1.tar.gz
Algorithm Hash digest
SHA256 fd86ca75002297df7c11a8f1704b5c138d576d92c18ba64d789e6de7b82be8f5
MD5 5a819595cd72d2d4007df0f1f64d612e
BLAKE2b-256 e13039a39fc7fcc67a034ed06ef838263384edb7f47e6bdb25d992e1db934077

See more details on using hashes here.

File details

Details for the file etptool-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: etptool-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for etptool-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 30c01b05f548440942e96b84330037a86cbdaaf690d72886d58d35c86852ad7f
MD5 f2b572088ab7beff6b25fbe05a5dbf6a
BLAKE2b-256 2bd303fc00a44e9ed5deb6b942aa455cf28f131aef355ff6dfb4fc6307cd5039

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page