Hardware Abstraction Layer for Sigma-Delta 24 (SD24)
Group: MSP Software Development
#include "sd24.h"
#include <stdint.h>
#include <stdbool.h>
Go to the source code of this file.
Data Structures | |
struct | _HAL_ADC_SD24_Channel_ |
Contains the SD24 Channel Configuration. More... | |
struct | _HAL_ADC_SD24_Configuration_ |
Contains the SD24 Configuration. More... | |
Macros | |
#define | HAL_ADC_CONV_INVALID_INDEX 0xFF |
Invalid Index for Converter Number. More... | |
#define | HAL_ADC_MAX_MOD_FREQ 2097152L |
Maximum modulation frequency is 2MHz. More... | |
#define | HAL_ADC_V_ARRAY_LENGTH 4 |
Size of voltage array (it must be a multiple of 2) More... | |
#define | HAL_ADC_I_ARRAY_LENGTH 4 |
Size of voltage array (it must be a multiple of 2) More... | |
#define | HAL_ADC_V_MASK (HAL_ADC_V_ARRAY_LENGTH-1) |
Voltage Mask used for circular buffer. More... | |
#define | HAL_ADC_I_MASK (HAL_ADC_I_ARRAY_LENGTH-1) |
Current Mask used for circular buffer. More... | |
#define | HAL_ADC_CH0_READ (BIT0) |
#define | HAL_ADC_CH1_READ (BIT1) |
#define | HAL_ADC_CH2_READ (BIT2) |
#define | HAL_ADC_CH3_READ (BIT3) |
#define | HAL_ADC_FREQ_4000_HZ (4000) |
#define | HAL_ADC_FREQ_8000_HZ (8000) |
#define | HAL_ADC_FREQ_16000_HZ (16000) |
#define | HAL_ADC_PHASE_NO_DATA_READY 0x00 |
#define | HAL_ADC_PHASE_A_DATA_READY 0x01 |
#define | HAL_ADC_PHASE_B_DATA_READY 0x02 |
#define | HAL_ADC_PHASE_C_DATA_READY 0x04 |
#define | HAL_ADC_PHASE_NEUTRAL_DATA_READY 0x40 |
#define | HAL_ADC_PHASE_TOTAL_DATA_READY 0x80 |
#define | HAL_ADC_OSR_32 (32-1) |
#define | HAL_ADC_OSR_64 (64-1) |
#define | HAL_ADC_OSR_128 (128-1) |
#define | HAL_ADC_OSR_256 (256-1) |
Typedefs | |
typedef enum _HAL_ADC_message_code_ | HAL_ADC_message_code |
The following enumeration contain all possible HAL_ADC driver return message codes. More... | |
typedef struct _HAL_ADC_SD24_Channel_ | HAL_ADC_SD24_Channel |
Contains the SD24 Channel Configuration. More... | |
typedef struct _HAL_ADC_SD24_Configuration_ | HAL_ADC_SD24_Configuration |
Contains the SD24 Configuration. More... | |
Enumerations | |
enum | _HAL_ADC_message_code_ { HAL_ADC_message_code_no_error =0, HAL_ADC_message_code_invalid_freq_error =1, HAL_ADC_message_code_no_error =0, HAL_ADC_message_code_invalid_mod_freq_error =1, HAL_ADC_message_code_invalid_clock_divider_error =2 } |
The following enumeration contain all possible HAL_ADC driver return message codes. More... | |
Functions | |
HAL_ADC_message_code | HAL_ADC_init (HAL_ADC_SD24_Configuration *config) |
The following API configures SD24 module based on user configuration files "emSwLib_userConfig.c" and "emSwLib_userConfig.h". More... | |
void | HAL_ADC_startConversion (HAL_ADC_SD24_Configuration *config) |
The following API starts the enabled converters. More... | |
void | HAL_ADC_stopConversion (HAL_ADC_SD24_Configuration *config) |
The following API stops the enabled converters. More... | |
void | HAL_ADC_enableInterrupt (HAL_ADC_SD24_Configuration *config) |
The following API enables the interrupt for the master converter. More... | |
void | HAL_ADC_disableInterrupt (HAL_ADC_SD24_Configuration *config) |
The following API disables the interrupt for the master converter. More... | |
void | HAL_ADC_printResult (HAL_ADC_SD24_Configuration *config) |
The following API sends the stored results to the GUI. More... | |
void | HAL_ADC_clearVariables (uint8_t phase) |
The following API clears all the global variables used in the ISR.) More... | |
Variables | |
volatile uint8_t | phaseDataReady |
HAL_ADC_SD24_Configuration | halAdcConfig |
#define HAL_ADC_CONV_INVALID_INDEX 0xFF |
Invalid Index for Converter Number.
(C) Copyright 2017, Texas Instruments, Inc.
#define HAL_ADC_MAX_MOD_FREQ 2097152L |
Maximum modulation frequency is 2MHz.
#define HAL_ADC_V_ARRAY_LENGTH 4 |
Size of voltage array (it must be a multiple of 2)
#define HAL_ADC_I_ARRAY_LENGTH 4 |
Size of voltage array (it must be a multiple of 2)
#define HAL_ADC_V_MASK (HAL_ADC_V_ARRAY_LENGTH-1) |
Voltage Mask used for circular buffer.
#define HAL_ADC_I_MASK (HAL_ADC_I_ARRAY_LENGTH-1) |
Current Mask used for circular buffer.
#define HAL_ADC_CH0_READ (BIT0) |
#define HAL_ADC_CH1_READ (BIT1) |
#define HAL_ADC_CH2_READ (BIT2) |
#define HAL_ADC_CH3_READ (BIT3) |
#define HAL_ADC_FREQ_4000_HZ (4000) |
#define HAL_ADC_FREQ_8000_HZ (8000) |
#define HAL_ADC_FREQ_16000_HZ (16000) |
#define HAL_ADC_PHASE_NO_DATA_READY 0x00 |
#define HAL_ADC_PHASE_A_DATA_READY 0x01 |
#define HAL_ADC_PHASE_B_DATA_READY 0x02 |
#define HAL_ADC_PHASE_C_DATA_READY 0x04 |
#define HAL_ADC_PHASE_NEUTRAL_DATA_READY 0x40 |
#define HAL_ADC_PHASE_TOTAL_DATA_READY 0x80 |
#define HAL_ADC_OSR_32 (32-1) |
#define HAL_ADC_OSR_64 (64-1) |
#define HAL_ADC_OSR_128 (128-1) |
#define HAL_ADC_OSR_256 (256-1) |
typedef enum _HAL_ADC_message_code_ HAL_ADC_message_code |
The following enumeration contain all possible HAL_ADC driver return message codes.
typedef struct _HAL_ADC_SD24_Channel_ HAL_ADC_SD24_Channel |
Contains the SD24 Channel Configuration.
typedef struct _HAL_ADC_SD24_Configuration_ HAL_ADC_SD24_Configuration |
Contains the SD24 Configuration.
The following enumeration contain all possible HAL_ADC driver return message codes.