Example program for EVAL-AD4130
Dependencies: tempsensors sdp_k1_sdram
app/ad4130_data_capture.h@2:7b2b268ea49c, 22 months ago (annotated)
- Committer:
- Mahesh Phalke
- Date:
- Wed Jul 20 18:12:00 2022 +0530
- Revision:
- 2:7b2b268ea49c
Initial firmware commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Mahesh Phalke |
2:7b2b268ea49c | 1 | /***************************************************************************//** |
Mahesh Phalke |
2:7b2b268ea49c | 2 | * @file ad4130_data_capture.h |
Mahesh Phalke |
2:7b2b268ea49c | 3 | * @brief Header for AD4130 data capture interfaces |
Mahesh Phalke |
2:7b2b268ea49c | 4 | ******************************************************************************** |
Mahesh Phalke |
2:7b2b268ea49c | 5 | * Copyright (c) 2021-22 Analog Devices, Inc. |
Mahesh Phalke |
2:7b2b268ea49c | 6 | * All rights reserved. |
Mahesh Phalke |
2:7b2b268ea49c | 7 | * |
Mahesh Phalke |
2:7b2b268ea49c | 8 | * This software is proprietary to Analog Devices, Inc. and its licensors. |
Mahesh Phalke |
2:7b2b268ea49c | 9 | * By using this software you agree to the terms of the associated |
Mahesh Phalke |
2:7b2b268ea49c | 10 | * Analog Devices Software License Agreement. |
Mahesh Phalke |
2:7b2b268ea49c | 11 | *******************************************************************************/ |
Mahesh Phalke |
2:7b2b268ea49c | 12 | |
Mahesh Phalke |
2:7b2b268ea49c | 13 | #ifndef AD4130_DATA_CAPTURE_H_ |
Mahesh Phalke |
2:7b2b268ea49c | 14 | #define AD4130_DATA_CAPTURE_H_ |
Mahesh Phalke |
2:7b2b268ea49c | 15 | |
Mahesh Phalke |
2:7b2b268ea49c | 16 | /******************************************************************************/ |
Mahesh Phalke |
2:7b2b268ea49c | 17 | /***************************** Include Files **********************************/ |
Mahesh Phalke |
2:7b2b268ea49c | 18 | /******************************************************************************/ |
Mahesh Phalke |
2:7b2b268ea49c | 19 | |
Mahesh Phalke |
2:7b2b268ea49c | 20 | #include <stdint.h> |
Mahesh Phalke |
2:7b2b268ea49c | 21 | #include <stdbool.h> |
Mahesh Phalke |
2:7b2b268ea49c | 22 | #include <stddef.h> |
Mahesh Phalke |
2:7b2b268ea49c | 23 | |
Mahesh Phalke |
2:7b2b268ea49c | 24 | /******************************************************************************/ |
Mahesh Phalke |
2:7b2b268ea49c | 25 | /********************** Macros and Constants Definition ***********************/ |
Mahesh Phalke |
2:7b2b268ea49c | 26 | /******************************************************************************/ |
Mahesh Phalke |
2:7b2b268ea49c | 27 | |
Mahesh Phalke |
2:7b2b268ea49c | 28 | #if defined(USE_SDRAM_CAPTURE_BUFFER) |
Mahesh Phalke |
2:7b2b268ea49c | 29 | #define adc_data_buffer SDRAM_START_ADDRESS |
Mahesh Phalke |
2:7b2b268ea49c | 30 | #define DATA_BUFFER_SIZE SDRAM_SIZE_BYTES |
Mahesh Phalke |
2:7b2b268ea49c | 31 | #else |
Mahesh Phalke |
2:7b2b268ea49c | 32 | extern int8_t adc_data_buffer[]; |
Mahesh Phalke |
2:7b2b268ea49c | 33 | #define DATA_BUFFER_SIZE (32768) // 32kbytes |
Mahesh Phalke |
2:7b2b268ea49c | 34 | #endif |
Mahesh Phalke |
2:7b2b268ea49c | 35 | |
Mahesh Phalke |
2:7b2b268ea49c | 36 | /******************************************************************************/ |
Mahesh Phalke |
2:7b2b268ea49c | 37 | /********************** Variables and User Defined Data Types *****************/ |
Mahesh Phalke |
2:7b2b268ea49c | 38 | /******************************************************************************/ |
Mahesh Phalke |
2:7b2b268ea49c | 39 | |
Mahesh Phalke |
2:7b2b268ea49c | 40 | /******************************************************************************/ |
Mahesh Phalke |
2:7b2b268ea49c | 41 | /************************ Public Declarations *********************************/ |
Mahesh Phalke |
2:7b2b268ea49c | 42 | /******************************************************************************/ |
Mahesh Phalke |
2:7b2b268ea49c | 43 | |
Mahesh Phalke |
2:7b2b268ea49c | 44 | int32_t ad4130_data_capture_init(void); |
Mahesh Phalke |
2:7b2b268ea49c | 45 | int32_t read_single_sample(uint8_t input_chn, uint32_t *raw_data); |
Mahesh Phalke |
2:7b2b268ea49c | 46 | int32_t read_buffered_data(int8_t **pbuf, uint32_t nb_of_bytes); |
Mahesh Phalke |
2:7b2b268ea49c | 47 | int32_t prepare_data_transfer(uint32_t ch_mask, uint8_t sample_size); |
Mahesh Phalke |
2:7b2b268ea49c | 48 | int32_t end_data_transfer(void); |
Mahesh Phalke |
2:7b2b268ea49c | 49 | void data_capture_callback(void *ctx); |
Mahesh Phalke |
2:7b2b268ea49c | 50 | void fifo_data_capture_callback(void *ctx); |
Mahesh Phalke |
2:7b2b268ea49c | 51 | |
Mahesh Phalke |
2:7b2b268ea49c | 52 | #endif /* AD4130_DATA_CAPTURE_H_ */ |