All Projects → pfalcon → libperipha

pfalcon / libperipha

Licence: other
Grand unified collection of headers to access various hardware chips and components

Programming Languages

c
50402 projects - #5 most used programming language
python
139335 projects - #7 most used programming language
C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to libperipha

lipsi
Lipsi: Probably the Smallest Processor in the World
Stars: ✭ 64 (+276.47%)
Mutual labels:  hardware
esp8266
esp8266 resources.
Stars: ✭ 17 (+0%)
Mutual labels:  hardware
icebreaker-amaranth-examples
This repository contains iCEBreaker examples for Amaranth HDL.
Stars: ✭ 26 (+52.94%)
Mutual labels:  hardware
Omega2
Everything related to the Onion Omega2 IoT Computer family
Stars: ✭ 21 (+23.53%)
Mutual labels:  hardware
linux-802.15.4-sniffer
Linux Based 802.15.4/Zigbee Sniffer
Stars: ✭ 17 (+0%)
Mutual labels:  hardware
ScouseTom
Open Source EIT system using Keithley 6221 current source and EEG systems
Stars: ✭ 17 (+0%)
Mutual labels:  hardware
embedded-time
Time(ing) library (Instant/Duration/Clock/Timer/Period/Frequency) for bare-metal embedded systems
Stars: ✭ 72 (+323.53%)
Mutual labels:  hardware
LipSync
An open-source mouth operated sip and puff joystick that enables people with limited hand function emulate a mouse on their computer and/or smartphone.
Stars: ✭ 27 (+58.82%)
Mutual labels:  hardware
bdiefinder
Find Samsung B-Die DDR 4 memory kits on Amazon, Newegg and many more
Stars: ✭ 91 (+435.29%)
Mutual labels:  hardware
azure-sphere-hardware-designs
Hardware reference designs for Azure Sphere chips created and maintained by the Azure Sphere team at Microsoft
Stars: ✭ 26 (+52.94%)
Mutual labels:  hardware
powerblade
1 in² AC power meter
Stars: ✭ 50 (+194.12%)
Mutual labels:  hardware
r e c u r
an open diy py/pi based video sampler
Stars: ✭ 220 (+1194.12%)
Mutual labels:  hardware
nova-hardware
Hologram Nova Hardware
Stars: ✭ 37 (+117.65%)
Mutual labels:  hardware
samsung-bios-check
BIOS update checker for Samsung laptops running Linux
Stars: ✭ 25 (+47.06%)
Mutual labels:  hardware
DomesdayDuplicator
High-speed LaserDisc RF sampler
Stars: ✭ 39 (+129.41%)
Mutual labels:  hardware
SAMD TimerInterrupt
This library enables you to use Interrupt from Hardware Timers on an SAMD-based board. These SAMD Hardware Timers, using Interrupt, still work even if other functions are blocking. Moreover, they are much more precise (certainly depending on clock frequency accuracy) than other software timers using millis() or micros(). That's mandatory if you …
Stars: ✭ 28 (+64.71%)
Mutual labels:  hardware
twigs
Alternate firmware for Mutable Instruments Branches synthesizer module
Stars: ✭ 21 (+23.53%)
Mutual labels:  hardware
ioBroker.ring
Ring Video Doorbell Adapter
Stars: ✭ 25 (+47.06%)
Mutual labels:  hardware
Bluetooth-Speaker
MouDio: a compact and portable Bluetooth speaker with high-quality components for powerful, clear sound. Moudio is built using four PCBs and laser-cut acrylic grills with 3D printed parts, and it can be easily assembled using the provided instructions.
Stars: ✭ 27 (+58.82%)
Mutual labels:  hardware
midi-eye
Ruby MIDI input event listener
Stars: ✭ 24 (+41.18%)
Mutual labels:  hardware
libperipha (lib peripheral access) is a collection of headers and
definitions to access internal registers of various hardware components.

License
-------
libperipha consists of number of components, developed by project
contributors, collected from existing projects, or imported from
vendor releases. All components of libperipha are released under
well-known liberal Open Source licenses (such as BSD or MIT), or
are in public domain. Please consult each individual file for
licensing/copyright terms applying to it. Following provides
(possibly incomplete) information for major libperihpa components:

1. Default libperipha license unless otherwise specified: 3-clause BSD.
If you contribute materials of which you are copyright holder, please
consider using this license to minimize complexity and confusion.

2. scripts/ subdirectory: It's common practice in Open Source community
to release development and support tools on stricter freedom and
community protecting license, like GPL. However, to minimize confusion
and to keep automatic licensing scanners happy, libperipha adopts to use
same 3-clause BSD license for support scripts.

3. arm/cortex-m/arm-cmsis/ subdir: CMSIS library, copyrighted by ARM Ltd.
and released under 3-clause BSD license.


Downloading
-----------
libperipha is distributed via git repository. To checkout:

    git clone --recursive https://github.com/pfalcon/libperipha.git

If you cloned without --recursive, run:

    git submodule update --init --recursive


Interface/API
-------------
There're a few well-known ways to define hardware registers and access
them:

1. Define iomem addresses of registers, and provide functions/macros
to access them. E.g.:

#define REG_DATA 0x40
#define READ_R8(addr) ...
#define WRITE_R8(addr, val) ...
uint8_t v = READ_R8(REG_DATA);
WRITE_R8(REG_DATA, 'a');

2. Define registers as "virtual variables", so they can be read/written
directly. This is really a variation of the previous method, where
register symbol is defined to a dereferenced pointer to an address:

#define _REG_DATA 0x40
#define R8(addr) (*(volatile uint8_t*)(addr))
#define REG_DATA R8(_REG_DATA)
uint8_t v = REG_DATA;
REG_DATA = 'a';

3. More complex hardware may have number of similar blocks, so instead
of using just scalar address with method 1, separate block base address
and in-block register offsets are defines, with corresponding accessors:

#define BLOCK1 0x10
#define BLOCK2 0x20
#define REG_DATA 0x00
#define REG_CTRL 0x02
#define READ_R16(base, offset) ...
#define WRITE_R16(base, offset, val) ...
uint16_t v = READ_R16(BLOCK1, REG_DATA);
WRITE_R16(BLOCK2, REG_DATA, 0xaa55);

4. Generalization of method 2 to a repeating blocks is using structures
to define block register layouts, then defining block symbols as structure
pointers using block base addresses:

struct BLOCK {
    uint16_t REG_DATA;
    uint16_t REG_CTRL;
};
#define _BLOCK1 0x10
#define _BLOCK2 0x20
#define BLOCK1 ((volatile struct BLOCK*)_BLOCK1)
#define BLOCK2 (*(volatile struct BLOCK*)_BLOCK1)
uint16_t v = BLOCK1->REG_DATA;
BLOCK1->REG_DATA = 0xaa55;
BLOCK2.REG_CTRL = CMD_RESET;


It's hard to say that one method is "better" than another, each of them has
its pros and cons. For example, for simple hardware, it makes no sense
to mandate usage of extra parameters in accessor methods or define
structures, methods 1 & 2 work pretty well. Methods 2 & 4 are more
concise, but require registers to be memory-mapped (or special pointer
types support from compiler).

So, libperipha doesn't try to postulate any of these as primary, but
embraces them all. It is however recommended to whenever possible support
all of them. It's not as hard as it seems, methods 1 & 2 have basically
the same underlying definitions (register addresses as scalar), and from
4 to 3 it is possible to go with offsetof macro. All these cases can be
covered by simple codegeneration script. Going from method 3 to 4 is more
complicated, but a tool to layout structures based on register offsets
and sizes is just a bit more complicated than trivial.


(Re)generating headers from YAML descriptions
---------------------------------------------
libperipha favors declaritive descriptions encoded in easy to understand YAML
files. To generate headers from .yaml files, run scripts/yaml2h.py tool
in a directory with such files.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].