Python wrapper for the candle (gs_usb) windows driver.
Project description
candle_driver
Python wrapper for the candle (gs_usb) windows driver which is published here.
Example usage
import candle_driver
# lists all available candle devices
devices = candle_driver.list_devices()
# use first availabel device
device = devices[0]
print('Device path: %s' % device.path())
print('Device name: %s' % device.name())
print('Device timestamp: %d' % device.timestamp()) # in usec
print('Device channels: %s', device.channel_count())
# open device (blocks other processes from using it)
device.open()
# open first channel
ch = device.channel(0)
ch.set_bitrate(1000000)
# or
ch.set_timings(prop_seg=1, phase_seg1=12, phase_seg2=2, sjw=1, brp=3)
# start receiving data
ch.start()
# normal frame
ch.write(10, b'abcdefgh')
# extended frame
ch.write(10235 | candle_driver.CANDLE_ID_EXTENDED, b'abcdefgh')
# wait 1000ms for data
frame_type, can_id, can_data, extended, ts = ch.read(1000)
# close everything
ch.stop()
device.close()
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
Windows C driver is licensed under the GPLv3 License - see the LICENSE file for details.
Acknowledgments
- Hubert Denkmair for the Windows C driver.
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
candle_driver-0.1.0.tar.gz
(12.1 kB
view hashes)
Built Distribution
Close
Hashes for candle_driver-0.1.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55f3d666154680465a3b380cdee3978cf824d0b493fe0d1581b5a369e0916700 |
|
MD5 | 26e0e42c00c3f5c7c7f63790921b6e98 |
|
BLAKE2b-256 | 96c8b9706ba326e18e5bfa276b9c196ab2a7d278266b0f9453bb870391c958c9 |