Skip to content

Type interface to writebytes not clear #118

Open
@PeterWurmsdobler

Description

Hello,

first, thanks for providing this library that allows accessing devices over SPI in python; that is very convenient.

The name of the method writebytes alludes to the data type needing to be some kind of unsigned char or some uint8 from the ctypes. Having written code around this assumption I found that I always go a TypeError: Non-In/Long value in argument. Going through the c-code I realised that there a converion to __u8 is being performed. So my assumption was wrong.

Bottom line, it appears that writebytes accepts a list of int rather than bytes which are then cast to an unsigned 8 bit quantity. I wonder whether that could be made clearer in the documentation.

Cheers, peter.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions