EFR32 Mighty Gecko 1 Software Documentation  efr32mg1-doc-5.1.2
board.h File Reference

Detailed Description

BOARD module header file.

Version
5.1.1

License

Copyright 2016 Silicon Laboratories, Inc. http://www.silabs.com

This file is licensed under the Silicon Labs License Agreement. See the file "Silabs_License_Agreement.txt" for details. Before using this software for any purpose, you must agree to the terms of that agreement.

Definition in file board.h.

#include <stdint.h>
#include "em_gpio.h"
#include "i2cspm.h"
#include "thunderboard/board_pic_regs.h"
#include "thunderboard/board_rgbled_profiles.h"

Go to the source code of this file.

Macros

#define BOARD_BUTTON_INT_ENABLE   true
 
#define BOARD_BUTTON_INT_FLAG   0x04
 
#define BOARD_BUTTON_LEFT   0x01
 
#define BOARD_BUTTON_LEFT_PIN   14
 
#define BOARD_BUTTON_LEFT_PORT   gpioPortD
 
#define BOARD_BUTTON_MASK   0x03
 
#define BOARD_BUTTON_PORT   gpioPortD
 
#define BOARD_BUTTON_RIGHT   0x02
 
#define BOARD_BUTTON_RIGHT_PIN   15
 
#define BOARD_BUTTON_RIGHT_PORT   gpioPortD
 
#define BOARD_BUTTON_SHIFT   14
 
#define BOARD_ERROR_I2C_TRANSFER_FAILED   0x03
 
#define BOARD_ERROR_I2C_TRANSFER_NACK   0x02
 
#define BOARD_ERROR_I2C_TRANSFER_TIMEOUT   0x01
 
#define BOARD_ERROR_PIC_FW_INVALID   0x05
 
#define BOARD_ERROR_PIC_FW_UPDATE_FAILED   0x06
 
#define BOARD_ERROR_PIC_ID_MISMATCH   0x04
 
#define BOARD_FLASH_PIN_SPI_CLK   8
 
#define BOARD_FLASH_PIN_SPI_CS   4
 
#define BOARD_FLASH_PIN_SPI_MISO   7
 
#define BOARD_FLASH_PIN_SPI_MOSI   6
 
#define BOARD_FLASH_PORT_SPI   gpioPortC
 
#define BOARD_FLASH_PORT_SPI_CS   gpioPortA
 
#define BOARD_FLASH_USART   (USART1)
 
#define BOARD_OK   0
 
#define BOARD_PIC_DEVICE_ID   0x50584F49
 
#define BOARD_PIC_INT_WAKE_PIN   10
 
#define BOARD_PIC_INT_WAKE_PORT   gpioPortD
 
#define BOARD_RGBLED_BLUE_CCLOC   19
 
#define BOARD_RGBLED_BLUE_PIN   13
 
#define BOARD_RGBLED_BLUE_PORT   gpioPortD
 
#define BOARD_RGBLED_CMU_CLK   cmuClock_TIMER0
 
#define BOARD_RGBLED_GREEN_CCLOC   19
 
#define BOARD_RGBLED_GREEN_PIN   12
 
#define BOARD_RGBLED_GREEN_PORT   gpioPortD
 
#define BOARD_RGBLED_RED_CCLOC   19
 
#define BOARD_RGBLED_RED_PIN   11
 
#define BOARD_RGBLED_RED_PORT   gpioPortD
 
#define BOARD_RGBLED_TIMER   (TIMER0)
 

Functions

uint32_t BOARD_envSensEnable (bool enable)
 Enables or disables the environmental sensor group (Pressure, RH/Temp, UV/Ambient light and Hall sensors) More...
 
uint32_t BOARD_envSensEnableIRQ (bool enable)
 Enables or disables the environmental sensor group (Pressure, RH/Temp, UV/Ambient light and Hall sensors) GPIO interrupts. More...
 
void BOARD_flashDeepPowerDown (void)
 Puts the Flash chip in deep power down mode. More...
 
uint32_t BOARD_gasSensorEnable (bool enable)
 Enables or disables the Air Quality / Gas Sensor. More...
 
uint32_t BOARD_gasSensorEnableIRQ (bool enable)
 Enables or disables the Air Quality / Gas Sensor GPIO interrupt. More...
 
uint32_t BOARD_gasSensorWake (bool wake)
 Wakes up the Air Quality / Gas Sensor. More...
 
uint32_t BOARD_imuEnable (bool enable)
 Enables or disables the accelerometer and gyroscope sensor. More...
 
uint32_t BOARD_imuEnableIRQ (bool enable)
 Enables or disables the accelerometer and gyroscope GPIO interrupt. More...
 
uint32_t BOARD_init (void)
 Initializes the Thunderboard Sense board. More...
 
void BOARD_ledSet (uint8_t leds)
 Turns on or off the red and/or green LED. More...
 
uint32_t BOARD_micEnable (bool enable)
 Enables or disables the MEMS microphone. More...
 
uint32_t BOARD_picGetDeviceId (void)
 Reads the device ID of the IO expander. More...
 
uint32_t BOARD_picGetFwRevision (uint8_t *major, uint8_t *minor, uint8_t *patch)
 Reads the firmware revision of the IO expander. More...
 
uint8_t BOARD_picGetHwRevision (void)
 Reads the hardware revision of the IO expander. More...
 
uint32_t BOARD_picIntClear (uint8_t flags)
 Clears the interrupt status flags in the interrupt controller. More...
 
uint32_t BOARD_picIntGet (uint8_t *flags)
 Reads the interrupt status flags from the interrupt controller. More...
 
bool BOARD_picIsLegacyIntCtrl (void)
 Checks if the legacy interrupt control method should be used. More...
 
uint32_t BOARD_picReadReg (uint8_t reg, uint8_t *result)
 Reads a register in the IO expander. More...
 
uint32_t BOARD_picRegBitsSet (uint8_t addr, bool set, uint8_t bitMask)
 Sets the given bit(s) in a register in the IO expander. More...
 
uint32_t BOARD_picWriteReg (uint8_t reg, uint8_t value)
 Writes a register in the IO expander. More...
 
void BOARD_pushButtonEnableIRQ (bool enable)
 Enables or disables the pushbutton GPIO interrupt. More...
 
uint8_t BOARD_pushButtonGetState (void)
 Gets the state of the pushbuttons. More...
 
void BOARD_rgbledEnable (bool enable, uint8_t mask)
 Enables or disables the RGB LED power supply line. More...
 
void BOARD_rgbledPowerEnable (bool enable)
 Enables or disables the RGB LED power supply line. More...
 
void BOARD_rgbledSetColor (uint8_t red, uint8_t green, uint8_t blue)
 Sets the color of the RGB LEDs. The brightness of the LEDs is almost linear to the color value. More...
 
void BOARD_rgbledSetRawColor (uint16_t red, uint16_t green, uint16_t blue)
 Sets the raw color of the RGB LEDs. The brightness is non-linear function of the raw color value. More...