Bladeren bron

Add reading from the BME280 using the official API

Currently the data values are written to the debug output.
Bernd Gottschlag 5 jaren geleden
bovenliggende
commit
e5ad15dbfa

+ 3
- 0
.gitmodules Bestand weergeven

@@ -0,0 +1,3 @@
1
+[submodule "weather-sensor/firmware/BME280_driver"]
2
+	path = weather-sensor/firmware/BME280_driver
3
+	url = https://github.com/BoschSensortec/BME280_driver.git

+ 1
- 0
weather-sensor/firmware/BME280_driver

@@ -0,0 +1 @@
1
+Subproject commit 3d686a326565b9cadb8507f73d7576ec0cc891f2

+ 139
- 0
weather-sensor/firmware/bme280_interface.c Bestand weergeven

@@ -0,0 +1,139 @@
1
+#include <avr/io.h>
2
+#include <util/delay.h>
3
+
4
+#include "bme280.h"
5
+#include "bme280_interface.h"
6
+
7
+/* for debugging */
8
+#include "uart_debug.h"
9
+#include <stdint.h>
10
+#include <stdio.h>
11
+#include <string.h>
12
+
13
+
14
+void user_delay_ms(uint32_t period);
15
+int8_t user_spi_read(uint8_t dev_id, uint8_t reg_addr, uint8_t *reg_data, uint16_t len);
16
+int8_t user_spi_write(uint8_t dev_id, uint8_t reg_addr, uint8_t *reg_data, uint16_t len);
17
+
18
+
19
+struct bme280_dev deviceStructure;
20
+uint32_t req_delay;
21
+
22
+
23
+int8_t Initialize_BME280(void)
24
+{
25
+	int8_t rslt = BME280_OK;
26
+	uint8_t settings_sel;
27
+	char debugString[20] = "";
28
+
29
+
30
+	/* Setup the SPI interface */
31
+	BME_CSN_DDR |= (1 << BME_CSN_PIN);
32
+	BME_CSN_PORT |= (1 << BME_CSN_PIN);
33
+
34
+
35
+	/* Sensor_0 interface over SPI with native chip select line */
36
+	deviceStructure.dev_id = 0;
37
+	deviceStructure.intf = BME280_SPI_INTF;
38
+	deviceStructure.read = user_spi_read;
39
+	deviceStructure.write = user_spi_write;
40
+	deviceStructure.delay_ms = user_delay_ms;
41
+
42
+	rslt = bme280_init(&deviceStructure);
43
+
44
+	/* Settings for mode of operation: weather monitorint */
45
+	deviceStructure.settings.osr_h = BME280_OVERSAMPLING_1X;
46
+	deviceStructure.settings.osr_p = BME280_OVERSAMPLING_1X;
47
+	deviceStructure.settings.osr_t = BME280_OVERSAMPLING_1X;
48
+	deviceStructure.settings.filter = BME280_FILTER_COEFF_OFF;
49
+
50
+	settings_sel = BME280_OSR_PRESS_SEL | BME280_OSR_TEMP_SEL | BME280_OSR_HUM_SEL | BME280_FILTER_SEL;
51
+
52
+	rslt = bme280_set_sensor_settings(settings_sel, &deviceStructure);
53
+
54
+	/* calculate minimum delay required between consecutive measurments */
55
+	req_delay = bme280_cal_meas_delay(&deviceStructure.settings);
56
+
57
+	sprintf(debugString, "req delay: %ld\r\n", req_delay);
58
+	Print_Debug_String(debugString);
59
+
60
+	return rslt;
61
+}
62
+
63
+/* Get one measurement in forced mode */
64
+void BME280_Get_Measurement(void)
65
+{
66
+	int8_t rslt = BME280_OK;
67
+	struct bme280_data comp_data;
68
+	char debugString[30] = "";
69
+
70
+	rslt = bme280_set_sensor_mode(BME280_FORCED_MODE, &deviceStructure);
71
+	/* Wait for the measurement to complete and print data @25Hz */
72
+	deviceStructure.delay_ms(req_delay);
73
+	rslt = bme280_get_sensor_data(BME280_ALL, &comp_data, &deviceStructure);
74
+
75
+	sprintf(debugString, "rslt: %d\r\n", rslt);
76
+	Print_Debug_String(debugString);
77
+	sprintf(debugString, "temp: %ld\r\n", comp_data.temperature);
78
+	Print_Debug_String(debugString);
79
+	sprintf(debugString, "hum: %ld\r\n", comp_data.humidity);
80
+	Print_Debug_String(debugString);
81
+	sprintf(debugString, "pres: %ld\r\n", comp_data.pressure);
82
+	Print_Debug_String(debugString);
83
+}
84
+
85
+/* Implementation of the interface function needed by the BME280 library */
86
+void user_delay_ms(uint32_t period)
87
+{
88
+	while (period--)
89
+	{
90
+		_delay_ms(1);
91
+	}
92
+}
93
+
94
+int8_t user_spi_read(uint8_t dev_id, uint8_t reg_addr, uint8_t *reg_data, uint16_t len)
95
+{
96
+	int8_t rslt = 0; /* Return 0 for Success, non-zero for failure */
97
+
98
+	/* unused parameters */
99
+	(void)dev_id;
100
+
101
+	/* SPI routine */
102
+
103
+	/* TODO pack into spi byte transfer function */
104
+	BME_CSN_PORT &= ~(1<<BME_CSN_PIN); // Start the transmission
105
+	SPDR = reg_addr;
106
+	while(!(SPSR & (1<<SPIF))); // Wait for transmission complete
107
+
108
+	for (uint16_t i = 0; i < len; i ++)
109
+	{
110
+		SPDR = 0x0; /* value doesn't matter */
111
+		while(!(SPSR & (1<<SPIF))); // Wait for transmission complete
112
+		reg_data[i] = SPDR;
113
+	}
114
+	BME_CSN_PORT |= (1<<BME_CSN_PIN); // Stop the transmission
115
+
116
+	return rslt;
117
+}
118
+
119
+int8_t user_spi_write(uint8_t dev_id, uint8_t reg_addr, uint8_t *reg_data, uint16_t len)
120
+{
121
+	int8_t rslt = 0; /* Return 0 for Success, non-zero for failure */
122
+
123
+	/* unused parameters */
124
+	(void)dev_id;
125
+
126
+	/* SPI routine */
127
+	BME_CSN_PORT &= ~(1<<BME_CSN_PIN); // Start the transmission
128
+	SPDR = reg_addr;
129
+	while(!(SPSR & (1<<SPIF))); // Wait for transmission complete
130
+
131
+	for (uint16_t i = 0; i < len; i ++)
132
+	{
133
+		SPDR = reg_data[i]; /* value doesn't matter */
134
+		while(!(SPSR & (1<<SPIF))); // Wait for transmission complete
135
+	}
136
+	BME_CSN_PORT |= (1<<BME_CSN_PIN); // Stop the transmission
137
+
138
+	return rslt;
139
+}

+ 15
- 0
weather-sensor/firmware/bme280_interface.h Bestand weergeven

@@ -0,0 +1,15 @@
1
+#ifndef BME280_H
2
+#define BME280_H
3
+
4
+#include <stdint.h>
5
+//#include "bme280.h"
6
+
7
+/* AVR I/O pin definionts */
8
+#define BME_CSN_DDR   DDRB
9
+#define BME_CSN_PORT  PORTB
10
+#define BME_CSN_PIN   PB6
11
+
12
+int8_t Initialize_BME280(void);
13
+void BME280_Get_Measurement(void);
14
+
15
+#endif

BIN
weather-sensor/firmware/main Bestand weergeven


+ 11
- 0
weather-sensor/firmware/main.c Bestand weergeven

@@ -9,6 +9,7 @@
9 9
 
10 10
 #include "nrf24l01.h"
11 11
 #include "nrf24l01_definitions.h"
12
+#include "bme280_interface.h"
12 13
 #include "uart_debug.h"
13 14
 
14 15
 //#define LED_DDR     DDRB        //DDRA, DDRB...
@@ -65,8 +66,17 @@ int main (void)
65 66
 	/* Configure the transmission parameters (Enhanced ShockBurst)*/
66 67
 	Configure_Transmission();
67 68
 
69
+	/* Initialize the BME280 */
70
+	Initialize_BME280();
68 71
 
69 72
 
73
+#if 0
74
+	/* Test the BME280 by reading the ID */
75
+	uint8_t id = Read_BME280_Register(0xD0);
76
+	sprintf(debugString, "ID: 0x%x\r\n", id);
77
+	Print_Debug_String(debugString);
78
+#endif
79
+
70 80
 
71 81
 
72 82
 
@@ -76,6 +86,7 @@ int main (void)
76 86
 
77 87
 	while(1)
78 88
 	{
89
+		BME280_Get_Measurement();
79 90
 		Send_Test_Message();
80 91
 		_delay_ms(1000);
81 92
 	}

+ 0
- 200
weather-sensor/firmware/main.hex Bestand weergeven

@@ -1,200 +0,0 @@
1
-:100000000C9456000C9473000C9473000C947300C1
2
-:100010000C9473000C9473000C9473000C94730094
3
-:100020000C9473000C9473000C9473000C94730084
4
-:100030000C9473000C9473000C9473000C94730074
5
-:100040000C9473000C9473000C9473000C94730064
6
-:100050000C9473000C9473000C9473000C94730054
7
-:100060000C9473000C9473000C9473000C94730044
8
-:100070000C9473000C9473000C9473000C94730034
9
-:100080000C9473000C9473000C9473000C94730024
10
-:100090000C9473000C9473000C9473000C94730014
11
-:1000A0000C9473000C9473000C94730011241FBE05
12
-:1000B000CFEFDAE0DEBFCDBF11E0A0E0B1E0E6E1D6
13
-:1000C000FCE002C005900D92AE34B107D9F721E0F3
14
-:1000D000AEE4B1E001C01D92A335B207E1F70E9482
15
-:1000E000C5020C9409060C94000086E084B980E5F2
16
-:1000F0008CBD08952D988FEF8EBD0DB407FEFDCFFA
17
-:100100002D9A8EB50895982F86EF890F823010F0C2
18
-:10011000903111F485E001C081E02D989EBD0DB4B1
19
-:1001200007FEFDCF262FFB011EBC0DB407FEFDCF41
20
-:100130009EB591939E2F921B9817B0F32D9A089518
21
-:100140009F92AF92BF92CF92DF92EF92FF920F9366
22
-:100150001F93CF93DF93CDB7DEB7C555D1090FB647
23
-:10016000F894DEBF0FBECDBF1A821982FE0133960E
24
-:1001700090E3DF011D929A95E9F77E01B1E5EB0E60
25
-:10018000F11CB7010E948300982E1BAA67018E0103
26
-:100190000D5C1F4F84E2A82E81E0B82E8C2D8E19A5
27
-:1001A000891598F4F60181916F011F928F931F9327
28
-:1001B0000F93BF92AF921F930F930E941F030FB62E
29
-:1001C000F894DEBF0FBECDBFE9CF1F930F9382E13E
30
-:1001D00091E09F938F938E010F5F1F4F1F930F939B
31
-:1001E0000E941F03C8010E94AB020F900F900F9056
32
-:1001F0000F900F900F90CB5ADF4F0FB6F894DEBFE1
33
-:100200000FBECDBFDF91CF911F910F91FF90EF9067
34
-:10021000DF90CF90BF90AF909F9008952D9880620F
35
-:100220008EBD0DB407FEFDCF6EBD0DB407FEFDCF34
36
-:100230002D9A0895249A259A2D9A2C988FEE95E55B
37
-:100240000197F1F700C000006AE080E00E940E0113
38
-:100250008FE99FE00197F1F700C0000008952D9805
39
-:1002600080E58EBD0DB407FEFDCF83E78EBD0DB4D6
40
-:1002700007FEFDCF2D9A08952D9890EA9EBD0DB4EE
41
-:1002800007FEFDCF262FFB019E2F921B981730F4FF
42
-:1002900091919EBD0DB407FEFDCFF6CF2D9A089526
43
-:1002A0004F925F926F927F928F929F92AF92BF9286
44
-:1002B000CF92DF92EF92FF920F931F93CF93DF9332
45
-:1002C000CDB7DEB7EB970FB6F894DEBF0FBECDBF4C
46
-:1002D0008091000190910101A0910201B091030170
47
-:1002E00088AF99AFAAAFBBAF1A821982FE013396CD
48
-:1002F00080E3DF011D928A95E9F7BE01685C7F4FBC
49
-:1003000084E00E943C012C9AB8E2BA95F1F72C984F
50
-:10031000412C512C32018CE2882E81E0982E02E192
51
-:1003200011E0CE0101967C0197E3C92E91E0D92E10
52
-:100330002EE3A22E21E0B22EAFECB7E01197F1F739
53
-:1003400000C00000BE016D5C7F4F87E00E9483000B
54
-:10035000823088F09F928F921F930F93FF92EF92BB
55
-:100360000E941F03C7010E94AB020F900F900F90D5
56
-:100370000F900F900F908BA985FF13C0DF92CF9243
57
-:100380001F930F93FF92EF920E941F03C7010E94D9
58
-:10039000AB020F900F900F900F900F900F9081E095
59
-:1003A00001C080E09BA994FF12C0BF92AF921F933F
60
-:1003B0000F93FF92EF920E941F03C7010E94AB02AE
61
-:1003C0000F900F900F900F900F900F9081E0BFEF64
62
-:1003D0004B1A5B0A6B0A7B0A811108C08FEF481623
63
-:1003E00051046104710409F0A7CF06C09FEF4916BC
64
-:1003F000510461047104C1F486E491E09F938F93EA
65
-:1004000082E191E09F938F938E010F5F1F4F1F93A7
66
-:100410000F930E941F03C8010E94AB020F900F9020
67
-:100420000F900F900F900F90BE016D5C7F4F87E093
68
-:100430000E9483006BA96F7087E00E940E01EB960B
69
-:100440000FB6F894DEBF0FBECDBFDF91CF911F91E5
70
-:100450000F91FF90EF90DF90CF90BF90AF909F9063
71
-:100460008F907F906F905F904F900895CF93DF9320
72
-:1004700000D000D0CDB7DEB769837A838B839C83AD
73
-:100480002D9880E38EBD0DB407FEFDCFFE013196A1
74
-:10049000CE01059621912EBD0DB407FEFDCFE817C4
75
-:1004A000F907C1F71EBC0DB407FEFDCF2D9A0F90C2
76
-:1004B0000F900F900F90DF91CF910895CF93DF931E
77
-:1004C00000D000D0CDB7DEB769837A838B839C835D
78
-:1004D0002D988AE28EBD0DB407FEFDCFFE01319648
79
-:1004E000CE01059621912EBD0DB407FEFDCFE81774
80
-:1004F000F907C1F71EBC0DB407FEFDCF2D9A0F9072
81
-:100500000F900F900F90DF91CF91089562E385E0F7
82
-:100510000E940E010E942F0164E08DE10E940E01F5
83
-:100520006FE38CE10E940E0166E574E382E190E0E6
84
-:100530000E94360266E574E382E190E00C945E026C
85
-:100540009093CD008093CC0088E18093C9008EE029
86
-:100550008093CA00089540E0242F30E0FC01019010
87
-:100560000020E9F73197E81BF90B2E173F0760F4DD
88
-:100570005091C80055FFFCCFFC01E20FF31F208112
89
-:100580002093CE004F5FE8CF0895CF93DF93CDB790
90
-:10059000DEB7E2970FB6F894DEBF0FBECDBF1A826A
91
-:1005A0001982FE01339680E3DF011D928A95E9F7F7
92
-:1005B00083E390E00E94A00284E091E09F938F93F8
93
-:1005C00082E191E09F938F938E010F5F1F4F1F93E6
94
-:1005D0000F930E941F03C8010E94AB020E94750086
95
-:1005E0000E941A010E9486020F900F900F900F90A8
96
-:1005F0000F900F9087E1C82E81E0D82E92E1E92E6E
97
-:1006000091E0F92E0E945001DF92CF92FF92EF927B
98
-:100610001F930F930E941F03C8010E94AB02BFEFFC
99
-:1006200029E688E1B15020408040E1F700C0000099
100
-:100630000F900F900F900F900F900F90E3CFAEE0C0
101
-:10064000B0E0E5E2F3E00C94E0050D891E8986E058
102
-:100650008C831A8309838FEF9FE79E838D83AE017E
103
-:10066000475E5F4F6F89788DCE0101960E944103EE
104
-:10067000EF81F885E00FF11F10822E96E4E00C94D4
105
-:10068000FC05ABE0B0E0E7E4F3E00C94D2056C01CC
106
-:100690007B018A01FC0117821682838181FFCCC114
107
-:1006A000CE0101963C01F6019381F70193FD8591FE
108
-:1006B00093FF81917F01882309F4BAC1853239F40F
109
-:1006C00093FD859193FF81917F01853229F4B601D5
110
-:1006D00090E00E943805E7CF912C212C312CFFE1CE
111
-:1006E000F315D8F08B3279F038F4803279F0833218
112
-:1006F000A1F4232D20611DC08D3261F0803369F497
113
-:10070000232D216016C0832D8260382EE32DE460F6
114
-:100710003E2E2AC0F32DF8601DC037FC2DC020ED01
115
-:10072000280F2A3040F08E32B9F436FC81C1232DD7
116
-:100730002064322E19C036FE06C08AE0989E200D35
117
-:100740001124922E11C0EAE02E9E200D1124222E9B
118
-:10075000F32DF0623F2E08C08C3621F4832D806883
119
-:10076000382E02C0883641F4F70193FD859193FF3E
120
-:1007700081917F018111B3CF982F9F7D9554933044
121
-:1007800028F40C5F1F4F9FE399830DC0833631F02F
122
-:10079000833771F0833509F059C021C0F801808199
123
-:1007A00089830E5F1F4F88248394912C530113C0BB
124
-:1007B0002801F2E04F0E511CF801A080B18036FEF6
125
-:1007C00003C0692D70E002C06FEF7FEFC5010E948A
126
-:1007D0002D054C018201F32DFF773F2E16C0280115
127
-:1007E00022E0420E511CF801A080B18036FE03C009
128
-:1007F000692D70E002C06FEF7FEFC5010E942205F6
129
-:100800004C01F32DF0683F2E820133FC1BC0822D7A
130
-:1008100090E088169906B0F4B60180E290E00E945C
131
-:1008200038052A94F4CFF50137FC859137FE819184
132
-:100830005F01B60190E00E94380521102A9421E062
133
-:10084000821A91088114910471F7E8C0843611F07E
134
-:10085000893641F5F80137FE07C0608171818281D8
135
-:1008600093810C5F1F4F08C060817181072E000CBF
136
-:10087000880B990B0E5F1F4FF32DFF763F2E97FFCE
137
-:1008800009C090958095709561957F4F8F4F9F4FD0
138
-:10089000F0683F2E2AE030E0A3010E947405882E04
139
-:1008A000861845C0853731F4232D2F7EB22E2AE0DD
140
-:1008B00030E025C0932D997FB92E8F36C1F018F402
141
-:1008C000883579F0B5C0803719F0883721F0B0C08D
142
-:1008D000E92FE061BE2EB4FE0DC0FB2DF460BF2EEB
143
-:1008E00009C034FE0AC0292F2660B22E06C028E0B7
144
-:1008F00030E005C020E130E002C020E132E0F80144
145
-:10090000B7FE07C060817181828193810C5F1F4FA8
146
-:1009100006C06081718180E090E00E5F1F4FA301EF
147
-:100920000E947405882E8618FB2DFF773F2E36FE19
148
-:100930000DC0232D2E7FA22E891458F434FE0BC037
149
-:1009400032FC09C0832D8E7EA82E05C0B82CA32CA6
150
-:1009500003C0B82C01C0B92CA4FE0FC0FE01E80DE5
151
-:10096000F11D8081803321F49A2D997EA92E09C032
152
-:10097000A2FE06C0B394B39404C08A2D867809F011
153
-:10098000B394A3FC11C0A0FE06C0B21488F4280CD6
154
-:10099000922C9B180EC0B21460F4B60180E290E075
155
-:1009A0000E943805B394F7CFB21418F42B1802C084
156
-:1009B000982C212CA4FE10C0B60180E390E00E9488
157
-:1009C0003805A2FE17C0A1FC03C088E790E002C072
158
-:1009D00088E590E0B6010CC08A2D867859F0A1FE1A
159
-:1009E00002C08BE201C080E2A7FC8DE2B60190E07C
160
-:1009F0000E943805891438F4B60180E390E00E9423
161
-:100A000038059A94F7CF8A94F301E80DF11D80819F
162
-:100A1000B60190E00E9438058110F5CF222009F43C
163
-:100A200042CEB60180E290E00E9438052A94F6CFCB
164
-:100A3000F6018681978102C08FEF9FEF2B96E2E14E
165
-:100A40000C94EE05FC010590615070400110D8F740
166
-:100A5000809590958E0F9F1F0895FC016150704006
167
-:100A600001900110D8F7809590958E0F9F1F0895E3
168
-:100A70000F931F93CF93DF93FB01238121FD03C0CD
169
-:100A80008FEF9FEF2CC022FF16C046815781248133
170
-:100A900035814217530744F4A081B1819D012F5F36
171
-:100AA0003F4F318320838C93268137812F5F3F4FC7
172
-:100AB0003783268314C08B01EC01FB010084F18590
173
-:100AC000E02D0995892BE1F6D80116968D919C9120
174
-:100AD0001797019617969C938E931697CE01DF91E8
175
-:100AE000CF911F910F910895FA01AA27283051F153
176
-:100AF000203181F1E8946F936E7F6E5F7F4F8F4F4F
177
-:100B00009F4FAF4FB1E03ED0B4E03CD0670F781FAD
178
-:100B1000891F9A1FA11D680F791F8A1F911DA11D92
179
-:100B20006A0F711D811D911DA11D20D009F46894CB
180
-:100B30003F912AE0269F11243019305D3193DEF673
181
-:100B4000CF010895462F4770405D4193B3E00FD029
182
-:100B5000C9F7F6CF462F4F70405D4A3318F0495D14
183
-:100B600031FD4052419302D0A9F7EACFB4E0A695F7
184
-:100B70009795879577956795BA95C9F70097610519
185
-:100B8000710508959B01AC010A2E0694579547956F
186
-:100B900037952795BA95C9F7620F731F841F951F64
187
-:100BA000A01D08952F923F924F925F926F927F9275
188
-:100BB0008F929F92AF92BF92CF92DF92EF92FF926D
189
-:100BC0000F931F93CF93DF93CDB7DEB7CA1BDB0B19
190
-:100BD0000FB6F894DEBF0FBECDBF09942A883988BE
191
-:100BE00048885F846E847D848C849B84AA84B984C5
192
-:100BF000C884DF80EE80FD800C811B81AA81B981D1
193
-:100C0000CE0FD11D0FB6F894DEBF0FBECDBFED01E4
194
-:060C10000895F894FFCFE7
195
-:100C1600DEADBEEF50726F6772616D2073746172E4
196
-:100C2600740025730D0A0074657374206D65737303
197
-:100C360061676500257330782578200072656164E8
198
-:100C4600206572726F720054582066696E006D617D
199
-:0E0C560078207265740074696D656F757400A6
200
-:00000001FF

+ 2
- 2
weather-sensor/firmware/makefile Bestand weergeven

@@ -7,8 +7,8 @@ clean:
7 7
 flash: main.hex
8 8
 	sudo avrdude -c avr109 -b 57600 -P /dev/ttyACM0 -p m32u4 -v -U flash:w:main.hex
9 9
 
10
-main: main.c nrf24l01.c nrf24l01.h nrf24l01_definitions.h uart_debug.c uart_debug.h
11
-	avr-gcc main.c nrf24l01.c uart_debug.c  -o main -mmcu=atmega32u4 -Os -Wall -Wextra -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -DF_CPU=8000000UL
10
+main: main.c nrf24l01.c nrf24l01.h nrf24l01_definitions.h uart_debug.c uart_debug.h bme280_interface.c bme280_interface.h BME280_driver/bme280.c BME280_driver/bme280.h
11
+	avr-gcc main.c nrf24l01.c bme280_interface.c BME280_driver/bme280.c uart_debug.c  -I BME280_driver -o main -mmcu=atmega32u4 -Os -Wall -Wextra -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -DF_CPU=8000000UL -D BME280_32BIT_ENABLE
12 12
 
13 13
 main.hex: main
14 14
 	avr-objcopy -O ihex -R .eeprom main main.hex

+ 1
- 0
weather-sensor/firmware/nrf24l01.c Bestand weergeven

@@ -27,6 +27,7 @@ void Initialize_NRF24L01(void)
27 27
 	NRF_CE_DDR |= (1 << NRF_CE_PIN);
28 28
 	NRF_CSN_DDR |= (1 << NRF_CSN_PIN);
29 29
 
30
+	/* Set the chip select pin to not selected */
30 31
 	NRF_CSN_PORT |= (1 << NRF_CSN_PIN);
31 32
 
32 33
 	/* Ensure that the CE pin is set to 0*/

Laden…
Annuleren
Opslaan