Loading...
Searching...
No Matches
furi_hal_spi_types.h
1#pragma once
2
3#include <stdint.h>
4#include <stddef.h>
5
6#include <furi_hal_gpio.h>
7
8#include <stm32wbxx_ll_spi.h>
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14typedef struct FuriHalSpiBus FuriHalSpiBus;
16
18typedef enum {
19 FuriHalSpiBusEventInit,
20 FuriHalSpiBusEventDeinit,
21 FuriHalSpiBusEventLock,
22 FuriHalSpiBusEventUnlock,
23 FuriHalSpiBusEventActivate,
24 FuriHalSpiBusEventDeactivate,
25} FuriHalSpiBusEvent;
26
28typedef void (*FuriHalSpiBusEventCallback)(FuriHalSpiBus* bus, FuriHalSpiBusEvent event);
29
32 SPI_TypeDef* spi;
33 FuriHalSpiBusEventCallback callback;
34 FuriHalSpiBusHandle* current_handle;
35};
36
38typedef enum {
39 FuriHalSpiBusHandleEventInit,
40 FuriHalSpiBusHandleEventDeinit,
41 FuriHalSpiBusHandleEventActivate,
42 FuriHalSpiBusHandleEventDeactivate,
43} FuriHalSpiBusHandleEvent;
44
46typedef void (*FuriHalSpiBusHandleEventCallback)(
47 FuriHalSpiBusHandle* handle,
48 FuriHalSpiBusHandleEvent event);
49
52 FuriHalSpiBus* bus;
53 FuriHalSpiBusHandleEventCallback callback;
54 const GpioPin* miso;
55 const GpioPin* mosi;
56 const GpioPin* sck;
57 const GpioPin* cs;
58};
59
60#ifdef __cplusplus
61}
62#endif
FuriHal spi handle.
Definition furi_hal_spi_types.h:51
FuriHal spi bus.
Definition furi_hal_spi_types.h:31
Gpio structure.
Definition furi_hal_gpio.h:161