image_patterns.h 1.01 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef IMAGE_PATTERNS_H
#define IMAGE_PATTERNS_H

#include "patterns.h"
#include "memory.h"

#ifndef MAX_NUM_IMAGES
  #define MAX_NUM_IMAGES             1
#endif

#ifndef MAX_IMAGE_WIDTH
  #define MAX_IMAGE_WIDTH            15
#endif

#ifndef MAX_IMAGE_HEIGHT
  #define MAX_IMAGE_HEIGHT           15
#endif

#include "image_patterns_registers.h"

#define IMAGE_GROUP                  0x20

unsigned char img_patterns_init(TMemory *memory);

#pragma pack (push, 1)
typedef struct
{
  short int start_row;
  short int start_col;
  unsigned char buffer_id;
  unsigned char waveform_index;
  unsigned char motion_index;
}TIMGDisplayData;
#pragma pack (pop)

#define IMG_ID_OFFSET                   0x01
#define IMG_START_ROW_OFFSET            0
#define IMG_START_COL_OFFSET            2
#define IMG_BUFFER_ID_OFFSET            4
#define IMG_WF_INDEX_OFFSET             5
#define IMG_MTN_INDEX_OFFSET            6

void img_general(TLEDArea *area,TIMGDisplayData *pattern_data,unsigned short int period,unsigned char *buffer);

#endif