Fork of mbed-dev with the NUCLEO-L152RE target modified for use with the STM32L151RB (128 kB flash, 16 kB RAM).

Fork of mbed-dev by mbed official

To use this, remove the default "mbed" library and import this one instead. Target must be NUCLEO_L152RE.

Files at this revision

API Documentation at this revision

Comitter:
Jim Paris
Date:
Wed Oct 07 14:47:15 2015 -0400
Parent:
9:5c4c51610e70
Child:
11:1c81e962729c
Commit message:
Use BSRR instead of BRR register for GPIOs, since xB doesn't have BRR

Changed in this revision

targets/hal/TARGET_STM/TARGET_STM32L1/gpio_api.c Show annotated file Show diff for this revision Revisions of this file
targets/hal/TARGET_STM/TARGET_STM32L1/gpio_object.h Show annotated file Show diff for this revision Revisions of this file
--- a/targets/hal/TARGET_STM/TARGET_STM32L1/gpio_api.c	Wed Oct 07 14:43:47 2015 -0400
+++ b/targets/hal/TARGET_STM/TARGET_STM32L1/gpio_api.c	Wed Oct 07 14:47:15 2015 -0400
@@ -58,7 +58,7 @@
     obj->mask    = gpio_set(pin);
     obj->reg_in  = &gpio->IDR;
     obj->reg_set = &gpio->BSRR;
-    obj->reg_clr = &gpio->BRR;
+//    obj->reg_clr = &gpio->BRR;
 }
 
 void gpio_mode(gpio_t *obj, PinMode mode)
--- a/targets/hal/TARGET_STM/TARGET_STM32L1/gpio_object.h	Wed Oct 07 14:43:47 2015 -0400
+++ b/targets/hal/TARGET_STM/TARGET_STM32L1/gpio_object.h	Wed Oct 07 14:47:15 2015 -0400
@@ -45,7 +45,7 @@
     uint32_t mask;
     __IO uint32_t *reg_in;
     __IO uint32_t *reg_set;
-    __IO uint32_t *reg_clr;
+//    __IO uint32_t *reg_clr;
 } gpio_t;
 
 static inline void gpio_write(gpio_t *obj, int value)
@@ -54,11 +54,11 @@
     if (value) {
         *obj->reg_set = obj->mask;
     } else {
-#if defined(TARGET_STM32L152RC) || defined(TARGET_STM32L151RC)
+//#if defined(TARGET_STM32L152RC) || defined(TARGET_STM32L151RC)
         *obj->reg_set = obj->mask << 16;
-#else
-        *obj->reg_clr = obj->mask;
-#endif
+//#else
+//        *obj->reg_clr = obj->mask;
+//#endif
     }
 }