Groups | Search | Server Info | Login | Register


Groups > perl.module-authors > #3256

Re: Module heirarchy naming for SPI/I²C device drivers

Newsgroups perl.module-authors
Date 2015-10-22 18:15 +0100
Subject Re: Module heirarchy naming for SPI/I²C device drivers
Message-ID <20151022181546.5b0483ed@shy.leonerd.org.uk> (permalink)
References <20151021185438.50ac7052@shy.leonerd.org.uk> <20151022103900.GG4420@sanger.ac.uk> <5628CC4E.6030306@perl.it>
From leonerd@leonerd.org.uk ("Paul \"LeoNerd\" Evans")

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Thu, 22 Oct 2015 13:45:18 +0200
Aldo Calpini <dada@perl.it> wrote:

> I would personally keep Device, most of the hardware-related stuff on 
> CPAN (not much, but still) is already in that namespace.

Agree.

> Bus, by itself, is far from unambiguous to me 
> (https://en.wikipedia.org/wiki/Bus). On the other hand, I think I2C
> and SPI are familiar enough to people working - or playing - with
> electronics.

Ditto.

> So I would go for:
> 
> Device::I2C
> Device::SPI
> 
> Which are hardware-abstract, and subclassed if/when needed 
> (Device::I2C::FT232H, etc.).

Hmm. I'm not sure I like putting "SPI" or "I²C" or whatever (UART?
1Wire?) in the module name. There are genuinely some chips that are
available with a variety of interface types, or some even support a
selection of them by different hardware configurations or whatever. So
I think that the interface type should be an implementation detail, and
not really part of the name.

What do you think to simply

  Device::Chip::*

as the namespace for individual chips. E.g

  Device::Chip::INA219
  Device::Chip::MAX7221

I'm not sure if driver adapters (Bus Pirate, FT232H, Raspberry Pi
GPIO, etc...) would necessarily warrant a dedicated space too; they
become the consumers of these chips, much like my existing
Device::BusPirate currently consumes chips within its space.

-- 
Paul "LeoNerd" Evans

leonerd@leonerd.org.uk
http://www.leonerd.org.uk/  |  https://metacpan.org/author/PEVANS

Back to perl.module-authors | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Module heirarchy naming for SPI/I²C device drivers leonerd@leonerd.org.uk ("Paul \"LeoNerd\" Evans") - 2015-10-21 18:54 +0100
  Re: Module heirarchy naming for SPI/I²C device drivers mca@sanger.ac.uk (Matthew Astley) - 2015-10-22 11:39 +0100
    Re: Module heirarchy naming for SPI/I²C device drivers leonerd@leonerd.org.uk ("Paul \"LeoNerd\" Evans") - 2015-10-22 12:42 +0100
    Re: Module heirarchy naming for SPI/I²C device drivers leonerd@leonerd.org.uk ("Paul \"LeoNerd\" Evans") - 2015-10-22 18:15 +0100
    Re: Module heirarchy naming for SPI/I²C device drivers aaron@priven.com (Aaron Priven) - 2015-10-22 12:52 -0700
  Re: Module heirarchy naming for SPI/I²C device drivers dpchrist@holgerdanske.com (David Christensen) - 2015-10-22 18:20 -0700

csiph-web