precision-converters-firmware
ad7124_console_app.h
Go to the documentation of this file.
1 
17 #ifndef AD7124_CONSOLE_APP_H_
18 #define AD7124_CONSOLE_APP_H_
19 
20 #include "adi_console_menu.h"
21 
22 /* #defines */
23 #define AD7124_CONFIG_A 0
24 #define AD7124_CONFIG_B 1
25 
26 /* Public Declarations */
27 int32_t ad7124_app_initialize(uint8_t configID);
28 
30 
31 
32 /* AD7124 Filter types */
33 typedef enum {
39 
40 /* AD7124 Reference Source */
41 typedef enum {
44  INT,
45  AVDD
47 
48 /* AD7124 power mode */
49 typedef enum {
54 
55 // Available adc master clock for particular power mode
56 #define LOW_POWER_MODE_FREQUENCY 76800 // 76.8Khz
57 #define MED_POWER_MODE_FREQUENCY 153600 // 153.6Khz
58 #define FUL_POWER_MODE_FREQUENCY 614400 // 614.4Khz
59 
60 #define DEVICE_REG_READ_ID 1
61 #define DEVICE_REG_WRITE_ID 2
62 
63 /* AD7124 Setup Configuration Structure */
64 typedef struct {
65  filter_type filter; // Filter type
66  uint16_t data_rate_fs_val; // Output data rate value
67  uint8_t programmable_gain_bits; // PGA bits value
68  uint8_t polarity; // Bipolar or Unipolar analog input
69  reference_type reference; // Reference source for ADC
70  uint8_t input_buffers; // Buffers on analog inputs
71  uint8_t reference_buffers; // Buffers on reference source
72  uint8_t channel_enabled; // Channel Enable/Disable flag
73  uint8_t setup_assigned; // Assigned setup to channel
74  uint8_t pos_analog_input; // Positive analog input
75  uint8_t neg_analog_input; // Negative analog input
77 
78 
79 #endif /* AD7124_CONSOLE_APP_H_ */
console_menu ad7124_main_menu
Definition: ad7124_console_app.c:2082
int32_t ad7124_app_initialize(uint8_t configID)
Initialize the AD7124 device and the SPI port as required.
Definition: ad7124_console_app.c:274
filter_type
Definition: ad7124_console_app.h:33
@ FAST_SETTLING_SINC4_FILTER
Definition: ad7124_console_app.h:36
@ SINC4_FILTER
Definition: ad7124_console_app.h:34
@ FAST_SETTLING_SINC3_FILTER
Definition: ad7124_console_app.h:37
@ SINC3_FILTER
Definition: ad7124_console_app.h:35
reference_type
Definition: ad7124_console_app.h:41
@ AVDD
Definition: ad7124_console_app.h:45
@ REFIN2
Definition: ad7124_console_app.h:43
@ REFIN1
Definition: ad7124_console_app.h:42
@ INT
Definition: ad7124_console_app.h:44
power_mode_t
Definition: ad7124_console_app.h:49
@ MED_POWER_MODE
Definition: ad7124_console_app.h:51
@ LOW_POWER_MODE
Definition: ad7124_console_app.h:50
@ FULL_POWER_MODE
Definition: ad7124_console_app.h:52
: A simple console menu manager handler
Definition: ad7124_console_app.h:64
reference_type reference
Definition: ad7124_console_app.h:69
uint8_t pos_analog_input
Definition: ad7124_console_app.h:74
filter_type filter
Definition: ad7124_console_app.h:65
uint8_t polarity
Definition: ad7124_console_app.h:68
uint8_t input_buffers
Definition: ad7124_console_app.h:70
uint8_t setup_assigned
Definition: ad7124_console_app.h:73
uint8_t reference_buffers
Definition: ad7124_console_app.h:71
uint8_t channel_enabled
Definition: ad7124_console_app.h:72
uint8_t programmable_gain_bits
Definition: ad7124_console_app.h:67
uint8_t neg_analog_input
Definition: ad7124_console_app.h:75
uint16_t data_rate_fs_val
Definition: ad7124_console_app.h:66
Definition: adi_console_menu.h:89