Ultibo API
C/C++ API for Ultibo Core
Loading...
Searching...
No Matches
hyperpixel.h
Go to the documentation of this file.
1/*
2 * This file is part of the Ultibo project, https://ultibo.org/
3 *
4 * The MIT License (MIT)
5 *
6 * Copyright (c) 2026 Garry Wood <garry@softoz.com.au>
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files (the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 * THE SOFTWARE.
25 */
26#ifndef _ULTIBO_HYPERPIXEL_H
27#define _ULTIBO_HYPERPIXEL_H
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33#include "ultibo/gpio.h"
34
37#define HYPERPIXEL40_RECTANGLE 0
38#define HYPERPIXEL40_SQUARE 1
39#define HYPERPIXEL40_SQUARE2021 2
40#define HYPERPIXEL21_ROUND 3
41
43#define HYPERPIXEL_GPIO_PIN_FUNCTION GPIO_FUNCTION_ALT2
44#define HYPERPIXEL_GPIO_PIN_PULL GPIO_PULL_NONE
45#define HYPERPIXEL_GPIO_PIN_COUNT 22
46static const uint32_t HYPERPIXEL_GPIO_PINS[HYPERPIXEL_GPIO_PIN_COUNT] = {
57
64
71
73#define HYPERPIXEL_SPI_FUNCTION GPIO_FUNCTION_OUT
74#define HYPERPIXEL_SPI_PULL GPIO_PULL_NONE
75#define HYPERPIXEL_SPI_CLK GPIO_PIN_27
76#define HYPERPIXEL_SPI_MOSI GPIO_PIN_26
77#define HYPERPIXEL_SPI_CS GPIO_PIN_18
78#define HYPERPIXEL_SPI_DELAY 100
79#define HYPERPIXEL_SPI_WAIT 120
80
81#define HYPERPIXEL_SPI_CLK_ALT GPIO_PIN_11
82#define HYPERPIXEL_SPI_MOSI_ALT GPIO_PIN_10
83
84#define HYPERPIXEL_SPI_DELAY_ALT 10
85#define HYPERPIXEL_SPI_WAIT_ALT 200
86
88#define HYPERPIXEL_I2C_SDA GPIO_PIN_10
89#define HYPERPIXEL_I2C_SCL GPIO_PIN_11
90#define HYPERPIXEL_I2C_DELAY 4
91
93#define HYPERPIXEL_BACKLIGHT_FUNCTION GPIO_FUNCTION_OUT
94#define HYPERPIXEL_BACKLIGHT_PULL GPIO_PULL_NONE
95#define HYPERPIXEL_BACKLIGHT_PIN GPIO_PIN_19
96
98#define HYPERPIXEL_TOUCH_INTERRUPT_TRIGGER GPIO_TRIGGER_FALLING
99#define HYPERPIXEL_TOUCH_INTERRUPT_FUNCTION GPIO_FUNCTION_IN
100#define HYPERPIXEL_TOUCH_INTERRUPT_PULL GPIO_PULL_UP
101#define HYPERPIXEL_TOUCH_INTERRUPT_PIN GPIO_PIN_27
102
107{
109 uint32_t fsel;
110 uint32_t pull;
111 uint32_t clk;
112 uint32_t mosi;
113 uint32_t cs;
114 uint32_t wait;
115 uint32_t delay;
116};
117
119uint32_t STDCALL hyperpixel_initialize(uint32_t model);
120
121#ifdef __cplusplus
122}
123#endif
124
125#endif // _ULTIBO_HYPERPIXEL_H
#define GPIO_PIN_5
Definition globalconst.h:1314
#define GPIO_PIN_17
Definition globalconst.h:1326
#define GPIO_PIN_13
Definition globalconst.h:1322
#define GPIO_PIN_0
Definition globalconst.h:1309
#define GPIO_PIN_25
Definition globalconst.h:1334
#define GPIO_PIN_14
Definition globalconst.h:1323
#define GPIO_PIN_7
Definition globalconst.h:1316
#define GPIO_PIN_9
Definition globalconst.h:1318
#define GPIO_PIN_16
Definition globalconst.h:1325
#define GPIO_PIN_23
Definition globalconst.h:1332
#define GPIO_PIN_1
Definition globalconst.h:1310
#define GPIO_PIN_2
Definition globalconst.h:1311
#define GPIO_PIN_15
Definition globalconst.h:1324
#define GPIO_PIN_6
Definition globalconst.h:1315
#define GPIO_PIN_12
Definition globalconst.h:1321
#define GPIO_PIN_20
Definition globalconst.h:1329
#define GPIO_PIN_24
Definition globalconst.h:1333
#define GPIO_PIN_21
Definition globalconst.h:1330
#define GPIO_PIN_22
Definition globalconst.h:1331
#define GPIO_PIN_4
Definition globalconst.h:1313
#define GPIO_PIN_3
Definition globalconst.h:1312
#define GPIO_PIN_8
Definition globalconst.h:1317
#define STDCALL
Definition globaltypes.h:45
struct _GPIO_DEVICE GPIO_DEVICE
Forward declared for GPIOPin.
Definition gpio.h:85
#define HYPERPIXEL_GPIO_PIN_COUNT
Definition hyperpixel.h:45
uint32_t STDCALL hyperpixel_initialize(uint32_t model)
struct _HYPERPIXEL_DATA HYPERPIXEL_DATA
Definition hyperpixel.h:105
Definition hyperpixel.h:107
GPIO_DEVICE * device
The GPIO device to use.
Definition hyperpixel.h:108
uint32_t fsel
The GPIO function select value.
Definition hyperpixel.h:109
uint32_t clk
The CLK pin for software SPI.
Definition hyperpixel.h:111
uint32_t delay
Clock delay time in microseconds.
Definition hyperpixel.h:115
uint32_t cs
The CS pin for software SPI.
Definition hyperpixel.h:113
uint32_t mosi
The MOSI pin for software SPI.
Definition hyperpixel.h:112
uint32_t wait
Wait time in milliseconds before display on.
Definition hyperpixel.h:114
uint32_t pull
The GPIO pull select value.
Definition hyperpixel.h:110