Loading...
Searching...
No Matches
dsp0401.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2017 Inria
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
19
20#include <inttypes.h>
21#include <stdint.h>
22#include "periph/gpio.h"
23#include "periph/pwm.h"
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
32enum {
38};
39
43typedef struct {
44 gpio_t sdi;
45 gpio_t clk;
46 gpio_t lat;
48 uint8_t pwm_channel;
49 uint8_t brightness;
50 uint8_t module_count;
52
56typedef struct {
58} dsp0401_t;
59
72int dsp0401_init(dsp0401_t *dev, const dsp0401_params_t *params);
73
80void dsp0401_display_text(const dsp0401_t *dev, char *text);
81
88
96void dsp0401_scroll_text(const dsp0401_t *dev, char *text, uint16_t delay);
97
98#ifdef __cplusplus
99}
100#endif
101
Low-level GPIO peripheral driver interface definitions.
void dsp0401_clear_text(const dsp0401_t *dev)
Clear the text displayed on the DSP0401.
void dsp0401_scroll_text(const dsp0401_t *dev, char *text, uint16_t delay)
Scroll the given text on the DSP0401.
int dsp0401_init(dsp0401_t *dev, const dsp0401_params_t *params)
Initialize the given DSP0401.
void dsp0401_display_text(const dsp0401_t *dev, char *text)
Display the given text on the DSP0401.
@ DSP0401_ERR_CLK_GPIO
Something went wrong with CLK GPIO.
Definition dsp0401.h:34
@ DSP0401_ERR_PWM
Something went wrong with PWM.
Definition dsp0401.h:37
@ DSP0401_OK
All ok.
Definition dsp0401.h:33
@ DSP0401_ERR_SDI_GPIO
Something went wrong with SDI GPIO.
Definition dsp0401.h:35
@ DSP0401_ERR_LAT_GPIO
Something went wrong with LAT GPIO.
Definition dsp0401.h:36
uint_fast8_t pwm_t
Default PWM type definition.
Definition pwm.h:88
void delay(unsigned long msec)
Sleep for a given amount of time [milliseconds].
Adds include for missing inttype definitions.
Low-level PWM peripheral driver interface definitions.
Device initialization parameters.
Definition dsp0401.h:43
uint8_t pwm_channel
PWM device channel.
Definition dsp0401.h:48
gpio_t lat
Latch pin.
Definition dsp0401.h:46
pwm_t pwm
PWM device.
Definition dsp0401.h:47
gpio_t clk
Clock pin.
Definition dsp0401.h:45
uint8_t module_count
Number of connected modules.
Definition dsp0401.h:50
gpio_t sdi
Data input pin.
Definition dsp0401.h:44
uint8_t brightness
LED brightness.
Definition dsp0401.h:49
Device descriptor for the DSP0401.
Definition dsp0401.h:56
dsp0401_params_t params
Device parameters.
Definition dsp0401.h:57