Commit 66ac77f4 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Split the pattern related headers into two parts to be used from the C++...

Split the pattern related headers into two parts to be used from the C++ driver without low level firmware dependencies.
parent 3d3856c0
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#define IMAGE_PATTERNS_H #define IMAGE_PATTERNS_H
#include "patterns.h" #include "patterns.h"
#include "image_patterns_common.h"
#include "frame_buffer_control.h" #include "frame_buffer_control.h"
#include "memory.h" #include "memory.h"
...@@ -17,8 +18,6 @@ ...@@ -17,8 +18,6 @@
#error "Please, specify the maximum image height with the IMG_MAX_IMAGE_HEIGHT macro" #error "Please, specify the maximum image height with the IMG_MAX_IMAGE_HEIGHT macro"
#endif #endif
#define IMAGE_GROUP 0x20
extern unsigned char img_pattern_data[IMG_MAX_NUM_IMAGES][IMG_MAX_IMAGE_WIDTH][IMG_MAX_IMAGE_HEIGHT][3]; extern unsigned char img_pattern_data[IMG_MAX_NUM_IMAGES][IMG_MAX_IMAGE_WIDTH][IMG_MAX_IMAGE_HEIGHT][3];
void img_patterns_init(TMemory *memory,unsigned short int ram_base_address); void img_patterns_init(TMemory *memory,unsigned short int ram_base_address);
...@@ -34,13 +33,6 @@ typedef struct ...@@ -34,13 +33,6 @@ typedef struct
}TIMGDisplayData; }TIMGDisplayData;
#pragma pack (pop) #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 char buffer_id,unsigned short int period,TFBControl *control); void img_general(TLEDArea *area,TIMGDisplayData *pattern_data,unsigned char buffer_id,unsigned short int period,TFBControl *control);
#endif #endif
#ifndef IMAGE_PATTERNS_COMMON_H
#define IMAGE_PATTERNS_COMMON_H
#define IMAGE_GROUP 0x20
#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
#endif
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#define _MOTION_PATTERNS_H #define _MOTION_PATTERNS_H
#include "patterns.h" #include "patterns.h"
#include "motion_patterns_common.h"
#include "frame_buffer_control.h" #include "frame_buffer_control.h"
#ifndef MTN_X_LED_SPACING #ifndef MTN_X_LED_SPACING
...@@ -12,10 +13,6 @@ ...@@ -12,10 +13,6 @@
#error "Please, specify the LED spacing in mm in the Y direction with the MTN_Y_LED_SPACING macro" #error "Please, specify the LED spacing in mm in the Y direction with the MTN_Y_LED_SPACING macro"
#endif #endif
#define MOTION_GROUP 0x30
typedef enum {MTN_RAMP=0x01,MTN_TRIANGLE=0x02,MTN_CIRCLE=0x03,MTN_NONE=0x04} mtn_id_t;
typedef struct typedef struct
{ {
short int max_coord_x; short int max_coord_x;
...@@ -63,12 +60,6 @@ typedef struct ...@@ -63,12 +60,6 @@ typedef struct
}TMotion; }TMotion;
#pragma pack (pop) #pragma pack (pop)
#define MTN_ID_OFFSET 0
#define MTN_SPEED_OFFSET 1
#define MTN_DATA 3
#define MTN_CURRENT_COL_OFFSET 12
#define MTN_CURRENT_ROW_OFFSET 14
#define MTN_CURRENT_TIME_OFFSET 16
void mtn_general(TLEDArea *area,TMotion *pattern_data,unsigned char buffer_id,unsigned short int period,TFBControl *control); void mtn_general(TLEDArea *area,TMotion *pattern_data,unsigned char buffer_id,unsigned short int period,TFBControl *control);
void mtn_compute(TMotion *pattern_data); void mtn_compute(TMotion *pattern_data);
......
#ifndef MOTION_PATTERNS_COMMON_H
#define MOTION_PATTERNS_COMMON_H
#define MOTION_GROUP 0x30
typedef enum {MTN_RAMP=0x01,MTN_TRIANGLE=0x02,MTN_CIRCLE=0x03,MTN_NONE=0x04} mtn_id_t;
#define MTN_ID_OFFSET 0
#define MTN_SPEED_OFFSET 1
#define MTN_DATA 3
#define MTN_CURRENT_COL_OFFSET 12
#define MTN_CURRENT_ROW_OFFSET 14
#define MTN_CURRENT_TIME_OFFSET 16
#endif
...@@ -2,12 +2,9 @@ ...@@ -2,12 +2,9 @@
#define WAVEFORM_PATTERNS_H #define WAVEFORM_PATTERNS_H
#include "patterns.h" #include "patterns.h"
#include "waveform_patterns_common.h"
#include "frame_buffer_control.h" #include "frame_buffer_control.h"
#define WAVEFORM_GROUP 0x10
typedef enum {WF_SINE=0x01,WF_SQUARE=0x02,WF_RAMP=0x03,WF_TRIANGLE=0x04,WF_NONE=0x05} wf_id_t;
typedef struct typedef struct
{ {
unsigned short int phase; unsigned short int phase;
...@@ -49,17 +46,6 @@ typedef struct ...@@ -49,17 +46,6 @@ typedef struct
}TWaveform; }TWaveform;
#pragma pack (pop) #pragma pack (pop)
#define WF_ID_OFFSET 0
#define WF_MAX_R_OFFSET 1
#define WF_MAX_G_OFFSET 2
#define WF_MAX_B_OFFSET 3
#define WF_MIN_R_OFFSET 4
#define WF_MIN_G_OFFSET 5
#define WF_MIN_B_OFFSET 6
#define WF_PERIOD_OFFSET 7
#define WF_DATA_OFFSET 9
#define WF_ACTIVE 11
#define WF_CURRENT_PERIOD_OFFSET 12
void wf_general(TLEDArea *area,TWaveform *pattern_data,unsigned char buffer_id,unsigned short int period,TFBControl *control); void wf_general(TLEDArea *area,TWaveform *pattern_data,unsigned char buffer_id,unsigned short int period,TFBControl *control);
TPixelRGB wf_pixel(TWaveform *pattern_data); TPixelRGB wf_pixel(TWaveform *pattern_data);
......
#ifndef WAVEFORM_PATTERNS_COMMON_H
#define WAVEFORM_PATTERNS_COMMON_H
#define WAVEFORM_GROUP 0x10
typedef enum {WF_SINE=0x01,WF_SQUARE=0x02,WF_RAMP=0x03,WF_TRIANGLE=0x04,WF_NONE=0x05} wf_id_t;
#define WF_ID_OFFSET 0
#define WF_MAX_R_OFFSET 1
#define WF_MAX_G_OFFSET 2
#define WF_MAX_B_OFFSET 3
#define WF_MIN_R_OFFSET 4
#define WF_MIN_G_OFFSET 5
#define WF_MIN_B_OFFSET 6
#define WF_PERIOD_OFFSET 7
#define WF_DATA_OFFSET 9
#define WF_ACTIVE 11
#define WF_CURRENT_PERIOD_OFFSET 12
#endif
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment