mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 17:25:20 +03:00
STM32F4: Drivers
This commit is contained in:
parent
96757c18a2
commit
7ca39bbde6
29 changed files with 2082 additions and 282 deletions
|
@ -1,21 +1,25 @@
|
|||
#pragma once
|
||||
|
||||
#include "platform.h"
|
||||
#include "common/utils.h"
|
||||
|
||||
enum rcc_reg {
|
||||
RCC_EMPTY = 0, // make sure that default value (0) does not enable anything
|
||||
RCC_AHB,
|
||||
RCC_APB2,
|
||||
RCC_APB1,
|
||||
RCC_EMPTY = 0, // make sure that default value (0) does not enable anything
|
||||
RCC_AHB,
|
||||
RCC_APB2,
|
||||
RCC_APB1,
|
||||
RCC_AHB1,
|
||||
};
|
||||
|
||||
#define RCC_ENCODE(reg, mask) (((reg) << 5) | LOG2_32BIT(mask))
|
||||
#define RCC_AHB(periph) RCC_ENCODE(RCC_AHB, RCC_AHBENR_ ## periph ## EN)
|
||||
#define RCC_APB2(periph) RCC_ENCODE(RCC_APB2, RCC_APB2ENR_ ## periph ## EN)
|
||||
#define RCC_APB1(periph) RCC_ENCODE(RCC_APB1, RCC_APB1ENR_ ## periph ## EN)
|
||||
#define RCC_AHB1(periph) RCC_ENCODE(RCC_AHB1, RCC_AHB1ENR_ ## periph ## EN)
|
||||
|
||||
typedef uint8_t rccPeriphTag_t;
|
||||
|
||||
void RCC_ClockCmd(rccPeriphTag_t periphTag, FunctionalState NewState);
|
||||
void RCC_ResetCmd(rccPeriphTag_t periphTag, FunctionalState NewState);
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue