![]() |
ISSDK
1.7
IoT Sensing Software Development Kit
|
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"
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_GPIO * | pGpioDriver = &Driver_GPIO_KSDK |
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.
#define adc12_irq_callback ADC0_IRQHandler |
Definition at line 70 of file dp5004_demo.c.
#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().
#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().
#define dp5004_odr_callback PWT_LPTMR0_IRQHandler |
Definition at line 68 of file dp5004_demo.c.
#define MPXV5004DP_ODR_ms 100U |
Definition at line 73 of file dp5004_demo.c.
Referenced by KE15Z_LPTMR0_ADC0_Initialize().
#define MPXV5004DP_STREAM_DATA_SIZE 6U |
Definition at line 75 of file dp5004_demo.c.
Referenced by main().
void adc12_irq_callback | ( | void | ) |
Definition at line 116 of file dp5004_demo.c.
References bAdc12ConversionCompletedFlag, gAdcConversionValue, and MPXVDP5004_ADC12_CHANNEL_GROUP.
void dp5004_odr_callback | ( | void | ) |
Definition at line 108 of file dp5004_demo.c.
References gAdcChannelConfigStruct, and MPXVDP5004_ADC12_CHANNEL_GROUP.
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().
int main | ( | void | ) |
Main function.
Initialize GREEN LED pin used by FRDM board
Initialize the UART driver.
Set the UART Power mode.
Set UART Baud Rate.
Initialize streaming and assign a Stream ID.
Populate streaming header.
Definition at line 241 of file dp5004_demo.c.
References ADS_MAX_STRING_LENGTH, APPLICATION_NAME, APPLICATION_VERSION, bAdc12ConversionCompletedFlag, bDp5004Ready, BOARD_BootClockRUN, BOARD_DEBUG_UART_BAUDRATE, BOARD_RunADS(), BOARD_SystickElapsedTime_us(), BOARD_SystickEnable(), boardString, GENERIC_DRIVER_GPIO::clr_pin, embAppName, gAdcConversionValue, GPIO_DIRECTION_OUT, GREEN_LED, gStreamID, gSystick, HOST_FORMAT_HDLC, Host_IO_Add_ISO_Header(), Host_IO_Init(), Host_IO_Receive(), Host_IO_Send(), HOST_S_DRIVER, HOST_S_SIGNAL_EVENT, int32_t(), KE15Z_LPTMR0_ADC0_Initialize(), MPXV5004DP_PRESSURE_FROM_ADC_VALUE, MPXV5004DP_STREAM_DATA_SIZE, GENERIC_DRIVER_GPIO::pin_init, dp5004_pressuredata_t::pressure, process_host_command(), rawData, SHIELD_NAME, shieldString, SMC, SMC_SetPowerModeWait(), status, STREAMING_HEADER_LEN, streamingPacket, fxls8962_acceldataUser_t::timestamp, dp5004_pressuredata_t::timestamp, and GENERIC_DRIVER_GPIO::toggle_pin.
bool process_host_command | ( | uint8_t | tag, |
uint8_t * | hostCommand, | ||
uint8_t * | hostResponse, | ||
size_t * | hostMsgSize, | ||
size_t | respBufferSize | ||
) |
Definition at line 156 of file dp5004_demo.c.
References bDp5004Ready, BOARD_SystickStart(), boardString, bStreamingEnabled, GENERIC_DRIVER_GPIO::clr_pin, embAppName, GREEN_LED, gStreamID, gSystick, HOST_CMD_START, HOST_CMD_STOP, HOST_MSG_CMD_ACT_OFFSET, HOST_MSG_LEN_LSB_OFFSET, HOST_PRO_CMD_W_CFG_TAG, HOST_PRO_INT_CMD_TAG, HOST_PRO_INT_DEV_TAG, and shieldString.
Referenced by main().
volatile bool bAdc12ConversionCompletedFlag = false |
Definition at line 97 of file dp5004_demo.c.
Referenced by adc12_irq_callback(), and main().
volatile bool bDp5004Ready = false |
Definition at line 97 of file dp5004_demo.c.
Referenced by KE15Z_LPTMR0_ADC0_Initialize(), main(), and process_host_command().
char boardString[ADS_MAX_STRING_LENGTH] = {0} |
Definition at line 95 of file dp5004_demo.c.
Referenced by main(), and process_host_command().
volatile bool bStreamingEnabled = false |
Definition at line 97 of file dp5004_demo.c.
Referenced by process_host_command().
char embAppName[ADS_MAX_STRING_LENGTH] = {0} |
Definition at line 96 of file dp5004_demo.c.
Referenced by main(), and process_host_command().
adc12_channel_config_t gAdcChannelConfigStruct |
Definition at line 98 of file dp5004_demo.c.
Referenced by dp5004_odr_callback(), and KE15Z_LPTMR0_ADC0_Initialize().
volatile uint32_t gAdcConversionValue |
Definition at line 99 of file dp5004_demo.c.
Referenced by adc12_irq_callback(), and main().
uint8_t gStreamID |
Definition at line 100 of file dp5004_demo.c.
Referenced by main(), and process_host_command().
int32_t gSystick |
Definition at line 101 of file dp5004_demo.c.
Referenced by main(), and process_host_command().
GENERIC_DRIVER_GPIO* pGpioDriver = &Driver_GPIO_KSDK |
Definition at line 102 of file dp5004_demo.c.
char shieldString[ADS_MAX_STRING_LENGTH] = {0} |
Definition at line 95 of file dp5004_demo.c.
Referenced by main(), and process_host_command().