Skip to content

Commit 4116af7

Browse files
committed
ext/hal/st/lib: stm32wb hci shared ram driver
Library providing hci driver for host/controller communication over shared RAM Origin: ST Microelectronics License: BSD-3-Clause URL: http://www.st.com/en/embedded-software/stm32cubewb.html Commit: 1.0.0 Purpose: Shared RAM driver for STM32WB Maintained-by: External Signed-off-by: Erwan Gouriou <[email protected]>
1 parent bd00108 commit 4116af7

23 files changed

+4184
-0
lines changed

ext/hal/st/lib/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,13 @@ if(CONFIG_HAS_STLIB)
2121
zephyr_include_directories(audio/microphone)
2222
zephyr_sources(audio/microphone/OpenPDMFilter.c)
2323
endif()
24+
if(CONFIG_BT_STM32_IPM)
25+
zephyr_include_directories(stm32wb/hci)
26+
zephyr_sources(stm32wb/hci/shci.c)
27+
zephyr_sources(stm32wb/hci/shci_tl.c)
28+
zephyr_sources(stm32wb/hci/hw_ipcc.c)
29+
zephyr_sources(stm32wb/hci/stm_list.c)
30+
zephyr_sources(stm32wb/hci/tl_mbox.c)
31+
zephyr_sources(stm32wb/hci/tl_if.c)
32+
endif()
2433
endif()

ext/hal/st/lib/README

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ Available libs:
55
* sensor/vl53l0x:
66
allows to drive the vl53l0x sensor
77
full information can be found here : http://www.st.com/en/embedded-software/stsw-img005.html
8+
* stm32wb/hci:
9+
Middleware for interprocessor communication on stm32wb dual core SoC
810
* ...

ext/hal/st/lib/stm32wb/hci/README

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
STM32WB HCI
2+
###########
3+
4+
Origin:
5+
ST Microelectronics
6+
http://www.st.com/en/embedded-software/stm32cubewb.html
7+
8+
Status:
9+
version 1.0.0
10+
11+
Purpose:
12+
This library is used on stm32wb series to enable HCI communication between
13+
a host BLE running on CM-4 STM32WB core and a controller BLE firmware running
14+
on CM-0 core.
15+
16+
Description:
17+
This library provides an API for shared RAM communication with BLE controller
18+
firmware running on STM32WB C-M0 core.
19+
20+
Dependencies:
21+
This library depends on STM32Cube IPCC HAL API.
22+
It is available in ext/hal/st/stm32cube/stm32wbxx/drivers
23+
24+
URL:
25+
http://www.st.com/en/embedded-software/stm32cubewb.html
26+
27+
commit:
28+
version 1.0.0
29+
30+
Maintained-by:
31+
External
32+
33+
License:
34+
BSD-3-Clause
35+
36+
License Link:
37+
opensource.org/licenses/BSD-3-Clause
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
/**
2+
******************************************************************************
3+
* File Name : app_common.h
4+
* Description : App Common application configuration file for BLE
5+
* middleWare.
6+
******************************************************************************
7+
* @attention
8+
*
9+
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
10+
* All rights reserved.</center></h2>
11+
*
12+
* This software component is licensed by ST under BSD 3-Clause license,
13+
* the "License"; You may not use this file except in compliance with the
14+
* License. You may obtain a copy of the License at:
15+
* opensource.org/licenses/BSD-3-Clause
16+
*
17+
******************************************************************************
18+
*/
19+
20+
/* Define to prevent recursive inclusion -------------------------------------*/
21+
#ifndef APP_COMMON_H
22+
#define APP_COMMON_H
23+
24+
#ifdef __cplusplus
25+
extern "C"{
26+
#endif
27+
28+
#include <stdint.h>
29+
#include <string.h>
30+
#include <stdio.h>
31+
#include <stdlib.h>
32+
#include <stdarg.h>
33+
34+
#include "app_conf.h"
35+
36+
/* -------------------------------- *
37+
* Basic definitions *
38+
* -------------------------------- */
39+
40+
#undef NULL
41+
#define NULL 0
42+
43+
#undef FALSE
44+
#define FALSE 0
45+
46+
#undef TRUE
47+
#define TRUE (!0)
48+
49+
/* -------------------------------- *
50+
* Critical Section definition *
51+
* -------------------------------- */
52+
#define BACKUP_PRIMASK() uint32_t primask_bit= __get_PRIMASK()
53+
#define DISABLE_IRQ() __disable_irq()
54+
#define RESTORE_PRIMASK() __set_PRIMASK(primask_bit)
55+
56+
/* -------------------------------- *
57+
* Macro delimiters *
58+
* -------------------------------- */
59+
60+
#define M_BEGIN do {
61+
62+
#define M_END } while(0)
63+
64+
/* -------------------------------- *
65+
* Some useful macro definitions *
66+
* -------------------------------- */
67+
68+
#define MAX( x, y ) (((x)>(y))?(x):(y))
69+
70+
#define MIN( x, y ) (((x)<(y))?(x):(y))
71+
72+
#define MODINC( a, m ) M_BEGIN (a)++; if ((a)>=(m)) (a)=0; M_END
73+
74+
#define MODDEC( a, m ) M_BEGIN if ((a)==0) (a)=(m); (a)--; M_END
75+
76+
#define MODADD( a, b, m ) M_BEGIN (a)+=(b); if ((a)>=(m)) (a)-=(m); M_END
77+
78+
#define MODSUB( a, b, m ) MODADD( a, (m)-(b), m )
79+
80+
#define PAUSE( t ) M_BEGIN \
81+
__IO int _i; \
82+
for ( _i = t; _i > 0; _i -- ); \
83+
M_END
84+
85+
#define DIVF( x, y ) ((x)/(y))
86+
87+
#define DIVC( x, y ) (((x)+(y)-1)/(y))
88+
89+
#define DIVR( x, y ) (((x)+((y)/2))/(y))
90+
91+
#define SHRR( x, n ) ((((x)>>((n)-1))+1)>>1)
92+
93+
#define BITN( w, n ) (((w)[(n)/32] >> ((n)%32)) & 1)
94+
95+
#define BITNSET( w, n, b ) M_BEGIN (w)[(n)/32] |= ((U32)(b))<<((n)%32); M_END
96+
97+
/* -------------------------------- *
98+
* Compiler *
99+
* -------------------------------- */
100+
#define PLACE_IN_SECTION( __x__ ) __attribute__((section (__x__)))
101+
102+
#ifdef WIN32
103+
#define ALIGN(n)
104+
#else
105+
#define ALIGN(n) __attribute__((aligned(n)))
106+
#endif
107+
108+
#ifdef __cplusplus
109+
} /* extern "C" */
110+
#endif
111+
112+
#endif /*APP_COMMON_H */
113+
114+
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

0 commit comments

Comments
 (0)