Contiki 3.x
board.c
Go to the documentation of this file.
1 /**
2  * \addtogroup mbxxx-platform
3  *
4  * @{
5  */
6 /*
7  * Copyright (c) 2010, STMicroelectronics.
8  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  * 1. Redistributions of source code must retain the above copyright
14  * notice, this list of conditions and the following disclaimer.
15  * 2. Redistributions in binary form must reproduce the above
16  * copyright notice, this list of conditions and the following
17  * disclaimer in the documentation and/or other materials provided
18  * with the distribution.
19  * 3. The name of the author may not be used to endorse or promote
20  * products derived from this software without specific prior
21  * written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
24  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
27  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
29  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
31  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34  *
35  * This file is part of the Contiki OS
36  *
37  */
38 /*---------------------------------------------------------------------------*/
39 /**
40 * \file
41 * Software layer to support all the ST kits boards
42 *
43 * \brief
44 * Board file x STM32W108 Kits boards
45 *
46 * This file implements a software layer to support all the ST kits boards
47 * and deal with the difference in leds, buttons and sensors connected
48 * to the board. This a bit too complex for customer boards adaptation
49 * and customer can simplify it to adapt it to their hardware environment
50 * as they normally don't need to have the software running on several boards.
51 * The boards supported are:
52 * - MB851 A
53 * - MB851 B
54 * - MB851 C
55 * - MB851 D
56 * - MB954 A
57 * - MB954 B
58 * - MB954 C
59 * - MB950 A
60 * - MB950 B
61 * - MB951 A
62 * - MB951 B
63 * - IDZ401V1
64 */
65 /*---------------------------------------------------------------------------*/
66 
67 #include PLATFORM_HEADER
68 #include BOARD_HEADER
69 #ifdef EMBERZNET_HAL
70 #include "stack/include/ember.h"
71 #include "stack/include/error.h"
72 #include "hal/hal.h"
73 #define PORTA (0 << 3)
74 #define PORTB (1 << 3)
75 #define PORTC (2 << 3)
76 #else
77 #include "error.h"
78 #include "hal/hal.h"
80 #endif
81 #include <string.h>
82 #include "dev/i2c.h"
83 
84 const LedResourceType LedsMB851A[] = {
85  {
86  "D1", /* Green LED */
87  PORTB,
88  6
89  },
90  {
91  "D3", /* Yellow LED */
92  PORTB,
93  5
94  }
95 };
96 
97 const InfraRedLedResourceType infraRedLedMB851A = {
98  "D5", /* Infrared LED */
99  PORTB,
100  4
101 };
102 
103 const LedResourceType LedsMB954A[] = {
104  {
105  "D1", /* Green LED */
106  PORTA,
107  5
108  },
109  {
110  "D3", /* Yellow LED */
111  PORTA,
112  0
113  }
114 };
115 
116 const LedResourceType LedsIDZ401V1[] = {
117  {
118  "D2", /* Yellow LED */
119  PORTA,
120  7
121  }
122 };
123 
124 
125 const ButtonResourceType ButtonsMB851A[] = {
126  {
127  "S1",
128  PORTA,
129  7
130  }
131 };
132 
133 const ButtonResourceType ButtonsMB954A[] = {
134  {
135  "S1",
136  PORTB,
137  3
138  }
139 };
140 
141 const ButtonResourceType ButtonsMB950A[] = {
142  {
143  "S1",
144  PORTB,
145  3
146  },
147  {
148  "S2",
149  PORTA,
150  7
151  },
152  {
153  "S3",
154  PORTB,
155  7
156  },
157  {
158  "S4",
159  PORTB,
160  0
161  },
162  {
163  "S5",
164  PORTB,
165  6
166  }
167 };
168 
169 const ButtonResourceType ButtonsMB951A[] = {
170  {
171  "S1",
172  PORTA,
173  3
174  },
175 };
176 
177 const ButtonResourceType ButtonsIDZ401V1[] = {
178 
179 };
180 
181 
182 const TempSensorResourceType stlm20PB7noDiv = {
183  "STLM20",
184  PORTB,
185  7,
186  1,
187  FALSE
188 };
189 
190 const TempSensorResourceType stlm20PA4noDiv = {
191  "STLM20",
192  PORTA,
193  4,
194  1,
195  FALSE
196 };
197 
198 const TempSensorResourceType stlm20PA4withDiv = {
199  "STLM20",
200  PORTA,
201  4,
202  2,
203  TRUE
204 };
205 
206 const MemsResourceType memsSensor = {
207  "LIS302",
208  0
209 };
210 
211 const BoardIOType ioMB851A = {
212  LedsMB851A,
213  ButtonsMB851A,
214 };
215 
216 const BoardIOType ioMB954A = {
217  LedsMB954A,
218  ButtonsMB954A,
219 };
220 
221 const BoardIOType ioMB950A = {
222  LedsMB954A,
223  ButtonsMB950A,
224 };
225 
226 const BoardIOType ioMB951A = {
227  LedsMB954A,
228  ButtonsMB951A,
229 };
230 
231 const BoardIOType ioIDZ401V1 = {
232  LedsIDZ401V1,
233  ButtonsIDZ401V1,
234 };
235 
236 const BoardResourcesType MB851A = {
237  "MB851 A",
240  LEDS_MB851A,
241  &ioMB851A,
242  &infraRedLedMB851A,
243  &memsSensor,
244  &stlm20PB7noDiv,
245 };
246 
247 const BoardResourcesType MB851B = {
248  "MB851 B",
251  LEDS_MB851B,
252  &ioMB851A,
253  &infraRedLedMB851A,
254  &memsSensor,
255  &stlm20PB7noDiv,
256 };
257 
258 const BoardResourcesType MB851C = {
259  "MB851 C",
262  LEDS_MB851C,
263  &ioMB954A,
264  &infraRedLedMB851A,
265  &memsSensor,
266  &stlm20PA4withDiv,
267 };
268 
269 const BoardResourcesType MB851D = {
270  "MB851 D",
273  LEDS_MB851D,
274  &ioMB954A,
275  &infraRedLedMB851A,
276  &memsSensor,
277  &stlm20PA4withDiv,
278 };
279 
280 const BoardResourcesType MB954A = {
281  "MB954 A",
284  LEDS_MB954A,
285  &ioMB954A,
286  &infraRedLedMB851A,
287  &memsSensor,
288  &stlm20PA4noDiv,
289 };
290 
291 const BoardResourcesType MB954B = {
292  "MB954 B",
295  LEDS_MB954B,
296  &ioMB954A,
297  &infraRedLedMB851A,
298  &memsSensor,
299  &stlm20PA4withDiv,
300 };
301 
302 const BoardResourcesType MB954C = {
303  "MB954 C",
306  LEDS_MB954C,
307  &ioMB954A,
308  &infraRedLedMB851A,
309  &memsSensor,
310  &stlm20PA4noDiv,
311 };
312 
313 const BoardResourcesType MB950A = {
314  "MB950 A",
317  LEDS_MB950A,
318  &ioMB950A,
319  &infraRedLedMB851A,
320  &memsSensor,
321  &stlm20PA4noDiv,
322 };
323 
324 const BoardResourcesType MB950B = {
325  "MB950 B",
328  LEDS_MB950B,
329  &ioMB950A,
330  &infraRedLedMB851A,
331  &memsSensor,
332  &stlm20PA4noDiv,
333 };
334 
335 const BoardResourcesType MB951A = {
336  "MB951 A",
339  LEDS_MB951A,
340  &ioMB951A,
341  NULL,
342  NULL,
343  NULL,
344 };
345 
346 const BoardResourcesType MB951B = {
347  "MB951 B",
350  LEDS_MB951B,
351  &ioMB951A,
352  NULL,
353  NULL,
354  NULL,
355 };
356 
357 const BoardResourcesType IDZ401V1 = {
358  "IDZ401V1",
362  &ioIDZ401V1,
363  NULL,
364  NULL,
365  NULL,
366 };
367 
368 static const BoardResourcesType *boardList [] = {
369  &MB851A,
370  &MB851B,
371  &MB851C,
372  &MB851D,
373  &MB954A,
374  &MB954B,
375  &MB954C,
376  &MB950A,
377  &MB950B,
378  &MB951A,
379  &MB951B,
380  &IDZ401V1
381 };
382 
383 BoardResourcesType const *boardDescription = NULL;
384 
385 #define PORT_NAME(x) ((x == PORTA) ? "A": ((x == PORTB) ? "B" : ((x == PORTC) ? "C": "?")))
386 
387 void halBoardInit(void)
388 {
389  char boardName[16];
390  int8_t i;
391  boardDescription = NULL;
392 #ifdef EMBERZNET_HAL
393  halCommonGetToken(boardName, TOKEN_MFG_BOARD_NAME);
394 #else
395  halCommonGetMfgToken(boardName, TOKEN_MFG_BOARD_NAME);
396 #endif
397 
398  i = 15;
399  while ((i >= 0) && (boardName[i] == 0xFF)) {
400  boardName[i] = 0;
401  i--;
402  }
403 
404  for (i = 0; i < (sizeof(boardList)/4) ; i++)
405  if (strcmp(boardName, (boardList[i])->name) == 0) {
406  boardDescription = (BoardResourcesType *) boardList[i];
407  break;
408  }
409 
410  if (boardDescription == NULL) {
411  /* Board type not identified default to MB851A also to support legacy boards */
412  boardDescription = (BoardResourcesType *) &IDZ401V1;
413  }
414  return;
415 }
416 
418 {
419  return boardDescription;
420 }
421 
423 {
424  /* Set everything to input value */
425  GPIO_PACFGL = (GPIOCFG_IN <<PA0_CFG_BIT)|
426  (GPIOCFG_IN <<PA1_CFG_BIT)|
427  (GPIOCFG_IN <<PA2_CFG_BIT)|
428  (GPIOCFG_IN <<PA3_CFG_BIT);
429  GPIO_PACFGH = (GPIOCFG_IN <<PA4_CFG_BIT)| /* PTI EN */
430  (GPIOCFG_IN <<PA5_CFG_BIT)| /* PTI_DATA */
431  (GPIOCFG_IN <<PA6_CFG_BIT)|
432  (GPIOCFG_IN <<PA7_CFG_BIT);
433  GPIO_PBCFGL = (GPIOCFG_IN <<PB0_CFG_BIT)|
434  (GPIOCFG_IN <<PB1_CFG_BIT)| /* Uart TX */
435  (GPIOCFG_IN <<PB2_CFG_BIT)| /* Uart RX */
436  (GPIOCFG_IN <<PB3_CFG_BIT);
437  GPIO_PBCFGH = (GPIOCFG_IN <<PB4_CFG_BIT)|
438  (GPIOCFG_IN <<PB5_CFG_BIT)|
439  (GPIOCFG_IN <<PB6_CFG_BIT)|
440  (GPIOCFG_IN <<PB7_CFG_BIT);
441  GPIO_PCCFGL = (GPIOCFG_IN <<PC0_CFG_BIT)|
442  (GPIOCFG_IN <<PC1_CFG_BIT)|
443  (GPIOCFG_IN <<PC2_CFG_BIT)|
444  (GPIOCFG_IN <<PC3_CFG_BIT);
445  GPIO_PCCFGH = (GPIOCFG_IN <<PC4_CFG_BIT)|
446  (GPIOCFG_IN <<PC5_CFG_BIT)|
447 #ifdef EMBERZNET_HAL
448  (CFG_C6 <<PC6_CFG_BIT)| /* OSC32K */
449  (CFG_C7 <<PC7_CFG_BIT); /* OSC32K */
450 #else
451  (GPIOCFG_IN <<PC6_CFG_BIT)| /* OSC32K */
452  (GPIOCFG_IN <<PC7_CFG_BIT); /* OSC32K */
453 #endif
454 
455 
456  /* Configure GPIO for BUTTONSs */
457  {
458  ButtonResourceType *buttons = (ButtonResourceType *) boardDescription->io->buttons;
459  uint8_t i;
460  for (i = 0; i < boardDescription->buttons; i++) {
461  halGpioConfig(PORTx_PIN(buttons[i].gpioPort, buttons[i].gpioPin), GPIOCFG_IN_PUD);
462  halGpioSet(PORTx_PIN(buttons[i].gpioPort, buttons[i].gpioPin), GPIOOUT_PULLUP);
463  }
464  }
465 
466  /* Configure GPIO for LEDs */
467  {
468  LedResourceType *leds = (LedResourceType *) boardDescription->io->leds;
469  uint8_t i;
470  for (i = 0; i < boardDescription->leds; i++) {
471  /* LED default off */
472  halGpioConfig(PORTx_PIN(leds[i].gpioPort, leds[i].gpioPin), GPIOCFG_OUT);
473  halGpioSet(PORTx_PIN(leds[i].gpioPort, leds[i].gpioPin), 1);
474  }
475  }
476 
477  /* Configure GPIO for power amplifier */
478  if (boardDescription->flags & BOARD_HAS_PA) {
479  /* SiGe Ant Sel to output */
480  halGpioConfig(PORTB_PIN(5), GPIOCFG_OUT);
481  halGpioSet(PORTB_PIN(5), 1);
482  /* SiGe Standby */
483  halGpioConfig(PORTB_PIN(6), GPIOCFG_OUT);
484  halGpioSet(PORTB_PIN(6), 0);
485  }
486 
487 }
488 void halBoardPowerUp(void)
489 {
490 
491  /* Set everything to input value */
492  GPIO_PACFGL = (GPIOCFG_IN <<PA0_CFG_BIT)|
493  (GPIOCFG_IN <<PA1_CFG_BIT)|
494  (GPIOCFG_IN <<PA2_CFG_BIT)|
495  (GPIOCFG_IN <<PA3_CFG_BIT);
496  GPIO_PACFGH = (GPIOCFG_IN <<PA4_CFG_BIT)| /* PTI EN */
497  (GPIOCFG_IN <<PA5_CFG_BIT)| /* PTI_DATA */
498  (GPIOCFG_IN <<PA6_CFG_BIT)|
499  (GPIOCFG_IN <<PA7_CFG_BIT);
500  GPIO_PBCFGL = (GPIOCFG_IN <<PB0_CFG_BIT)|
501  (GPIOCFG_OUT_ALT <<PB1_CFG_BIT)| /* Uart TX */
502  (GPIOCFG_IN <<PB2_CFG_BIT)| /* Uart RX */
503  (GPIOCFG_IN <<PB3_CFG_BIT);
504  GPIO_PBCFGH = (GPIOCFG_IN <<PB4_CFG_BIT)|
505  (GPIOCFG_IN <<PB5_CFG_BIT)|
506  (GPIOCFG_IN <<PB6_CFG_BIT)|
507  (GPIOCFG_IN <<PB7_CFG_BIT);
508  GPIO_PCCFGL = (GPIOCFG_IN <<PC0_CFG_BIT)|
509  (GPIOCFG_IN <<PC1_CFG_BIT)|
510  (GPIOCFG_IN <<PC2_CFG_BIT)|
511  (GPIOCFG_IN <<PC3_CFG_BIT);
512  GPIO_PCCFGH = (GPIOCFG_IN <<PC4_CFG_BIT)|
513  (GPIOCFG_IN <<PC5_CFG_BIT)|
514 #ifdef EMBERZNET_HAL
515  (CFG_C6 <<PC6_CFG_BIT)| /* OSC32K */
516  (CFG_C7 <<PC7_CFG_BIT); /* OSC32K */
517 #else
518  (GPIOCFG_IN <<PC6_CFG_BIT)| /* OSC32K */
519  (GPIOCFG_IN <<PC7_CFG_BIT); /* OSC32K */
520 #endif
521 
522  /* Configure GPIO for I2C access */
523  if ((boardDescription->flags & BOARD_HAS_MEMS) || (boardDescription->flags & BOARD_HAS_EEPROM)) {
524  halGpioConfig(PORTA_PIN(1), GPIOCFG_OUT_ALT_OD);
525  halGpioConfig(PORTA_PIN(2), GPIOCFG_OUT_ALT_OD);
526  i2c_enable();
527  }
528  /* Configure GPIO for ADC access (temp sensor) */
529  if (boardDescription->flags & BOARD_HAS_TEMP_SENSOR) {
531  boardDescription->temperatureSensor->gpioPin),
532  GPIOCFG_ANALOG);
533  }
534  /* Configure GPIO for LEDs */
535  {
536  LedResourceType *leds = (LedResourceType *) boardDescription->io->leds;
537  uint8_t i;
538  for (i = 0; i < boardDescription->leds; i++) {
539  /* LED default off */
540  halGpioConfig(PORTx_PIN(leds[i].gpioPort, leds[i].gpioPin), GPIOCFG_OUT);
541  halGpioSet(PORTx_PIN(leds[i].gpioPort, leds[i].gpioPin), 1);
542  }
543  }
544  /* Configure GPIO for BUTTONSs */
545  {
546  ButtonResourceType *buttons = (ButtonResourceType *) boardDescription->io->buttons;
547  uint8_t i;
548  for (i = 0; i < boardDescription->buttons; i++) {
549  halGpioConfig(PORTx_PIN(buttons[i].gpioPort, buttons[i].gpioPin), GPIOCFG_IN_PUD);
550  halGpioSet(PORTx_PIN(buttons[i].gpioPort, buttons[i].gpioPin), GPIOOUT_PULLUP);
551  }
552  }
553 
554  /* Configure GPIO for power amplifier */
555  if (boardDescription->flags & BOARD_HAS_PA) {
556  /* SiGe Ant Sel (default ceramic antenna) */
557  halGpioConfig(PORTB_PIN(5), GPIOCFG_OUT);
558  halGpioSet(PORTB_PIN(5), 1);
559  /* SiGe Standby (default out of standby) */
560  halGpioConfig(PORTB_PIN(6), GPIOCFG_OUT);
561  halGpioSet(PORTB_PIN(6), 1);
562  /* SiGe LNA (default LNA off )*/
563  halGpioConfig(PORTB_PIN(7), GPIOCFG_OUT);
564  halGpioSet(PORTB_PIN(7), 0);
565  /* SiGe nTX Active */
566  halGpioConfig(PORTC_PIN(5), GPIOCFG_OUT_ALT);
567  }
568 }
569 
570 
571 #include <stdio.h>
572 void printLeds (void)
573 {
574  uint8_t i=0;
575  LedResourceType *leds;
576  leds = (LedResourceType *) boardDescription->io->leds;
577  while (i < boardDescription->leds) {
578  printf ("Led %s (port:%s, bit:%d)\r\n", leds->name, PORT_NAME(leds->gpioPort), leds->gpioPin);
579  leds++; i++;
580  }
581 }
582 
583 void printButtons (void)
584 {
585  uint8_t i=0;
586  ButtonResourceType *buttons;
587  buttons = (ButtonResourceType *) boardDescription->io->buttons;
588  while (i < boardDescription->buttons) {
589  printf ("Button %s (port:%s, bit:%d)\r\n", buttons->name, PORT_NAME(buttons->gpioPort), buttons->gpioPin);
590  buttons++; i++;
591  }
592 }
593 
594 void boardPrintStringDescription(void)
595 {
596 
597  if (boardDescription != NULL) {
598  printf ("*************************************\r\n");
599  printf ("Board name = %s\r\n", boardDescription->name);
600  printf ("*************************************\r\n");
601  printf("Number of leds on the board: %d\n", boardDescription->leds);
602  printf("Number of buttons on the board: %d\n", boardDescription->buttons);
603  printLeds();
604  printButtons();
605  if (boardDescription->mems) {
606  printf ("MEMS = %s\r\n", boardDescription->mems->name);
607  }
608  if (boardDescription->temperatureSensor) {
609  printf ("Temp sensor = %s, port:%s, pin:%d, div:%d, adcFix:%s\r\n",
610  boardDescription->temperatureSensor->name,
611  PORT_NAME(boardDescription->temperatureSensor->gpioPort),
612  boardDescription->temperatureSensor->gpioPin,
613  boardDescription->temperatureSensor->div,
614  boardDescription->temperatureSensor->adcFix ? "Yes" : "No"
615  );
616  }
617 
618  printf ("EEProm:%s\r\n", (boardDescription->flags & BOARD_HAS_EEPROM) ? "Yes" : "No");
619  printf ("PC i/f:%s\r\n", (boardDescription->flags & BOARD_HAS_FTDI) ? "FTDI" : "STM32F");
620  printf ("Power Amplifier:%s\r\n", (boardDescription->flags & BOARD_HAS_PA) ? "Yes" : "No");
621 
622  }
623 }
624 /** @} */
uint8_t buttons
Number of buttons.
Definition: board.h:172
#define BOARD_HAS_FTDI
Flag to indicate if FTDI is used as PC interface.
Definition: board.h:159
#define BOARD_HAS_MEMS
Flag to indicate if MEMS is present.
Definition: board.h:143
uint8_t leds
Number of leds.
Definition: board.h:174
#define LEDS_MB851C
Define the number of LEDs in the specific board revision.
Definition: board.h:33
#define BUTTONS_MB851C
Define the number of user buttons in the specific board revision.
Definition: board.h:62
#define LEDS_MB954C
Define the number of LEDs in the specific board revision.
Definition: board.h:95
Data structure for board user I/O.
Definition: board.h:133
char * name
Name of the temperature sensor device.
Definition: board.h:121
Cortex-M3 Manufacturing token system.
const LedResourceType * leds
Pointer to LED resources.
Definition: board.h:135
#define PORTC_PIN(y)
Some registers and variables require indentifying GPIO by a single number instead of the port and pin...
Definition: micro-common.h:48
Data structure for button description.
Definition: board.h:97
#define BOARD_HAS_EEPROM
Flag to indicate if EEPROM is present.
Definition: board.h:155
#define BUTTONS_MB950B
Define the number of user buttons in the specific board revision.
Definition: board.h:166
#define PORTB
Peripheral PORTB base pointer.
Definition: MK60D10.h:6419
uint8_t gpioPort
GPIO port associated with the sensor.
Definition: board.h:123
#define BUTTONS_MB954B
Define the number of user buttons in the specific board revision.
Definition: board.h:70
#define BUTTONS_MB954C
Define the number of user buttons in the specific board revision.
Definition: board.h:155
#define NULL
The null pointer.
#define BUTTONS_MB954A
Define the number of user buttons in the specific board revision.
Definition: board.h:66
#define BUTTONS_MB851A
Define the number of user buttons in the specific board revision.
Definition: board.h:54
#define BOARD_HAS_STM32F
Flag to indicate if STM32F is used as PC interface.
Definition: board.h:163
void halBoardPowerDown(void)
Perform board specific action to power down the system, usually before going to deep sleep...
Definition: board.c:284
#define LEDS_MB951B
Define the number of LEDs in the specific board revision.
Definition: board.h:114
#define PORTx_PIN(x, y)
Some registers and variables require indentifying GPIO by a single number instead of the port and pin...
Definition: micro-common.h:55
void halGpioSet(uint32_t gpio, boolean value)
Set/Clear single GPIO bit.
Definition: micro-common.c:63
Data structure for temperature sensor description.
Definition: board.h:119
char * name
Name of the MEMS device.
Definition: board.h:111
#define BUTTONS_MB851D
Define the number of user buttons in the specific board revision.
Definition: board.h:140
#define LEDS_IDZ401V1
Define the number of LEDs in the specific board revision.
Definition: board.h:121
#define LEDS_MB951A
Define the number of LEDs in the specific board revision.
Definition: board.h:49
BoardResourcesType const * halBoardGetDescription(void)
Return pointer to board description structure.
Definition: board.c:279
void i2c_enable(void)
Configure serial controller in I2C mode and set I2C speed.
Definition: i2c.c:52
#define BUTTONS_MB851B
Define the number of user buttons in the specific board revision.
Definition: board.h:58
#define TRUE
An alias for one, used for clarity.
#define PORTA_PIN(y)
Some registers and variables require indentifying GPIO by a single number instead of the port and pin...
Definition: micro-common.h:36
boolean adcFix
Flag to indicate whether the ADC range extension bug fix is implemented.
Definition: board.h:127
#define BUTTONS_MB951A
Define the number of user buttons in the specific board revision.
Definition: board.h:78
#define LEDS_MB851D
Define the number of LEDs in the specific board revision.
Definition: board.h:80
#define BOARD_HAS_PA
Flag to indicate if external power amplifier is present.
Definition: board.h:151
#define BOARD_HAS_TEMP_SENSOR
Flag to indicate if temeprature sensor is present.
Definition: board.h:147
#define LEDS_MB954A
Define the number of LEDs in the specific board revision.
Definition: board.h:37
#define BUTTONS_IDZ401V1
Define the number of user buttons in the specific board revision.
Definition: board.h:181
Data structure for MEMS description.
Definition: board.h:109
const MemsResourceType * mems
Board infrared MEMS description.
Definition: board.h:180
#define BUTTONS_MB951B
Define the number of user buttons in the specific board revision.
Definition: board.h:174
void halBoardInit(void)
Initialize the board description data structure after autodetect of the boards based on the CIB Board...
Definition: board.c:250
#define PORTA
Peripheral PORTA base pointer.
Definition: MK60D10.h:6415
Generic set of HAL includes for all platforms.
#define BUTTONS_MB950A
Define the number of user buttons in the specific board revision.
Definition: board.h:74
void halBoardPowerUp(void)
Perform board specific action to power up the system.
Definition: board.c:350
uint8_t gpioPin
GPIO pin associated with the sensor.
Definition: board.h:125
const ButtonResourceType * buttons
Pointer to button resources.
Definition: board.h:137
const TempSensorResourceType * temperatureSensor
Board infrared temeprature sensor description.
Definition: board.h:182
Data structure describing board features.
Definition: board.h:168
uint8_t div
Voltage divider network from sensor vout and GPIO.
Definition: board.h:232
#define FALSE
An alias for zero, used for clarity.
Data structure for led description.
Definition: board.h:83
#define PORTB_PIN(y)
Some registers and variables require indentifying GPIO by a single number instead of the port and pin...
Definition: micro-common.h:42
const BoardIOType * io
Board I/O description.
Definition: board.h:176
void halGpioConfig(uint32_t io, uint32_t config)
Configure an IO pin&#39;s operating mode.
Definition: micro-common.c:48
#define LEDS_MB950A
Define the number of LEDs in the specific board revision.
Definition: board.h:45
#define LEDS_MB950B
Define the number of LEDs in the specific board revision.
Definition: board.h:106
#define LEDS_MB851A
Define the number of LEDs in the specific board revision.
Definition: board.h:25
#define LEDS_MB954B
Define the number of LEDs in the specific board revision.
Definition: board.h:41
#define LEDS_MB851B
Define the number of LEDs in the specific board revision.
Definition: board.h:29