Pervasive Displays Library Suite - Basic edition 8.0.8
Library for Pervasive Displays e-paper screens and EXT3 extension board
Loading...
Searching...
No Matches
hV_HAL_Peripherals.h File Reference

Light hardware abstraction layer for peripherals. More...

#include <Arduino.h>
#include <SPI.h>
#include <Wire.h>
#include <stdint.h>
#include <stdio.h>
#include <stdarg.h>
Include dependency graph for hV_HAL_Peripherals.h:
This graph shows which files directly or indirectly include this file:

Macros

#define hV_HAL_PERIPHERALS_RELEASE   806
 Release.
 
#define mySerial   Serial
 SDK library.
 

Functions

void hV_HAL_begin ()
 General initialisation.
 
void waitFor (uint8_t pin, uint8_t state=HIGH)
 Wait for.
 
void hV_HAL_SPI_begin (uint32_t speed=8000000)
 Configure and start SPI.
 
void hV_HAL_SPI_end ()
 End SPI.
 
uint8_t hV_HAL_SPI_transfer (uint8_t data)
 Combined write and read of a single byte.
 
3-wire SPI bus
Warning
  • Arduino does not support 3-wire SPI, bit-bang simulation
  • Viewer: For compatibility only, not implemented in Linux
Note
hV_HAL_SPI3_begin() sets the pins for 3-wire SPI.
void hV_HAL_SPI3_begin ()
 Configure 3-wire SPI.
 
void hV_HAL_SPI3_define (uint8_t pinClock=SCK, uint8_t pinData=MOSI)
 Set the 3-wire SPI pins.
 
uint8_t hV_HAL_SPI3_read ()
 Read a single byte.
 
void hV_HAL_SPI3_write (uint8_t value)
 Write a single byte.
 
Wire bus
void hV_HAL_Wire_begin ()
 Configure and start Wire bus.
 
void hV_HAL_Wire_end ()
 End Wire bus.
 
void hV_HAL_Wire_transfer (uint8_t address, uint8_t *dataWrite, size_t sizeWrite, uint8_t *dataRead=0, size_t sizeRead=0)
 Combined write and read.
 

Detailed Description

Light hardware abstraction layer for peripherals.

Project Pervasive Displays Library Suite
Based on highView technology

Author
Rei Vilo
Date
21 Oct 2024
Version
806
  • Basic edition: for hobbyists and for basic usage
    Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
    See also
    https://creativecommons.org/licenses/by-sa/4.0/

    Consider the Evaluation or Commercial editions for professionals or organisations and for commercial usage
  • Evaluation edition: for professionals or organisations, evaluation only, no commercial usage
    All rights reserved
  • Commercial edition: for professionals or organisations, commercial usage
    All rights reserved
  • Viewer edition: for professionals or organisations
    All rights reserved
  • Documentation
    All rights reserved

Macro Definition Documentation

◆ mySerial

#define mySerial   Serial

SDK library.

See also
References

SDK other libraries

Other libraries

Function Documentation

◆ hV_HAL_SPI3_begin()

void hV_HAL_SPI3_begin ( )

Configure 3-wire SPI.

Note
Select default SCK as clock and MOSI as data (SDIO)

◆ hV_HAL_SPI3_define()

void hV_HAL_SPI3_define ( uint8_t pinClock = SCK,
uint8_t pinData = MOSI )

Set the 3-wire SPI pins.

Parameters
pinClockclock, default = SCK
pinDatacombined data, default = MOSI
Note
For manual configuration only
Warning
SCK and MOSI provided by Arduino SDK
  • Some boards require manual configuration

◆ hV_HAL_SPI3_read()

uint8_t hV_HAL_SPI3_read ( )

Read a single byte.

Returns
read byte
Note
Configure the clock pin as output and data pin as input.
Warning
/CS to be managed externally.

◆ hV_HAL_SPI3_write()

void hV_HAL_SPI3_write ( uint8_t value)

Write a single byte.

Parameters
databyte
Note
Configure the clock and data pins as output.
Warning
/CS to be managed externally.

◆ hV_HAL_SPI_begin()

void hV_HAL_SPI_begin ( uint32_t speed = 8000000)

Configure and start SPI.

Parameters
speedSPI speed in Hz, 8000000 = default
Note
Other parameters are
  • Bit order: MSBFIRST
  • Data mode: SPI_MODE0
With check for unique initialisation

◆ hV_HAL_SPI_end()

void hV_HAL_SPI_end ( )

End SPI.

Note
With check for unique deinitialisation

◆ hV_HAL_SPI_transfer()

uint8_t hV_HAL_SPI_transfer ( uint8_t data)

Combined write and read of a single byte.

Parameters
databyte
Returns
read byte
Warning
No check for previous initialisation

◆ hV_HAL_Wire_begin()

void hV_HAL_Wire_begin ( )

Configure and start Wire bus.

Note
Master mode only
With check for unique initialisation

◆ hV_HAL_Wire_end()

void hV_HAL_Wire_end ( )

End Wire bus.

Note
With check for unique deinitialisation

◆ hV_HAL_Wire_transfer()

void hV_HAL_Wire_transfer ( uint8_t address,
uint8_t * dataWrite,
size_t sizeWrite,
uint8_t * dataRead = 0,
size_t sizeRead = 0 )

Combined write and read.

Parameters
[in]addressI2C device address
[in]dataWritebuffer to write
[in]sizeWritenumber of bytes
[out]dataReadbuffer to read
[in]sizeReadnumber of bytes
Note
If sizeRead = 0, no read performed
Warning
No check for previous initialisation

◆ waitFor()

void waitFor ( uint8_t pin,
uint8_t state = HIGH )

Wait for.

Parameters
pinpin number
statestate to reach, default = HIGH