Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Donald Chen
pc-ble-driver-connectivity-fw
Commits
0e3ddb18
Commit
0e3ddb18
authored
Nov 06, 2018
by
Donald Chen
Browse files
add passthrough
parent
99157eb3
Changes
3
Hide whitespace changes
Inline
Side-by-side
examples/ble_central_and_peripheral/ble_connectivity/main.c
View file @
0e3ddb18
...
...
@@ -36,39 +36,61 @@
#include "ser_phy_debug_comm.h"
#if defined
(
__CC_ARM
)
#if defined
(
__CC_ARM)
typedef
struct
__attribute__
((
packed
))
{
uint32_t
magic_number
;
/* Magic number to verify the presence of this structure in memory */
uint32_t
struct_version
:
8
;
/* Version of this struct format */
uint32_t
rfu0
:
24
;
/* Reserved for future use, shall be 0xFFFFFF */
uint32_t
revision_hash
;
/* Unique revision identifier */
uint32_t
version_major
:
8
;
/* Major version number */
uint32_t
version_minor
:
8
;
/* Minor version number */
uint32_t
version_patch
:
8
;
/* Patch version number */
uint32_t
rfu1
:
8
;
/* Reserved for future use, shall be 0xFF */
uint32_t
sd_ble_api_version
:
8
;
/* SoftDevice BLE API version number */
uint32_t
transport_type
:
8
;
/* Connectivity transport type, 1 = UART HCI */
uint32_t
rfu2
:
16
;
/* Reserved for future use, shall be 0xFFFF */
uint32_t
baud_rate
;
/* UART transport baud rate */
uint32_t
magic_number
;
/* Magic number to verify the presence of this structure in memory */
uint32_t
struct_version
:
8
;
/* Version of this struct format */
uint32_t
rfu0
:
24
;
/* Reserved for future use, shall be 0xFFFFFF */
uint32_t
revision_hash
;
/* Unique revision identifier */
uint32_t
version_major
:
8
;
/* Major version number */
uint32_t
version_minor
:
8
;
/* Minor version number */
uint32_t
version_patch
:
8
;
/* Patch version number */
uint32_t
rfu1
:
8
;
/* Reserved for future use, shall be 0xFF */
uint32_t
sd_ble_api_version
:
8
;
/* SoftDevice BLE API version number */
uint32_t
transport_type
:
8
;
/* Connectivity transport type, 1 = UART HCI */
uint32_t
rfu2
:
16
;
/* Reserved for future use, shall be 0xFFFF */
uint32_t
baud_rate
;
/* UART transport baud rate */
}
version_info_t
;
static
const
version_info_t
version_info
__attribute__
((
at
(
0x20000
)))
=
{
.
magic_number
=
0x46D8A517
,
.
struct_version
=
2
,
.
rfu0
=
0xFFFFFF
,
.
revision_hash
=
0
,
.
version_major
=
1
,
.
version_minor
=
2
,
.
version_patch
=
0
,
.
rfu1
=
0xFF
,
.
magic_number
=
0x46D8A517
,
.
struct_version
=
2
,
.
rfu0
=
0xFFFFFF
,
.
revision_hash
=
0
,
.
version_major
=
1
,
.
version_minor
=
2
,
.
version_patch
=
0
,
.
rfu1
=
0xFF
,
.
sd_ble_api_version
=
NRF_SD_BLE_API_VERSION
,
.
transport_type
=
1
,
.
rfu2
=
0xFFFF
,
.
baud_rate
=
SER_PHY_UART_BAUDRATE_VAL
,
.
transport_type
=
1
,
.
rfu2
=
0xFFFF
,
.
baud_rate
=
SER_PHY_UART_BAUDRATE_VAL
,
};
#endif
void
pa_lna_init
(
void
)
{
#define PA_RX_EN_PIN 38 //p1.06
#define PA_TX_EN_PIN 37 //p1.05
#define PA_MODE_PIN 36 //p1.04
#define ANT_SEL_PIN 34 //p1.02
//configure PA-LNA pins as outputs
nrf_gpio_cfg_output
(
PA_RX_EN_PIN
);
nrf_gpio_cfg_output
(
PA_TX_EN_PIN
);
nrf_gpio_cfg_output
(
PA_MODE_PIN
);
nrf_gpio_cfg_output
(
ANT_SEL_PIN
);
//set PA-LNA pins for bypass mode, using the internal antenna
nrf_gpio_pin_clear
(
PA_RX_EN_PIN
);
nrf_gpio_pin_clear
(
PA_TX_EN_PIN
);
nrf_gpio_pin_set
(
PA_MODE_PIN
);
nrf_gpio_pin_set
(
ANT_SEL_PIN
);
}
/**@brief Main function of the connectivity application. */
int
main
(
void
)
{
...
...
@@ -77,7 +99,9 @@ int main(void)
APP_ERROR_CHECK
(
NRF_LOG_INIT
(
NULL
));
NRF_LOG_INFO
(
"BLE connectivity started
\r\n
"
);
#if ( defined(SER_PHY_HCI_DEBUG_ENABLE) || defined(SER_PHY_DEBUG_APP_ENABLE))
pa_lna_init
();
#if (defined(SER_PHY_HCI_DEBUG_ENABLE) || defined(SER_PHY_DEBUG_APP_ENABLE))
debug_init
(
NULL
);
#endif
...
...
@@ -92,7 +116,6 @@ int main(void)
nrf_clock_lf_cfg_t
clock_lf_cfg
=
NRF_CLOCK_LFCLKSRC
;
SOFTDEVICE_HANDLER_INIT
(
&
clock_lf_cfg
,
NULL
);
/* Subscribe for BLE events. */
err_code
=
softdevice_ble_evt_handler_set
(
ser_conn_ble_event_handle
);
APP_ERROR_CHECK
(
err_code
);
...
...
examples/ble_central_and_peripheral/ble_connectivity/pca10040/ser_s132_hci/armgcc/.gitignore
0 → 100644
View file @
0e3ddb18
_build
examples/ble_central_and_peripheral/ble_connectivity/pca10040/ser_s132_hci/armgcc/Makefile
View file @
0e3ddb18
...
...
@@ -126,12 +126,11 @@ LIB_FILES += \
# C flags common to all targets
CFLAGS
+=
-D__STACK_SIZE
=
2048
CFLAGS
+=
-DNRF52
CFLAGS
+=
-DNRF52_PAN_64
CFLAGS
+=
-DSOFTDEVICE_PRESENT
CFLAGS
+=
-DSER_CONNECTIVITY
CFLAGS
+=
-DBOARD_PCA10040
CFLAGS
+=
-DNRF528
32
CFLAGS
+=
-DNRF528
40_XXAA
CFLAGS
+=
-D__HEAP_SIZE
=
1024
CFLAGS
+=
-DNRF52_PAN_12
CFLAGS
+=
-DNRF52_PAN_58
...
...
@@ -163,12 +162,11 @@ CXXFLAGS += \
# Assembler flags common to all targets
ASMFLAGS
+=
-x
assembler-with-cpp
ASMFLAGS
+=
-D__STACK_SIZE
=
2048
ASMFLAGS
+=
-DNRF52
ASMFLAGS
+=
-DNRF52_PAN_64
ASMFLAGS
+=
-DSOFTDEVICE_PRESENT
ASMFLAGS
+=
-DSER_CONNECTIVITY
ASMFLAGS
+=
-DBOARD_PCA10040
ASMFLAGS
+=
-DNRF528
32
ASMFLAGS
+=
-DNRF528
40_XXAA
ASMFLAGS
+=
-D__HEAP_SIZE
=
1024
ASMFLAGS
+=
-DNRF52_PAN_12
ASMFLAGS
+=
-DNRF52_PAN_58
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment