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

Sdk 8 support #107

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
caed458
changed uint8_t* data to uint8_t data, and added rbc_mesh_init to RBC…
erinsb Apr 12, 2016
63f2f01
Reverted data back to a pointer (*data)
erinsb Apr 13, 2016
6562471
added simple_uart
erinsb Apr 13, 2016
ba5b1dc
added simple_uart
erinsb Apr 13, 2016
0a0a174
modified simple_uart
erinsb Apr 13, 2016
5f195b9
added printf debugging statements
erinsb Apr 14, 2016
1d44350
removed various printf statements
erinsb Apr 14, 2016
6302aa7
added dynamic memory allocation to preserve serial_cmd array through …
erinsb Apr 14, 2016
e993a40
Fixed uint8_t data back to uint8_t * data
Apr 14, 2016
9df314b
Fixed missing free()
Apr 14, 2016
35997fc
allocated and freed evt.data in order to preserve memory of the array
erinsb Apr 14, 2016
1b7d26e
Added gpio_config for setting pins
Apr 14, 2016
db6cfd1
added gpio_config files
erinsb Apr 14, 2016
9fe3e1f
added ifdef DEBUG statements, changed to allow more than 3 evt->evt_h…
erinsb Apr 14, 2016
39b54d8
more ifdef DEBUG lines added
erinsb Apr 15, 2016
2ef732a
Added project specific value updates
Apr 15, 2016
f3b99c4
Comment updates
Apr 15, 2016
0bed32b
commented out some printf statements
erinsb Apr 16, 2016
ae4bdf1
added analog read from analog pins
erinsb Apr 17, 2016
d234e08
Added value refresh command for analog reads
Apr 17, 2016
abdd5cc
changed some debug statements
erinsb Apr 17, 2016
c2d6eb2
value_refresh fixes
erinsb Apr 17, 2016
cc82d70
misc updates
erinsb Apr 18, 2016
70ff33a
more misc updates
erinsb Apr 18, 2016
be04f9f
Filled in Template project for smart home project
Apr 18, 2016
1ba4f8a
Updated device pins
Apr 18, 2016
6c028f5
Set ping handle back low after it has been handled
Apr 18, 2016
7a611b6
added sd initialization in template
erinsb Apr 18, 2016
b93f0a0
Updated includes
Apr 18, 2016
22678f3
misc debugging statements
erinsb Apr 19, 2016
3c4f397
Prevent multiple devices from updating same handle on ping
Apr 19, 2016
9b2b916
fixed last commit
erinsb Apr 19, 2016
c6cb0cc
Added RECEIVER ifdef for debugging
Apr 19, 2016
a269a95
Added Pulsemeasure for Digital input
Apr 19, 2016
629e2d8
updated defines
erinsb Apr 19, 2016
ece3412
Last minute clean-up
erinsb May 17, 2016
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
33 changes: 20 additions & 13 deletions application_controller/serial_interface/serial_command.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ typedef enum
{
SERIAL_CMD_OPCODE_ECHO = 0x02,
SERIAL_CMD_OPCODE_RADIO_RESET = 0x0E,

SERIAL_CMD_OPCODE_INIT = 0x70,
SERIAL_CMD_OPCODE_VALUE_SET = 0x71,
SERIAL_CMD_OPCODE_VALUE_ENABLE = 0x72,
Expand All @@ -44,62 +44,68 @@ typedef enum
SERIAL_CMD_OPCODE_ACCESS_ADDR_GET = 0x7C,
SERIAL_CMD_OPCODE_CHANNEL_GET = 0x7D,
SERIAL_CMD_OPCODE_INTERVAL_GET = 0x7F,

SERIAL_CMD_OPCODE_VALUE_REFRESH = 0x6F,
} __packed serial_cmd_opcode_t;


/****** CMD PARAMS ******/
typedef struct
typedef struct
{
uint8_t data[29];
} __packed serial_cmd_params_echo_t;

typedef struct
typedef struct
{
uint32_t access_addr;
uint32_t int_min;
uint8_t channel;
} __packed serial_cmd_params_init_t;

typedef struct
typedef struct
{
uint16_t handle;
uint8_t flag;
uint8_t flag;
uint8_t value;
} __packed serial_cmd_params_flag_set_t;

typedef struct
typedef struct
{
uint16_t handle;
uint8_t flag;
uint8_t flag;
} __packed serial_cmd_params_flag_get_t;

typedef struct
typedef struct
{
uint16_t handle;
uint8_t value[RBC_MESH_VALUE_MAX_LEN];
} __packed serial_cmd_params_value_set_t;

typedef struct
typedef struct
{
uint16_t handle;
} __packed serial_cmd_params_value_enable_t;

typedef struct
typedef struct
{
uint16_t handle;
} __packed serial_cmd_params_value_disable_t;

typedef struct
typedef struct
{
uint16_t handle;
} __packed serial_cmd_params_value_get_t;

typedef struct
{
uint16_t handle;
} __packed serial_cmd_params_value_refresh_t

typedef struct
typedef struct
{
uint8_t length;
serial_cmd_opcode_t opcode;
union
union
{
serial_cmd_params_echo_t echo;
serial_cmd_params_init_t init;
Expand All @@ -109,6 +115,7 @@ typedef struct
serial_cmd_params_value_enable_t value_enable;
serial_cmd_params_value_disable_t value_disable;
serial_cmd_params_value_get_t value_get;
serial_cmd_params_value_refresh_t value_refresh;
} __packed params;
} __packed serial_cmd_t;

Expand Down
2 changes: 2 additions & 0 deletions nRF51/SDK/bsp/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "wt51822.h"
#elif defined(BOARD_CUSTOM)
#include "custom_board.h"
#elif defined(BOARD_CUSTOM_SERIAL)
#include "custom_board_serial.h"
#else
#error "Board is not defined"
#endif
Expand Down
131 changes: 131 additions & 0 deletions nRF51/SDK/bsp/custom_board_serial.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
/***********************************************************************************
Copyright (c) Nordic Semiconductor ASA
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.

3. Neither the name of Nordic Semiconductor ASA nor the names of other
contributors to this software may be used to endorse or promote products
derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
************************************************************************************/
#ifndef PCA10028_H
#define PCA10028_H

// LEDs definitions for PCA10028
#define LEDS_NUMBER 4

#define LED_START 21
#define LED_1 21
#define LED_2 22
#define LED_3 23
#define LED_4 24
#define LED_STOP 24

#define LEDS_LIST { LED_1, LED_2, LED_3, LED_4 }

#define BSP_LED_0 LED_1
#define BSP_LED_1 LED_2
#define BSP_LED_2 LED_3
#define BSP_LED_3 LED_4

#define BSP_LED_0_MASK (1<<BSP_LED_0)
#define BSP_LED_1_MASK (1<<BSP_LED_1)
#define BSP_LED_2_MASK (1<<BSP_LED_2)
#define BSP_LED_3_MASK (1<<BSP_LED_3)

#define LEDS_MASK (BSP_LED_0_MASK | BSP_LED_1_MASK | BSP_LED_2_MASK | BSP_LED_3_MASK)
/* all LEDs are lit when GPIO is low */
#define LEDS_INV_MASK LEDS_MASK

#define BUTTONS_NUMBER 4

#define BUTTON_START 17
#define BUTTON_1 17
#define BUTTON_2 18
#define BUTTON_3 19
#define BUTTON_4 20
#define BUTTON_STOP 20
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP

#define BUTTONS_LIST { BUTTON_1, BUTTON_2, BUTTON_3, BUTTON_4 }

#define BSP_BUTTON_0 BUTTON_1
#define BSP_BUTTON_1 BUTTON_2
#define BSP_BUTTON_2 BUTTON_3
#define BSP_BUTTON_3 BUTTON_4

#define BSP_BUTTON_0_MASK (1<<BSP_BUTTON_0)
#define BSP_BUTTON_1_MASK (1<<BSP_BUTTON_1)
#define BSP_BUTTON_2_MASK (1<<BSP_BUTTON_2)
#define BSP_BUTTON_3_MASK (1<<BSP_BUTTON_3)

#define BUTTONS_MASK 0x001E0000

#define RX_PIN_NUMBER 11
#define TX_PIN_NUMBER 9
#define CTS_PIN_NUMBER 10
#define RTS_PIN_NUMBER 8
#define HWFC true

#define SPIS_MISO_PIN 28 // SPI MISO signal.
#define SPIS_CSN_PIN 12 // SPI CSN signal.
#define SPIS_MOSI_PIN 25 // SPI MOSI signal.
#define SPIS_SCK_PIN 29 // SPI SCK signal.

#define SPIM0_SCK_PIN 4 /**< SPI clock GPIO pin number. */
#define SPIM0_MOSI_PIN 1 /**< SPI Master Out Slave In GPIO pin number. */
#define SPIM0_MISO_PIN 3 /**< SPI Master In Slave Out GPIO pin number. */
#define SPIM0_SS_PIN 2 /**< SPI Slave Select GPIO pin number. */

#define SPIM1_SCK_PIN 15 /**< SPI clock GPIO pin number. */
#define SPIM1_MOSI_PIN 12 /**< SPI Master Out Slave In GPIO pin number. */
#define SPIM1_MISO_PIN 14 /**< SPI Master In Slave Out GPIO pin number. */
#define SPIM1_SS_PIN 13 /**< SPI Slave Select GPIO pin number. */

// serialization APPLICATION board
#define SER_APP_RX_PIN 12 // UART RX pin number.
#define SER_APP_TX_PIN 13 // UART TX pin number.
#define SER_APP_CTS_PIN 15 // UART Clear To Send pin number.
#define SER_APP_RTS_PIN 14 // UART Request To Send pin number.

#define SER_APP_SPIM0_SCK_PIN 29 // SPI clock GPIO pin number.
#define SER_APP_SPIM0_MOSI_PIN 25 // SPI Master Out Slave In GPIO pin number
#define SER_APP_SPIM0_MISO_PIN 28 // SPI Master In Slave Out GPIO pin number
#define SER_APP_SPIM0_SS_PIN 12 // SPI Slave Select GPIO pin number
#define SER_APP_SPIM0_RDY_PIN 14 // SPI READY GPIO pin number
#define SER_APP_SPIM0_REQ_PIN 13 // SPI REQUEST GPIO pin number

// serialization CONNECTIVITY board
#define SER_CON_RX_PIN 13 // UART RX pin number.
#define SER_CON_TX_PIN 12 // UART TX pin number.
#define SER_CON_CTS_PIN 14 // UART Clear To Send pin number. Not used if HWFC is set to false.
#define SER_CON_RTS_PIN 15 // UART Request To Send pin number. Not used if HWFC is set to false.


#define SER_CON_SPIS_SCK_PIN 29 // SPI SCK signal.
#define SER_CON_SPIS_MOSI_PIN 25 // SPI MOSI signal.
#define SER_CON_SPIS_MISO_PIN 28 // SPI MISO signal.
#define SER_CON_SPIS_CSN_PIN 12 // SPI CSN signal.
#define SER_CON_SPIS_RDY_PIN 14 // SPI READY GPIO pin number.
#define SER_CON_SPIS_REQ_PIN 13 // SPI REQUEST GPIO pin number.

#endif // PCA10028_H
Loading