Skip to content

Commit 64d8bcb

Browse files
authored
Merge pull request #360 from adafruit/spi-dma
use SPIM3 for nrf52840 with maximum speed at 32 Mhz
2 parents 53b0e99 + 4d26a6f commit 64d8bcb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+7296
-5624
lines changed

cores/nRF5/nordic/nrfx/CHANGELOG.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,50 @@
11
# Changelog
22
All notable changes to this project are documented in this file.
33

4+
## [1.7.2] - 2019-07-25
5+
### Added
6+
- Added functions in the DPPI, GPIOTE, PPI, RTC, and TIMER HALs for getting tasks and events specified by index.
7+
- Added the possibility of suspending transfers in the TWI driver. This allows combining several transfers into one continuous TWI transaction.
8+
- Added termination of transfers at deinitialization of the UARTE driver.
9+
- Added buffer alignment checks in the QSPI driver.
10+
- Introduced the NRFX_OFFSETOF macro that duplicates the functionality of the built-in offsetof() mechanism, but can be used without issues also with non-constant expressions.
11+
- Added an alternative way of ending the DMA transfer loop in the USBD driver.
12+
- Added the CTSTARTED and CTSTOPPED events to the CLOCK HAL.
13+
14+
### Changed
15+
- Removed an assertion that prevented setting the data payload size of isochronous endpoints to zero, to fulfill requirements of the USB 2.0 specification, paragraph 5.6.3.
16+
- Declared the tx_buffer_length field in the UART driver's control block as volatile to prevent issues in case of compilation with high optimization level.
17+
18+
### Fixed
19+
- Fixed an incorrect conversion of frequency values in the RADIO HAL.
20+
- Fixed an incorrectly enabled interrupt in the QSPI driver.
21+
- Corrected the LFCLK source selection values in the template configuration file for nRF9160.
22+
- Fixed support for external LFCLK sources for nRF52811.
23+
24+
## [1.7.1] - 2019-04-08
25+
### Added
26+
- Added functions in the NVMC driver for getting the flash page size, the count of pages and the total flash size.
27+
28+
### Fixed
29+
- Fixed handling of short unaligned write requests (1 or 2 bytes in length) in the nrfx_nvmc_bytes_write() function.
30+
31+
## [1.7.0] - 2019-03-29
32+
### Added
33+
- Added drivers for NVMC and TEMP.
34+
- Added HALs: AAR and FICR.
35+
- Added support for the custom instruction long frame mode in the QSPI driver.
36+
37+
### Changed
38+
- Reworked HAL for NVMC. Now it can be used for all SoCs supported by nrfx.
39+
- Reworked HAL for TEMP.
40+
- Improved documentation. Now it is more precise and can be generated without warnings with newer versions of doxygen.
41+
- Improved the UARTE driver to consume less current after the TX operation. Now at the end of the transmission the transmitter is turned off by the STOPTX task.
42+
- Improved C++ support in drivers. Now fields in structures are filled up in the correct order.
43+
- Changed to size_t the type used for holding the amount of data in the TWIS driver.
44+
45+
### Fixed
46+
- Fixed a race condition in the USBD driver. It could occur when an IN transfer was interrupted by an OUT transaction, which in turn was interrupted by a process with a higher priority.
47+
448
## [1.6.2] - 2019-02-12
549
### Added
650
- Added the possibility to use the macro NRFX_COREDEP_DELAY_US_LOOP_CYCLES to specify the number of cycles consumed by one iteration of the internal loop in the function nrfx_coredep_delay_us().

cores/nRF5/nordic/nrfx/drivers/include/nrf_bitmask.h

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,17 @@ extern "C" {
4545
* @brief Bitmask managing module.
4646
*/
4747

48+
/** @brief Macro for getting index of byte in byte stream where @c abs_bit is put. */
4849
#define BITMASK_BYTE_GET(abs_bit) ((abs_bit)/8)
50+
51+
/** @brief Macro for getting relative index of bit in byte. */
4952
#define BITMASK_RELBIT_GET(abs_bit) ((abs_bit) & 0x00000007)
5053

5154
/**
52-
* Function for checking if bit in the multi-byte bit mask is set.
55+
* @brief Function for checking if bit in the multi-byte bit mask is set.
5356
*
54-
* @param bit Bit index.
55-
* @param p_mask A pointer to mask with bit fields.
57+
* @param[in] bit Bit index.
58+
* @param[in] p_mask Pointer to mask with bit fields.
5659
*
5760
* @return 0 if bit is not set, positive value otherwise.
5861
*/
@@ -65,10 +68,10 @@ __STATIC_INLINE uint32_t nrf_bitmask_bit_is_set(uint32_t bit, void const * p_mas
6568
}
6669

6770
/**
68-
* Function for setting a bit in the multi-byte bit mask.
71+
* @brief Function for setting a bit in the multi-byte bit mask.
6972
*
70-
* @param bit Bit index.
71-
* @param p_mask A pointer to mask with bit fields.
73+
* @param[in] bit Bit index.
74+
* @param[in] p_mask Pointer to mask with bit fields.
7275
*/
7376
__STATIC_INLINE void nrf_bitmask_bit_set(uint32_t bit, void * p_mask)
7477
{
@@ -79,10 +82,10 @@ __STATIC_INLINE void nrf_bitmask_bit_set(uint32_t bit, void * p_mask)
7982
}
8083

8184
/**
82-
* Function for clearing a bit in the multi-byte bit mask.
85+
* @brief Function for clearing a bit in the multi-byte bit mask.
8386
*
84-
* @param bit Bit index.
85-
* @param p_mask A pointer to mask with bit fields.
87+
* @param[in] bit Bit index.
88+
* @param[in] p_mask Pointer to mask with bit fields.
8689
*/
8790
__STATIC_INLINE void nrf_bitmask_bit_clear(uint32_t bit, void * p_mask)
8891
{
@@ -93,12 +96,12 @@ __STATIC_INLINE void nrf_bitmask_bit_clear(uint32_t bit, void * p_mask)
9396
}
9497

9598
/**
96-
* Function for performing bitwise OR operation on two multi-byte bit masks.
99+
* @brief Function for performing bitwise OR operation on two multi-byte bit masks.
97100
*
98-
* @param p_mask1 A pointer to the first bit mask.
99-
* @param p_mask2 A pointer to the second bit mask.
100-
* @param p_out_mask A pointer to the output bit mask.
101-
* @param length Length of output mask in bytes.
101+
* @param[in] p_mask1 Pointer to the first bit mask.
102+
* @param[in] p_mask2 Pointer to the second bit mask.
103+
* @param[in] p_out_mask Pointer to the output bit mask.
104+
* @param[in] length Length of output mask in bytes.
102105
*/
103106
__STATIC_INLINE void nrf_bitmask_masks_or(void const * p_mask1,
104107
void const * p_mask2,
@@ -116,12 +119,12 @@ __STATIC_INLINE void nrf_bitmask_masks_or(void const * p_mask1,
116119
}
117120

118121
/**
119-
* Function for performing bitwise AND operation on two multi-byte bit masks.
122+
* @brief Function for performing bitwise AND operation on two multi-byte bit masks.
120123
*
121-
* @param p_mask1 A pointer to the first bit mask.
122-
* @param p_mask2 A pointer to the second bit mask.
123-
* @param p_out_mask A pointer to the output bit mask.
124-
* @param length Length of output mask in bytes.
124+
* @param[in] p_mask1 Pointer to the first bit mask.
125+
* @param[in] p_mask2 Pointer to the second bit mask.
126+
* @param[in] p_out_mask Pointer to the output bit mask.
127+
* @param[in] length Length of output mask in bytes.
125128
*/
126129
__STATIC_INLINE void nrf_bitmask_masks_and(void const * p_mask1,
127130
void const * p_mask2,

cores/nRF5/nordic/nrfx/drivers/include/nrfx_adc.h

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -46,46 +46,38 @@ extern "C" {
4646
* @brief Analog-to-Digital Converter (ADC) peripheral driver.
4747
*/
4848

49-
/**
50-
* @brief Driver event types.
51-
*/
49+
/** @brief Driver event types. */
5250
typedef enum
5351
{
5452
NRFX_ADC_EVT_DONE, ///< Event generated when the buffer is filled with samples.
5553
NRFX_ADC_EVT_SAMPLE, ///< Event generated when the requested channel is sampled.
5654
} nrfx_adc_evt_type_t;
5755

58-
/**
59-
* @brief Analog-to-digital converter driver DONE event.
60-
*/
56+
/** @brief ADC driver DONE event structure. */
6157
typedef struct
6258
{
6359
nrf_adc_value_t * p_buffer; ///< Pointer to the buffer with converted samples.
6460
uint16_t size; ///< Number of samples in the buffer.
6561
} nrfx_adc_done_evt_t;
6662

67-
/**
68-
* @brief Analog-to-digital converter driver SAMPLE event.
69-
*/
63+
/** @brief SAMPLE event structure. */
7064
typedef struct
7165
{
7266
nrf_adc_value_t sample; ///< Converted sample.
7367
} nrfx_adc_sample_evt_t;
7468

75-
/**
76-
* @brief Analog-to-digital converter driver event.
77-
*/
69+
/** @brief ADC driver event. */
7870
typedef struct
7971
{
8072
nrfx_adc_evt_type_t type; ///< Event type.
8173
union
8274
{
8375
nrfx_adc_done_evt_t done; ///< Data for DONE event.
8476
nrfx_adc_sample_evt_t sample; ///< Data for SAMPLE event.
85-
} data;
77+
} data; ///< Union to store event data.
8678
} nrfx_adc_evt_t;
8779

88-
/**@brief Macro for initializing the ADC channel with the default configuration. */
80+
/** @brief Macro for initializing the ADC channel with the default configuration. */
8981
#define NRFX_ADC_DEFAULT_CHANNEL(analog_input) \
9082
{ \
9183
NULL, \
@@ -98,7 +90,7 @@ typedef struct
9890
} \
9991
}
10092

101-
// Forward declaration of the nrfx_adc_channel_t type.
93+
/** @brief Forward declaration of the nrfx_adc_channel_t type. */
10294
typedef struct nrfx_adc_channel_s nrfx_adc_channel_t;
10395

10496
/**
@@ -113,9 +105,7 @@ struct nrfx_adc_channel_s
113105
nrf_adc_config_t config; ///< ADC configuration for the current channel.
114106
};
115107

116-
/**
117-
* @brief ADC configuration.
118-
*/
108+
/** @brief ADC configuration. */
119109
typedef struct
120110
{
121111
uint8_t interrupt_priority; ///< Priority of ADC interrupt.
@@ -142,11 +132,11 @@ typedef void (*nrfx_adc_event_handler_t)(nrfx_adc_evt_t const * p_event);
142132
* If a valid event handler is provided, the driver is initialized in non-blocking mode.
143133
* If event_handler is NULL, the driver works in blocking mode.
144134
*
145-
* @param[in] p_config Pointer to the structure with initial configuration.
135+
* @param[in] p_config Pointer to the structure with the initial configuration.
146136
* @param[in] event_handler Event handler provided by the user.
147137
*
148-
* @retval NRFX_SUCCESS If initialization was successful.
149-
* @retval NRFX_ERROR_INVALID_STATE If the driver is already initialized.
138+
* @retval NRFX_SUCCESS Initialization was successful.
139+
* @retval NRFX_ERROR_INVALID_STATE The driver is already initialized.
150140
*/
151141
nrfx_err_t nrfx_adc_init(nrfx_adc_config_t const * p_config,
152142
nrfx_adc_event_handler_t event_handler);
@@ -169,6 +159,8 @@ void nrfx_adc_uninit(void);
169159
*
170160
* @note The channel instance variable @p p_channel is used by the driver as an item
171161
* in a list. Therefore, it cannot be an automatic variable that is located on the stack.
162+
*
163+
* @param[in] p_channel Pointer to the channel instance.
172164
*/
173165
void nrfx_adc_channel_enable(nrfx_adc_channel_t * const p_channel);
174166

@@ -177,6 +169,8 @@ void nrfx_adc_channel_enable(nrfx_adc_channel_t * const p_channel);
177169
*
178170
* This function can be called only when there is no conversion in progress
179171
* (the ADC is not busy).
172+
*
173+
* @param p_channel Pointer to the channel instance.
180174
*/
181175
void nrfx_adc_channel_disable(nrfx_adc_channel_t * const p_channel);
182176

@@ -206,11 +200,11 @@ void nrfx_adc_sample(void);
206200
* fail if ADC is busy. The channel does not need to be enabled to perform a single conversion.
207201
*
208202
* @param[in] p_channel Channel.
209-
* @param[out] p_value Pointer to the location where the result should be placed. Unless NULL is
203+
* @param[out] p_value Pointer to the location where the result is to be placed. Unless NULL is
210204
* provided, the function is blocking.
211205
*
212-
* @retval NRFX_SUCCESS If conversion was successful.
213-
* @retval NRFX_ERROR_BUSY If the ADC driver is busy.
206+
* @retval NRFX_SUCCESS Conversion was successful.
207+
* @retval NRFX_ERROR_BUSY The ADC driver is busy.
214208
*/
215209
nrfx_err_t nrfx_adc_sample_convert(nrfx_adc_channel_t const * const p_channel,
216210
nrf_adc_value_t * p_value);
@@ -241,16 +235,16 @@ nrfx_err_t nrfx_adc_sample_convert(nrfx_adc_channel_t const * const p_channel,
241235
* @param[in] buffer Result buffer.
242236
* @param[in] size Buffer size in samples.
243237
*
244-
* @retval NRFX_SUCCESS If conversion was successful.
245-
* @retval NRFX_ERROR_BUSY If the driver is busy.
238+
* @retval NRFX_SUCCESS Conversion was successful.
239+
* @retval NRFX_ERROR_BUSY The driver is busy.
246240
*/
247241
nrfx_err_t nrfx_adc_buffer_convert(nrf_adc_value_t * buffer, uint16_t size);
248242

249243
/**
250244
* @brief Function for retrieving the ADC state.
251245
*
252-
* @retval true If the ADC is busy.
253-
* @retval false If the ADC is ready.
246+
* @retval true The ADC is busy.
247+
* @retval false The ADC is ready.
254248
*/
255249
bool nrfx_adc_is_busy(void);
256250

@@ -273,11 +267,11 @@ __STATIC_INLINE uint32_t nrfx_adc_start_task_get(void)
273267

274268
#endif
275269

270+
/** @} */
276271

277-
void nrfx_adc_irq_handler(void);
278272

273+
void nrfx_adc_irq_handler(void);
279274

280-
/** @} */
281275

282276
#ifdef __cplusplus
283277
}

0 commit comments

Comments
 (0)