Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ldiawi2 #60

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion api/wms_radio_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@
/** @brief Maximum amount of configurable power levels */
#define APP_LIB_RADIO_CFG_POWER_MAX_CNT 10

/** @brief Minimum configured radio current (10 x mA) */
#define APP_LIB_RADIO_CFG_CURRENT_MIN 1

/**
* @brief Maximum configured radio current (10 x mA)
*
* FCC allow maximum power for 2.4GHz to be roughly 600mA, so to be sure that
* we don't block the users from doing what they want, but also have some
* reasonable limit to root out obviously invalid values, we set the upper
* limit for current to be 10A.
*/
#define APP_LIB_RADIO_CFG_CURRENT_MAX 1000

/**
* @brief FEM control command from firmware to application
*
Expand Down Expand Up @@ -186,7 +199,7 @@ typedef struct
/** RX state current, unit [mA x 10] */
uint16_t rx_current;
/** RX LNA gain or 0 [dB] */
int8_t rx_gain_dbm;
int8_t rx_gain_db;
/** Amount of power levels configured */
uint8_t power_count;
/** TX power level configuration / table.
Expand Down
16 changes: 10 additions & 6 deletions api/wms_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,16 @@
typedef uint32_t app_lib_settings_net_addr_t;

/**
* @brief Network channel type definition.
*
* All nodes on the network must have the same network channel.
* @brief Channel type definition.
*/
typedef uint8_t app_lib_settings_net_channel_t;

/**
* @brief Reserved value for definition of 'no channel' for @ref
* app_lib_settings_net_channel_t
*/
#define CHANNEL_NO_CHANNEL 0

typedef enum {
/** Sink in Low Energy mode */
APP_LIB_SETTINGS_ROLE_SINK_LE = 0x00,
Expand Down Expand Up @@ -541,10 +545,10 @@ typedef app_res_e
uint16_t * max_value_p);

/**
* @brief Get access cycle range
* @brief Get access cycle range limits
*
* Return the minimum and maximum access cycle value, in milliseconds, that can
* be used when setting the access cycle range with the @ref
* Return the minimum and maximum for valid access cycle range, in milliseconds,
* that can be used when setting the access cycle range with the @ref
* app_lib_settings_set_ac_range_f "lib_settings->setAcRange"() function.
*
* @param min_value_p
Expand Down
12 changes: 10 additions & 2 deletions api/wms_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#define APP_LIB_STATE_NAME 0x02f9c165 //!< "STATE"

/** @brief Maximum supported library version */
#define APP_LIB_STATE_VERSION 0x20D
#define APP_LIB_STATE_VERSION 0x20E

/**
* @brief Macro for cost indicating "no route". Used in @ref
Expand Down Expand Up @@ -125,7 +125,7 @@ typedef struct
* is unknown for this neighbor. */
uint8_t cost;
/** Radio channel used by the neighbor */
uint8_t channel;
app_lib_settings_net_channel_t channel;
/** Type of the neighbor. @ref app_lib_state_nbor_type_e */
uint8_t type;
/**
Expand Down Expand Up @@ -605,6 +605,13 @@ typedef app_res_e (*app_lib_state_scan_stop_f)(void);
typedef app_res_e (*app_lib_state_get_install_quality_f)
(app_lib_state_install_quality_t * qual_out);

/**
* @brief Query cluster channel (i.e. operating channel) currently in use
* @return Cluster channel in use
*/
typedef app_lib_settings_net_channel_t (*app_lib_state_get_cluster_channel_t)
(void);

/**
* @brief List of library functions
*/
Expand All @@ -623,6 +630,7 @@ typedef struct
app_lib_state_scan_stop_f stopScanNbors;
app_lib_state_get_install_quality_f getInstallQual;
app_lib_state_set_stack_event_cb_f setOnStackEventCb;
app_lib_state_get_cluster_channel_t getClusterChannel;
} app_lib_state_t;

#endif /* APP_LIB_STATE_H_ */
31 changes: 18 additions & 13 deletions board/bgm220-ek4314a/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,40 @@
#ifndef BOARD_BGM220_EK4314A_BOARD_H_
#define BOARD_BGM220_EK4314A_BOARD_H_

// Waps usart defines
// usart definitions
#define BOARD_USART_ID 0

#define BOARD_USART_GPIO_PORT GPIO_PORTA
#define BOARD_USART_TX_PORT GPIO_PORTA
#define BOARD_USART_TX_PIN 5
#define BOARD_USART_RX_PORT GPIO_PORTA
#define BOARD_USART_RX_PIN 6

// List of GPIO ports and pins for the LEDs on the board:
#define BOARD_LED_PIN_LIST {{GPIO_PORTA, 4}}
// List of GPIO pins
#define BOARD_GPIO_PIN_LIST {{GPIO_PORTA, 4},\
{GPIO_PORTC, 7},\
{GPIO_PORTA, 6}} /* required by the dual_mcu app. usart wakeup pin (= BOARD_USART_RX). */

// User friendly name for GPIOs (IDs mapped to the BOARD_GPIO_PIN_LIST table)
#define BOARD_GPIO_ID_LED0 0 // mapped to pin PA04
#define BOARD_GPIO_ID_BUTTON0 1 // mapped to pin PC07
#define BOARD_GPIO_ID_USART_WAKEUP 2 // mapped to pin PA06

// List of LED IDs
#define BOARD_LED_ID_LIST {BOARD_GPIO_ID_LED0}

// Active high polarity for LEDs
#define BOARD_LED_ACTIVE_LOW false
#define BOARD_LED_ACTIVE_LOW false

// List of ext. ints, GPIO ports and pins for buttons on the board:
// List of button IDs
// NOTE! EFR32xG22 can wake up from deep sleep (EM2) using GPIO input trigger
// only from A or B ports. Having the button in port C prevents button
// to be used for waking up from deep sleep.
#define BOARD_BUTTON_PIN_LIST {{4, GPIO_PORTC, 7}}
#define BOARD_BUTTON_ID_LIST {BOARD_GPIO_ID_BUTTON0}

// Active low polarity for buttons
#define BOARD_BUTTON_ACTIVE_LOW true

// Board has external pull-up for buttons
#define BOARD_BUTTON_INTERNAL_PULL false

// Buttons use even external interrupts
#define BOARD_BUTTON_USE_EVEN_INT true

// Buttons use even external interrupts
//#define BOARD_BUTTON_USE_EVEN_INT true

#endif /* BOARD_BGM220_EK4314A_BOARD_H_ */
96 changes: 57 additions & 39 deletions board/efr32_template/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@
*/
#define BOARD_USART_ID 0

/**
* @brief GPIO port used
*
* Valid values: <code>GPIOA, GPIOB, ...</code>
*/
#define BOARD_USART_GPIO_PORT GPIOA
/**
* @brief RX routeloc definition
*
Expand All @@ -45,40 +39,85 @@
*/
#define BOARD_USART_ROUTELOC_TXLOC USART_ROUTELOC0_TXLOC_LOC0

/**
* @brief Transmission pin port
*/
#define BOARD_USART_TX_PORT GPIOA
/**
* @brief Transmission pin number
*/
#define BOARD_USART_TX_PIN 0
/**
* @brief Reception pin port
*/
#define BOARD_USART_RX_PORT GPIOA
/**
* @brief Reception pin number
*/
#define BOARD_USART_RX_PIN 1

/**
* @brief GPIO definitions
*
* If board needs GPIOs, they are defined here. If not defined, a dummy
* GPIO driver is compiled, so that applications can use the GPIO driver
* unconditionally.
*
* For Silabs EFR32 family, the list contains GPIO port/pin number pairs.
*
* @note in order for application to use GPIOs, see @ref source_makefile_hal_gpio
* "here".
*/
#define BOARD_GPIO_PIN_LIST {{GPIOF, 4}, /* PF04 */\
{GPIOF, 5}, /* PF05 */\
{GPIOF, 6}, /* PF06 */\
{GPIOF, 7}, /* PF07 */\
{GPIOA, 1}, /* PA01. required by the dual_mcu app. usart wakeup pin (= BOARD_USART_RX) */\
{GPIOD, 8}} /* PD08. required by the dual_mcu app (indication signal) */

/**
* @brief GPIO IDs
*
* User friendly name for GPIOs (IDs mapped to the BOARD_GPIO_PIN_LIST table)
*
*/
#define BOARD_GPIO_ID_LED0 0 // mapped to pin PF04
#define BOARD_GPIO_ID_LED1 1 // mapped to pin PF05
#define BOARD_GPIO_ID_BUTTON0 2 // mapped to pin PF06
#define BOARD_GPIO_ID_BUTTON1 3 // mapped to pin PF07

/**
* @brief pin for dual mcu app, usart wakeup
*
* This only used in @ref source/dualmcu_app.c "dualmcu_app" application to
* wake up the usart driver when detecting a transition on the usart RX pin.
*
* It is optional definition.
*/
#define BOARD_GPIO_ID_USART_WAKEUP 4 // mapped to pin PA01

/**
* @brief Interrupt pin for dual mcu app, unread indication
*
* This only used in @ref source/dualmcu_app.c "dualmcu_app" application to
* announce with GPIO pin that there is incoming indication to be read from
* device.
*
* It is optional definition. If not present, no irq pin is present
* It is optional definition.
*/
#define BOARD_UART_INT_PIN 8
#define BOARD_UART_INT_PORT GPIOD
#define BOARD_GPIO_ID_UART_IRQ 5 // mapped to pin PD08

/**
* @brief LED definitions
*
* If board contains LEDs, they are defined here. If not defined, a dummy
* LED driver is compiled, so that applications can use the LED driver
* If board contains LEDs, The LED IDs list is defined here. The LED IDs are mapped to GPIO IDs.
* If not defined, a dummy LED driver is compiled, so that applications can use the LED driver
* unconditionally.
*
* For Silabs EFR32 family, the list contains GPIO port/pin number pairs.
*
* @note in order for application to use LEDs, see @ref source_makefile_hal_led
* "here".
*/
#define BOARD_LED_PIN_LIST {{GPIOF, 4}, {GPIOF, 5}}
#define BOARD_LED_PIN_LIST {BOARD_GPIO_ID_LED0, BOARD_GPIO_ID_LED1}

/**
* @brief LED GPIO polarity
Expand All @@ -92,18 +131,14 @@
/**
* @brief Button definitions
*
* Any buttons present on the board are defined here. If not defined, a dummy
* button driver is compiled, so that applications can use the button driver
* If board contains buttons, The button IDs list is defined here. The button IDs are mapped to GPIO IDs.
* If not defined, a dummy button driver is compiled, so that applications can use the button driver
* unconditionally.
*
* For Silabs EFR32 family, the list contains GPIO external interrupt numbers,
* GPIO ports and pins. See \ref BOARD_BUTTON_USE_EVEN_INT below for extra
* considerations when selecting external interrupt numbers.
*
* @note in order for application to use buttons, see @ref
* source_makefile_hal_button "here".
*/
#define BOARD_BUTTON_PIN_LIST {{4, GPIOF, 6}, {6, GPIOF, 7}}
#define BOARD_BUTTON_ID_LIST {BOARD_GPIO_ID_BUTTON0, BOARD_GPIO_ID_BUTTON1}

/**
* @brief Button GPIO polarity
Expand All @@ -123,23 +158,6 @@
* \ref BOARD_BUTTON_INTERNAL_PULL to true to enable internal pull-up(down).
* Pull-up(down) is enabled when \ref BOARD_BUTTON_ACTIVE_LOW is true(false).
*/
#define BOARD_BUTTON_INTERNAL_PULL true

/**
* @brief Button GPIO interrupt even/odd selection
*
* The EFR32 GPIO block has 16 configurable external interrupt sources. Even
* and odd numbered interrupt sources are routed to separate interrupt vectors
* in the processor. If this setting is true, the button interrupts use the
* even interrupt vector GPIO_EVEN_IRQn, otherwise GPIO_ODD_IRQn.
*
* Not all GPIO pins can be mapped to all even or odd external interrupt
* sources. Please see the GPIO_EXTIPINSELL and GPIO_EXTIPINSELH register
* documentation in the EFR32xG12 Wireless Gecko Reference Manual.
*
* The external interrupt source in \ref BOARD_BUTTON_PIN_LIST above should
* match this definition, otherwise the buttons won't work.
*/
#define BOARD_BUTTON_USE_EVEN_INT true
#define BOARD_BUTTON_INTERNAL_PULL true

#endif /* _BOARD_EFR32_TEMPLATE_BOARD_H_ */
18 changes: 13 additions & 5 deletions board/mdbt50q_rx/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,27 @@
#ifndef BOARD_MDBT50Q_RX_H_
#define BOARD_MDBT50Q_RX_H_


// Serial port
// There is no serial port but a USB connection

// List of GPIO pins
#define BOARD_GPIO_PIN_LIST {45, /* P1.13 */\
43, /* P1.11 */\
15} /* P0.15 */

// User friendly name for GPIOs (IDs mapped to the BOARD_GPIO_PIN_LIST table)
#define BOARD_GPIO_ID_LED0 0 // mapped to pin P1.13
#define BOARD_GPIO_ID_LED1 1 // mapped to pin P1.11
#define BOARD_GPIO_ID_BUTTON0 2 // mapped to pin P0.15

// List of GPIO pins for the LEDs on the board: LED 1 P1.13 to LED 2 P1.11
#define BOARD_LED_PIN_LIST {45, 43}
// List of LED IDs
#define BOARD_LED_ID_LIST {BOARD_GPIO_ID_LED0, BOARD_GPIO_ID_LED1}

// Active low polarity for LEDs
#define BOARD_LED_ACTIVE_LOW true

// List of GPIO pins for buttons on the board: Button 1 to Button 4
#define BOARD_BUTTON_PIN_LIST {15}
// List of button IDs
#define BOARD_BUTTON_ID_LIST {BOARD_GPIO_ID_BUTTON0}

// Active low polarity for buttons
#define BOARD_BUTTON_ACTIVE_LOW true
Expand Down
16 changes: 14 additions & 2 deletions board/nrf52832_mdk_v2/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,20 @@
#define BOARD_USART_TX_PIN 20
#define BOARD_USART_RX_PIN 19

// List of GPIO pins for the LEDs on the board: LED R, G, B
#define BOARD_LED_PIN_LIST {23, 22, 24}
// List of GPIO pins
#define BOARD_GPIO_PIN_LIST {23, /* P0.23 */\
22, /* P0.22 */\
24, /* P0.24 */\
19} /* P0.19. required by the dual_mcu app. usart wakeup pin (= BOARD_USART_RX) */

// User friendly name for GPIOs (IDs mapped to the BOARD_GPIO_PIN_LIST table)
#define BOARD_GPIO_ID_LED_R 0 // mapped to pin P0.23
#define BOARD_GPIO_ID_LED_G 1 // mapped to pin P0.22
#define BOARD_GPIO_ID_LED_B 2 // mapped to pin P0.24
#define BOARD_GPIO_ID_USART_WAKEUP 3 // mapped to pin P0.19

// List of LED IDs
#define BOARD_LED_ID_LIST {BOARD_GPIO_ID_LED_R, BOARD_GPIO_ID_LED_G, BOARD_GPIO_ID_LED_B}

// Active low polarity for LEDs
#define BOARD_LED_ACTIVE_LOW true
Expand Down
Loading