Skip to content

Commit 1e44e29

Browse files
leonardocavagnisfacchinm
authored andcommitted
cosmetics of all modules (add file header and sections)
1 parent e910ea9 commit 1e44e29

File tree

13 files changed

+198
-53
lines changed

13 files changed

+198
-53
lines changed

Diff for: libraries/H7_Video/examples/ArduinoLogo/ArduinoLogo.ino

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ INCBIN(test, "/home/user/Downloads/test.bin");
1818
*/
1919

2020
H7_Video Display(480, 800, GIGA_DISPLAY_SHIELD);
21+
//H7_Video Display(720, 480);
2122

2223
void setup() {
2324
Display.begin();

Diff for: libraries/H7_Video/examples/ArduinoLogoDrawing/ArduinoLogoDrawing.ino

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "H7_Video.h" // H7_Video depends on ArduinoGraphics
1010

1111
H7_Video Display(480, 800, GIGA_DISPLAY_SHIELD);
12+
//H7_Video Display(720, 480);
1213

1314
void setup() {
1415
Display.begin();

Diff for: libraries/H7_Video/examples/LVGLDemo/LVGLDemo.ino

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include "giga_touch.h"
44

55
H7_Video Display(480, 800, GIGA_DISPLAY_SHIELD);
6+
//H7_Video Display(720, 480);
67

78
//@TODO: Complete demo with 4 main features
89

Diff for: libraries/H7_Video/src/H7_Video.cpp

+18-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
/**
2+
******************************************************************************
3+
* @file H7_Video.cpp
4+
* @author
5+
* @version
6+
* @date
7+
* @brief
8+
******************************************************************************
9+
*/
10+
11+
/* Includes ------------------------------------------------------------------*/
112
#include "H7_Video.h"
213

314
#include "dsi.h"
@@ -8,10 +19,14 @@
819

920
#if __has_include ("lvgl.h")
1021
#include "lvgl.h"
22+
#endif
1123

24+
/* Private function prototypes -----------------------------------------------*/
25+
#if __has_include ("lvgl.h")
1226
void lvgl_displayFlushing(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * color_p);
1327
#endif
1428

29+
/* Functions -----------------------------------------------------------------*/
1530
H7_Video::H7_Video(int width, int heigth, DisplayShieldModel shield) :
1631
ArduinoGraphics(width, heigth) {
1732
_shield = shield;
@@ -162,4 +177,6 @@ void H7_Video::attachLVGLTouchCb(void (*touch_cb)(void*,void*)) {
162177
indev_drv.read_cb = (void(*)(lv_indev_drv_t *, lv_indev_data_t *))(touch_cb); /* Set your driver function */
163178
lv_indev_t * my_indev = lv_indev_drv_register(&indev_drv); /* Register the driver in LVGL and save the created input device object */
164179
}
165-
#endif
180+
#endif
181+
182+
/**** END OF FILE ****/

Diff for: libraries/H7_Video/src/H7_Video.h

+14
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,30 @@
1+
/**
2+
******************************************************************************
3+
* @file H7_Video.h
4+
* @author
5+
* @version
6+
* @date
7+
* @brief
8+
******************************************************************************
9+
*/
10+
111
#ifndef _H7_VIDEO_H
212
#define _H7_VIDEO_H
313

14+
/* Includes ------------------------------------------------------------------*/
415
#include <ArduinoGraphics.h>
516

17+
/* Exported defines ----------------------------------------------------------*/
618
#define H7_VIDEO_MAX_WIDTH 1280
719
#define H7_VIDEO_MAX_HEIGHT 1024
820

21+
/* Exported enumeration ------------------------------------------------------*/
922
enum DisplayShieldModel {
1023
NONE_SHIELD = 0,
1124
GIGA_DISPLAY_SHIELD = 1
1225
};
1326

27+
/* Class ----------------------------------------------------------------------*/
1428
class H7_Video : public ArduinoGraphics {
1529
public:
1630
H7_Video(int width = H7_VIDEO_MAX_WIDTH, int heigth = H7_VIDEO_MAX_HEIGHT, DisplayShieldModel shield = NONE_SHIELD);

Diff for: libraries/H7_Video/src/anx7625.cpp

+29-16
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
1-
/*
2-
* This file is part of the coreboot project.
3-
*
4-
* Copyright 2019 Analogix Semiconductor.
5-
*
6-
* This program is free software; you can redistribute it and/or modify
7-
* it under the terms of the GNU General Public License as published by
8-
* the Free Software Foundation; version 2 of the License.
9-
*
10-
* This program is distributed in the hope that it will be useful,
11-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13-
* GNU General Public License for more details.
14-
*/
15-
1+
/**
2+
******************************************************************************
3+
* @file anx7625.cpp
4+
* @author
5+
* @version
6+
* @date
7+
* @brief This file is part of the coreboot project.
8+
* Copyright 2019 Analogix Semiconductor.
9+
*
10+
* This program is free software; you can redistribute it and/or modify
11+
* it under the terms of the GNU General Public License as published by
12+
* the Free Software Foundation; version 2 of the License.
13+
*
14+
* This program is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
* GNU General Public License for more details.
18+
*
19+
******************************************************************************
20+
*/
21+
22+
/* Includes ------------------------------------------------------------------*/
1623
#include <Arduino.h>
1724
#include <drivers/DigitalOut.h>
1825
#include <drivers/DigitalInOut.h>
@@ -24,6 +31,7 @@
2431
#include "anx7625.h"
2532
#include "video_modes.h"
2633

34+
/* Private define ------------------------------------------------------------*/
2735
#if 0
2836
#define ANXERROR(format, ...) \
2937
printk(BIOS_ERR, "ERROR: %s: " format, __func__, ##__VA_ARGS__)
@@ -376,6 +384,7 @@ enum AudioWdLen {
376384
#define ONE_BLOCK_SIZE 128
377385
#define FOUR_BLOCK_SIZE (ONE_BLOCK_SIZE*4)
378386

387+
/* Private function prototypes -----------------------------------------------*/
379388
static mbed::DigitalOut video_on(PK_2, 0);
380389
static mbed::DigitalOut video_rst(PJ_3, 0);
381390
static mbed::DigitalInOut otg_on(PJ_6, PIN_INPUT, PullUp, 0);
@@ -412,6 +421,8 @@ static void anx7625_start_dp_work(uint8_t bus);
412421
static int anx7625_hpd_change_detect(uint8_t bus);
413422
static void anx7625_parse_edid(const struct edid *edid, struct display_timing *dt);
414423

424+
/* Functions -----------------------------------------------------------------*/
425+
415426
int anx7625_dp_start(uint8_t bus, const struct edid *edid, enum edid_modes mode) {
416427
int ret;
417428
struct display_timing dt;
@@ -1383,4 +1394,6 @@ void anx7625_parse_edid(const struct edid *edid, struct display_timing *dt) {
13831394
dt->vactive, dt->vsync_len, dt->vfront_porch, dt->vback_porch);
13841395
}
13851396

1386-
#endif // defined(ARDUINO_PORTENTA_H7_M7)
1397+
#endif // defined(ARDUINO_PORTENTA_H7_M7)
1398+
1399+
/**** END OF FILE ****/

Diff for: libraries/H7_Video/src/anx7625.h

+15-9
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
1-
/* SPDX-License-Identifier: GPL-2.0-only */
2-
/*
3-
* Copyright(c) 2016, Analogix Semiconductor. All rights reserved.
4-
*
5-
*/
1+
/**
2+
******************************************************************************
3+
* @file anx7625.h
4+
* @author
5+
* @version
6+
* @date
7+
* @brief
8+
******************************************************************************
9+
*/
610

11+
#ifndef _ANX7625_H
12+
#define _ANX7625_H
13+
14+
/* Includes ------------------------------------------------------------------*/
715
extern "C" {
816
#include <edid.h>
917
}
1018

11-
#ifndef _ANX7625_H
12-
#define _ANX7625_H
13-
19+
/* Exported functions --------------------------------------------------------*/
1420
int anx7625_dp_start(uint8_t bus, const struct edid *edid, enum edid_modes mode = EDID_MODE_AUTO);
1521
int anx7625_dp_get_edid(uint8_t bus, struct edid *out);
1622
int anx7625_init(uint8_t bus);
@@ -19,4 +25,4 @@ int anx7625_get_cc_status(uint8_t bus, uint8_t *cc_status);
1925
int anx7625_read_system_status(uint8_t bus, uint8_t *sys_status);
2026
bool anx7625_is_power_provider(uint8_t bus);
2127

22-
#endif /* _ANX7625_H */
28+
#endif /* _ANX7625_H */

Diff for: libraries/H7_Video/src/dsi.cpp

+23-5
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,29 @@
1+
/**
2+
******************************************************************************
3+
* @file dsi.cpp
4+
* @author
5+
* @version
6+
* @date
7+
* @brief
8+
******************************************************************************
9+
*/
10+
11+
/* Includes ------------------------------------------------------------------*/
112
#include <Arduino.h>
213

314
#include "dsi.h"
415
#include "SDRAM.h"
516

6-
#define LCD_MAX_X_SIZE 1280
7-
#define LCD_MAX_Y_SIZE 1024
17+
/* Private define ------------------------------------------------------------*/
18+
#define LCD_MAX_X_SIZE 1280
19+
#define LCD_MAX_Y_SIZE 1024
820

921
#define BYTES_PER_PIXEL 2
1022
#define FB_BASE_ADDRESS ((uint32_t)SDRAM_START_ADDRESS)
1123
#define FB_ADDRESS_0 (FB_BASE_ADDRESS)
1224
#define FB_ADDRESS_1 (FB_BASE_ADDRESS + (LCD_MAX_X_SIZE * LCD_MAX_Y_SIZE * BYTES_PER_PIXEL))
1325

14-
DSI_HandleTypeDef dsi;
15-
26+
/* Private variables ---------------------------------------------------------*/
1627
static DMA2D_HandleTypeDef dma2d;
1728
static LTDC_HandleTypeDef ltdc;
1829

@@ -24,9 +35,14 @@ static uint32_t __ALIGNED(32) L8_CLUT[256];
2435

2536
static uint32_t pend_buffer = 0;
2637

38+
/* Exported variables --------------------------------------------------------*/
39+
DSI_HandleTypeDef dsi;
40+
41+
/* Private function prototypes -----------------------------------------------*/
2742
static void dsi_fillBuffer(uint32_t LayerIndex, void *pDst, uint32_t xSize, uint32_t ySize, uint32_t OffLine, uint32_t ColorIndex);
2843
static void dsi_layerInit(uint16_t LayerIndex, uint32_t FB_Address);
2944

45+
/* Functions -----------------------------------------------------------------*/
3046
int dsi_init(uint8_t bus, struct edid *edid, struct display_timing *dt) {
3147
#ifdef ARDUINO_GIGA
3248
static const uint32_t DSI_PLLNDIV = 125;
@@ -357,4 +373,6 @@ void dsi_fillBuffer(uint32_t LayerIndex, void *pDst, uint32_t xSize, uint32_t yS
357373
}
358374
}
359375
}
360-
}
376+
}
377+
378+
/**** END OF FILE ****/

Diff for: libraries/H7_Video/src/dsi.h

+23-12
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1+
/**
2+
******************************************************************************
3+
* @file dsi.h
4+
* @author
5+
* @version
6+
* @date
7+
* @brief
8+
******************************************************************************
9+
*/
10+
11+
/* Includes ------------------------------------------------------------------*/
112
#ifndef _DSI_H
213
#define _DSI_H
314

4-
extern DSI_HandleTypeDef dsi;
5-
15+
/* Exported struct -----------------------------------------------------------*/
616
struct display_timing {
717
unsigned int pixelclock;
818
unsigned int hactive;
@@ -17,16 +27,17 @@ struct display_timing {
1727
unsigned int vpol : 1;
1828
};
1929

20-
int dsi_init(uint8_t bus, struct edid *edid, struct display_timing *dt);
21-
22-
void dsi_lcdClear(uint32_t color);
23-
void dsi_lcdDrawImage(void *pSrc, void *pDst, uint32_t xSize, uint32_t ySize, uint32_t ColorMode);
24-
void dsi_lcdFillArea(void *pDst, uint32_t xSize, uint32_t ySize, uint32_t ColorMode);
25-
26-
void dsi_configueCLUT(uint32_t* clut);
30+
/* Exported variables --------------------------------------------------------*/
31+
extern DSI_HandleTypeDef dsi;
2732

28-
uint32_t dsi_getNextFrameBuffer(void);
29-
uint32_t dsi_getCurrentFrameBuffer(void);
30-
uint32_t dsi_getFramebufferEnd(void);
33+
/* Exported functions --------------------------------------------------------*/
34+
int dsi_init(uint8_t bus, struct edid *edid, struct display_timing *dt);
35+
void dsi_lcdClear(uint32_t color);
36+
void dsi_lcdDrawImage(void *pSrc, void *pDst, uint32_t xSize, uint32_t ySize, uint32_t ColorMode);
37+
void dsi_lcdFillArea(void *pDst, uint32_t xSize, uint32_t ySize, uint32_t ColorMode);
38+
void dsi_configueCLUT(uint32_t* clut);
39+
uint32_t dsi_getNextFrameBuffer(void);
40+
uint32_t dsi_getCurrentFrameBuffer(void);
41+
uint32_t dsi_getFramebufferEnd(void);
3142

3243
#endif /* _DSI_H */

Diff for: libraries/H7_Video/src/st7701.cpp

+26-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
1+
/**
2+
******************************************************************************
3+
* @file st7701.cpp
4+
* @author
5+
* @version
6+
* @date
7+
* @brief
8+
******************************************************************************
9+
*/
10+
11+
/* Includes ------------------------------------------------------------------*/
112
#include "Arduino.h"
213
#include "st7701.h"
314
#include "dsi.h"
415
#include "video_modes.h"
516

17+
/* Private define ------------------------------------------------------------*/
618
/* Command2 BKx selection command */
719
#define DSI_CMD2BKX_SEL 0xFF
820
#define DSI_CMD2BK1_SEL 0x11
@@ -31,28 +43,33 @@
3143
#define MIPI_DCS_SOFT_RESET 0x01
3244
#define MIPI_DCS_EXIT_SLEEP_MODE 0x11
3345

46+
#define hdsi_eval dsi
47+
48+
#define LCD_ST7701_ID 0x00 // VC (Virtual channel, for using muliple displays)
49+
50+
#define Delay(x) delay(x)
51+
52+
/* Private macro -------------------------------------------------------------*/
3453
#define SSD_MODE(a,b)
3554
#define Set_POWER(a,b,c,d)
3655
#define Set_STANDBY()
3756
#define Set_BOOST(a,b,c,d)
3857
#define Set_RESET(a,b)
3958
#define SSD_LANE(a,b)
4059

41-
#define hdsi_eval dsi
42-
43-
#define LCD_ST7701_ID 0x00 // VC (Virtual channel, for using muliple displays)
44-
45-
#define Delay(x) delay(x)
46-
60+
/* Private variables ---------------------------------------------------------*/
4761
const uint16_t _E5[17] = {0xE5,0x0E,0x2D,0xA0,0xa0,0x10,0x2D,0xA0,0xA0,0x0A,0x2D,0xA0,0xA0,0x0C,0x2D,0xA0,0xA0};
4862
const uint16_t _E8[17] = {0xE8,0x0D,0x2D,0xA0,0xA0,0x0F,0x2D,0xA0,0xA0,0x09,0x2D,0xA0,0xA0,0x0B,0x2D,0xA0,0xA0};
4963
const uint16_t _ED[17] = {0xED,0xAB,0x89,0x76,0x54,0x01,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x10,0x45,0x67,0x98,0xBA};
5064

65+
/* Private function prototypes -----------------------------------------------*/
5166
static void Generic_Long_Write(uint8_t* pdata, int length);
5267
static void DCS_Short_Write_NP(uint8_t data0);
5368
static void Generic_Short_Write_1P(uint8_t data0, uint8_t data1);
5469
static void DCS_Short_Read_NP(uint8_t data0, int length, uint8_t* p_data);
5570

71+
/* Functions -----------------------------------------------------------------*/
72+
5673
void st7701_init(enum edid_modes mode) {
5774
struct edid _edid;
5875
struct display_timing dt;
@@ -241,4 +258,6 @@ void Generic_Long_Write(uint8_t* pdata, int length) {
241258

242259
void DCS_Short_Read_NP(uint8_t data0, int length, uint8_t* p_data) {
243260
HAL_DSI_Read(&hdsi_eval, LCD_ST7701_ID, p_data, length, DSI_DCS_SHORT_PKT_READ, data0, NULL);
244-
}
261+
}
262+
263+
/**** END OF FILE ****/

0 commit comments

Comments
 (0)