Pervasive Displays Library Suite - Reference Manual 9.0.3
Library for Pervasive Displays e-paper screens, extension boards and development kits
|
Light hardware abstraction layer for peripherals. More...
#include <Arduino.h>
#include <stdint.h>
#include <stdio.h>
#include <stdarg.h>
#include <Wire.h>
#include <SPI.h>
Macros | |
#define | hV_SDK_PERIPHERALS_RELEASE 902 |
Release. | |
Specific configuration | |
SDK library
Other libraries | |
#define | hV_SDK_Serial Serial |
FRAM management. | |
#define | hV_SDK_Serial_Speed 115200 |
Serial port speed. | |
#define | hV_SDK_Wire Wire |
Wire configuration. | |
#define | hV_SDK_SPI SPI |
SPI configuration. | |
#define | SPI_SPEED_4_MHz 4000000 |
SPI speed. | |
#define | SPI_SPEED_8_MHz 8000000 |
SPI configuration. | |
#define | SPI_SPEED_16_MHz 16000000 |
SPI configuration. | |
#define | hV_SDK_SPI_SPEED SPI_SPEED_8_MHz |
SPI configuration. | |
#define | hV_SDK_SPI_MOSI MOSI |
SPI pins. | |
#define | hV_SDK_SPI_MISO MISO |
SPI configuration. | |
#define | hV_SDK_SPI_SCK SCK |
SPI configuration. | |
Functions | |
template<typename T> | |
void | hV_SDK_Serial_print (T text) |
Print to serial console. | |
template<typename T> | |
void | hV_SDK_Serial_println (T text) |
Print to serial console with cr-lf at the end. | |
General | |
void | hV_SDK_begin () |
General initialisation. | |
void | hV_SDK_exit (uint8_t code=0) |
General exit. | |
GPIO | |
void | hV_SDK_GPIO_begin (void) |
GPIO initialisation. | |
void | hV_SDK_GPIO_define (uint8_t pin, uint8_t mode) |
Define GPIO mode. | |
void | hV_SDK_GPIO_write (uint8_t pin, uint8_t value) |
Write GPIO. | |
uint8_t | hV_SDK_GPIO_read (uint8_t pin) |
Read GPIO. | |
Time | |
void | hV_SDK_delayMicroseconds (uint32_t us) |
Microsecond non-blocking delay. | |
void | hV_SDK_delayMilliseconds (uint32_t ms) |
Millisecond non-blocking delay. | |
uint32_t | hV_SDK_getMilliseconds (void) |
Get milliseconds since start-up. | |
Serial console | |
Formatted output to hV_SDK_Serial | |
void | hV_SDK_Serial_begin (uint32_t speed=115200) |
Initialise console. | |
void | hV_SDK_Serial_printf (const char *format, va_list args) |
Format and send to console. | |
void | hV_SDK_Serial_crlf (void) |
Print carriage-return line-feed. | |
SPI bus | |
| |
void | hV_SDK_SPI_begin (uint32_t speed=8000000) |
Configure and start SPI. | |
void | hV_SDK_SPI_end () |
End SPI. | |
uint8_t | hV_SDK_SPI_transfer (uint8_t data) |
Combined write and read of a single byte. | |
void | hV_SDK_SPI_transfer (uint8_t *data, size_t size) |
Combined write and read. | |
3-wire SPI bus | |
| |
void | hV_SDK_SPI3_begin () |
Configure 3-wire SPI. | |
void | hV_SDK_SPI3_end () |
End 3-wire SPI. | |
void | hV_SDK_SPI3_define (uint8_t pinClock=SCK, uint8_t pinData=MOSI) |
Set the 3-wire SPI pins. | |
uint8_t | hV_SDK_SPI3_read () |
Read a single byte. | |
void | hV_SDK_SPI3_write (uint8_t data) |
Write a single byte. | |
Wire bus | |
void | hV_SDK_Wire_begin () |
Configure and start Wire bus. | |
void | hV_SDK_Wire_end () |
End Wire bus. | |
void | hV_SDK_Wire_transfer (uint8_t address, uint8_t *dataWrite, size_t sizeWrite, uint8_t *dataRead=0, size_t sizeRead=0) |
Combined write and read. | |
Miscellaneous | |
uint32_t | hV_SDK_random (uint32_t maxNumber) |
Pseudo-random number. | |
Light hardware abstraction layer for peripherals.
Project Pervasive Displays Library Suite
Based on highView technology
Commercial edition: for professionals or organisations, commercial usage
#define hV_SDK_Serial Serial |
FRAM management.
for MSP430FR MCUs
Serial configuration
Serial port
#define hV_SDK_Serial_Speed 115200 |
Serial port speed.
Recommended 115200
#define hV_SDK_SPI SPI |
SPI configuration.
SPI bus
#define hV_SDK_SPI_MISO MISO |
SPI configuration.
SPI bus
#define hV_SDK_SPI_MOSI MOSI |
SPI pins.
For default SPI3 configuration
#define hV_SDK_SPI_SCK SCK |
SPI configuration.
SPI bus
#define hV_SDK_SPI_SPEED SPI_SPEED_8_MHz |
SPI configuration.
SPI bus
#define hV_SDK_Wire Wire |
Wire configuration.
Wire bus
#define SPI_SPEED_16_MHz 16000000 |
SPI configuration.
SPI bus
#define SPI_SPEED_4_MHz 4000000 |
SPI speed.
Recommended 4 MHz, safe up to 8 MHz
#define SPI_SPEED_8_MHz 8000000 |
SPI configuration.
SPI bus
void hV_SDK_begin | ( | ) |
General initialisation.
hV_SDK_Serial initialised at hV_SDK_Serial_Speed
void hV_SDK_delayMicroseconds | ( | uint32_t | us | ) |
Microsecond non-blocking delay.
us | delay, us |
void hV_SDK_delayMilliseconds | ( | uint32_t | ms | ) |
Millisecond non-blocking delay.
ms | delay, ms |
void hV_SDK_exit | ( | uint8_t | code = 0 | ) |
General exit.
code | default = 0 = success, otherwise error |
uint32_t hV_SDK_getMilliseconds | ( | void | ) |
Get milliseconds since start-up.
void hV_SDK_GPIO_begin | ( | void | ) |
GPIO initialisation.
Required for GPIO expander
void hV_SDK_GPIO_define | ( | uint8_t | pin, |
uint8_t | mode ) |
Define GPIO mode.
pin | pin number |
uint8_t hV_SDK_GPIO_read | ( | uint8_t | pin | ) |
Read GPIO.
pin | pin number |
void hV_SDK_GPIO_write | ( | uint8_t | pin, |
uint8_t | value ) |
Write GPIO.
pin | pin number |
value | HIGH = true or LOW = false |
uint32_t hV_SDK_random | ( | uint32_t | maxNumber | ) |
Pseudo-random number.
maxNumber | maximum random number |
void hV_SDK_Serial_begin | ( | uint32_t | speed = 115200 | ) |
Initialise console.
speed | in bps, eg. 115200 |
void hV_SDK_Serial_print | ( | T | text | ) |
Print to serial console.
T | type of the element, [u]int{8|16|32}_t float String char* |
text | element to print |
void hV_SDK_Serial_printf | ( | const char * | format, |
va_list | args ) |
Format and send to console.
format | see https://www.cplusplus.com/reference/cstdio/printf/ for tokens |
args | explicit variadic list required for hV_HAL_Serial_printf() |
void hV_SDK_Serial_println | ( | T | text | ) |
Print to serial console with cr-lf at the end.
T | type of the element: [u]int{8|16|32}_t float String char* |
text | element to print |
void hV_SDK_SPI3_define | ( | uint8_t | pinClock = SCK, |
uint8_t | pinData = MOSI ) |
Set the 3-wire SPI pins.
pinClock | clock, default = SCK |
pinData | combined data, default = MOSI |
uint8_t hV_SDK_SPI3_read | ( | ) |
Read a single byte.
void hV_SDK_SPI3_write | ( | uint8_t | data | ) |
Write a single byte.
data | byte |
void hV_SDK_SPI_begin | ( | uint32_t | speed = 8000000 | ) |
Configure and start SPI.
speed | SPI speed in Hz, hV_HAL_SPI_SPEED = default Other values are SPI_SPEED_4_MHz, SPI_SPEED_8_MHz, SPI_SPEED_16_MHz |
void hV_SDK_SPI_end | ( | ) |
End SPI.
void hV_SDK_SPI_transfer | ( | uint8_t * | data, |
size_t | size ) |
Combined write and read.
data | array of uint8_t to send |
size | length |
uint8_t hV_SDK_SPI_transfer | ( | uint8_t | data | ) |
Combined write and read of a single byte.
data | byte |
void hV_SDK_Wire_begin | ( | ) |
Configure and start Wire bus.
void hV_SDK_Wire_end | ( | ) |
End Wire bus.
void hV_SDK_Wire_transfer | ( | uint8_t | address, |
uint8_t * | dataWrite, | ||
size_t | sizeWrite, | ||
uint8_t * | dataRead = 0, | ||
size_t | sizeRead = 0 ) |
Combined write and read.
[in] | address | I2C device address |
[in] | dataWrite | buffer to write |
[in] | sizeWrite | number of bytes |
[out] | dataRead | buffer to read |
[in] | sizeRead | number of bytes |