summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bsp/stm32/stm32f072-st-nucleo/applications/arduino/pins_arduino.c18
-rw-r--r--bsp/stm32/stm32f072-st-nucleo/applications/arduino/pins_arduino.h1
-rw-r--r--bsp/stm32/stm32l475-atk-pandora/applications/arduino/pins_arduino.c10
-rw-r--r--bsp/stm32/stm32l475-atk-pandora/applications/arduino/pins_arduino.h3
-rw-r--r--bsp/stm32/stm32l475-atk-pandora/board/CubeMX_Config/STM32L475VE.ioc32
-rw-r--r--bsp/stm32/stm32l475-atk-pandora/board/ports/lcd/demo/lcd_sample.c7
-rw-r--r--bsp/stm32/stm32l475-atk-pandora/board/ports/lcd/drv_lcd.c7
-rw-r--r--bsp/stm32/stm32l475-atk-pandora/board/ports/lcd/lcd_qrcode.c2
-rw-r--r--bsp/stm32/stm32l475-atk-pandora/board/ports/lcd/lcd_qrcode.h4
9 files changed, 47 insertions, 37 deletions
diff --git a/bsp/stm32/stm32f072-st-nucleo/applications/arduino/pins_arduino.c b/bsp/stm32/stm32f072-st-nucleo/applications/arduino/pins_arduino.c
index 3453369b8f..9f71da8711 100644
--- a/bsp/stm32/stm32f072-st-nucleo/applications/arduino/pins_arduino.c
+++ b/bsp/stm32/stm32f072-st-nucleo/applications/arduino/pins_arduino.c
@@ -20,11 +20,11 @@
*/
const pin_map_t pin_map_table[]=
{
- {D0, GET_PIN(A,3)}, /* RX */
- {D1, GET_PIN(A,2)}, /* TX */
+ {D0}, /* RX */
+ {D1}, /* TX */
{D2, GET_PIN(A,10)},
{D3, GET_PIN(B,3), "pwm2", 2}, /* PWM */
- {D4, GET_PIN(B,5)}, /* D4 */
+ {D4, GET_PIN(B,5)},
{D5, GET_PIN(B,4), "pwm3", 1}, /* PWM */
{D6, GET_PIN(B,10), "pwm2", 3}, /* PWM */
{D7, GET_PIN(A,8)},
@@ -36,12 +36,12 @@ const pin_map_t pin_map_table[]=
{D13, GET_PIN(A,5)},
{D14, GET_PIN(B,9)},
{D15, GET_PIN(B,8)},
- {A0, GET_PIN(A,0), "adc1", 0},
- {A1, GET_PIN(A,1), "adc1", 1},
- {A2, GET_PIN(A,4), "adc1", 4},
- {A3, GET_PIN(B,0), "adc1", 8},
- {A4, GET_PIN(C,1), "adc1", 11},
- {A5, GET_PIN(C,0), "adc1", 10}
+ {A0, GET_PIN(A,0), "adc1", 0}, /* ADC */
+ {A1, GET_PIN(A,1), "adc1", 1}, /* ADC */
+ {A2, GET_PIN(A,4), "adc1", 4}, /* ADC */
+ {A3, GET_PIN(B,0), "adc1", 8}, /* ADC */
+ {A4, GET_PIN(C,1), "adc1", 11}, /* ADC */
+ {A5, GET_PIN(C,0), "adc1", 10} /* ADC */
};
/* initialization for BSP; maybe a blank function */
diff --git a/bsp/stm32/stm32f072-st-nucleo/applications/arduino/pins_arduino.h b/bsp/stm32/stm32f072-st-nucleo/applications/arduino/pins_arduino.h
index 2b8022e333..e62cec6635 100644
--- a/bsp/stm32/stm32f072-st-nucleo/applications/arduino/pins_arduino.h
+++ b/bsp/stm32/stm32f072-st-nucleo/applications/arduino/pins_arduino.h
@@ -36,7 +36,6 @@
#define LED_BUILTIN D13 /* Built-in LED */
-#define ARDUINO_PINOUT_PWM_MAX 5 /* This Arduino variant has 5 PWM pins */
#define ARDUINO_PWM_HZ 500 /* Arduino UNO's PWM is around 500Hz */
#define ARDUINO_DEFAULT_IIC_BUS_NAME "i2c4"
diff --git a/bsp/stm32/stm32l475-atk-pandora/applications/arduino/pins_arduino.c b/bsp/stm32/stm32l475-atk-pandora/applications/arduino/pins_arduino.c
index 6fb99d4898..796db0cd2d 100644
--- a/bsp/stm32/stm32l475-atk-pandora/applications/arduino/pins_arduino.c
+++ b/bsp/stm32/stm32l475-atk-pandora/applications/arduino/pins_arduino.c
@@ -44,12 +44,10 @@ const pin_map_t pin_map_table[]=
{D21, GET_PIN(E,7)}, /* BSP: RED-LED */
{D22, GET_PIN(E,8)}, /* LED_BUILTIN, BSP: GREEN-LED */
{D23, GET_PIN(E,9), "pwm1", 1}, /* PWM, BSP: BLUE-LED */
- {A0, GET_PIN(C,2), "adc1", 3},
- {A1, GET_PIN(C,4), "adc1", 13},
- {A2},
- {A3},
- {A4},
- {A5}
+ {A0, GET_PIN(C,2), "adc1", 3}, /* ADC */
+ {A1, GET_PIN(C,4), "adc1", 13}, /* ADC */
+ {A2, RT_NULL, "adc1", 0}, /* ADC, On-Chip: internal reference voltage */
+ {A3, RT_NULL, "adc1", 17} /* ADC, On-Chip: internal temperature sensor */
};
/* initialization for BSP; maybe a blank function */
diff --git a/bsp/stm32/stm32l475-atk-pandora/applications/arduino/pins_arduino.h b/bsp/stm32/stm32l475-atk-pandora/applications/arduino/pins_arduino.h
index e0d619ba51..d21b5394b5 100644
--- a/bsp/stm32/stm32l475-atk-pandora/applications/arduino/pins_arduino.h
+++ b/bsp/stm32/stm32l475-atk-pandora/applications/arduino/pins_arduino.h
@@ -39,12 +39,9 @@
#define A1 (25)
#define A2 (26)
#define A3 (27)
-#define A4 (28)
-#define A5 (29)
#define LED_BUILTIN D22 /* Built-in LED */
-#define ARDUINO_PINOUT_PWM_MAX 6 /* This Arduino variant has 6 PWM pins */
#define ARDUINO_PWM_HZ 500 /* Arduino UNO's PWM is around 500Hz */
#define ARDUINO_DEFAULT_IIC_BUS_NAME "i2c4"
diff --git a/bsp/stm32/stm32l475-atk-pandora/board/CubeMX_Config/STM32L475VE.ioc b/bsp/stm32/stm32l475-atk-pandora/board/CubeMX_Config/STM32L475VE.ioc
index 9077e59436..d70a8ee43f 100644
--- a/bsp/stm32/stm32l475-atk-pandora/board/CubeMX_Config/STM32L475VE.ioc
+++ b/bsp/stm32/stm32l475-atk-pandora/board/CubeMX_Config/STM32L475VE.ioc
@@ -78,24 +78,26 @@ Mcu.Pin43=PB3 (JTDO-TRACESWO)
Mcu.Pin44=PB5
Mcu.Pin45=PB7
Mcu.Pin46=PB8
-Mcu.Pin47=VP_IWDG_VS_IWDG
-Mcu.Pin48=VP_LPTIM1_VS_LPTIM_counterModeInternalClock
-Mcu.Pin49=VP_RTC_VS_RTC_Activate
+Mcu.Pin47=VP_ADC1_TempSens_Input
+Mcu.Pin48=VP_ADC1_Vref_Input
+Mcu.Pin49=VP_IWDG_VS_IWDG
Mcu.Pin5=PC14-OSC32_IN (PC14)
-Mcu.Pin50=VP_SAI1_VP_$IpInstance_SAIA_SAI_BASIC
-Mcu.Pin51=VP_SAI1_VP_$IpInstance_SAIB_SAI_BASIC
-Mcu.Pin52=VP_SYS_VS_Systick
-Mcu.Pin53=VP_TIM1_VS_ClockSourceINT
-Mcu.Pin54=VP_TIM2_VS_ClockSourceINT
-Mcu.Pin55=VP_TIM4_VS_ClockSourceINT
-Mcu.Pin56=VP_TIM15_VS_ClockSourceINT
-Mcu.Pin57=VP_TIM16_VS_ClockSourceINT
-Mcu.Pin58=VP_TIM17_VS_ClockSourceINT
+Mcu.Pin50=VP_LPTIM1_VS_LPTIM_counterModeInternalClock
+Mcu.Pin51=VP_RTC_VS_RTC_Activate
+Mcu.Pin52=VP_SAI1_VP_$IpInstance_SAIA_SAI_BASIC
+Mcu.Pin53=VP_SAI1_VP_$IpInstance_SAIB_SAI_BASIC
+Mcu.Pin54=VP_SYS_VS_Systick
+Mcu.Pin55=VP_TIM1_VS_ClockSourceINT
+Mcu.Pin56=VP_TIM2_VS_ClockSourceINT
+Mcu.Pin57=VP_TIM4_VS_ClockSourceINT
+Mcu.Pin58=VP_TIM15_VS_ClockSourceINT
+Mcu.Pin59=VP_TIM16_VS_ClockSourceINT
Mcu.Pin6=PC15-OSC32_OUT (PC15)
+Mcu.Pin60=VP_TIM17_VS_ClockSourceINT
Mcu.Pin7=PH0-OSC_IN (PH0)
Mcu.Pin8=PH1-OSC_OUT (PH1)
Mcu.Pin9=PC2
-Mcu.PinsNb=59
+Mcu.PinsNb=61
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32L475VETx
@@ -369,6 +371,10 @@ USART2.IPParameters=VirtualMode-Asynchronous
USART2.VirtualMode-Asynchronous=VM_ASYNC
USB_OTG_FS.IPParameters=VirtualMode
USB_OTG_FS.VirtualMode=Device_Only
+VP_ADC1_TempSens_Input.Mode=IN-TempSens
+VP_ADC1_TempSens_Input.Signal=ADC1_TempSens_Input
+VP_ADC1_Vref_Input.Mode=IN-Vrefint
+VP_ADC1_Vref_Input.Signal=ADC1_Vref_Input
VP_IWDG_VS_IWDG.Mode=IWDG_Activate
VP_IWDG_VS_IWDG.Signal=IWDG_VS_IWDG
VP_LPTIM1_VS_LPTIM_counterModeInternalClock.Mode=Counts__internal_clock_event_00
diff --git a/bsp/stm32/stm32l475-atk-pandora/board/ports/lcd/demo/lcd_sample.c b/bsp/stm32/stm32l475-atk-pandora/board/ports/lcd/demo/lcd_sample.c
index 336a494fca..ddcb64d564 100644
--- a/bsp/stm32/stm32l475-atk-pandora/board/ports/lcd/demo/lcd_sample.c
+++ b/bsp/stm32/stm32l475-atk-pandora/board/ports/lcd/demo/lcd_sample.c
@@ -12,8 +12,10 @@
#include <rtdevice.h>
#include <board.h>
#include <drv_lcd.h>
-#include <lcd_qrcode.h>
#include "rttlogo.h"
+#ifdef BSP_USING_LCD_QRCODE
+#include <lcd_qrcode.h>
+#endif /* BSP_USING_LCD_QRCODE */
static int lcd_sample(void)
{
@@ -24,7 +26,8 @@ static int lcd_sample(void)
lcd_draw_line(0, 69+24, 240, 69+24);
#ifdef BSP_USING_LCD_QRCODE
lcd_show_qrcode(54, 69+24+6, 4, ECC_LOW, "https://www.rt-thread.org/", 4);
-#endif
+#endif /* BSP_USING_LCD_QRCODE */
+
return RT_EOK;
}
INIT_APP_EXPORT(lcd_sample);
diff --git a/bsp/stm32/stm32l475-atk-pandora/board/ports/lcd/drv_lcd.c b/bsp/stm32/stm32l475-atk-pandora/board/ports/lcd/drv_lcd.c
index 3dcc2ae982..02f2b6927e 100644
--- a/bsp/stm32/stm32l475-atk-pandora/board/ports/lcd/drv_lcd.c
+++ b/bsp/stm32/stm32l475-atk-pandora/board/ports/lcd/drv_lcd.c
@@ -238,10 +238,15 @@ void lcd_display_brightness(rt_uint8_t percent)
{
struct rt_device_pwm *pwm_dev;
+ if(percent > 100)
+ {
+ percent = 100;
+ }
+
pwm_dev = (struct rt_device_pwm*)rt_device_find("pwm4");
if(pwm_dev != RT_NULL)
{
- rt_pwm_set(pwm_dev, 2, 1000000, percent*10000); /* PWM4 CH2 with 1000Hz */
+ rt_pwm_set(pwm_dev, 2, 1000000, percent*10000); /* PB7, PWM4 CH2 with 1000Hz */
rt_pwm_enable(pwm_dev, 2);
}
}
diff --git a/bsp/stm32/stm32l475-atk-pandora/board/ports/lcd/lcd_qrcode.c b/bsp/stm32/stm32l475-atk-pandora/board/ports/lcd/lcd_qrcode.c
index 2f58bbe966..aebc36b679 100644
--- a/bsp/stm32/stm32l475-atk-pandora/board/ports/lcd/lcd_qrcode.c
+++ b/bsp/stm32/stm32l475-atk-pandora/board/ports/lcd/lcd_qrcode.c
@@ -105,7 +105,7 @@ static void show_qrcode_by_line(rt_uint16_t x, rt_uint16_t y, rt_uint8_t size, r
*
* @param x x position
* @param y y position
- * @param version version of qrcode
+ * @param version version of qrcode (ECC_LOW, ECC_MEDIUM, ECC_QUARTILE or ECC_HIGH)
* @param ecc level of error correction
* @param data string
* @param enlargement enlargement_factor
diff --git a/bsp/stm32/stm32l475-atk-pandora/board/ports/lcd/lcd_qrcode.h b/bsp/stm32/stm32l475-atk-pandora/board/ports/lcd/lcd_qrcode.h
index 320cbb8aa6..c9c0de99c5 100644
--- a/bsp/stm32/stm32l475-atk-pandora/board/ports/lcd/lcd_qrcode.h
+++ b/bsp/stm32/stm32l475-atk-pandora/board/ports/lcd/lcd_qrcode.h
@@ -5,7 +5,9 @@
#ifdef BSP_USING_LCD_QRCODE
#include <rtdef.h>
+#include <qrcode.h>
+
rt_err_t lcd_show_qrcode(rt_uint16_t x, rt_uint16_t y, rt_uint8_t version, rt_uint8_t ecc, const char *data, rt_uint8_t enlargement);
-#endif
+#endif /* BSP_USING_LCD_QRCODE */
#endif