NOTE: This project is still in development and is not yet ready for production use.
pip install etptool
See etplib README for instructions on flashing the ETP firmware.
etptool cfg save transport serial:COM4:115200
Replace COM4
with the serial port of the ETP device.
etptool fw info
etptool gpio info
- Configure GPIO pin
_13
as output
etptool gpio init _13:output
- Configure GPIO pin
_3
as input
etptool gpio init _3:input
- Read GPIO pin
_3
etptool gpio read _3
- Monitor GPIO pin
_3
etptool gpio read --monitor _3
- 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 and0
will turn ON the LED.
etptool adc info
- Enable ADC pin
a0
etptool adc init a0:en
- Disable ADC pin
a0
etptool adc init a0:dis
- Read ADC pin
a0
etptool adc read a0
- Monitor ADC pin
a0
etptool adc read --monitor a0
etptool pwm info
etptool pwm init _3:en
etptool pwm ctrl _3:50
etptool i2c info
- 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
etptool i2c scan 0
or
etptool i2c scan --bus 0
- Read 2 bytes from I2C device
0x68
etptool i2c read 0 104 2
or
etptool i2c read --bus 0 --addr 104 --len 2
- 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
- Read 4 bytes from I2C device
0x68
register0x02
etptool i2c read_reg 0 104 2 4
or
etptool i2c read_reg --bus 0 --addr 104 --reg 2 --len 4
- Write 4 bytes to I2C device
0x68
register0x02
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
etptool spi info
- 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
- Transfer 2 bytes on SPI bus 0
etptool spi transfer 0 10 20
or
etptool spi transfer --bus 0 --data 10 20