image_patterns.h 1.27 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

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

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

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

#define IMAGE_GROUP                  0x20

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

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

#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

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

#endif