Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of FastIO by
Revision 23:23a43a288e2c, committed 2018-04-17
- Comitter:
- amateusz
- Date:
- Tue Apr 17 13:28:24 2018 +0000
- Parent:
- 22:45b32f07e790
- Commit message:
- Added support for STM32L1xx (checked on Nucleo L152). I'm done this solely cross referenced existing STM32 target files with L152 reference manual.
Changed in this revision
--- a/Devices/FastIO_NUCLEO_F030.h Tue Sep 20 20:41:42 2016 +0000 +++ b/Devices/FastIO_NUCLEO_F030.h Tue Apr 17 13:28:24 2018 +0000 @@ -10,6 +10,7 @@ #define PINMASK (1 << STM_PIN(pin)) #define PORT ((GPIO_TypeDef *)(GPIOA_BASE + 0x0400 * STM_PORT(pin))) + #define INIT_PIN RCC->AHBENR |= (1 << (STM_PORT(pin) + 17)); (PORT->MODER &= ~(GPIO_MODER_MODER0_1 << (STM_PIN(pin) * 2))); container.mask = PINMASK #define DESTROY_PIN
--- a/Devices/FastIO_STM32L073XX.h Tue Sep 20 20:41:42 2016 +0000 +++ b/Devices/FastIO_STM32L073XX.h Tue Apr 17 13:28:24 2018 +0000 @@ -10,6 +10,7 @@ #define PINMASK (1 << STM_PIN(pin)) #define PORT ((GPIO_TypeDef *)(GPIOA_BASE + 0x0400 * STM_PORT(pin))) + #define INIT_PIN RCC->IOPENR |= (1 << STM_PORT(pin)); (PORT->MODER &= ~(GPIO_MODER_MODE0_1 << (STM_PIN(pin) * 2))); container.mask = PINMASK #define DESTROY_PIN
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Devices/FastIO_STM32L1.h Tue Apr 17 13:28:24 2018 +0000 @@ -0,0 +1,26 @@ +#if defined(TARGET_STM32L1) + +#include "mbed.h" +#include "pinmap.h" + +typedef struct { + uint32_t mask; +} fastio_vars; + +#define PINMASK (1 << STM_PIN(pin)) +#define PORT ((GPIO_TypeDef *)(GPIOA_BASE + 0x0400 * STM_PORT(pin))) + + +#define INIT_PIN RCC->AHBENR |= (1 << STM_PORT(pin)); (PORT->MODER &= ~(GPIO_MODER_MODER0_1 << (STM_PIN(pin) * 2))); container.mask = PINMASK +#define DESTROY_PIN + +#define SET_DIR_INPUT (PORT->MODER &= ~(GPIO_MODER_MODER0_0 << (STM_PIN(pin) * 2))) +#define SET_DIR_OUTPUT (PORT->MODER |= (GPIO_MODER_MODER0_0 << (STM_PIN(pin) * 2))) +#define SET_MODE(pull) pin_mode(pin, pull); + +#define WRITE_PIN_SET (PORT->BSRR = PINMASK) +#define WRITE_PIN_CLR (PORT->BRR = PINMASK) + +#define READ_PIN ((PORT->IDR & container.mask) ? 1 : 0) + +#endif \ No newline at end of file
--- a/FastIO.h Tue Sep 20 20:41:42 2016 +0000 +++ b/FastIO.h Tue Apr 17 13:28:24 2018 +0000 @@ -9,6 +9,7 @@ #include "FastIO_K20D50M_KPSDK.h" #include "FastIO_STM32F4.h" #include "FastIO_STM32L073XX.h" +#include "FastIO_STM32L1.h" #include "FastIO_NUCLEO_F030.h" #include "FastIO_LPC11XX.h" #include "FastIO_EFM32.h"