Skip to content

Commit

Permalink
Release 1.8.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
waltjohnson committed May 11, 2020
1 parent e0bd2b5 commit f5dacd5
Show file tree
Hide file tree
Showing 1,025 changed files with 74,520 additions and 26,369 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
/build_cygwin
ExampleProjects/Arduino/ReadIS/src/
EVB-2/IS_EVB-2/Debug/
EVB-2/.vs/
EVB-2/IS_EVB-2/Release/
5 changes: 4 additions & 1 deletion CLTool/VS_project/CLTool.vcxproj.user
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerCommandArguments>-c=COM31</LocalDebuggerCommandArguments>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ add_library(InertialSense
src/ISTcpServer.cpp
src/ISUtilities.cpp
src/linked_list.c
src/ring_buffer.c
src/serialPort.c
src/serialPortPlatform.c
src/time_conversion.c
Expand Down
124 changes: 75 additions & 49 deletions EVB-2/IS_EVB-2/IS_EVB-2.cppproj

Large diffs are not rendered by default.

90 changes: 48 additions & 42 deletions EVB-2/IS_EVB-2/src/ASF/sam/boards/user_board/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,17 +386,16 @@ void refresh_CFG_LED(void)
case EVB2_CB_PRESET_SPI_RS232: LED_CFG_CYAN(); break;
case EVB2_CB_PRESET_USB_HUB_RS232: LED_CFG_YELLOW(); break;
case EVB2_CB_PRESET_USB_HUB_RS422: LED_CFG_WHITE(); break;
#ifdef CONF_BOARD_CAN1
case EVB2_CB_PRESET_CAN: LED_CFG_RED(); break;
#endif
}
}


void board_IO_config(void)
{
// uINS ser0
if(g_flashCfg->cbOptions&EVB2_CB_OPTIONS_TRISTATE_UINS_IO)
if (g_flashCfg->cbOptions&EVB2_CB_OPTIONS_TRISTATE_UINS_IO ||
(g_flashCfg->uinsComPort != EVB2_PORT_UINS0 &&
g_flashCfg->uinsAuxPort != EVB2_PORT_UINS0))
{ // I/O tristate
ioport_set_pin_input_mode(UART_INS_SER0_TXD_PIN, 0, 0);
ioport_set_pin_input_mode(UART_INS_SER0_RXD_PIN, 0, 0);
Expand All @@ -410,21 +409,10 @@ void board_IO_config(void)
#endif
}

// uINS ser1
if(g_flashCfg->cbOptions&EVB2_CB_OPTIONS_TRISTATE_UINS_IO)
{ // I/O tristate - (Enable pin and set as input)
ioport_set_pin_input_mode(UART_INS_SER1_TXD_PIN, 0, 0);
ioport_set_pin_input_mode(UART_INS_SER1_RXD_PIN, 0, 0);

ioport_set_pin_input_mode(SPI_INS_MISO_PIN, 0, 0);
ioport_set_pin_input_mode(SPI_INS_MOSI_PIN, 0, 0);
ioport_set_pin_input_mode(SPI_INS_SCLK_PIN, 0, 0);
ioport_set_pin_input_mode(SPI_INS_CS_PIN, 0, 0);
ioport_set_pin_input_mode(SPI_INS_EN, 0, 0);
}
else if(g_flashCfg->cbOptions&EVB2_CB_OPTIONS_SPI_ENABLE)
// uINS ser1
if (g_flashCfg->cbOptions&EVB2_CB_OPTIONS_SPI_ENABLE)
{
#ifdef CONF_BOARD_SPI_UINS
#ifdef CONF_BOARD_SPI_UINS
ioport_set_pin_peripheral_mode(SPI_INS_MISO_PIN, SPI_INS_MISO_FLAGS);
ioport_set_pin_peripheral_mode(SPI_INS_MOSI_PIN, SPI_INS_MOSI_FLAGS);
ioport_set_pin_peripheral_mode(SPI_INS_SCLK_PIN, SPI_INS_SCLK_FLAGS);
Expand All @@ -436,28 +424,41 @@ void board_IO_config(void)
//Indicate to uINS that SPI is requested
ioport_set_pin_output_mode(SPI_INS_EN, IOPORT_PIN_LEVEL_LOW);
ioport_enable_pin(SPI_INS_EN);

//Setup data ready pin
ioport_set_pin_dir(INS_DATA_RDY_PIN_IDX, IOPORT_DIR_INPUT);
ioport_set_pin_mode(INS_DATA_RDY_PIN_IDX, IOPORT_MODE_PULLDOWN);

spiTouINS_init();
#endif
}
spiTouINS_init();
#endif
}
else if (g_flashCfg->cbOptions&EVB2_CB_OPTIONS_TRISTATE_UINS_IO ||
(g_flashCfg->uinsComPort != EVB2_PORT_UINS1 &&
g_flashCfg->uinsAuxPort != EVB2_PORT_UINS1))
{ // I/O tristate - (Enable pin and set as input)
ioport_set_pin_input_mode(UART_INS_SER1_TXD_PIN, 0, 0);
ioport_set_pin_input_mode(UART_INS_SER1_RXD_PIN, 0, 0);

ioport_set_pin_input_mode(SPI_INS_MISO_PIN, 0, 0);
ioport_set_pin_input_mode(SPI_INS_MOSI_PIN, 0, 0);
ioport_set_pin_input_mode(SPI_INS_SCLK_PIN, 0, 0);
ioport_set_pin_input_mode(SPI_INS_CS_PIN, 0, 0);
ioport_set_pin_input_mode(SPI_INS_EN, 0, 0);
}
else
{
#ifdef CONF_BOARD_SERIAL_UINS_SER1
ioport_set_pin_peripheral_mode(UART_INS_SER1_TXD_PIN, UART_INS_SER1_TXD_FLAGS);
ioport_set_pin_peripheral_mode(UART_INS_SER1_RXD_PIN, UART_INS_SER1_RXD_FLAGS);
serInit(EVB2_PORT_UINS1, 115200, NULL);
serInit(EVB2_PORT_UINS1, 921600, NULL);
ioport_set_pin_input_mode(SPI_INS_SCLK_PIN, 0, 0);
ioport_set_pin_input_mode(SPI_INS_CS_PIN, 0, 0);
ioport_set_pin_input_mode(SPI_INS_EN, 0, 0);
#endif
}

#ifdef CONF_BOARD_SERIAL_SP330
if(g_flashCfg->cbOptions&EVB2_CB_OPTIONS_SP330_RS422)
if (g_flashCfg->cbOptions&EVB2_CB_OPTIONS_SP330_RS422)
{ // RS422 mode
ioport_set_pin_output_mode(SP330_N485_RXEN_PIN, IOPORT_PIN_LEVEL_LOW); // Enable RS485 receiver
ioport_set_pin_output_mode(SP330_485_N232_PIN, IOPORT_PIN_LEVEL_HIGH); // Enable RS422/RS485 mode
Expand All @@ -467,11 +468,11 @@ void board_IO_config(void)
ioport_set_pin_output_mode(SP330_N485_RXEN_PIN, IOPORT_PIN_LEVEL_HIGH); // Disable RS485 receiver
ioport_set_pin_output_mode(SP330_485_N232_PIN, IOPORT_PIN_LEVEL_LOW); // Enable RS232 mode
}
serSetBaudRate(EVB2_PORT_SP330, 921600);
serSetBaudRate(EVB2_PORT_SP330, g_flashCfg->h3sp330BaudRate);
#endif

#ifdef CONF_BOARD_SERIAL_XBEE
if(g_flashCfg->cbOptions&EVB2_CB_OPTIONS_XBEE_ENABLE)
if (g_flashCfg->cbOptions&EVB2_CB_OPTIONS_XBEE_ENABLE)
{ // XBee enabled
ioport_set_pin_peripheral_mode(UART_XBEE_RXD_PIN, UART_XBEE_RXD_FLAGS);
ioport_set_pin_peripheral_mode(UART_XBEE_TXD_PIN, UART_XBEE_TXD_FLAGS);
Expand Down Expand Up @@ -516,7 +517,7 @@ void board_IO_config(void)
#endif

#ifdef CONF_BOARD_SPI_ATWINC_WIFI
if(g_flashCfg->cbOptions&EVB2_CB_OPTIONS_WIFI_ENABLE )
if (g_flashCfg->cbOptions&EVB2_CB_OPTIONS_WIFI_ENABLE )
{ // WiFi enabled
wifi_enable(true); // power on wifi. Connect to hot spot and TCP socket
}
Expand All @@ -530,17 +531,17 @@ void board_IO_config(void)
#endif

// Reset default baud rates
if(!(g_flashCfg->cbOptions&EVB2_CB_OPTIONS_TRISTATE_UINS_IO))
if (!(g_flashCfg->cbOptions&EVB2_CB_OPTIONS_TRISTATE_UINS_IO))
{ // I/O not tristate
serSetBaudRate(EVB2_PORT_UINS0, 921600);
if(!(g_flashCfg->cbOptions&EVB2_CB_OPTIONS_SPI_ENABLE))
if (!(g_flashCfg->cbOptions&EVB2_CB_OPTIONS_SPI_ENABLE))
{
serSetBaudRate(EVB2_PORT_UINS1, 115200);
serSetBaudRate(EVB2_PORT_UINS1, 921600);
}
}
serSetBaudRate(EVB2_PORT_BLE, 115200);
serSetBaudRate(EVB2_PORT_XRADIO, 115200);
serSetBaudRate(EVB2_PORT_GPIO_H8, 115200);
serSetBaudRate(EVB2_PORT_XRADIO, g_flashCfg->h4xRadioBaudRate);
serSetBaudRate(EVB2_PORT_GPIO_H8, g_flashCfg->h8gpioBaudRate);
#ifdef CONF_BOARD_CAN1
if (g_flashCfg->cbOptions&EVB2_CB_OPTIONS_CAN_ENABLE)
{
Expand Down Expand Up @@ -575,6 +576,13 @@ void board_init(void)

//////////////////////////////////////////////////////////////////////////
// Init system clocks
// If running on PLL, disable it so second PLL initialization does not hang device
if((PMC->PMC_MCKR & PMC_MCKR_CSS_Msk) == PMC_MCKR_CSS_PLLA_CLK)
{
pmc_switch_mck_to_mainck(0);
pll_disable(PLLA_ID);
}

pmc_switch_sclk_to_32kxtal(PMC_OSC_XTAL); // set SLCK to use external 32kHz crystal rather than internal 32kHz RC oscillator.
sysclk_init();

Expand Down Expand Up @@ -661,19 +669,13 @@ void board_init(void)

//////////////////////////////////////////////////////////////////////////
// Serial Ports
// #ifdef CONF_BOARD_UART_CONSOLE
// /* Configure UART pins */
// ioport_set_pin_peripheral_mode(USART1_RXD_GPIO, USART1_RXD_FLAGS);
// MATRIX->CCFG_SYSIO |= CCFG_SYSIO_SYSIO4;
// ioport_set_pin_peripheral_mode(USART1_TXD_GPIO, USART1_TXD_FLAGS);
// #endif

// UINS ser0 and ser1 - In board_IO_init() in main.cpp

#ifdef CONF_BOARD_SERIAL_EXT_RADIO // External Radio
ioport_set_pin_peripheral_mode(UART_EXT_RADIO_RXD_PIN, UART_EXT_RADIO_RXD_FLAGS);
ioport_set_pin_peripheral_mode(UART_EXT_RADIO_TXD_PIN, UART_EXT_RADIO_TXD_FLAGS);
serInit(EVB2_PORT_XRADIO, 115200, NULL);
serInit(EVB2_PORT_XRADIO, g_flashCfg->h4xRadioBaudRate, NULL);
// ioport_set_pin_dir(EXT_RADIO_RST, IOPORT_DIR_OUTPUT);
// ioport_set_pin_level(EXT_RADIO_RST, IOPORT_PIN_LEVEL_HIGH); // Low assert
#endif
Expand All @@ -689,17 +691,21 @@ void board_init(void)
#ifdef CONF_BOARD_SERIAL_SP330 // RS232/RS422/RS485 converter
ioport_set_pin_peripheral_mode(UART_SP330_RXD_PIN, UART_SP330_RXD_FLAGS);
ioport_set_pin_peripheral_mode(UART_SP330_TXD_PIN, UART_SP330_TXD_FLAGS);
serInit(EVB2_PORT_SP330, 921600, NULL);
serInit(EVB2_PORT_SP330, g_flashCfg->h3sp330BaudRate, NULL);
ioport_set_pin_output_mode(SP330_NSLEW_PIN, IOPORT_PIN_LEVEL_HIGH); // Don't limit data rate to less than 250 Kbps
ioport_set_pin_output_mode(SP330_NFULL_DPLX_PIN, IOPORT_PIN_LEVEL_LOW); // RS485 full duplex (RS232 N/A)
ioport_set_pin_output_mode(SP330_NSHDN_PIN, IOPORT_PIN_LEVEL_HIGH); // Enable device
#endif

#ifdef CONF_BOARD_SERIAL_GPIO_H8 // GPIO TTL
ioport_set_pin_output_mode(GPIO_UART_INV_PIN, IOPORT_PIN_LEVEL_LOW); // Non-inverting
ioport_set_pin_output_mode(GPIO_UART_INV_PIN, IOPORT_PIN_LEVEL_LOW); // Non-inverting
ioport_set_pin_peripheral_mode(GPIO_H8_UART_RXD_PIN, GPIO_H8_UART_RXD_FLAGS);
MATRIX->CCFG_SYSIO |= CCFG_SYSIO_SYSIO4;
ioport_set_pin_peripheral_mode(GPIO_H8_UART_TXD_PIN, GPIO_H8_UART_TXD_FLAGS);
serInit(EVB2_PORT_GPIO_H8, 115200, NULL);
serInit(EVB2_PORT_GPIO_H8, g_flashCfg->h8gpioBaudRate, NULL);

// char buf[3] = "123";
// serWrite(EVB2_PORT_GPIO_H8, buf, 3, NULL);
#endif


Expand Down
25 changes: 18 additions & 7 deletions EVB-2/IS_EVB-2/src/ASF/sam/boards/user_board/user_board.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@
// GPIO UART
#define GPIO_H8_UART_RXD_PIN (PIO_PA21_IDX)
#define GPIO_H8_UART_RXD_FLAGS (IOPORT_MODE_MUX_A | IOPORT_MODE_PULLUP)
// #define GPIO_H8_UART_RXD_FLAGS (IOPORT_MODE_MUX_A)
#define GPIO_H8_UART_TXD_PIN (PIO_PB4_IDX)
#define GPIO_H8_UART_TXD_FLAGS (IOPORT_MODE_MUX_D)

Expand All @@ -244,6 +245,14 @@
#define LED_CFG_WHITE() { LED_ON(LED_CFG_RED_PIN); LED_ON(LED_CFG_GRN_PIN); LED_ON(LED_CFG_BLU_PIN); }
#define LED_CFG_OFF() { LED_OFF(LED_CFG_RED_PIN); LED_OFF(LED_CFG_GRN_PIN); LED_OFF(LED_CFG_BLU_PIN); }

#define LED_COLOR_RED() LED_CFG_RED();
#define LED_COLOR_GREEN() LED_CFG_GREEN();
#define LED_COLOR_BLUE() LED_CFG_BLUE();
#define LED_COLOR_CYAN() LED_CFG_CYAN();
#define LED_COLOR_YELLOW() LED_CFG_YELLOW();
#define LED_COLOR_PURPLE() LED_CFG_PURPLE();
#define LED_COLOR_WHITE() LED_CFG_WHITE();

// EVB - LED - Logger
#define LED_LOG_RED_PIN (PIO_PA11_IDX)
#define LED_LOG_GRN_PIN (PIO_PD23_IDX)
Expand All @@ -261,6 +270,8 @@
#define LEDS_ALL_OFF() { LED_OFF(LED_LOG_RED_PIN); LED_OFF(LED_LOG_GRN_PIN); LED_OFF(LED_LOG_BLU_PIN); }
#define LEDS_ALL_TOGGLE() { LED_TOGGLE(LED_LOG_RED_PIN); LED_TOGGLE(LED_LOG_GRN_PIN); LED_TOGGLE(LED_LOG_BLU_PIN); }



// LED - INS Communications
#define LED_INS_RXD_PIN (PIO_PC8_IDX) // green
#define LED_INS_TXD_PIN (PIO_PC28_IDX) // red
Expand Down Expand Up @@ -328,13 +339,13 @@
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////

#define CONSOLE_UART (USART1)
#define CONSOLE_UART_ID (ID_USART1)
/** USART1 pins definitions, PA21,PB4. */
#define USART1_RXD_GPIO (PIO_PA21_IDX)
#define USART1_RXD_FLAGS (IOPORT_MODE_MUX_A | IOPORT_MODE_PULLUP)
#define USART1_TXD_GPIO (PIO_PB4_IDX)
#define USART1_TXD_FLAGS (IOPORT_MODE_MUX_D)
// #define CONSOLE_UART (USART1)
// #define CONSOLE_UART_ID (ID_USART1)
// /** USART1 pins definitions, PA21,PB4. */
// #define USART1_RXD_GPIO (PIO_PA21_IDX)
// #define USART1_RXD_FLAGS (IOPORT_MODE_MUX_A | IOPORT_MODE_PULLUP)
// #define USART1_TXD_GPIO (PIO_PB4_IDX)
// #define USART1_TXD_FLAGS (IOPORT_MODE_MUX_D)

// /** USART0 pins definitions, PB0,PB1. */
// #define USART0_RXD_GPIO (PIO_PB0_IDX
Expand Down
Loading

0 comments on commit f5dacd5

Please sign in to comment.