-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcTest.c
More file actions
29 lines (26 loc) · 683 Bytes
/
cTest.c
File metadata and controls
29 lines (26 loc) · 683 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <stdio.h>
#include <stdbool.h>
#include <stdint.h>
#include "inc/inaRegisterMap.h"
#include "inc/inaTypes.h"
int tenBit[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
void printBinary(int number){
bool bit;
int index = 16;
while(number > 0){
bit = number%2;
number = number/2;
tenBit[index--] = bit;
}
printf("\nnumber is ");
for (int i = 0 ; i <= 16; i++){
printf("%d", tenBit[i]);
}
}
void main(){
inaChannel_t chan = ChannelOne;
inaAveragingMode_t averagingMode = avgModeSamples4;
int a = (averagingMode << (ina_EnMaskSummationControlShiftMask + (3-chan)));
printf("%d\n", a);
printBinary(a);
}