image_patterns.h 1.31 KB
Newer Older
1
2
3
4
#ifndef IMAGE_PATTERNS_H
#define IMAGE_PATTERNS_H

#include "patterns.h"
5
#include "frame_buffer_control.h"
6
#include "memory.h"
7

8
9
#ifndef IMG_MAX_NUM_IMAGES
  #error "Please, specify the maximum number of images with the IMG_MAX_NUM_IMAGES macro"
10
11
#endif

12
13
#ifndef IMG_MAX_IMAGE_WIDTH
  #error "Please, specify the maximum image width with the IMG_MAX_IMAGE_WIDTH macro"
14
15
#endif

16
17
#ifndef IMG_MAX_IMAGE_HEIGHT
  #error "Please, specify the maximum image height with the IMG_MAX_IMAGE_HEIGHT macro"
18
19
20
21
#endif

#define IMAGE_GROUP                  0x20

22
23
extern unsigned char img_pattern_data[IMG_MAX_NUM_IMAGES][IMG_MAX_IMAGE_WIDTH][IMG_MAX_IMAGE_HEIGHT][3];

24
void img_patterns_init(TMemory *memory,unsigned short int ram_base_address);
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43

#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

44
void img_general(TLEDArea *area,TIMGDisplayData *pattern_data,unsigned char buffer_id,unsigned short int period,TFBControl *control);
45
46

#endif