PICSimLab - Programmable IC Simulator Laboratory
0.9.2
PICSimLab - API
Loading...
Searching...
No Matches
ldd_max72xx.h
1
/* ########################################################################
2
3
PICSimLab - Programmable IC Simulator Laboratory
4
5
########################################################################
6
7
Copyright (c) : 2010-2024 Luis Claudio GambĂ´a Lopes <lcgamboa@yahoo.com>
8
9
This program is free software; you can redistribute it and/or modify
10
it under the terms of the GNU General Public License as published by
11
the Free Software Foundation; either version 2, or (at your option)
12
any later version.
13
14
This program is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
GNU General Public License for more details.
18
19
You should have received a copy of the GNU General Public License
20
along with this program; if not, write to the Free Software
21
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22
23
For e-mail suggestions : lcgamboa@yahoo.com
24
######################################################################## */
25
26
#ifndef LDD_MAX72XX
27
#define LDD_MAX72XX
28
29
#include "../lib/draw.h"
30
#include "bitbang_spi.h"
31
32
/* pinout
33
1 DIN
34
2 DIG0
35
3 DIG4
36
4 GND
37
5 DIG6
38
6 DIG2
39
7 DIG3
40
8 DIG7
41
9 GND
42
10 DIG5
43
11 DIG1
44
12 /CS
45
13 CLK
46
14 SEGA
47
15 SEGF
48
16 SEGB
49
17 SEGG
50
18 ISET
51
19 VCC
52
20 SEGC
53
21 SEGE
54
22 SEGDP
55
23 SEGD
56
24 DOUT
57
*/
58
59
typedef
struct
{
60
unsigned
char
ram[8];
61
bitbang_spi_t
bb_spi;
62
unsigned
short
ancs;
63
unsigned
short
dat;
64
unsigned
char
update;
65
unsigned
short
dout;
66
}
ldd_max72xx_t
;
67
68
void
ldd_max72xx_rst(
ldd_max72xx_t
* ldd);
69
void
ldd_max72xx_init(
ldd_max72xx_t
* ldd);
70
void
ldd_max72xx_update(
ldd_max72xx_t
* ldd);
71
72
unsigned
char
ldd_max72xx_io(
ldd_max72xx_t
* ldd,
unsigned
char
din,
unsigned
char
clk,
unsigned
char
ncs);
73
74
void
ldd_max72xx_draw(
ldd_max72xx_t
* ldd, CanvasCmd_ft CanvasCmd,
int
x1,
int
y1,
int
w1,
int
h1,
int
picpwr,
int
angle,
75
int
mode);
76
77
#endif
// LDD_MAX72XX
bitbang_spi_t
Definition
bitbang_spi.h:35
ldd_max72xx_t
Definition
ldd_max72xx.h:59
src
devices
ldd_max72xx.h
Generated by
1.9.8