Revision 0ecf4119
| modules/NUCLEO-F103RB/module.c | ||
|---|---|---|
| 51 | 51 |
|
| 52 | 52 |
#if defined(AMIROLLD_CFG_DW1000) |
| 53 | 53 |
|
| 54 |
/*! SPI (high and low speed) configuration for DW1000 */
|
|
| 54 |
/*! SPI (high speed) configuration for DW1000 */ |
|
| 55 | 55 |
SPIConfig moduleHalSpiUwbHsConfig = {
|
| 56 | 56 |
/* circular buffer mode */ false, |
| 57 | 57 |
/* callback function pointer */ NULL, |
| 58 | 58 |
/* chip select line port */ GPIOB, |
| 59 | 59 |
/* chip select line pad number */ GPIOB_PIN12, |
| 60 |
/* CR1 */ 0, |
|
| 61 |
/* CR2 */ 0,
|
|
| 60 |
/* CR1 */ 0, // 32/2 Mbps
|
|
| 61 |
/* CR2 */ SPI_CR2_RXDMAEN | SPI_CR2_TXDMAEN,
|
|
| 62 | 62 |
}; |
| 63 | 63 |
|
| 64 |
/*! SPI (low speed) configuration for DW1000 */ |
|
| 64 | 65 |
SPIConfig moduleHalSpiUwbLsConfig = {
|
| 65 | 66 |
/* circular buffer mode */ false, |
| 66 | 67 |
/* callback function pointer */ NULL, |
| 67 | 68 |
/* chip select line port */ GPIOB, |
| 68 | 69 |
/* chip select line pad number */ GPIOB_PIN12, |
| 69 |
/* CR1 */ SPI_CR1_BR_1 | SPI_CR1_BR_0, |
|
| 70 |
/* CR2 */ 0,
|
|
| 70 |
/* CR1 */ SPI_CR1_BR_1 | SPI_CR1_BR_0, // 32/16 Mbps
|
|
| 71 |
/* CR2 */ SPI_CR2_RXDMAEN | SPI_CR2_TXDMAEN,
|
|
| 71 | 72 |
}; |
| 72 | 73 |
|
| 73 | 74 |
#endif /* defined(AMIROLLD_CFG_DW1000) */ |
| ... | ... | |
| 97 | 98 |
}; |
| 98 | 99 |
|
| 99 | 100 |
#if defined(AMIROLLD_CFG_DW1000) |
| 100 |
|
|
| 101 | 101 |
/** |
| 102 | 102 |
* @brief DW1000 reset output signal GPIO. |
| 103 | 103 |
*/ |
| 104 | 104 |
static apalGpio_t _gpioDw1000Reset = {
|
| 105 |
/* line */ PAL_LINE(GPIOA, GPIOA_ARD_A0),
|
|
| 105 |
/* line */ LINE_ARD_D15, // PAL_LINE(GPIOB, GPIOB_ARD_D15)
|
|
| 106 | 106 |
}; |
| 107 | 107 |
ROMCONST apalControlGpio_t moduleGpioDw1000Reset = {
|
| 108 | 108 |
/* GPIO */ &_gpioDw1000Reset, |
| ... | ... | |
| 113 | 113 |
}, |
| 114 | 114 |
}; |
| 115 | 115 |
|
| 116 |
|
|
| 117 | 116 |
/** |
| 118 | 117 |
* @brief DW1000 interrrupt input signal GPIO. |
| 119 | 118 |
*/ |
| 120 | 119 |
static apalGpio_t _gpioDw1000Irqn = {
|
| 121 |
/* line */ PAL_LINE(GPIOB, GPIOB_ARD_D6),
|
|
| 120 |
/* line */ LINE_ARD_D14, // PAL_LINE(GPIOB, GPIOB_ARD_D14)
|
|
| 122 | 121 |
}; |
| 123 | 122 |
ROMCONST apalControlGpio_t moduleGpioDw1000Irqn = {
|
| 124 | 123 |
/* GPIO */ &_gpioDw1000Irqn, |
| ... | ... | |
| 129 | 128 |
}, |
| 130 | 129 |
}; |
| 131 | 130 |
|
| 132 |
|
|
| 133 | 131 |
/** |
| 134 | 132 |
* @brief DW1000 SPI chip select output signal GPIO. |
| 135 | 133 |
*/ |
| ... | ... | |
| 241 | 239 |
{
|
| 242 | 240 |
(void)argc; |
| 243 | 241 |
(void)argv; |
| 242 |
((ut_dw1000data_t*)moduleUtAlldDw1000.data)->dw1000d = &moduleLldDw1000; |
|
| 244 | 243 |
aosUtRun(stream, &moduleUtAlldDw1000, NULL); |
| 245 | 244 |
return AOS_OK; |
| 246 | 245 |
} |
| 246 |
static ut_dw1000data_t _utAlldDw1000Data = {
|
|
| 247 |
/* dw1000d */ NULL, |
|
| 248 |
}; |
|
| 247 | 249 |
aos_unittest_t moduleUtAlldDw1000 = {
|
| 248 | 250 |
/* info */ "DW1000", |
| 249 | 251 |
/* name */ "UWB System", |
| ... | ... | |
| 253 | 255 |
/* callback */ _utShellCmdCb_Dw1000, |
| 254 | 256 |
/* next */ NULL, |
| 255 | 257 |
}, |
| 256 |
/* data */ &moduleLldDw1000,
|
|
| 258 |
/* data */ &_utAlldDw1000Data, // TODO: &moduleLldDw1000
|
|
| 257 | 259 |
}; |
| 258 | 260 |
#endif /* defined(AMIROLLD_CFG_DW1000) */ |
| 259 | 261 |
|
| modules/NUCLEO-F103RB/module.h | ||
|---|---|---|
| 79 | 79 |
#if defined(AMIROLLD_CFG_DW1000) |
| 80 | 80 |
|
| 81 | 81 |
/** |
| 82 |
* @brief SPI interface driver for the motion sensors (gyroscope and accelerometer).
|
|
| 82 |
* @brief SPI interface driver for UWB DW1000 module.
|
|
| 83 | 83 |
*/ |
| 84 | 84 |
#define MODULE_HAL_SPI_UWB SPID2 |
| 85 | 85 |
|
| 86 | 86 |
|
| 87 | 87 |
/** |
| 88 |
* @brief Configuration for the SPI interface driver to communicate with the LED driver.
|
|
| 88 |
* @brief Configuration for the high-speed SPI interface driver of DW1000 module..
|
|
| 89 | 89 |
*/ |
| 90 | 90 |
extern SPIConfig moduleHalSpiUwbHsConfig; |
| 91 | 91 |
|
| 92 | 92 |
/** |
| 93 |
* @brief Configuration for the SPI interface driver to communicate with the wireless transceiver.
|
|
| 93 |
* @brief Configuration for the low-speed SPI interface driver of DW1000 module.
|
|
| 94 | 94 |
*/ |
| 95 | 95 |
extern SPIConfig moduleHalSpiUwbLsConfig; |
| 96 | 96 |
|
| ... | ... | |
| 149 | 149 |
/** |
| 150 | 150 |
* @brief Event flag to be call dwt_isr() interrupt. |
| 151 | 151 |
*/ |
| 152 |
#define MODULE_OS_IOEVENTFLAGS_DW1000_IRQn AOS_IOEVENT_FLAG(PAL_PAD(LINE_ARD_D6))
|
|
| 152 |
#define MODULE_OS_IOEVENTFLAGS_DW1000_IRQn AOS_IOEVENT_FLAG(PAL_PAD(LINE_ARD_D14))
|
|
| 153 | 153 |
|
| 154 | 154 |
/** |
| 155 | 155 |
* @brief Event flag to be set on a USER_BUTTON interrupt. |
| ... | ... | |
| 252 | 252 |
#if defined(AMIROLLD_CFG_DW1000) |
| 253 | 253 |
#define MODULE_MAIN_LOOP_IO_EVENT_DW1000() { \
|
| 254 | 254 |
if(eventflags & MODULE_OS_IOEVENTFLAGS_DW1000_IRQn) { \
|
| 255 |
/*apalGpioToggle(moduleGpioLedGreen.gpio); // just for debug */ \ |
|
| 256 | 255 |
process_deca_irq(); \ |
| 257 | 256 |
} \ |
| 258 | 257 |
} |
Also available in: Unified diff