Skip to content
Snippets Groups Projects
Commit c212c594 authored by Paul Best's avatar Paul Best
Browse files

Update JConfig.CFG, log2wav, RapportInfo2txt, CLOCK.CFG, log2wav.c,...

Update JConfig.CFG, log2wav, RapportInfo2txt, CLOCK.CFG, log2wav.c, plot_mpu.py, RapportInfo2txt.c, trame IMU.txt files
parents
Branches
No related tags found
No related merge requests found
//System Configuration File
CLOCKTIME= 01/12/2020 14:30:00;
\ No newline at end of file
//System Configuration File
Sampling_Resolution=16; // 16 = Resolution in bits (8 or 16)
Sampling_Freq=256000; // 256000 = Sampling frequency(in sample //per sec). Possibles values are //512000,256000, 128000,64000 With WidBand //Filters, or 512000, //128000,32000,8000 With Low Latency //filter
Filter_Selection=1; // = 1 ; filter selection. Possibles //values are:
//0->Wideband1 (0.45 to0.55)×fDATA
//1->Wideband2 (0.40 to0.50)×fDATA
//2->LowLatency
AutoStart=true; // = true = Auto record at boot
FILE_Size_Limit=150000000;//File Size limitation (in bytes) = //150000000 for 5 minutes
Record_Use_TimeInterval=true; //Set or unset the discrete recording
Shutdown_Duration=5; //Time period of wait time between each record (in seconds)
Preparing_Duration=5; //Time to boot and prepare Pic 32 (SD Card or HDD is not the same)
Recording_Duration=5; //Time period of record (in seconds)
Stopping_Duration=5; //Time to stop Pic 32 (SD Card or HDD is not the same)
Channel_Count=2; //Number of channels to record
Storage_Target=SD; //Storage target (SD for SD card, HDD for hard disk drive or USB for Device mode)
CNN_Detection_Timeout_Duration=30;
GSM_Data_Send_Timeout_Duration=3;
Nb_Remontes_Par_Jour=10;
File added
// by paul
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#define NTOAS_MAX 200
#define RORQUAL_SAMPLE_RATE 4000
#define RORQUAL_LENSIG RORQUAL_SAMPLE_RATE*10 // load 60sec
#define RORQUAL_WINSIZE 4096
#define RORQUAL_LENSPEC (RORQUAL_LENSIG - RORQUAL_WINSIZE)/RORQUAL_HOPSIZE
#define RORQUAL_HOPSIZE 256
#define RORQUAL_LENPRED RORQUAL_LENSPEC - (5-1)*3 //3 layers of kernel size 5
#define RORQUAL_NSAMPLESTOSEND 3 // see cacha
#define RORQUAL_SAMPLESPERSAMPLE 8000 // see cacha
#define CACHA_SAMPLE_RATE 64000
#define CACHA_LENSIG CACHA_SAMPLE_RATE*10 // load 5sec
#define CACHA_WINSIZE 512
#define CACHA_LENSPEC (CACHA_LENSIG - CACHA_WINSIZE)/CACHA_HOPSIZE
#define CACHA_HOPSIZE 256
#define CACHA_LENPRED (((CACHA_LENSPEC - 6)/2 - 6)/2 -6)/2 // 3 layers hopsize 2 kernel 7
#define CACHA_NSAMPLESTOSEND 10 // a sample is positionned at a high pred from the cnn, we extract the audio signal arround to send back via network
#define CACHA_SAMPLESPERSAMPLE 6400 // number of audio samples per high pred sample to send back
typedef struct{
float predsC[CACHA_LENPRED]; //len of preds for 10sec signal
bool detectionCachalot;
float predsR[RORQUAL_LENPRED]; //len of preds for 60sec signal
bool detectionRorqual;
char fileName[50]; //Nom du fichier concerne
int ToAs_cacha[NTOAS_MAX];
unsigned char hydros_ToAs_cacha[NTOAS_MAX];
short predPeaksR[RORQUAL_NSAMPLESTOSEND]; //indices of predPeaks for rorqual
short predPeaksC[CACHA_NSAMPLESTOSEND]; //indices of predPeaks for cachalot
short int samplesR[RORQUAL_NSAMPLESTOSEND][RORQUAL_SAMPLESPERSAMPLE]; // samples to send back for rorqual
short int samplesC[CACHA_NSAMPLESTOSEND][CACHA_SAMPLESPERSAMPLE]; // samples to send back for cachalot
}RAPPORT;
int main(int argc, char* argv[]){
FILE* infile = fopen("Rapport.info", "rb");
FILE* outfile = fopen("Rapport.txt", "w+");
if(infile==NULL){
printf("Failed to open input file\n");
return 0;
}
if(outfile==NULL){
printf("Failed to open output file\n");
return 0;
}
RAPPORT rapport;
fread(&rapport, sizeof(RAPPORT), 1, infile);
int i, j;
fprintf(outfile, "Filename : %s \n", rapport.fileName);
fprintf(outfile, "\n rorqual preds\n");
for(i=0; i<RORQUAL_LENPRED; i++){
fprintf(outfile, "%f,", rapport.predsR[i]);
}
fprintf(outfile, "\n rorqual predPeaks\n");
for(i=0; i<RORQUAL_NSAMPLESTOSEND; i++){
fprintf(outfile, "%hd,", rapport.predPeaksR[i]);
}
fprintf(outfile, "\n rorqual samples\n");
for(i=0; i<RORQUAL_NSAMPLESTOSEND; i++){
for(j=0; j<RORQUAL_SAMPLESPERSAMPLE; j++){
fprintf(outfile, "%hd,", rapport.samplesR[i][j]);
}
fprintf(outfile, "\n");
}
fprintf(outfile, "cacha preds\n");
for(i=0; i<CACHA_LENPRED; i++){
fprintf(outfile, "%f,", rapport.predsC[i]);
}
fprintf(outfile, "\n cacha predPeaks\n");
for(i=0; i<CACHA_NSAMPLESTOSEND; i++){
fprintf(outfile, "%hd,", rapport.predPeaksC[i]);
}
fprintf(outfile, "\n cacha samples\n");
for(i=0; i<CACHA_NSAMPLESTOSEND; i++){
for(j=0; j<CACHA_SAMPLESPERSAMPLE; j++){
fprintf(outfile, "%hd,", rapport.samplesC[i][j]);
}
fprintf(outfile, "\n");
}
fclose(infile);
fclose(outfile);
return 0;
}
log2wav 0 → 100644
File added
log2wav.c 0 → 100644
// Jan. 2021
// by paul, inspired / recycled from microchip code by SMIOT
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#define MAX_PERIPHERAL 5 //Nombre max de peripheriques externes
#define twoKpDef (2.0f * 0.5f) // 2 * proportional gain
#define twoKiDef (2.0f * 0.0f) // 2 * integral gain
#define PI 3.14159265358979323846
// now = micros();
float twoKp = twoKpDef; // 2 * proportional gain (Kp)
float twoKi = twoKiDef; // 2 * integral gain (Ki)
float q0 = 1.0f;
float q1 = 0.0f;
float q2 = 0.0f;
float q3 = 0.0f;
float integralFBx = 0.0f;
float integralFBy = 0.0f;
float integralFBz = 0.0f;
float anglesComputed = 0;
void update(float gx, float gy, float gz, float ax, float ay, float az, float mx, float my, float mz)
{
float recipNorm;
float q0q0, q0q1, q0q2, q0q3, q1q1, q1q2, q1q3, q2q2, q2q3, q3q3;
float hx, hy, bx, bz;
float halfvx, halfvy, halfvz, halfwx, halfwy, halfwz;
float halfex, halfey, halfez;
float qa, qb, qc;
// Convert gyroscope degrees/sec to radians/sec
gx *= 0.0174533f;
gy *= 0.0174533f;
gz *= 0.0174533f;
// Use IMU algorithm if magnetometer measurement invalid
// (avoids NaN in magnetometer normalisation)
if((mx == 0.0f) && (my == 0.0f) && (mz == 0.0f)) {
// updateIMU(gx, gy, gz, ax, ay, az);
return;
}
// now = micros();
// // Set integration time by time elapsed since last filter update
// delta_t = ((now - last_update) / 1000000.0f);
// last_update = now;
// Compute feedback only if accelerometer measurement valid
// (avoids NaN in accelerometer normalisation)
if(!((ax == 0.0f) && (ay == 0.0f) && (az == 0.0f))) {
// Normalise accelerometer measurement
recipNorm = powf(ax * ax + ay * ay + az * az, -0.5);
ax *= recipNorm;
ay *= recipNorm;
az *= recipNorm;
// Normalise magnetometer measurement
recipNorm = powf(mx * mx + my * my + mz * mz, -0.5);
mx *= recipNorm;
my *= recipNorm;
mz *= recipNorm;
// Auxiliary variables to avoid repeated arithmetic
q0q0 = q0 * q0;
q0q1 = q0 * q1;
q0q2 = q0 * q2;
q0q3 = q0 * q3;
q1q1 = q1 * q1;
q1q2 = q1 * q2;
q1q3 = q1 * q3;
q2q2 = q2 * q2;
q2q3 = q2 * q3;
q3q3 = q3 * q3;
// Reference direction of Earth's magnetic field
hx = 2.0f * (mx * (0.5f - q2q2 - q3q3) + my * (q1q2 - q0q3) + mz * (q1q3 + q0q2));
hy = 2.0f * (mx * (q1q2 + q0q3) + my * (0.5f - q1q1 - q3q3) + mz * (q2q3 - q0q1));
bx = sqrtf(hx * hx + hy * hy);
bz = 2.0f * (mx * (q1q3 - q0q2) + my * (q2q3 + q0q1) + mz * (0.5f - q1q1 - q2q2));
// Estimated direction of gravity and magnetic field
halfvx = q1q3 - q0q2;
halfvy = q0q1 + q2q3;
halfvz = q0q0 - 0.5f + q3q3;
halfwx = bx * (0.5f - q2q2 - q3q3) + bz * (q1q3 - q0q2);
halfwy = bx * (q1q2 - q0q3) + bz * (q0q1 + q2q3);
halfwz = bx * (q0q2 + q1q3) + bz * (0.5f - q1q1 - q2q2);
// Error is sum of cross product between estimated direction
// and measured direction of field vectors
halfex = (ay * halfvz - az * halfvy) + (my * halfwz - mz * halfwy);
halfey = (az * halfvx - ax * halfvz) + (mz * halfwx - mx * halfwz);
halfez = (ax * halfvy - ay * halfvx) + (mx * halfwy - my * halfwx);
// Compute and apply integral feedback if enabled
if(false){ //twoKi > 0.0f) {
// integral error scaled by Ki
integralFBx += twoKi * halfex * 0.01;
integralFBy += twoKi * halfey * 0.01;
integralFBz += twoKi * halfez * 0.01;
gx += integralFBx; // apply integral feedback
gy += integralFBy;
gz += integralFBz;
} else {
integralFBx = 0.0f; // prevent integral windup
integralFBy = 0.0f;
integralFBz = 0.0f;
}
// Apply proportional feedback
gx += twoKp * halfex;
gy += twoKp * halfey;
gz += twoKp * halfez;
}
// Integrate rate of change of quaternion
gx *= (0.5f * 0.01); // pre-multiply common factors
gy *= (0.5f * 0.01);
gz *= (0.5f * 0.01);
qa = q0;
qb = q1;
qc = q2;
q0 += (-qb * gx - qc * gy - q3 * gz);
q1 += (qa * gx + qc * gz - q3 * gy);
q2 += (qa * gy - qb * gz + q3 * gx);
q3 += (qa * gz + qb * gy - qc * gx);
// Normalise quaternion
recipNorm = powf(q0 * q0 + q1 * q1 + q2 * q2 + q3 * q3, -0.5);
q0 *= recipNorm;
q1 *= recipNorm;
q2 *= recipNorm;
q3 *= recipNorm;
anglesComputed = 0;
}
typedef struct{
char Type; //type du peripherique (0x01 accel, 0x02 gyro, 0x03 magneto, 0x04 temperature, 0x05 pressure, 0x06 light,...)
char ID; //ID du peripherique
char Range; //Range de la mesure (ex: 2G, 4G, 6G, 8G, 16G pour un accel)
char Resolution; //Resolution de mesure du peripherique
short Frequency; //Frequence d'echantillonage du peripherique
}PERIPHERAL_CONFIGURATION;
typedef struct{
int headerSize; //Taille du header ce champ exclu
int versionNumber;
char numberOfChan;
char resolutionBits;
int samplingFrequency;
int dmaBlockSize;
int sizeOfAdditionnalDataBuffer;
char numberOfExternalPeripheral;
int timeStampOfStart;
PERIPHERAL_CONFIGURATION periphConfig[MAX_PERIPHERAL];
}HighBlueHeader;
struct WaveHeader_s {
char chunkId[4]; // Riff Wave Header
int chunkSize;
char format[4];
char subChunk1Id[4]; // Format Subchunk
int subChunk1Size;
short int audioFormat;
short int numChannels;
int sampleRate;
int byteRate;
short int blockAlign;
short int bitsPerSample;
//short int extraParamSize;
char subChunk2Id[4]; // Data Subchunk
int subChunk2Size;
} WaveHeader_default = {{'R','I','F','F'}, 36, {'W','A','V','E'}, {'f','m','t',' '}, 16, 1, 0, 0, 0, 0, 0, {'d','a','t','a'}, 0};
typedef struct WaveHeader_s WaveHeader;
void parseLogFileHeader(FILE* logfile, HighBlueHeader* hdr, int verbose){
// header parse
fread(&hdr->headerSize, 4, 1, logfile);
fread(&hdr->versionNumber, 2, 1, logfile);
fread(&hdr->numberOfChan, 1, 1, logfile);
fread(&hdr->resolutionBits, 1, 1, logfile);
fread(&hdr->samplingFrequency, 4, 1, logfile);
fread(&hdr->dmaBlockSize, 4, 1, logfile);
fread(&hdr->sizeOfAdditionnalDataBuffer, 4, 1, logfile);
fread(&hdr->numberOfExternalPeripheral, 1, 1, logfile);
fread(&hdr->timeStampOfStart, 4, 1, logfile);
if(verbose){
printf("header size : %d\n", hdr->headerSize);
printf("version number : %d\n", hdr->versionNumber);
printf("number of chans : %d\n", hdr->numberOfChan);
printf("resolutionBits : %d\n", hdr->resolutionBits);
printf("samplingFrequency : %d\n", hdr->samplingFrequency);
printf("dmaBlockSize : %d\n", hdr->dmaBlockSize);
printf("sizeOfAdditionnalDataBuffer : %d\n", hdr->sizeOfAdditionnalDataBuffer);
printf("numberOfExternalPeripheral : %d\n", hdr->numberOfExternalPeripheral);
printf("timeStampOfStart : %d\n", hdr->timeStampOfStart);
}
// load external periph config
for(int i=0; i<hdr->numberOfExternalPeripheral; i++){
fread(&hdr->periphConfig[i].Type, 1, 1, logfile);
fread(&hdr->periphConfig[i].ID, 1, 1, logfile);
fread(&hdr->periphConfig[i].Range, 1, 1, logfile);
fread(&hdr->periphConfig[i].Resolution, 1, 1, logfile);
fread(&hdr->periphConfig[i].Frequency, 2, 1, logfile);
}
return;
}
short int toLittleEndian(short int val){
return val = ((val & 0x00FF)<<8) | ((val & 0xFF00)>>8);
}
void parseMPU(unsigned char* additionnalDataBlock, int size, bool verbose, FILE* mpuFile){
static int maxtimeStamp = 0;
int i, timestamp;
short int trameSize = 31, val; // fixed for now
unsigned char* curData = additionnalDataBlock + 6; // first 6 bytes are for usb device
if(verbose){
printf("MPU Range : %hdG\n", *(curData + 5 + 3));
printf("MPU Resolution : %hd\n", *(curData + 5 + 3 + 1));
printf("MPU Sampling Frequency : %hd\n", *(curData + 5 + 3 + 3));
}
while(curData + trameSize + 6 < additionnalDataBlock + size){
if(!(curData[0]==0xFE && curData[1]==0x0A && curData[2]==0x0A && curData[5]==0x08)){
// skip trame if header is incorrect
curData += trameSize + 6;
continue;
}
curData += 3 + 2; // skip trame header, trame length
timestamp = *((int*) (curData + 9));
timestamp = ((timestamp & 0xFF000000)>>24) | ((timestamp & 0x00FF0000)>>8) | ((timestamp & 0x0000FF00)<<8) | ((timestamp & 0x000000FF)<<24);
if(timestamp > maxtimeStamp){
fprintf(mpuFile, "%d,", timestamp);
//printf("%d\n", timestamp);
// treat payload
for(i=13; i<31; i+=2){
val = *((short int*) (curData + i));
val = ((val & 0x00FF)<<8) | ((val & 0xFF00)>>8);
//printf("curData %x %x %hd", *(curData+i), *(curData + i +1), val);
if( true){//i<29){
fprintf(mpuFile, "%hd,", val);
}else{
fprintf(mpuFile, "%hd\n", val);
}
}
float ax = ((float) toLittleEndian(*((short int*) (curData + 13)))) / 32756 * 19.62; // resolution +- 2g
float ay = ((float) toLittleEndian(*((short int*) (curData + 15)))) / 32756 * 19.62;
float az = ((float) toLittleEndian(*((short int*) (curData + 17)))) / 32756 * 19.62;
float gx = ((float) toLittleEndian(*((short int*) (curData + 19)))) / 32756 * 250; // resolution +- 255deg/sec
float gy = ((float) toLittleEndian(*((short int*) (curData + 21)))) / 32756 * 250;
float gz = ((float) toLittleEndian(*((short int*) (curData + 23)))) / 32756 * 250;
float mx = ((float) toLittleEndian(*((short int*) (curData + 25)))) / 32756 * 0.15; // utesla
float my = ((float) toLittleEndian(*((short int*) (curData + 27)))) / 32756 * (0.15); // - car magneto oppose a accelero
float mz = ((float) toLittleEndian(*((short int*) (curData + 29)))) / 32756 * (0.15); // - car magneto oppose a accelero
// update(ax, ay, az, gx, gy, gz, mx, my, mz);
// fprintf(mpuFile, "%f,", atan2f(q0*q1 + q2*q3, 0.5f - q1*q1 - q2*q2) * 360 / PI); // roll
// fprintf(mpuFile, "%f,", asinf(-2.0f * (q1*q3 - q0*q2)) * 360 / PI); // pitch
// fprintf(mpuFile, "%f\n", atan2f(q1*q2 + q0*q3, 0.5f - q2*q2 - q3*q3) * 360 / PI); // yaw
float pitch = 180 * atan (ax/sqrt(ay*ay + az*az))/PI;
float roll = 180 * atan (ay/sqrt(ax*ax + az*az))/PI;
float yaw = 180 * atan (az/sqrt(ax*ax + az*az))/PI;
fprintf(mpuFile, "%f,", pitch);
fprintf(mpuFile, "%f,", yaw);
fprintf(mpuFile, "%f\n", roll);
maxtimeStamp = timestamp;
}
curData += trameSize + 1; // shift of trame size + 1 byte of checksum
}
}
int main(int argc, char* argv[]){
if(argc < 3){
printf("Script needs to be called with at least 2 arguments : \n \t input file name (.log file) \n \t output filename (.wav file)\n \t (optionnal) verbose (1 / void)\n");
return 0;
}
HighBlueHeader hdr;
FILE* logfile = fopen(argv[1], "rb");
if(logfile==NULL){
printf("Failed to open input file\n");
return 0;
}
int verbose = 0;
if(argc==5){
verbose = *argv[4]=='1';
}
// file opened successfully, we read the header
parseLogFileHeader(logfile, &hdr, verbose);
int resolutionBytes = hdr.resolutionBits/8;
// get file size then move to start of data
fseek(logfile, 0, SEEK_END);
long filesize = ftell(logfile);
long dataBlockSampleSize = hdr.dmaBlockSize / ( hdr.numberOfChan * resolutionBytes);
if(verbose){
printf("file size (bytes) %ld \n", filesize);
printf("dataBlockSampleSize %ld\n", dataBlockSampleSize);
}
if(hdr.resolutionBits!=16 && hdr.resolutionBits!=24 && hdr.resolutionBits!=32){
printf("resolution %d not supported yet sorry", hdr.resolutionBits);
return 0;
}
FILE* wavfile = fopen(argv[2], "wb"); // open wav file
if(wavfile==NULL){
printf("Failed to open wav output file\n");
return 0;
}
WaveHeader whdr = WaveHeader_default;
whdr.numChannels = hdr.numberOfChan;
whdr.sampleRate = hdr.samplingFrequency;
whdr.bitsPerSample = hdr.resolutionBits;
whdr.byteRate = whdr.sampleRate * whdr.numChannels * resolutionBytes;
whdr.blockAlign = whdr.numChannels * resolutionBytes;
whdr.chunkSize = 36 + (filesize - hdr.headerSize - 4) / (hdr.dmaBlockSize + hdr.sizeOfAdditionnalDataBuffer) * hdr.numberOfChan * dataBlockSampleSize * resolutionBytes;
whdr.subChunk2Size = whdr.chunkSize-36;
fwrite(&whdr, sizeof(WaveHeader), 1, wavfile);
FILE* mpuFile = fopen(argv[3], "w+"); // open mpu file
if(mpuFile==NULL){
printf("Failed to open mpu output file\n");
return 0;
}
char* dmaBlock = (char*) malloc(hdr.dmaBlockSize);
char* additionnalDataBlock = (char*) malloc(hdr.sizeOfAdditionnalDataBuffer);
char* samples = (char*) malloc(hdr.numberOfChan * resolutionBytes);
int ichan, isample;
long pos = 0;
bool isFirst = true;
fseek(logfile, hdr.headerSize + 4, SEEK_SET); // move past the logfile header
// read each dataBlock
do{
fread(additionnalDataBlock, hdr.sizeOfAdditionnalDataBuffer, 1, logfile);
parseMPU(additionnalDataBlock, hdr.sizeOfAdditionnalDataBuffer, isFirst && verbose, mpuFile);
isFirst = false;
fread(dmaBlock, hdr.dmaBlockSize, 1, logfile);
for(isample=0; isample<dataBlockSampleSize; isample++){
for(ichan=0; ichan<hdr.numberOfChan; ichan++){
memcpy(samples + ichan * resolutionBytes, dmaBlock + (ichan * dataBlockSampleSize + isample) * resolutionBytes, resolutionBytes);
}
fwrite(samples, resolutionBytes, hdr.numberOfChan, wavfile);
}
printf("\r %s : ", argv[2]);
pos = ftell(logfile);
printf(" %ld%%", pos*100/filesize);
}while(pos < filesize - 1);
printf("\r\n");
fclose(wavfile);
fclose(logfile);
fclose(mpuFile);
return 0;
}
import numpy as np
import matplotlib.pyplot as plt
import os
time, accelX, accelY, accelZ, gyroX, gyroY, gyroZ, magX, magY, magZ = [], [], [], [], [], [], [], [], [], []
for f in os.listdir('./test/'):
if not f.endswith('mpu.csv'):
continue
print(f)
a = np.loadtxt('./test/'+f, delimiter=',')
time.extend(a[:,0])
accelX.extend(a[:,1])
accelY.extend(a[:,2])
accelZ.extend(a[:,3])
gyroX.extend(a[:,4])
gyroY.extend(a[:,5])
gyroZ.extend(a[:,6])
magX.extend(a[:,10])
magY.extend(a[:,11])
magZ.extend(a[:,12])
plt.scatter(time, magX, label='x')
plt.scatter(time, magY, label='y')
plt.scatter(time, magZ, label='z')
plt.legend()
plt.show()
commandSPISentUART = HS_DATA_PACKET_FULL_TIMESTAMP;
indexpayloadSPISentUART = 0;
// uint16_t payloadLength = SET_RTCC_DU_RECORDER_AUDIO_LENGHT;
// uint8_t payload[payloadLength];
uint32_t timstampNow = GetFullTimestamp();
payloadSPISentUART[indexpayloadSPISentUART++] = 0x08;//Type IMU
payloadSPISentUART[indexpayloadSPISentUART++] = 0x01;//Sensor ID
payloadSPISentUART[indexpayloadSPISentUART++] = 9;//Sensor ID
payloadSPISentUART[indexpayloadSPISentUART++] = 4;//Range 4G
payloadSPISentUART[indexpayloadSPISentUART++] = 16;//16 bits resolution
payloadSPISentUART[indexpayloadSPISentUART++] = 0;//Sampling freq 100 Hz
payloadSPISentUART[indexpayloadSPISentUART++] = 100;//Sampling freq 100 Hz
payloadSPISentUART[indexpayloadSPISentUART++] = 0;//Nb samples
payloadSPISentUART[indexpayloadSPISentUART++] = 1;//Nb samples
payloadSPISentUART[indexpayloadSPISentUART++] = BREAK_UINT32(timstampNow, 3);//supervisorState.localTime.year;
payloadSPISentUART[indexpayloadSPISentUART++] = BREAK_UINT32(timstampNow, 2);//supervisorState.localTime.month;
payloadSPISentUART[indexpayloadSPISentUART++] = BREAK_UINT32(timstampNow, 1);//supervisorState.localTime.day;
payloadSPISentUART[indexpayloadSPISentUART++] = BREAK_UINT32(timstampNow, 0);//supervisorState.localTime.hour;
payloadSPISentUART[indexpayloadSPISentUART++] = ICM20948_subAccel.Accel_X_High;
payloadSPISentUART[indexpayloadSPISentUART++] = ICM20948_subAccel.Accel_X_Low;
payloadSPISentUART[indexpayloadSPISentUART++] = ICM20948_subAccel.Accel_Y_High;
payloadSPISentUART[indexpayloadSPISentUART++] = ICM20948_subAccel.Accel_Y_Low;
payloadSPISentUART[indexpayloadSPISentUART++] = ICM20948_subAccel.Accel_Z_High;
payloadSPISentUART[indexpayloadSPISentUART++] = ICM20948_subAccel.Accel_Z_Low;
payloadSPISentUART[indexpayloadSPISentUART++] = ICM20948_subGyro.Gyro_X_High;
payloadSPISentUART[indexpayloadSPISentUART++] = ICM20948_subGyro.Gyro_X_Low;
payloadSPISentUART[indexpayloadSPISentUART++] = ICM20948_subGyro.Gyro_Y_High;
payloadSPISentUART[indexpayloadSPISentUART++] = ICM20948_subGyro.Gyro_Y_Low;
payloadSPISentUART[indexpayloadSPISentUART++] = ICM20948_subGyro.Gyro_Z_High;
payloadSPISentUART[indexpayloadSPISentUART++] = ICM20948_subGyro.Gyro_Z_Low;
payloadSPISentUART[indexpayloadSPISentUART++] = ICM20948_subMag.Mag_X_High;
payloadSPISentUART[indexpayloadSPISentUART++] = ICM20948_subMag.Mag_X_Low;
payloadSPISentUART[indexpayloadSPISentUART++] = ICM20948_subMag.Mag_Y_High;
payloadSPISentUART[indexpayloadSPISentUART++] = ICM20948_subMag.Mag_Y_Low;
payloadSPISentUART[indexpayloadSPISentUART++] = ICM20948_subMag.Mag_Z_High;
payloadSPISentUART[indexpayloadSPISentUART++] = ICM20948_subMag.Mag_Z_Low;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment