DSP0401

Device driver interface for the DSP0401 alphanumeric display.

enum @118
DSP0401_OK = 0
All ok.
DSP0401_ERR_CLK_GPIO
Something went wrong with CLK GPIO.
DSP0401_ERR_SDI_GPIO
Something went wrong with SDI GPIO.
DSP0401_ERR_LAT_GPIO
Something went wrong with LAT GPIO.
DSP0401_ERR_PWM
Something went wrong with PWM.
int dsp0401_init(dsp0401_t * dev, const dsp0401_params_t * params)

Initialize the given DSP0401.

Parameters

dev:Initialized device descriptor of DSP0401 device
params:Device parameters to use

Return values

  • DSP0401_OK if everything is good
  • -DSP0401_ERR_CLK_GPIO if an error occured during CLK GPIO initialization
  • -DSP0401_ERR_SDI_GPIO if an error occured during SDI GPIO initialization
  • -DSP0401_ERR_LAT_GPIO if an error occured during LAT GPIO initialization
  • -DSP0401_ERR_PWM if an error occured during PWM initialization
void dsp0401_display_text(const dsp0401_t * dev, char * text)

Display the given text on the DSP0401.

Parameters

dev:Device descriptor of the DSP0401 device
text:The text to display

void dsp0401_clear_text(const dsp0401_t * dev)

Clear the text displayed on the DSP0401.

Parameters

dev:Device descriptor of the DSP0401 device

void dsp0401_scroll_text(const dsp0401_t * dev, char * text, uint16_t delay)

Scroll the given text on the DSP0401.

Parameters

dev:Device descriptor of the DSP0401 device
text:The text to scroll on the display
delay:Delay in ms between each horizontal move

struct dsp0401_params_t

Device initialization parameters.

gpio.h::gpio_t sdi

Data input pin.

gpio.h::gpio_t clk

Clock pin.

gpio.h::gpio_t lat

Latch pin.

pwm.h::pwm_t pwm

PWM device.

uint8_t pwm_channel

PWM device channel.

uint8_t brightness

LED brightness.

uint8_t module_count

Number of connected modules.

struct dsp0401_t

Device descriptor for the DSP0401.

dsp0401_params_t params

Device parameters.