39 #define BOARD_ERROR_I2C_TRANSFER_TIMEOUT 0x01
40 #define BOARD_ERROR_I2C_TRANSFER_NACK 0x02
41 #define BOARD_ERROR_I2C_TRANSFER_FAILED 0x03
42 #define BOARD_ERROR_PIC_ID_MISMATCH 0x04
43 #define BOARD_ERROR_PIC_FW_INVALID 0x05
44 #define BOARD_ERROR_PIC_FW_UPDATE_FAILED 0x06
54 #define BOARD_PIC_DEVICE_ID 0x50584F49
55 #define BOARD_PIC_INT_WAKE_PORT gpioPortD
56 #define BOARD_PIC_INT_WAKE_PIN 10
58 #define BOARD_RGBLED_TIMER (TIMER0)
59 #define BOARD_RGBLED_CMU_CLK cmuClock_TIMER0
60 #define BOARD_RGBLED_RED_PORT gpioPortD
61 #define BOARD_RGBLED_RED_PIN 11
62 #define BOARD_RGBLED_RED_CCLOC 19
63 #define BOARD_RGBLED_GREEN_PORT gpioPortD
64 #define BOARD_RGBLED_GREEN_PIN 12
65 #define BOARD_RGBLED_GREEN_CCLOC 19
66 #define BOARD_RGBLED_BLUE_PORT gpioPortD
67 #define BOARD_RGBLED_BLUE_PIN 13
68 #define BOARD_RGBLED_BLUE_CCLOC 19
70 #define BOARD_BUTTON_PORT gpioPortD
71 #define BOARD_BUTTON_SHIFT 14
72 #define BOARD_BUTTON_LEFT 0x01
73 #define BOARD_BUTTON_RIGHT 0x02
74 #define BOARD_BUTTON_MASK 0x03
75 #define BOARD_BUTTON_LEFT_PORT gpioPortD
76 #define BOARD_BUTTON_LEFT_PIN 14
77 #define BOARD_BUTTON_RIGHT_PORT gpioPortD
78 #define BOARD_BUTTON_RIGHT_PIN 15
79 #define BOARD_BUTTON_INT_FLAG 0x04
80 #define BOARD_BUTTON_INT_ENABLE true
82 #define BOARD_FLASH_USART (USART1)
83 #define BOARD_FLASH_PORT_SPI gpioPortC
84 #define BOARD_FLASH_PORT_SPI_CS gpioPortA
85 #define BOARD_FLASH_PIN_SPI_MOSI 6
86 #define BOARD_FLASH_PIN_SPI_MISO 7
87 #define BOARD_FLASH_PIN_SPI_CLK 8
88 #define BOARD_FLASH_PIN_SPI_CS 4
97 uint32_t BOARD_init ( void );
uint32_t BOARD_picIntGet(uint8_t *flags)
Reads the interrupt status flags from the interrupt controller.
void BOARD_ledSet(uint8_t leds)
Turns on or off the red and/or green LED.
uint32_t BOARD_gasSensorWake(bool wake)
Wakes up the Air Quality / Gas Sensor.
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...
bool BOARD_picIsLegacyIntCtrl(void)
Checks if the legacy interrupt control method should be used.
uint8_t BOARD_pushButtonGetState(void)
Gets the state of the pushbuttons.
uint32_t BOARD_picGetFwRevision(uint8_t *major, uint8_t *minor, uint8_t *patch)
Reads the firmware revision of the IO expander.
uint32_t BOARD_picIntClear(uint8_t flags)
Clears the interrupt status flags in the interrupt controller.
uint32_t BOARD_picWriteReg(uint8_t reg, uint8_t value)
Writes a register in the IO expander.
Power and Interrupt Controller Register Definitions.
void BOARD_flashDeepPowerDown(void)
Puts the Flash chip in deep power down mode.
uint32_t BOARD_envSensEnable(bool enable)
Enables or disables the environmental sensor group (Pressure, RH/Temp, UV/Ambient light and Hall sens...
uint32_t BOARD_micEnable(bool enable)
Enables or disables the MEMS microphone.
uint32_t BOARD_imuEnableIRQ(bool enable)
Enables or disables the accelerometer and gyroscope GPIO interrupt.
General Purpose IO (GPIO) peripheral API.
I2C simple poll-based master mode driver for the DK/STK.
uint8_t BOARD_picGetHwRevision(void)
Reads the hardware revision of the IO expander.
void BOARD_rgbledEnable(bool enable, uint8_t mask)
Enables or disables the RGB LED power supply line.
uint32_t BOARD_gasSensorEnableIRQ(bool enable)
Enables or disables the Air Quality / Gas Sensor GPIO interrupt.
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...
void BOARD_pushButtonEnableIRQ(bool enable)
Enables or disables the pushbutton GPIO interrupt.
uint32_t BOARD_imuEnable(bool enable)
Enables or disables the accelerometer and gyroscope sensor.
uint32_t BOARD_picRegBitsSet(uint8_t addr, bool set, uint8_t bitMask)
Sets the given bit(s) in a register in the IO expander.
uint32_t BOARD_picReadReg(uint8_t reg, uint8_t *result)
Reads a register in the IO expander.
uint32_t BOARD_envSensEnableIRQ(bool enable)
Enables or disables the environmental sensor group (Pressure, RH/Temp, UV/Ambient light and Hall sens...
void BOARD_rgbledPowerEnable(bool enable)
Enables or disables the RGB LED power supply line.
uint32_t BOARD_gasSensorEnable(bool enable)
Enables or disables the Air Quality / Gas Sensor.
uint32_t BOARD_picGetDeviceId(void)
Reads the device ID of the IO expander.