IIO is a new kernel subsystem for handling analog to digital converters (ADCs) and related hardware. It provides an in-kernel API for drivers as well as a user-space abstraction. IIO has been in development since 2009 and supports a variety of hardware while still maturing. The subsystem handles IIO devices, channels, triggers, and buffers to enable continuous and triggered data capture functionality.
Compare Performance-power of Arm Cortex vs RISC-V for AI applications_oct_2021Deepak Shankar
Abstract: In the Webinar, we will show you how to construct, simulate, analyze, validate, optimize an architecture model using pre-built components. We will compare micro and application benchmarks on system SoC models containing clusters of ARM Cortex A53, SiFive u74, ARM Cortex A77, and other vendor cores. The system will be built around custom switches, Ingress/Egress buffers, credit flow control, AI accelerators, NoC and AMBA AXI buses with multi-level caches, DDR4 DRAM and DMA. The evaluation and optimization criteria will be task latency, dCache hit-ratio, power consumed/task and memory bandwidth. The parameters to be modified are bus topology, cache size, processor clock speed, custom arbiters, task thread allocation and changing the processor pipeline.
Selection of cores is a combination of financial and technical bias. Technical comparison of processor cores requires the understanding of the workload, task partitioning and cache-memory structure. A core must be evaluated in the context of the target application. To evaluate these selections, architecture simulation software must be fortified with a library of Intellectual property for power and timing accurate processor cores, simulator at 100 million events per second, peripherals, and all possible traffic distributions
Key Takeaways:
1. Validating architecture models using mathematical calculus and hardware traces
2. Construct custom policies, arbitrations and configure processor cores
3. Select the right combination of statistics to detect bottlenecks and optimize the architecture
4. Identify the right use of stochastic, transaction, cycle-accurate and traces to construct the model
Speaker Bio:
Alex Su is a FPGA solution architect at E-Elements Technology, Hsinchu, Taiwan. He has been an FPGA Solution Architect and Xilinx FPGA Trainer for a number of years, supporting companies, research centers and universities in China and Taiwan. Prior to that, Mr Su has worked at ARM Ltd for 5 years in technical support of Arm CPU and System IP. Alex has also been engaged with a variety of FPGA-based Hardware Emulation System and over ten years in ASIC/SoC design and verification engineer.
Deepak Shankar is the Founder of Mirabilis Design and has been involved in the architecture exploration of over 250 SoC and processors. Mr. Shankar started Mirabilis Design because of a vacuum in the systems engineering and modeling space with the focus shifting to network design and early software development. Deepak has published over 50 articles and presented at over 30 conferences in EDA, semiconductors and embedded computing. Mr. Shankar has an MBA from UC Berkeley, MS in from Clemson University and BS from Coimbatore Institute of Technology, both in Electronics and Communication.
LCU13: An Introduction to ARM Trusted FirmwareLinaro
Resource: LCU13
Name: An Introduction to ARM Trusted Firmware
Date: 28-10-2013
Speaker: Andrew Thoelke
Video: http://www.youtube.com/watch?v=q32BEMMxmfw
Join this video course on udemy . Click here :
https://www.udemy.com/course/mastering-microcontroller-with-peripheral-driver-development/?couponCode=SLIDESHARE
Learn bare metal driver development systems using Embedded C: Writing drivers for STM32 GPIO,I2C,SPI,USART from scratch
Software/Hardware used:
In this course, the code is developed such a way that, It can be ported to any MCU you have at your hand.
If you need any help in porting these codes to different MCUs you can always reach out to me!
The course is strictly not bound to any 1 type of MCU. So, if you already have any Development board which runs with ARM-Cortex M3/M4 processor,
then I recommend you to continue using it.
But if you don’t have any Development board, then check out the below Development boards.
GNU Toolchain is the de facto standard of IT industrial and has been improved by comprehensive open source contributions. In this session, it is expected to cover the mechanism of compiler driver, system interaction (take GNU/Linux for example), linker, C runtime library, and the related dynamic linker. Instead of analyzing the system design, the session is use case driven and illustrated progressively.
The FIDO Alliance has launched of the FIDO Device Onboard (FDO) protocol, a new, open IoT standard that enables devices to simply and securely onboard to cloud and on-premise management platforms. Through this standard, the FIDO Alliance addresses challenges of security, cost and complexity tied to IoT device deployment at scale. FIDO Device Onboard furthers the fundamental vision of the Alliance, which has brought together 250+ of the most influential and innovative companies and government agencies from around the world to address cyber security in order to eliminate data breaches, and enable secure online experiences.
Inria Tech Talk : RIOT, l'OS libre pour vos objets connectés #IoTStéphanie Roger
Faites communiquer vos objets connectés avec la solution RIOT !
RIOT est un nano système d'exploitation open source, l’équivalent de Linux, pour l’internet des objets. Grâce aux standards de communication qu'il implémente, il vous permettra de développer facilement et de façon pérenne et sécurisée vos applications pour vos objets communicants et embarqués (agriculture connectée, suivi et gestion de bâtiments intelligents, petits automatismes, usine du futur ...).
Inria, l'institut national de recherche dédié au numérique, qui à French Tech Central connecte les entrepreneurs au meilleur de la recherche publique française, est un des membres co-fondateurs de la communauté mondiale des développeurs RIOT.
Compare Performance-power of Arm Cortex vs RISC-V for AI applications_oct_2021Deepak Shankar
Abstract: In the Webinar, we will show you how to construct, simulate, analyze, validate, optimize an architecture model using pre-built components. We will compare micro and application benchmarks on system SoC models containing clusters of ARM Cortex A53, SiFive u74, ARM Cortex A77, and other vendor cores. The system will be built around custom switches, Ingress/Egress buffers, credit flow control, AI accelerators, NoC and AMBA AXI buses with multi-level caches, DDR4 DRAM and DMA. The evaluation and optimization criteria will be task latency, dCache hit-ratio, power consumed/task and memory bandwidth. The parameters to be modified are bus topology, cache size, processor clock speed, custom arbiters, task thread allocation and changing the processor pipeline.
Selection of cores is a combination of financial and technical bias. Technical comparison of processor cores requires the understanding of the workload, task partitioning and cache-memory structure. A core must be evaluated in the context of the target application. To evaluate these selections, architecture simulation software must be fortified with a library of Intellectual property for power and timing accurate processor cores, simulator at 100 million events per second, peripherals, and all possible traffic distributions
Key Takeaways:
1. Validating architecture models using mathematical calculus and hardware traces
2. Construct custom policies, arbitrations and configure processor cores
3. Select the right combination of statistics to detect bottlenecks and optimize the architecture
4. Identify the right use of stochastic, transaction, cycle-accurate and traces to construct the model
Speaker Bio:
Alex Su is a FPGA solution architect at E-Elements Technology, Hsinchu, Taiwan. He has been an FPGA Solution Architect and Xilinx FPGA Trainer for a number of years, supporting companies, research centers and universities in China and Taiwan. Prior to that, Mr Su has worked at ARM Ltd for 5 years in technical support of Arm CPU and System IP. Alex has also been engaged with a variety of FPGA-based Hardware Emulation System and over ten years in ASIC/SoC design and verification engineer.
Deepak Shankar is the Founder of Mirabilis Design and has been involved in the architecture exploration of over 250 SoC and processors. Mr. Shankar started Mirabilis Design because of a vacuum in the systems engineering and modeling space with the focus shifting to network design and early software development. Deepak has published over 50 articles and presented at over 30 conferences in EDA, semiconductors and embedded computing. Mr. Shankar has an MBA from UC Berkeley, MS in from Clemson University and BS from Coimbatore Institute of Technology, both in Electronics and Communication.
LCU13: An Introduction to ARM Trusted FirmwareLinaro
Resource: LCU13
Name: An Introduction to ARM Trusted Firmware
Date: 28-10-2013
Speaker: Andrew Thoelke
Video: http://www.youtube.com/watch?v=q32BEMMxmfw
Join this video course on udemy . Click here :
https://www.udemy.com/course/mastering-microcontroller-with-peripheral-driver-development/?couponCode=SLIDESHARE
Learn bare metal driver development systems using Embedded C: Writing drivers for STM32 GPIO,I2C,SPI,USART from scratch
Software/Hardware used:
In this course, the code is developed such a way that, It can be ported to any MCU you have at your hand.
If you need any help in porting these codes to different MCUs you can always reach out to me!
The course is strictly not bound to any 1 type of MCU. So, if you already have any Development board which runs with ARM-Cortex M3/M4 processor,
then I recommend you to continue using it.
But if you don’t have any Development board, then check out the below Development boards.
GNU Toolchain is the de facto standard of IT industrial and has been improved by comprehensive open source contributions. In this session, it is expected to cover the mechanism of compiler driver, system interaction (take GNU/Linux for example), linker, C runtime library, and the related dynamic linker. Instead of analyzing the system design, the session is use case driven and illustrated progressively.
The FIDO Alliance has launched of the FIDO Device Onboard (FDO) protocol, a new, open IoT standard that enables devices to simply and securely onboard to cloud and on-premise management platforms. Through this standard, the FIDO Alliance addresses challenges of security, cost and complexity tied to IoT device deployment at scale. FIDO Device Onboard furthers the fundamental vision of the Alliance, which has brought together 250+ of the most influential and innovative companies and government agencies from around the world to address cyber security in order to eliminate data breaches, and enable secure online experiences.
Inria Tech Talk : RIOT, l'OS libre pour vos objets connectés #IoTStéphanie Roger
Faites communiquer vos objets connectés avec la solution RIOT !
RIOT est un nano système d'exploitation open source, l’équivalent de Linux, pour l’internet des objets. Grâce aux standards de communication qu'il implémente, il vous permettra de développer facilement et de façon pérenne et sécurisée vos applications pour vos objets communicants et embarqués (agriculture connectée, suivi et gestion de bâtiments intelligents, petits automatismes, usine du futur ...).
Inria, l'institut national de recherche dédié au numérique, qui à French Tech Central connecte les entrepreneurs au meilleur de la recherche publique française, est un des membres co-fondateurs de la communauté mondiale des développeurs RIOT.
How to Choose a Software Update Mechanism for Embedded Linux DevicesLeon Anavi
How to Choose a Software Update Mechanism for Embedded Linux Devices
by Leon Anavi, Konsulko Group
Embedded Linux Conference NA 2022 and Open Source Summit NA 2022
Atomic software system update of an embedded Linux device has always been an important part of any product, especially nowadays with the existing large fleets of connected devices and Internet of Things. There are several different widely used in the industry approaches: A/B updates with dual redundant scheme, delta updates, container-based updates and combined strategies. Open source technologies such as Mender, RAUC and libostree based solutions implement these strategies and provide tools to manage updates of multiple devices. What are the advantages and disadvantages? How to choose an appropriate open source solution for a specific project? This session explores a number of different open source Linux software update technologies with practical examples for integrating them using the Yocto Project and OpenEmbedded. In order to better understand the strengths and weaknesses of each technology, we deep dive in various use cases. The talk is appropriate for anyone with basic knowledge about Linux. It will hopefully help managers, engineers and developers better understand the technical challenges and the available open source solutions with which to overcome them easier and faster so that they can focus on the unique core features of their products.
The Yocto Project is a collaborative open source project that provides prototypes, tools and methods that let you create personalized Linux-based systems for embedded products independent from the hardware architecture. The project was born in 2010 as a partnership of many different hardware manufacturers, open-source operative systems providers and electronic companies, to bring some order to the chaos that was the development of Linux Embedded. Why use Project Yocto? Because it's a development environment for Linux embedded complete with tools, meta-data and documentation - everything that one needs. The free of charge tools that Yocto makes available are powerful and easy to generate (included emulation environments, debuggers, a tool-kit to generate applications and others) and they let you create and continue projects, without causing you a loss of optimizations and investments made in the prototyping phase. Project Yocto supports the adoption of this technology by the open-source community letting users concentrate on the characteristics and development of their product.
Kernel Recipes 2014 - Supporting a new ARM platform: the Allwinner exampleAnne Nicolas
Since last year, we have been working on supporting the SoCs from Allwinner, a chinese SoC vendor, in the mainline kernel. These SoCs are cheap, wide-spread, backed by a strong community and, until last year, only supported by an out-of-tree kernel.
Through this talk, we would like to share the status of this effort: where we were a year ago, what solutions were in place, where we are currently, and what to expect from the future. We will also focus on the community around these SoCs, the work that is done there, etc.
This talk will be useful to developers working on ARM hardware interested in platform code and anyone interested by cool and cheap hardware to hack on.
Maxime Ripard, Free Electrons
Kernel Recipes 2013 - ARM support in the Linux kernelAnne Nicolas
Over the past two years, the support of the platforms based on ARM processor in the Linux kernel has evolved considerably. Between the use of the Device Tree, moving drivers in many features like clock management or multiplexing of pines, the platform mechanism, the changes have been numerous.
Through the experience of the speaker about the addition to the core support for ARM Marvell Armada 370/XP processors, this intervention will provide an overview of these changes in order to better understand the new organization of the code for ARM architecture in the kernel.
This talk is intended to be useful both for developers who want to add support for a new ARM processor in the kernel, but also to those wishing to understand the ARM code for porting Linux to a new card, or just the curious one.
Kernel Recipes 2013 - Easy rootfs using BuildrootAnne Nicolas
The Linux kernel is an exciting world. But if you want to get a working system, it is still essential to provide our kernel a root filesystem. The kernel developers often struggle to find a simple rootfs, adapted to their architecture, together with the tools that fits properly.
We will present how Buildroot, a tool for building embedded Linux systems, can meet the needs of kernel developers in the build of minimal rootfs for their developments.
Kotlin Basics & Introduction to Jetpack Compose.pptxtakshilkunadia
In our fast and ever-changing world of tech, creating a great UI is not just indispensable but also an obligation as a developer. A great UI makes the whole experience of accessing the products/services an absolute pleasure.
Hour 1: Basics of Kotlin
Hour 2: Introduction to Jetpack Compose Development Kit
The Libre-SOC Project aims to create an entirely Libre-Licensed, transparently-developed fully auditable Hybrid 3D CPU-GPU-VPU, using the Supercomputer-class OpenPOWER ISA as the foundation.
Our first test ASIC is a 180nm "Fixed-Point" Power ISA v3.0B processor, 5.1mm x 5.9mm, as a proof-of-concept for the team, whose primary expertise is in Software Engineering. Software Engineering training brings a radically different approach to Hardware development: extensive unit tests, source code revision control, automated development tools are normal. Libre Project Management brings even more: bug trackers, mailing lists, auditable IRC logs and a wiki are standard fare for Libre Projects that are simply not normal Industry-Standard practice.
This talk therefore goes through the workflow, from the original HDL through to the GDS-II layout, showing how we were able to keep track of the development that led to the IMEC 180nm tape-out in July 2021. In particular, by following a parallel development process involving "Real" and "Symbolic" Cell Libraries, developed by Chips4Makers, will be shown how our developers did not need to sign a Foundry NDA, but were still able to work side-by-side with a University that did. With this parallel development process, the University upheld their NDA obligations, and Libre-SOC were simultaneously able to honour its Transparency Objectives.
Internet of Everything is already happening, driven by the staggering growth of smart devices, systems and sensors. As hardware and software developers look to use connectivity to create IoE devices and apps, they encounter misconceptions about complexities and technology options available to them. This session provides insight into the latest connectivity options and tools to help you add connected interactivity to apps and everyday objects.
Watch this presentation on YouTube: https://www.youtube.com/watch?v=bL-Y1XR-KT0&list=PLxeazpXYyqtNm2EnCbfSzy7aKOkHjiaSi&index=12
Implementation of Cmos Camera Device Driver and Wifi Technology on S3c2440 Us...IOSR Journals
Abstract: With the processing of CMOS technology, the technology of video acquisition based on CMOS is becoming a new trend. However, many CMOS camera chip is not supported by the newest Linux kernel yet. The environmental image acquirement and the Wi-Fi transmission system are studied and designed. In this paper, the method of designing the CMOS camera driver based on S3C2440 developing board with the embedded Linux environment is introduced and adds some components such as a USB Wi-Fi adapter. SCCB is a distinguishing feature of OV series CMOS chips. S3C2440 provides a camera interface, and the camera driver is designed based on it. The library and the utilities are compiled, and of images got from CMOS camera to the Wi-Fi mobile phone has been realized by means of programming.
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B KuteTushar B Kute
Recent And Future Trends In Os
Linux Kernel Module Programming, Embedded Operating Systems: Characteristics of Embedded Systems, Embedded Linux, and Application specific OS. Basic services of NACH Operating System.
Introduction to Service Oriented Operating System (SOOS), Introduction to Ubuntu EDGE OS.
Designed By : Tushar B Kute (http://tusharkute.com)
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Dr. Vinod Kumar Kanvaria
Exploiting Artificial Intelligence for Empowering Researchers and Faculty,
International FDP on Fundamentals of Research in Social Sciences
at Integral University, Lucknow, 06.06.2024
By Dr. Vinod Kumar Kanvaria
A workshop hosted by the South African Journal of Science aimed at postgraduate students and early career researchers with little or no experience in writing and publishing journal articles.
Introduction to AI for Nonprofits with Tapp NetworkTechSoup
Dive into the world of AI! Experts Jon Hill and Tareq Monaur will guide you through AI's role in enhancing nonprofit websites and basic marketing strategies, making it easy to understand and apply.
A review of the growth of the Israel Genealogy Research Association Database Collection for the last 12 months. Our collection is now passed the 3 million mark and still growing. See which archives have contributed the most. See the different types of records we have, and which years have had records added. You can also see what we have for the future.
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
1. IIO, a new kernel subsystem
IIO, a new kernel
subsystem
Maxime Ripard
Free Electrons
c Copyright 2009-2012, Free Electrons.
Creative Commons BY-SA 3.0 license.
Latest update: February 14, 2012.
Document sources, updates and translations:
Corrections, suggestions, contributions and translations are welcome!
Embedded Linux
Developers
Free Electrons
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 1
2. Outline
IIO, a new kernel subsystem
What is IIO ?
Definition
Current state in the kernel
Getting started
IIO device
IIO channels
Going further : Hardware triggers and buffers
Hardware Triggers
Buffers
Useful Resources
Conclusion
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 3
3. Maxime Ripard
Embedded Linux engineer and trainer at Free Electrons since
2011
Embedded Linux development: kernel and driver development,
system integration, boot time and power consumption
optimization, etc.
Embedded Linux, Embedded Android and driver development
training, with materials freely available under a Creative
Commons license.
http://free-electrons.com
Contributor to Buildroot, a simple open-source embedded
build system
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 4
4. Outline
IIO, a new kernel subsystem
What is IIO ?
Definition
Current state in the kernel
Getting started
IIO device
IIO channels
Going further : Hardware triggers and buffers
Hardware Triggers
Buffers
Useful Resources
Conclusion
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 5
5. IIO
A subsystem for Analog to Digital Converters (ADCs) and
related hardwares (accelerometers, light sensors, gyroscopes),
but also DACs
Can be used on ADCs ranging from a SoC ADC to 100M
samples/sec industrial ADCs
Until recently, mostly focused on user-space abstraction with
no in-kernel API for other drivers
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 6
6. Current state in the kernel
Developed since 2009 by Jonathan Cameron
Being developed in the staging/ directory until it comes to
an high quality code and a mature API
It is now moving out of staging, one step at a time: first,
basic features, then the support for advanced IIO features.
Already has a lot of different hardware supports and drivers
for them, mostly from Analog Devices Inc, but also drivers for
Texas Instruments, Atmel, etc.
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 7
7. Outline
IIO, a new kernel subsystem
What is IIO ?
Definition
Current state in the kernel
Getting started
IIO device
IIO channels
Going further : Hardware triggers and buffers
Hardware Triggers
Buffers
Useful Resources
Conclusion
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 8
8. iio dev structure
Main structure of all IIO drivers
Holds informations about the device and the driver, such as :
How much channels are available on the device ?
What modes can the device operate in ?
What hooks are available for this driver ?
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 9
9. Allocate a new device
struct iio_dev *idev = iio_allocate_device)
sizeof(struct at91_adc_state));
Allocates a struct iio dev, along with the private data of your
driver
Does all the basic initialisation
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 10
10. Capture modes
idev->modes = INDIO_DIRECT_MODE;
Defines the mode of operations available for this device, to choose
between :
INDIO DIRECT MODE the device can operate using software
triggers
INDIO BUFFER TRIGGERED the device can use hardware
triggers
INDIO BUFFER HARDWARE the device has a hardware buffer
INDIO ALL BUFFER MODES union of the two above
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 11
11. IIO infos
static const struct iio_info at91_adc_info = {
.driver_module = THIS_MODULE,
.read_raw = &at91_adc_read_raw,
};
idev->info = &at91_adc_info;
Used to declare the hooks the core can use for this device
Lot of hooks available corresponding to interactions the user
can make through sysfs.
read_raw for example is called to request a value from the
driver. A bitmask allows us to know more precisely which type
of value is requested, and for which channel if needed. It can
be for example either the scale used to convert value returned
to volts or the value in itself.
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 12
12. Basic design of the driver
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 13
14. Register the device
iio_device_register(idev);
this is sufficient to have a basic IIO device driver
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 15
15. Userspace API
If we look at /sys/bus/iio/devices/iio:deviceX, we should
have:
$ ls /sys/bus/iio/devices/iio:deviceX
in_voltage0_raw
in_voltage_scale
name
$
reading in voltage0 raw calls the read raw hook, with the
mask set to 0, and the chan argument set with the
iio chan spec structure corresponding to the the channel 0
reading in voltage scale calls the read raw hook, with the
mask set to IIO CHAN INFO SCALE
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 16
16. Outline
IIO, a new kernel subsystem
What is IIO ?
Definition
Current state in the kernel
Getting started
IIO device
IIO channels
Going further : Hardware triggers and buffers
Hardware Triggers
Buffers
Useful Resources
Conclusion
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 17
17. Hardware Triggers
IIO exposes API so that we can :
declare any given number of triggers
choose which channels we want enabled for conversions
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 18
18. Kernel API
static const struct iio_trigger_ops at91_adc_trigger_ops = {
.owner = THIS_MODULE,
.set_trigger_state = &at91_adc_configure_trigger,
};
struct iio_trigger *trig = iio_allocate_trigger("foo");
trig->ops = &at91_adc_trigger_ops;
iio_trigger_register(trig)
Once again, we have hooks to declare
These hooks are this time triggers-specific, so that we can
have a function called when the trigger state changes.
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 19
19. Poll Function
function triggered at each conversion
called through the functions iio_trigger_poll or
iio_trigger_poll_chained
basically, its job is to feed retrieve data from the device and
feed them into the buffer
IIO uses the IRQ model, so the poll function has the same
prototype than any other IRQ handler.
idev->pollfunc = iio_alloc_pollfunc(&iio_pollfunc_store_time,
&at91_adc_trigger_handler,
IRQF_ONESHOT,
idev,
"foo");
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 20
20. Buffers
doesn’t make much sense to have triggered captures without
a buffer
Buffers and triggers are closely tied together in IIO
2 types of buffers in IIO
One relies on kfifo
The other one is a ring buffer
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 21
21. Allocate a buffer
in the latest code, if you want to use the IIO ring buffer, boiler
plate code has been added so it’s pretty straightforward.
ret = iio_sw_rb_simple_setup(idev,
&iio_pollfunc_store_time,
&at91_adc_trigger_handler);
Allocate the buffer, allocates the poll function, declares the
device as supporting triggered capture, register the buffer
against the core, etc
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 22
22. Userspace API 1/3: Set up the capture
If we look at /sys/bus/iio/devices/, we should now have in
addition to iio:deviceX:
$ ls /sys/bus/iio/devices/
iio:device0
trigger0
$ ls /sys/bus/iio/devices/iio:device0
buffer
scan_elements
trigger
$ ls /sys/bus/iio/devices/iio:device0/buffer
enabled length
$ ls /sys/bus/iio/devices/iio:device0/scan_elements
in_voltage0_en
in_voltage0_index
in_voltage0_type
$ ls /sys/bus/iio/devices/trigger0
name
$
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 23
23. Userspace API 2/3: Start and stop a capture
$ echo 1 >
/sys/bus/iio/devices/iio:device0/scan_elements/in_voltage0_en
$ echo "foo" >
/sys/bus/iio/devices/iio:device0/trigger/current_trigger
$ echo 100 > /sys/bus/iio/devices/iio:device0/buffer/length
$ echo 1 > /sys/bus/iio/devices/iio:device0/buffer/enable
$ echo 0 > /sys/bus/iio/devices/iio:device0/buffer/enable
$ echo "" >
/sys/bus/iio/devices/iio:device0/trigger/current_trigger
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 24
24. Userspace API 3/3: Get the capture results
IIO also exposes a character device to get the converted
values: /dev/iio:deviceX
You just have to read in it to get data
Data are organized by chunks
Example: You have 4 channels, plus a timestamp one. All are
enabled except channel 2.
Channels Timestamp
Index 0 1 3
Size in bits 16 16 16 64
There is a program that provides a basic implementation and
a good way to test your driver in the IIO documentation
directory: drivers/staging/iio/Documentation/
generic_buffer.c
# ./generic-buffer -n at91_adc -t at91_adc-dev0-external
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 25
25. Outline
IIO, a new kernel subsystem
What is IIO ?
Definition
Current state in the kernel
Getting started
IIO device
IIO channels
Going further : Hardware triggers and buffers
Hardware Triggers
Buffers
Useful Resources
Conclusion
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 26
27. Outline
IIO, a new kernel subsystem
What is IIO ?
Definition
Current state in the kernel
Getting started
IIO device
IIO channels
Going further : Hardware triggers and buffers
Hardware Triggers
Buffers
Useful Resources
Conclusion
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 28
28. Conclusion
IIO is a nice subsystem to add ADCs and the like support
Still under heavy development, but also really opens to
changes and feedback
Yet reliable enough to be used in production
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 29