25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: dev_iq80321_7seg.c,v 1.3 2006/12/30 13:30:58 debug Exp $ |
* $Id: dev_iq80321_7seg.c,v 1.4 2007/06/15 19:11:15 debug Exp $ |
29 |
* |
* |
30 |
* IQ80321 LED device. Should work with NetBSD's iq80321_7seg.c. |
* COMMENT: IQ80321 LED device |
31 |
|
* |
32 |
|
* Should work with NetBSD's iq80321_7seg.c. |
33 |
* |
* |
34 |
* TODO: Graphical output of LED lines? |
* TODO: Graphical output of LED lines? |
35 |
*/ |
*/ |
50 |
}; |
}; |
51 |
|
|
52 |
|
|
|
/* |
|
|
* dev_iq80321_7seg_access(): |
|
|
*/ |
|
53 |
DEVICE_ACCESS(iq80321_7seg) |
DEVICE_ACCESS(iq80321_7seg) |
54 |
{ |
{ |
55 |
struct iq80321_7seg_data *d = extra; |
struct iq80321_7seg_data *d = extra; |
98 |
|
|
99 |
DEVINIT(iq80321_7seg) |
DEVINIT(iq80321_7seg) |
100 |
{ |
{ |
101 |
struct iq80321_7seg_data *d = malloc(sizeof(struct iq80321_7seg_data)); |
struct iq80321_7seg_data *d; |
102 |
if (d == NULL) { |
|
103 |
fprintf(stderr, "out of memory\n"); |
CHECK_ALLOCATION(d = malloc(sizeof(struct iq80321_7seg_data))); |
|
exit(1); |
|
|
} |
|
104 |
memset(d, 0, sizeof(struct iq80321_7seg_data)); |
memset(d, 0, sizeof(struct iq80321_7seg_data)); |
105 |
|
|
106 |
/* 0xfe840000 and 0xfe850000 */ |
/* 0xfe840000 and 0xfe850000 */ |