добавлена возможность конфигурирования вывода на вход с притяжкой к земле.
This commit is contained in:
1 parent
5d9b600195
commit
1289095ab0
3 files changed
+14
-7
No files matched your search
@@ -23,12 +23,14 @@
|
||||
#include <stdint.h>
|
||||
#include "wiring_private.h"
|
||||
|
||||
#define HIGH 0x1
|
||||
#define LOW 0x0
|
||||
#define INPUT 0x0
|
||||
#define OUTPUT 0x1
|
||||
#define INPUT_PULLUP 0x2
|
||||
#define NC 0xFFFFFFFF // Not connected
|
||||
#define HIGH 0x1
|
||||
#define LOW 0x0
|
||||
|
||||
#define INPUT 0x0
|
||||
#define OUTPUT 0x1
|
||||
#define INPUT_PULLUP 0x2
|
||||
#define INPUT_PULLDOWN 0x3
|
||||
#define NC 0xFFFFFFFF // Not connected
|
||||
|
||||
#define PI 3.1415926535897932384626433832795
|
||||
#define HALF_PI 1.5707963267948966192313216916398
|
||||
|
||||
@@ -56,6 +56,10 @@ void pinMode(uint32_t PinNumber, uint32_t PinMode)
|
||||
GPIO_InitStruct.Mode = HAL_GPIO_MODE_GPIO_INPUT;
|
||||
GPIO_InitStruct.Pull = HAL_GPIO_PULL_UP;
|
||||
break;
|
||||
case INPUT_PULLDOWN:
|
||||
GPIO_InitStruct.Mode = HAL_GPIO_MODE_GPIO_INPUT;
|
||||
GPIO_InitStruct.Pull = HAL_GPIO_PULL_DOWN;
|
||||
break;
|
||||
case OUTPUT:
|
||||
GPIO_InitStruct.Mode = HAL_GPIO_MODE_GPIO_OUTPUT;
|
||||
GPIO_InitStruct.Pull = HAL_GPIO_PULL_NONE;
|
||||
|
||||
Reference in new issue
Block a user