Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Why to create a driver

Featured Replies

Hello all,

I was reading the following topic when question myself about the advantages of write a driver for a device instead of write the SPI communication stuff on my application like vlad59 that use a python script to access the devices.

 

 

Thank you

2 minutes ago, metRo_ said:

I was reading the following topic when question myself about the advantages of write a driver for a device instead of write the SPI communication stuff on my application like vlad59 that use a python script to access the devices.

It's not about creating a driver. It's about creating a configuration that would allow loading already existing kernel drivers. It doesn't matter much for simple I2C/SPI sensors, but it is required if you want to use advanced features like triggers, interrupts, automatic calculations or want to have better performance and reliability (if you want to read the sensor as many times per second as possible and don't want to rely on userspace code)

I tried to talk (bitbanging) with a DS18B20 (One Wire temperature sensor) some years ago with a pretty loaded Raspberry pi : I started with Python and it worked 30% of the time, with C 50% of the time. All because of timing issues / preemptive kernel / threads ...

With the kernel module, I had almost no problem. Here I saw a big win with kernel drivers.

With I2C sensors I never had to tweak anything even if I used cpuburn at the same time but I may be lucky.

But I agree with Zador, it heavily depends on your use case, I check the value of ambient temperature every 5 minutes so there's nothing critical here. If we talked about relays it's another story.

 

  • Author

Thank you both for your explanation. Do you recommend any good documentation on how to create a kennel driver for a simple temperature sensor out example?

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.