|
35 | 35 | #define COUNTER_NODE_NAME pit0 |
36 | 36 | #define HW_TRIGGER_INTERVAL (2U) |
37 | 37 |
|
| 38 | +#elif defined(CONFIG_BOARD_NUCLEO_H743ZI) |
| 39 | + |
| 40 | +#define ADC_DEVICE_NODE DT_INST(0, st_stm32_adc) |
| 41 | +#define ADC_RESOLUTION 12 |
| 42 | +#define ADC_GAIN ADC_GAIN_1 |
| 43 | +#define ADC_REFERENCE ADC_REF_INTERNAL |
| 44 | +#define ADC_ACQUISITION_TIME ADC_ACQ_TIME_DEFAULT |
| 45 | +#define ADC_1ST_CHANNEL_ID 1 |
| 46 | +#define ADC_2ND_CHANNEL_ID 7 |
| 47 | +#define ALIGNMENT 32 |
| 48 | +#define BUFFER_MEM_REGION __attribute__((__section__(".sram4"))) |
| 49 | + |
| 50 | +#endif |
| 51 | + |
| 52 | +/* Invalid value that is not supposed to be written by the driver. It is used |
| 53 | + * to mark the sample buffer entries as empty. If needed, it can be overridden |
| 54 | + * for a particular board by providing a specific definition above. |
| 55 | + */ |
| 56 | +#if !defined(INVALID_ADC_VALUE) |
| 57 | +#define INVALID_ADC_VALUE SHRT_MIN |
| 58 | +#endif |
| 59 | + |
| 60 | +/* Memory region where buffers will be placed. By default placed in ZTEST_BMEM |
| 61 | + * but can be overwritten for a particular board. |
| 62 | + */ |
| 63 | +#if !defined(BUFFER_MEM_REGION) |
| 64 | +#define BUFFER_MEM_REGION EMPTY |
38 | 65 | #endif |
39 | 66 |
|
40 | 67 | /* for DMA HW trigger interval need large than HW trigger interval*/ |
|
45 | 72 | #define ALIGNMENT DMA_BUF_ADDR_ALIGNMENT(DT_NODELABEL(test_dma)) |
46 | 73 | #endif |
47 | 74 |
|
48 | | -static __aligned(ALIGNMENT) int16_t m_sample_buffer[BUFFER_SIZE]; |
49 | | -static __aligned(ALIGNMENT) int16_t m_sample_buffer2[2][BUFFER_SIZE]; |
| 75 | +static BUFFER_MEM_REGION __aligned(ALIGNMENT) int16_t m_sample_buffer[BUFFER_SIZE]; |
| 76 | +static BUFFER_MEM_REGION __aligned(ALIGNMENT) int16_t m_sample_buffer2[2][BUFFER_SIZE]; |
50 | 77 | static int current_buf_inx; |
51 | 78 |
|
52 | 79 | #if defined(CONFIG_ADC_ASYNC) |
|
0 commit comments