spi 1.0
AVR mega series spi library
Loading...
Searching...
No Matches
common Directory Reference
Directory dependency graph for common:
common

Directories

 
defines
 
enums
 
macros

Detailed Description

[![Version: 1.0 Release](https://img.shields.io/badge/Version-1.0%20Release-green.svg)](https://github.com/0x007e/hal-common) ![Build](https://github.com/0x007e/hal-common/actions/workflows/release.yml/badge.svg) [![License GPLv3](https://img.shields.io/badge/License-GPLv3-lightgrey)](https://www.gnu.org/licenses/gpl-3.0.html)

Common Hardware Abstraction Layer Headers

Ask DeepWiki

These hardware abstraction layer headers serve as a general structure for all hardware abstraction libraries, making them interchangeable across different platforms.

File Structure

hal/
└── common/
├── defines/
| └── TWI_defines.h
├── enums/
| ├── SPI_enums.h
| ├── TWI_enums.h
| └── UART_enums.h
└── macros/
└── PORT_macros.h

The headers are completely platform independent and can be usesd across a wide range of c-compilers.

Downloads

The headers can be downloaded (zip or tar), cloned or used as submodule in a project.

Type File Description
Library zip / tar Common hal macros/data structure library

Using with git clone

mkdir -p ./hal
git clone https://github.com/0x007E/hal-common.git ./hal
mv ./hal/hal-common ./hal/common

Using as git submodule

git submodule add https://github.com/0x007E/hal-common.git ./hal/common

Programming

#include "../lib/hal/common/enums/UART_enums.h"
// Sample UART receiving function
UART_Data uart_getchar(char *data)
{
// Check if an error has occured
if(...)
{
return UART_Fault;
}
// Check if uart data is received?
if(...)
{
*data = data_received;
return UART_Received;
}
return UART_Empty;
}
@ UART_Fault
Definition UART_enums.h:44
@ UART_Empty
Definition UART_enums.h:42
@ UART_Received
Definition UART_enums.h:43
enum UART_Data_t UART_Data
Alias for enum UART_Data_t representing UART receive status.
Definition UART_enums.h:28

R. GAECHTER