Loading...
Searching...
No Matches
dsp0401.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2017 Inria
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
8
21#ifndef DSP0401_H
22#define DSP0401_H
23
24#include <inttypes.h>
25#include <stdint.h>
26#include "periph/gpio.h"
27#include "periph/pwm.h"
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
36enum {
42};
43
47typedef struct {
48 gpio_t sdi;
49 gpio_t clk;
50 gpio_t lat;
52 uint8_t pwm_channel;
53 uint8_t brightness;
54 uint8_t module_count;
56
60typedef struct {
62} dsp0401_t;
63
76int dsp0401_init(dsp0401_t *dev, const dsp0401_params_t *params);
77
84void dsp0401_display_text(const dsp0401_t *dev, char *text);
85
92
100void dsp0401_scroll_text(const dsp0401_t *dev, char *text, uint16_t delay);
101
102#ifdef __cplusplus
103}
104#endif
105
106#endif /* DSP0401_H */
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:38
@ DSP0401_ERR_PWM
Something went wrong with PWM.
Definition dsp0401.h:41
@ DSP0401_OK
All ok.
Definition dsp0401.h:37
@ DSP0401_ERR_SDI_GPIO
Something went wrong with SDI GPIO.
Definition dsp0401.h:39
@ DSP0401_ERR_LAT_GPIO
Something went wrong with LAT GPIO.
Definition dsp0401.h:40
uint_fast8_t pwm_t
Default PWM type definition.
Definition pwm.h:92
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:47
uint8_t pwm_channel
PWM device channel.
Definition dsp0401.h:52
gpio_t lat
Latch pin.
Definition dsp0401.h:50
pwm_t pwm
PWM device.
Definition dsp0401.h:51
gpio_t clk
Clock pin.
Definition dsp0401.h:49
uint8_t module_count
Number of connected modules.
Definition dsp0401.h:54
gpio_t sdi
Data input pin.
Definition dsp0401.h:48
uint8_t brightness
LED brightness.
Definition dsp0401.h:53
Device descriptor for the DSP0401.
Definition dsp0401.h:60
dsp0401_params_t params
Device parameters.
Definition dsp0401.h:61