Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gpio_lld.h « Inc « Core « LLD_BLE_Proximity « LLD_BLE « Applications « P-NUCLEO-WB55.Nucleo « Projects - github.com/Flipper-Zero/STM32CubeWB.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 71678202a00430c3ef98748ae98ac528c3dc741e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/*
 * gpio_lld.h
 *
 */

#ifndef GPIO_LLD_H_
#define GPIO_LLD_H_

#if defined (USE_SIMU) || defined (USE_FPGA)
/* Be carefull with GPIO used on SIMU plateform */
// GPIOA port is used for CRC management on MASTER only
// GPIOC ad GPIOD ports are used to send messages between the 2 DORYs
#define GPIO_TX_PIN            GPIO_PIN_8
#define GPIO_TX_PORT           GPIOB

#define GPIO_1_PIN             GPIO_PIN_9
#define GPIO_1_PORT            GPIOB
#else /* on Nucleo boards */
/* Use GPIO PB.8 to monitor TX time during valid on Boards */
#define GPIO_TX_PIN            GPIO_PIN_8
#define GPIO_TX_PORT           GPIOB

#define GPIO_HARD_FAULT_PIN    GPIO_PIN_4
#define GPIO_HARD_FAULT_PORT   GPIOA

#define GPIO_MCO_PIN           GPIO_PIN_15
#define GPIO_MCO_PORT          GPIOA

#ifdef STM32WB35xx
#define GPIO_1_PIN             GPIO_PIN_3
#define GPIO_1_PORT            GPIOB

#define GPIO_2_PIN             GPIO_PIN_4
#define GPIO_2_PORT            GPIOB
#else
#define GPIO_1_PIN             GPIO_PIN_2
#define GPIO_1_PORT            GPIOC

#define GPIO_2_PIN             GPIO_PIN_3
#define GPIO_2_PORT            GPIOC
#endif
#endif

// External PA TX/RX pin is fixed by the chip
#define GPIO_EXT_PA_TX_PIN     GPIO_PIN_0
#define GPIO_EXT_PA_TX_PORT    GPIOB
// External PA enable pin is chosen by user
#define GPIO_EXT_PA_EN_PIN     GPIO_PIN_9
#define GPIO_EXT_PA_EN_PORT    GPIOB

void gpio_lld_phy_init( void );
void gpio_lld_phy_gpioTx_up(void);
void gpio_lld_phy_gpioTx_down(void);
void gpio_lld_phy_gpioHardFault_up(void);
void gpio_lld_phy_gpioHardFault_down(void);
void gpio_lld_phy_gpio1_up(void);
void gpio_lld_phy_gpio1_down(void);
void gpio_lld_phy_gpio2_up(void);
void gpio_lld_phy_gpio2_down(void);
void gpio_lld_phy_deInit(void);

void gpio_lld_mco_init(uint32_t mcoSource, uint32_t mcoDiv);
void gpio_lld_mco_deInit(void);

void gpio_lld_extPa_init(void);
void gpio_lld_extPa_deInit(void);

#ifdef USE_SIMU
void gpio_lld_SimuMaster_init(void);
void gpio_lld_SimuSlave_init(void);
#endif

void gpio_lld_lpuart_init(void);
void gpio_lld_lpuart_deInit(void);

void gpio_lld_usart_init(void);
void gpio_lld_usart_deInit(void);

#if !defined (USE_SIMU) && !defined(USE_FPGA)
void gpio_lld_pa2_init(uint8_t mode);
void gpio_lld_pa2_deInit(void);

void gpio_lld_dtb_init(uint8_t dtbMode);
void gpio_lld_dtb_deInit(void);
#endif

void gpio_lld_led1_toggle(void);
void gpio_lld_led2_toggle(void);
void gpio_lld_led3_toggle(void);

#endif /* GPIO_LLD_H_ */