ISSDK  1.7
IoT Sensing Software Development Kit
Data Structures | Macros | Functions | Variables
dp5004_demo.c File Reference

The dp5004_demo.c file implements the ISSDK MPXVDP5004 analog sensor driver demo demonstration in interrupt mode with FRDM-KE15Z. More...

#include "board.h"
#include "pin_mux.h"
#include "fsl_lptmr.h"
#include "fsl_adc12.h"
#include "clock_config.h"
#include "Driver_USART.h"
#include "issdk_hal.h"
#include "gpio_driver.h"
#include "host_io_uart.h"
#include "systick_utils.h"
#include "auto_detection_service.h"
Include dependency graph for dp5004_demo.c:

Go to the source code of this file.

Data Structures

struct  dp5004_pressuredata_t
 This structure defines the mpxv5004dp data buffer. More...
 

Macros

#define dp5004_odr_callback   PWT_LPTMR0_IRQHandler
 
#define adc12_irq_callback   ADC0_IRQHandler
 
#define MPXV5004DP_ODR_ms   100U
 
#define MPXV5004DP_STREAM_DATA_SIZE   6U
 
#define APPLICATION_NAME   "Analog Pressure Sensor Demo (MPXV5004DP)"
 Unique Name for this application which should match the target GUI pkg name. More...
 
#define APPLICATION_VERSION   "2.5"
 Version to distinguish between instances the same application based on target Shield and updates. More...
 

Functions

void dp5004_odr_callback (void)
 
void adc12_irq_callback (void)
 
void KE15Z_LPTMR0_ADC0_Initialize (void)
 
bool process_host_command (uint8_t tag, uint8_t *hostCommand, uint8_t *hostResponse, size_t *hostMsgSize, size_t respBufferSize)
 
int main (void)
 Main function. More...
 

Variables

char boardString [ADS_MAX_STRING_LENGTH] = {0}
 
char shieldString [ADS_MAX_STRING_LENGTH] = {0}
 
char embAppName [ADS_MAX_STRING_LENGTH] = {0}
 
volatile bool bAdc12ConversionCompletedFlag = false
 
volatile bool bStreamingEnabled = false
 
volatile bool bDp5004Ready = false
 
adc12_channel_config_t gAdcChannelConfigStruct
 
volatile uint32_t gAdcConversionValue
 
uint8_t gStreamID
 
int32_t gSystick
 
GENERIC_DRIVER_GPIOpGpioDriver = &Driver_GPIO_KSDK
 

Detailed Description

The dp5004_demo.c file implements the ISSDK MPXVDP5004 analog sensor driver demo demonstration in interrupt mode with FRDM-KE15Z.

Definition in file dp5004_demo.c.

Macro Definition Documentation

◆ adc12_irq_callback

#define adc12_irq_callback   ADC0_IRQHandler

Definition at line 70 of file dp5004_demo.c.

◆ APPLICATION_NAME

#define APPLICATION_NAME   "Analog Pressure Sensor Demo (MPXV5004DP)"

Unique Name for this application which should match the target GUI pkg name.

Definition at line 78 of file dp5004_demo.c.

Referenced by main().

◆ APPLICATION_VERSION

#define APPLICATION_VERSION   "2.5"

Version to distinguish between instances the same application based on target Shield and updates.

Definition at line 80 of file dp5004_demo.c.

Referenced by main().

◆ dp5004_odr_callback

#define dp5004_odr_callback   PWT_LPTMR0_IRQHandler

Definition at line 68 of file dp5004_demo.c.

◆ MPXV5004DP_ODR_ms

#define MPXV5004DP_ODR_ms   100U

Definition at line 73 of file dp5004_demo.c.

Referenced by KE15Z_LPTMR0_ADC0_Initialize().

◆ MPXV5004DP_STREAM_DATA_SIZE

#define MPXV5004DP_STREAM_DATA_SIZE   6U

Definition at line 75 of file dp5004_demo.c.

Referenced by main().

Function Documentation

◆ adc12_irq_callback()

void adc12_irq_callback ( void  )

◆ dp5004_odr_callback()

void dp5004_odr_callback ( void  )

Definition at line 108 of file dp5004_demo.c.

References gAdcChannelConfigStruct, and MPXVDP5004_ADC12_CHANNEL_GROUP.

◆ KE15Z_LPTMR0_ADC0_Initialize()

void KE15Z_LPTMR0_ADC0_Initialize ( void  )

Definition at line 123 of file dp5004_demo.c.

References bDp5004Ready, gAdcChannelConfigStruct, MPXV5004DP_ODR_ms, and MPXVDP5004_ADC12_CHANNEL.

Referenced by main().

Here is the caller graph for this function:

◆ main()

int main ( void  )

◆ process_host_command()

bool process_host_command ( uint8_t  tag,
uint8_t *  hostCommand,
uint8_t *  hostResponse,
size_t *  hostMsgSize,
size_t  respBufferSize 
)

Variable Documentation

◆ bAdc12ConversionCompletedFlag

volatile bool bAdc12ConversionCompletedFlag = false

Definition at line 97 of file dp5004_demo.c.

Referenced by adc12_irq_callback(), and main().

◆ bDp5004Ready

volatile bool bDp5004Ready = false

Definition at line 97 of file dp5004_demo.c.

Referenced by KE15Z_LPTMR0_ADC0_Initialize(), main(), and process_host_command().

◆ boardString

char boardString[ADS_MAX_STRING_LENGTH] = {0}

Definition at line 95 of file dp5004_demo.c.

Referenced by main(), and process_host_command().

◆ bStreamingEnabled

volatile bool bStreamingEnabled = false

Definition at line 97 of file dp5004_demo.c.

Referenced by process_host_command().

◆ embAppName

char embAppName[ADS_MAX_STRING_LENGTH] = {0}

Definition at line 96 of file dp5004_demo.c.

Referenced by main(), and process_host_command().

◆ gAdcChannelConfigStruct

adc12_channel_config_t gAdcChannelConfigStruct

Definition at line 98 of file dp5004_demo.c.

Referenced by dp5004_odr_callback(), and KE15Z_LPTMR0_ADC0_Initialize().

◆ gAdcConversionValue

volatile uint32_t gAdcConversionValue

Definition at line 99 of file dp5004_demo.c.

Referenced by adc12_irq_callback(), and main().

◆ gStreamID

uint8_t gStreamID

Definition at line 100 of file dp5004_demo.c.

Referenced by main(), and process_host_command().

◆ gSystick

int32_t gSystick

Definition at line 101 of file dp5004_demo.c.

Referenced by main(), and process_host_command().

◆ pGpioDriver

Definition at line 102 of file dp5004_demo.c.

◆ shieldString

char shieldString[ADS_MAX_STRING_LENGTH] = {0}

Definition at line 95 of file dp5004_demo.c.

Referenced by main(), and process_host_command().