Skip to content

Commit

Permalink
move mac_802_15_4 and shared_data to driver.
Browse files Browse the repository at this point in the history
  • Loading branch information
vacabun committed Nov 27, 2023
1 parent cc47aec commit 966b563
Show file tree
Hide file tree
Showing 17 changed files with 47 additions and 2,580 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ project(zephyr-dw3000)
FILE(GLOB app_sources src/main.cpp)
target_sources(app PRIVATE ${app_sources})

FILE(GLOB ex_sources src/*/*.cpp)
FILE(GLOB ex_sources src/device/*.cpp)
target_sources(app PRIVATE ${ex_sources})

FILE(GLOB ex_sources src/*/*/*.cpp)
FILE(GLOB ex_sources src/msg/*.cpp)
target_sources(app PRIVATE ${ex_sources})

target_include_directories(app PRIVATE include)
Expand Down
18 changes: 18 additions & 0 deletions boards/stm32f401_mini.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,21 @@
wakeup-gpios = <&gpiob 3 GPIO_ACTIVE_HIGH>;
};
};

// &spi1 {
// status = "okay";
// cs-gpios = <&gpioa 4 GPIO_ACTIVE_LOW>;
// pinctrl-0 = <&spi1_sck_pa5 &spi1_nss_pa4
// &spi1_miso_pa6 &spi1_mosi_pa7>;
// pinctrl-1 = <&spi2_sleep>;
// pinctrl-names = "default", "sleep";
// ieee802154: dw1000@0 {
// compatible = "decawave,dw1000";
// spi-max-frequency = <8000000>;
// int-gpios = <&gpiob 0 GPIO_ACTIVE_HIGH>;
// reset-gpios = <&gpiob 4 GPIO_ACTIVE_LOW>;
// status = "okay";
// reg = <0>;
// };
// };

42 changes: 15 additions & 27 deletions include/device/device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,47 +14,35 @@
#ifdef __cplusplus
extern "C"
{
#endif
#include "dw3000.h"
#ifdef __cplusplus
}
#endif

#include <shared_data/config_options.hpp>
#include <shared_data/shared_defines.hpp>
#include <shared_data/shared_functions.hpp>
#include <network/MAC_802_15_4/mac_802_15_4.hpp>
#include <network/MAC_802_15_4/key.hpp>
#endif /* __cplusplus */

#include "msg/twr_poll.hpp"
#include "msg/twr_response.hpp"
#include "msg/twr_final.hpp"
#include "msg/twr_report.hpp"
#ifdef CONFIG_DW3000

#ifdef __cplusplus
extern "C"
{
#endif
dwt_mic_size_e dwt_mic_size_from_bytes(uint8_t mic_size_in_bytes);
#ifdef __cplusplus
}
#endif
#include "dw3000.h"
dwt_mic_size_e dwt_mic_size_from_bytes(uint8_t mic_size_in_bytes);
extern dwt_txconfig_t txconfig_options;

/* Default antenna delay values for 64 MHz PRF.*/
#define TX_ANT_DLY 16385
#define RX_ANT_DLY 16385

/* Delay tx frames, in UWB microseconds.*/
#define TX_DLY_UUS 4000

/* Buffer to store received response message.
The received frame cannot be bigger than 127 if STD PHR mode is used */
#define RX_BUF_LEN 127

/* Note, the key index of 0 is forbidden to send as key index. Thus index 1 is the first. */
#define KEY_INDEX 1

#endif /* CONFIG_DW3000 */

#ifdef __cplusplus
}
#endif /* __cplusplus */

#include "msg/twr_poll.hpp"
#include "msg/twr_response.hpp"
#include "msg/twr_final.hpp"
#include "msg/twr_report.hpp"

#define BROADCAST_ADDR 0x0000000000000000

typedef void (*FuncPtr)(uint8_t *, int16_t, uint64_t, uint64_t);
Expand Down
7 changes: 0 additions & 7 deletions include/network/MAC_802_15_4/key.hpp

This file was deleted.

259 changes: 0 additions & 259 deletions include/network/MAC_802_15_4/mac_802_15_4.hpp

This file was deleted.

4 changes: 0 additions & 4 deletions include/network/network.hpp

This file was deleted.

Loading

0 comments on commit 966b563

Please sign in to comment.