mirror of
https://github.com/apache/nuttx.git
synced 2026-05-22 22:20:01 +08:00
Merged in alinjerpelea/nuttx (pull request #948)
arch: arm: cxd56xx: add GNSS device and UART0
* arch: arm: cxd56xx: add GNSS device
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
* arch: arm: cxd56xx: add Geofence Support
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
* arch: arm: cxd56xx: add UART0 iterface
UART0 is an interface with hardware flow control in the application subsystem.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
* configs: spresense: path correction
In the initial commit the path reference was not updated
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
committed by
Gregory Nutt
parent
1a1321df6b
commit
5867fdc0e1
@@ -0,0 +1,233 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/include/cxd56xx/geofence.h
|
||||
*
|
||||
* Copyright 2018 Sony Semiconductor Solutions Corporation
|
||||
*
|
||||
* 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 Sony Semiconductor Solutions Corporation nor
|
||||
* the names of its contributors 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 OWNER 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 __ARCH_ARM_INCLUDE_CXD56XX_GEOFENCE_H
|
||||
#define __ARCH_ARM_INCLUDE_CXD56XX_GEOFENCE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/* Start geofence monitoring.
|
||||
* This command is used to start the geofence monitoring.
|
||||
*
|
||||
* param arg
|
||||
* Parameter is Unnecessary. Set Zero.
|
||||
*/
|
||||
|
||||
#define CXD56_GEOFENCE_IOCTL_START 1
|
||||
|
||||
/* Stop geofence monitoring.
|
||||
* This command is used to stop the geofence monitoring.
|
||||
*
|
||||
* param arg
|
||||
* Parameter is Unnecessary. Set Zero.
|
||||
*/
|
||||
|
||||
#define CXD56_GEOFENCE_IOCTL_STOP 2
|
||||
|
||||
/* Add region.
|
||||
* This command is used to add the region.
|
||||
*
|
||||
* param arg
|
||||
* Parameter is struct cxd56_geofence_region_s.
|
||||
*/
|
||||
|
||||
#define CXD56_GEOFENCE_IOCTL_ADD 3
|
||||
|
||||
/* Modify region.
|
||||
* This command is used to modify the region.
|
||||
*
|
||||
* param arg
|
||||
* Parameter is struct cxd56_geofence_region_s.
|
||||
*/
|
||||
|
||||
#define CXD56_GEOFENCE_IOCTL_MODIFY 4
|
||||
|
||||
/* Delete region.
|
||||
* This command is used to delete the region.
|
||||
*
|
||||
* param arg
|
||||
* Parameter is region id.
|
||||
*/
|
||||
|
||||
#define CXD56_GEOFENCE_IOCTL_DELETE 5
|
||||
|
||||
/* Delete all region.
|
||||
* This command is used to delete all region.
|
||||
*
|
||||
* param arg
|
||||
* Parameter is Unnecessary. Set Zero.
|
||||
*/
|
||||
|
||||
#define CXD56_GEOFENCE_IOCTL_ALL_DELETE 6
|
||||
|
||||
/* Get region data.
|
||||
* This command is used to get region data.
|
||||
*
|
||||
* param arg
|
||||
* Parameter is struct cxd56_geofence_region_s pointer
|
||||
* Latitude and longitude and radius data of specified id is stored.
|
||||
*/
|
||||
|
||||
#define CXD56_GEOFENCE_IOCTL_GET_REGION_DATA 7
|
||||
|
||||
/* Get used id.
|
||||
* This command is used to get used region id.
|
||||
*
|
||||
* param arg
|
||||
* Parameter is uint32_t data pointer.
|
||||
* The used id is represented by bit field.
|
||||
* For example, when ID0 and ID19 are used,
|
||||
* since bit0 and bit19 are set, the return value is 0x00080001.
|
||||
*/
|
||||
|
||||
#define CXD56_GEOFENCE_IOCTL_GET_USED_ID 8
|
||||
|
||||
/* Get all status.
|
||||
* This command is used to get all region status.
|
||||
*
|
||||
* param arg
|
||||
* Parameter is Unnecessary. Set Zero.
|
||||
* All region status will stored in next read data.
|
||||
*/
|
||||
|
||||
#define CXD56_GEOFENCE_IOCTL_GET_ALL_STATUS 9
|
||||
|
||||
/* Set goefence operation mode
|
||||
* This command is used to set operation mode.
|
||||
*
|
||||
* param arg
|
||||
* Parameter is struct cxd56_geofence_mode_s.
|
||||
*/
|
||||
|
||||
#define CXD56_GEOFENCE_IOCTL_SET_MODE 10
|
||||
|
||||
/* check macros for GNSS commands */
|
||||
|
||||
#define CXD56_GEOFENCE_IOCTL_INVAL 0
|
||||
#define CXD56_GEOFENCE_IOCTL_MAX 11
|
||||
|
||||
/* The transition type indicating that the user exits the region. */
|
||||
|
||||
#define CXD56_GEOFENCE_TRANSITION_EXIT 0
|
||||
|
||||
/* The transition type indicating that the user enters the region. */
|
||||
|
||||
#define CXD56_GEOFENCE_TRANSITION_ENTER 1
|
||||
|
||||
/* The transition type indicating that the user enters and
|
||||
* dwells in region for a given period of time.
|
||||
*/
|
||||
|
||||
#define CXD56_GEOFENCE_TRANSITION_DWELL 2
|
||||
|
||||
/* MAX number of region on the CXD56xx. */
|
||||
|
||||
#define CXD56_GEOFENCE_REGION_CAPACITY 20
|
||||
|
||||
/* Region center point and radius data
|
||||
*
|
||||
* The latitude and longtitude data format is
|
||||
* integer value multiplied by 1000000.
|
||||
* Example: When latitude is 35.123456, specify 35123456.
|
||||
*/
|
||||
|
||||
struct cxd56_geofence_region_s
|
||||
{
|
||||
/* Region ID The range of ID is 0 to 19. */
|
||||
|
||||
uint8_t id;
|
||||
|
||||
/* Latitude (degree) of the center position of the region. */
|
||||
|
||||
long latitude;
|
||||
|
||||
/* Longitude (degree) of the center position of the region. */
|
||||
|
||||
long longitude;
|
||||
|
||||
/* Radius (m) of the region. */
|
||||
|
||||
uint16_t radius;
|
||||
};
|
||||
|
||||
/* Geofence mode setting parameter */
|
||||
|
||||
struct cxd56_geofence_mode_s
|
||||
{
|
||||
uint16_t deadzone; /* dead zone [meter] */
|
||||
uint16_t dwell_detecttime; /* Dewlling period time [sec] */
|
||||
};
|
||||
|
||||
/* The transition data */
|
||||
|
||||
struct cxd56_geofence_trans_s
|
||||
{
|
||||
/* Region ID */
|
||||
|
||||
uint8_t id;
|
||||
|
||||
/* Transition status.
|
||||
* The status is #CXD56_GEOFENCE_TRANSITION_EXIT or
|
||||
* #CXD56_GEOFENCE_TRANSITION_ENTER or #CXD56_GEOFENCE_TRANSITION_DWELL.
|
||||
*/
|
||||
|
||||
uint8_t status;
|
||||
};
|
||||
|
||||
/* Geofence output data structer. */
|
||||
|
||||
struct cxd56_geofence_status_s
|
||||
{
|
||||
/* Updated region ID count */
|
||||
|
||||
uint8_t update;
|
||||
|
||||
/* The detail data od updated region ID */
|
||||
|
||||
struct cxd56_geofence_trans_s status[CXD56_GEOFENCE_REGION_CAPACITY];
|
||||
};
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ARCH_ARM_INCLUDE_ARCH_CXD56XX_GEOFENCE_H */
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,68 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/include/cxd56xx/cxd56_uart0.h
|
||||
*
|
||||
* Copyright 2018 Sony Semiconductor Solutions Corporation
|
||||
*
|
||||
* 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 Sony Semiconductor Solutions Corporation nor
|
||||
* the names of its contributors 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 OWNER 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 __ARM_ARCH_INCLUDE_CXD56XX_CXD56_UART0_H
|
||||
#define __ARM_ARCH_INCLUDE_CXD56XX_CXD56_UART0_H
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
#define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_uart0initialize(FAR const char *devname);
|
||||
void cxd56_uart0uninitialize(FAR const char *devname);
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
#endif /* __ARM_ARCH_INCLUDE_CXD56XX_CXD56_UART0_H */
|
||||
@@ -224,6 +224,46 @@ config CXD56_GPIO_IRQ
|
||||
---help---
|
||||
Enable support for GPIO interrupts
|
||||
|
||||
config CXD56_UART0
|
||||
bool "UART0"
|
||||
default n
|
||||
---help---
|
||||
UART interface with hardware flow control in the application subsystem.
|
||||
|
||||
if CXD56_UART0
|
||||
|
||||
config CXD56_UART0_BAUD
|
||||
int "CXD56 UART0 BAUD"
|
||||
default 921600
|
||||
|
||||
config CXD56_UART0_PARITY
|
||||
int "CXd56 UART0 parity"
|
||||
default 0
|
||||
range 0 2
|
||||
---help---
|
||||
CXD56 UART0 parity. 0=None, 1=Odd, 2=Even. Default: None
|
||||
|
||||
config CXD56_UART0_BITS
|
||||
int "CXD56 UART0 number of bits"
|
||||
default 8
|
||||
range 5 8
|
||||
---help---
|
||||
CXD56 UART0 number of bits. Default: 8
|
||||
|
||||
config CXD56_UART0_2STOP
|
||||
int "CXD56 UART0 two stop bits"
|
||||
default 0
|
||||
---help---
|
||||
0=1 stop bit, 1=Two stop bits. Default: 1 stop bit
|
||||
|
||||
config CXD56_UART0_FLOWCONTROL
|
||||
bool "CXD56 UART0 flow control"
|
||||
default n
|
||||
---help---
|
||||
Enable CXD56 UART0 RTS flow control
|
||||
|
||||
endif
|
||||
|
||||
config CXD56_UART1
|
||||
bool "UART1"
|
||||
default y
|
||||
@@ -1183,4 +1223,71 @@ config CXD56_GE2D
|
||||
default n
|
||||
---help---
|
||||
A hardware image processor device.
|
||||
|
||||
config CXD56_GNSS
|
||||
bool "GNSS device"
|
||||
default n
|
||||
|
||||
if CXD56_GNSS
|
||||
|
||||
menu "GNSS settings"
|
||||
|
||||
config CXD56_GNSS_NPOLLWAITERS
|
||||
int "GNSS max poll waiters"
|
||||
default 4
|
||||
|
||||
config CXD56_GNSS_NSIGNALRECEIVERS
|
||||
int "GNSS max signal receivers"
|
||||
default 4
|
||||
|
||||
config CXD56_GNSS_WORKER_STACKSIZE
|
||||
int "GNSS worker thread stack size"
|
||||
default 128
|
||||
|
||||
config CXD56_GNSS_WORKER_THREAD_PRIORITY
|
||||
int "GNSS worker thread priority"
|
||||
default 255
|
||||
|
||||
config CXD56_GNSS_BACKUP_FILENAME
|
||||
string "GNSS backup file name"
|
||||
default "/mnt/spif/gnss_backup.bin"
|
||||
---help---
|
||||
Specify the path and file name of backup data.
|
||||
|
||||
config CXD56_GNSS_CEP_FILENAME
|
||||
string "GNSS CEP file name"
|
||||
default "/mnt/sd0/gnss_cep.bin"
|
||||
---help---
|
||||
Specify the path and file name of cep data.
|
||||
|
||||
config CXD56_GNSS_FW_RTK
|
||||
bool "Support carrier-phase data output for Real-Time Kinematic"
|
||||
default n
|
||||
---help---
|
||||
This is experimental function.
|
||||
|
||||
config CXD56_GNSS_DEBUG_FEATURE
|
||||
bool "GNSS debug feature"
|
||||
|
||||
if CXD56_GNSS_DEBUG_FEATURE
|
||||
|
||||
config CXD56_GNSS_DEBUG_ERROR
|
||||
bool "GNSS debug error"
|
||||
|
||||
config CXD56_GNSS_DEBUG_WARN
|
||||
bool "GNSS debug warn"
|
||||
|
||||
config CXD56_GNSS_DEBUG_INFO
|
||||
bool "GNSS debug info"
|
||||
|
||||
endif # CXD56_GNSS_DEBUG_FEATURE
|
||||
|
||||
endmenu
|
||||
config CXD56_GEOFENCE
|
||||
bool "Geofence Support"
|
||||
default y
|
||||
depends on CXD56_GNSS
|
||||
|
||||
endif
|
||||
|
||||
endmenu
|
||||
|
||||
@@ -101,6 +101,10 @@ CHIP_CSRCS += cxd56_powermgr.c
|
||||
CHIP_CSRCS += cxd56_farapi.c
|
||||
CHIP_CSRCS += cxd56_sysctl.c
|
||||
|
||||
ifeq ($(CONFIG_CXD56_UART0),y)
|
||||
CHIP_CSRCS += cxd56_uart0.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXD56_PM_PROCFS),y)
|
||||
CHIP_CSRCS += cxd56_powermgr_procfs.c
|
||||
endif
|
||||
@@ -181,3 +185,12 @@ endif
|
||||
ifeq ($(CONFIG_CXD56_WDT),y)
|
||||
CHIP_CSRCS += cxd56_wdt.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXD56_GNSS),y)
|
||||
CHIP_CSRCS += cxd56_gnss.c
|
||||
CHIP_CSRCS += cxd56_cpu1signal.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXD56_GEOFENCE),y)
|
||||
CHIP_CSRCS += cxd56_geofence.c
|
||||
endif
|
||||
|
||||
@@ -0,0 +1,281 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/cxd56xx/cxd56_cpu1signal.c
|
||||
*
|
||||
* Copyright 2018 Sony Semiconductor Solutions Corporation
|
||||
*
|
||||
* 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 Sony Semiconductor Solutions Corporation nor
|
||||
* the names of its contributors 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 OWNER 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <sched.h>
|
||||
#include <pthread.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include "cxd56_icc.h"
|
||||
#include "cxd56_cpu1signal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_CXD56CPU1_WORKER_STACKSIZE
|
||||
# define CONFIG_CXD56CPU1_WORKER_STACKSIZE 1024
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_CXD56CPU1_WORKER_THREAD_PRIORITY
|
||||
# define CONFIG_CXD56CPU1_WORKER_THREAD_PRIORITY (SCHED_PRIORITY_MAX)
|
||||
#endif
|
||||
|
||||
#define CXD56CPU1_CPUID 1
|
||||
|
||||
/****************************************************************************
|
||||
* Private Type
|
||||
****************************************************************************/
|
||||
|
||||
struct cxd56_sigtype_s
|
||||
{
|
||||
int use;
|
||||
cxd56_cpu1sighandler_t handler;
|
||||
FAR void * data;
|
||||
};
|
||||
|
||||
struct cxd56cpu1_info_s
|
||||
{
|
||||
pthread_t workertid;
|
||||
int ndev;
|
||||
struct cxd56_sigtype_s sigtype[CXD56_CPU1_DATA_TYPE_MAX];
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
static struct cxd56cpu1_info_s g_cpu1_info = {0};
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
static FAR void *cxd56cpu1_worker(FAR void *arg)
|
||||
{
|
||||
struct cxd56cpu1_info_s *priv = (struct cxd56cpu1_info_s *)arg;
|
||||
iccmsg_t msg;
|
||||
uint8_t sigtype;
|
||||
int ret;
|
||||
|
||||
msg.cpuid = CXD56CPU1_CPUID;
|
||||
|
||||
while (1)
|
||||
{
|
||||
ret = cxd56_iccrecvmsg(&msg, 0);
|
||||
if (ret < 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
sigtype = (uint8_t)CXD56_CPU1_GET_DEV(msg.data);
|
||||
if (sigtype >= CXD56_CPU1_DATA_TYPE_MAX)
|
||||
{
|
||||
_info("Caught invalid sigtype %d.\n", sigtype);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (priv->sigtype[sigtype].handler)
|
||||
{
|
||||
priv->sigtype[sigtype].handler(msg.data,
|
||||
priv->sigtype[sigtype].data);
|
||||
}
|
||||
}
|
||||
|
||||
return arg;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_cpu1sigsend(uint8_t sigtype, uint32_t data)
|
||||
{
|
||||
iccmsg_t msg;
|
||||
|
||||
msg.cpuid = CXD56CPU1_CPUID;
|
||||
msg.msgid = sigtype;
|
||||
msg.data = data;
|
||||
|
||||
return cxd56_iccsend(CXD56_PROTO_GNSS, &msg, 0);
|
||||
}
|
||||
|
||||
void cxd56_cpu1sigregisterhandler(uint8_t sigtype,
|
||||
cxd56_cpu1sighandler_t handler)
|
||||
{
|
||||
struct cxd56cpu1_info_s *priv = &g_cpu1_info;
|
||||
|
||||
if (sigtype >= CXD56_CPU1_DATA_TYPE_MAX)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
priv->sigtype[sigtype].handler = handler;
|
||||
}
|
||||
|
||||
void cxd56_cpu1sigunregisterhandler(uint8_t sigtype)
|
||||
{
|
||||
struct cxd56cpu1_info_s *priv = &g_cpu1_info;
|
||||
|
||||
if (sigtype >= CXD56_CPU1_DATA_TYPE_MAX)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
priv->sigtype[sigtype].handler = NULL;
|
||||
}
|
||||
|
||||
int cxd56_cpu1siginit(uint8_t sigtype, FAR void *data)
|
||||
{
|
||||
struct cxd56cpu1_info_s *priv = &g_cpu1_info;
|
||||
pthread_attr_t tattr;
|
||||
struct sched_param param;
|
||||
pthread_t tid;
|
||||
int ret;
|
||||
|
||||
if (sigtype >= CXD56_CPU1_DATA_TYPE_MAX)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
sched_lock();
|
||||
|
||||
if (priv->sigtype[sigtype].use)
|
||||
{
|
||||
ret = -EBUSY;
|
||||
goto _err1;
|
||||
}
|
||||
|
||||
priv->sigtype[sigtype].use = true;
|
||||
priv->sigtype[sigtype].data = data;
|
||||
|
||||
if (priv->ndev > 0)
|
||||
{
|
||||
ret = OK;
|
||||
goto _err1;
|
||||
}
|
||||
|
||||
priv->ndev++;
|
||||
|
||||
sched_unlock();
|
||||
|
||||
cxd56_iccinit(CXD56_PROTO_GNSS);
|
||||
|
||||
ret = cxd56_iccinitmsg(CXD56CPU1_CPUID);
|
||||
if (ret < 0)
|
||||
{
|
||||
_err("Failed to initialize ICC for GPS CPU: %d\n", ret);
|
||||
goto _err0;
|
||||
}
|
||||
|
||||
pthread_attr_init(&tattr);
|
||||
tattr.stacksize = CONFIG_CXD56CPU1_WORKER_STACKSIZE;
|
||||
param.sched_priority = CONFIG_CXD56CPU1_WORKER_THREAD_PRIORITY;
|
||||
pthread_attr_setschedparam(&tattr, ¶m);
|
||||
|
||||
ret = pthread_create(&tid, &tattr, cxd56cpu1_worker,
|
||||
(pthread_addr_t)priv);
|
||||
if (ret != 0)
|
||||
{
|
||||
cxd56_iccuninitmsg(CXD56CPU1_CPUID);
|
||||
ret = -ret; /* pthread_create does not modify errno. */
|
||||
goto _err0;
|
||||
}
|
||||
priv->workertid = tid;
|
||||
|
||||
return ret;
|
||||
|
||||
_err0:
|
||||
priv->sigtype[sigtype].use = false;
|
||||
priv->sigtype[sigtype].data = NULL;
|
||||
return ret;
|
||||
|
||||
_err1:
|
||||
sched_unlock();
|
||||
return ret;
|
||||
}
|
||||
|
||||
int cxd56_cpu1siguninit(uint8_t sigtype)
|
||||
{
|
||||
struct cxd56cpu1_info_s *priv = &g_cpu1_info;
|
||||
pthread_t tid;
|
||||
int ret;
|
||||
|
||||
if (sigtype >= CXD56_CPU1_DATA_TYPE_MAX)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
sched_lock();
|
||||
|
||||
if (!priv->sigtype[sigtype].use)
|
||||
{
|
||||
ret = -EBUSY;
|
||||
goto _err1;
|
||||
}
|
||||
|
||||
priv->ndev--;
|
||||
priv->sigtype[sigtype].use = false;
|
||||
priv->sigtype[sigtype].data = NULL;
|
||||
|
||||
if (priv->ndev > 0)
|
||||
{
|
||||
ret = OK;
|
||||
goto _err0;
|
||||
}
|
||||
|
||||
tid = priv->workertid;
|
||||
priv->workertid = 0;
|
||||
|
||||
sched_unlock();
|
||||
|
||||
pthread_cancel(tid);
|
||||
pthread_join(tid, NULL);
|
||||
|
||||
cxd56_iccuninit(CXD56CPU1_CPUID);
|
||||
|
||||
return 0;
|
||||
|
||||
_err1:
|
||||
sched_unlock();
|
||||
|
||||
_err0:
|
||||
return ret;
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/cxd56xx/cxd56_cpu1signal.h
|
||||
*
|
||||
* Copyright 2018 Sony Semiconductor Solutions Corporation
|
||||
*
|
||||
* 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 Sony Semiconductor Solutions Corporation nor
|
||||
* the names of its contributors 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 OWNER 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 __ARCH_ARM_SRC_CXD56XX_CXD56_CPU1SIGNAL_H
|
||||
#define __ARCH_ARM_SRC_CXD56XX_CXD56_CPU1SIGNAL_H
|
||||
|
||||
/* CPU1 Notifyable functions */
|
||||
|
||||
#define CXD56_CPU1_DATA_TYPE_GNSS 0
|
||||
#define CXD56_CPU1_DATA_TYPE_GEOFENCE 1
|
||||
#define CXD56_CPU1_DATA_TYPE_PVTLOG 2
|
||||
#define CXD56_CPU1_DATA_TYPE_AGPS 3
|
||||
#define CXD56_CPU1_DATA_TYPE_RTK 4
|
||||
#define CXD56_CPU1_DATA_TYPE_SPECTRUM 5
|
||||
#define CXD56_CPU1_DATA_TYPE_INFO 6
|
||||
#define CXD56_CPU1_DATA_TYPE_BACKUP 7
|
||||
#define CXD56_CPU1_DATA_TYPE_CEP 8
|
||||
#define CXD56_CPU1_DATA_TYPE_CEPFILE 9
|
||||
#define CXD56_CPU1_DATA_TYPE_BKUPFILE 10
|
||||
#define CXD56_CPU1_DATA_TYPE_GPSEPHEMERIS 11
|
||||
#define CXD56_CPU1_DATA_TYPE_GLNEPHEMERIS 12
|
||||
#define CXD56_CPU1_DATA_TYPE_CPUFIFOAPI 13
|
||||
#define CXD56_CPU1_DATA_TYPE_SBAS 14
|
||||
#define CXD56_CPU1_DATA_TYPE_DCREPORT 15
|
||||
#define CXD56_CPU1_DATA_TYPE_MAX 16
|
||||
|
||||
/* CPU1 devices */
|
||||
|
||||
#define CXD56_CPU1_DEV_GNSS (CXD56_CPU1_DATA_TYPE_GNSS)
|
||||
#define CXD56_CPU1_DEV_GEOFENCE (CXD56_CPU1_DATA_TYPE_GEOFENCE)
|
||||
|
||||
#define CXD56_CPU1_DEV_MASK 0xff
|
||||
#define CXD56_CPU1_GET_DEV(DATA) ((DATA) & CXD56_CPU1_DEV_MASK)
|
||||
#define CXD56_CPU1_GET_DATA(DATA) ((DATA) >> 8)
|
||||
|
||||
#if CXD56_CPU1_DATA_TYPE_MAX > (CXD56_CPU1_DEV_MASK + 1)
|
||||
#error "CXD56_CPU1_DEV must be smaller than 0xf"
|
||||
#endif
|
||||
|
||||
typedef void (*cxd56_cpu1sighandler_t)(uint32_t data, FAR void *userdata);
|
||||
|
||||
extern int cxd56_cpu1siginit(uint8_t cpu1dev, FAR void *data);
|
||||
extern int cxd56_cpu1siguninit(uint8_t cpu1dev);
|
||||
extern void cxd56_cpu1sigregisterhandler(uint8_t cpu1dev,
|
||||
cxd56_cpu1sighandler_t handler);
|
||||
extern void cxd56_cpu1sigunregisterhandler(uint8_t cpu1dev);
|
||||
extern int cxd56_cpu1sigsend(uint8_t sigtype, uint32_t data);
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_CXD56XX_CXD56_CPU1SIGNAL_H */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,86 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/cxd56xx/cxd56_geofence.h
|
||||
*
|
||||
* Copyright 2018 Sony Semiconductor Solutions Corporation
|
||||
*
|
||||
* 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 Sony Semiconductor Solutions Corporation nor
|
||||
* the names of its contributors 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 OWNER 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 __ARCH_ARM_SRC_CXD56XX_CXD56_GEOFENCE_H
|
||||
#define __ARCH_ARM_SRC_CXD56XX_CXD56_GEOFENCE_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
#define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cxd56_geofenceinitialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize GEOFENCE device
|
||||
*
|
||||
* Input Parameters:
|
||||
* devpath - The full path to the driver to register. E.g., "/dev/geofence"
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) on success; a negated errno value on failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_geofenceinitialize(FAR const char *devpath);
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __ARCH_ARM_SRC_CXD56XX_CXD56_GEOFENCE_H */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,108 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/cxd56xx/cxd56_gnss.h
|
||||
*
|
||||
* Copyright 2018 Sony Semiconductor Solutions Corporation
|
||||
*
|
||||
* 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 Sony Semiconductor Solutions Corporation nor
|
||||
* the names of its contributors 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 OWNER 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 __ARCH_ARM_SRC_CXD56XX_CXD56_GNSS_H
|
||||
#define __ARCH_ARM_SRC_CXD56XX_CXD56_GNSS_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <debug.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
#define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/* GNSS specific debug */
|
||||
|
||||
#ifdef CONFIG_CXD56_GNSS_DEBUG_ERROR
|
||||
# define gnsserr(fmt, ...) logerr(fmt, ## __VA_ARGS__)
|
||||
#else
|
||||
# define gnsserr(fmt, ...)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CXD56_GNSS_DEBUG_WARN
|
||||
# define gnsswarn(fmt, ...) logwarn(fmt, ## __VA_ARGS__)
|
||||
#else
|
||||
# define gnsswarn(fmt, ...)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CXD56_GNSS_DEBUG_INFO
|
||||
# define gnssinfo(fmt, ...) loginfo(fmt, ## __VA_ARGS__)
|
||||
#else
|
||||
# define gnssinfo(fmt, ...)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cxd56_gnssinitialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize GNSS device
|
||||
*
|
||||
* Input Parameters:
|
||||
* devpath - The full path to the driver to register. E.g., "/dev/gps"
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) on success; a negated errno value on failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_gnssinitialize(FAR const char *devpath);
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __ARCH_ARM_SRC_CXD56XX_CXD56_GNSS_H */
|
||||
@@ -0,0 +1,356 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/cxd56xx/cxd56_gnss_api.h
|
||||
*
|
||||
* Copyright 2018 Sony Semiconductor Solutions Corporation
|
||||
*
|
||||
* 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 Sony Semiconductor Solutions Corporation nor
|
||||
* the names of its contributors 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 OWNER 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 __ARCH_ARM_SRC_CXD56XX_CXD56_GNSS_API_H
|
||||
#define __ARCH_ARM_SRC_CXD56XX_CXD56_GNSS_API_H
|
||||
|
||||
#include <arch/chip/gnss_type.h>
|
||||
#include <arch/chip/gnss.h>
|
||||
|
||||
/* GD Start mode */
|
||||
|
||||
#define CXD56_GNSS_STMOD_COLD 0
|
||||
#define CXD56_GNSS_STMOD_WARM 1
|
||||
#define CXD56_GNSS_STMOD_WARMACC2 2
|
||||
#define CXD56_GNSS_STMOD_HOT 3
|
||||
#define CXD56_GNSS_STMOD_HOTACC 4
|
||||
#define CXD56_GNSS_STMOD_HOTACC2 5
|
||||
#define CXD56_GNSS_STMOD_HOTACC3 6
|
||||
#define CXD56_GNSS_STMOD_XTC1 7
|
||||
#define CXD56_GNSS_STMOD_XTC2 8
|
||||
|
||||
/* GD operation mode */
|
||||
|
||||
/* GD_SetOperationMode, GD_GetOperationMode */
|
||||
|
||||
#define CXD56_GNSS_OPMOD_NORMAL 1
|
||||
#define CXD56_GNSS_OPMOD_LOWPOWER 2
|
||||
#define CXD56_GNSS_OPMOD_BALANCE 4
|
||||
#define CXD56_GNSS_OPMOD_1PSS 5
|
||||
|
||||
/* Start a positioning
|
||||
* begining to search the satellites and measure the receiver position
|
||||
*/
|
||||
|
||||
int GD_Start(uint8_t startMode);
|
||||
|
||||
/* Stop a positioning */
|
||||
|
||||
int GD_Stop(void);
|
||||
|
||||
/* Select GNSSs to positioning
|
||||
* These are able to specified by CXD56_GNSS_B_SAT_XXX defines.
|
||||
*/
|
||||
|
||||
int GD_SelectSatelliteSystem(uint32_t system);
|
||||
|
||||
/* Get current using GNSSs to positioning
|
||||
* A argument 'satellite' indicates current GNSSs by bit fields defined
|
||||
* by CXD56_GNSS_B_SAT_XXX.
|
||||
*/
|
||||
|
||||
int GD_GetSatelliteSystem(FAR uint32_t *system);
|
||||
|
||||
/* Set the rough receiver position */
|
||||
|
||||
int GD_SetReceiverPositionEllipsoidal(FAR double *dLat, FAR double *dLon,
|
||||
FAR double *dHeight);
|
||||
|
||||
/* Set the rough receiver position as orgothonal */
|
||||
|
||||
int GD_SetReceiverPositionOrthogonal(int32_t dX, int32_t dY, int32_t dZ);
|
||||
|
||||
/* Set enable or disable the 1PPS output. */
|
||||
|
||||
int GD_Set1ppsOutput(uint32_t enable);
|
||||
|
||||
/* Get the current 1PPS output setting. */
|
||||
|
||||
int GD_Get1ppsOutput(FAR uint32_t *enable);
|
||||
|
||||
/* Set the receiver operation mode
|
||||
* 1st argument 'mode' is a operation mode defined by CXD56_GNSS_OPMOD_XXX.
|
||||
* 2nd argument 'cycle' is a positioning period[ms], default is 1000[ms].
|
||||
*/
|
||||
|
||||
int GD_SetOperationMode(uint32_t mode, uint32_t cycle);
|
||||
|
||||
/* Get the receiver operation mode */
|
||||
|
||||
int GD_GetOperationMode(FAR uint32_t *mode, FAR uint32_t *cycle);
|
||||
|
||||
/* Set the TCXO offset */
|
||||
|
||||
int GD_SetTcxoOffset(int32_t offset);
|
||||
|
||||
/* Get the TCXO offset */
|
||||
|
||||
int GD_GetTcxoOffset(FAR int32_t *offset);
|
||||
|
||||
/* Set the estimated current time of the receiver.
|
||||
* 1st argument date & time are in UTC.
|
||||
*/
|
||||
|
||||
int GD_SetTime(FAR struct cxd56_gnss_date_s *date,
|
||||
FAR struct cxd56_gnss_time_s *time);
|
||||
|
||||
/* Set the network time */
|
||||
|
||||
int GD_SetFrameTime(uint16_t sec, uint32_t fracSec);
|
||||
|
||||
/* Get the almanac data */
|
||||
|
||||
int GD_GetAlmanac(uint32_t satellite, FAR uint32_t* almanac,
|
||||
FAR uint32_t *almanacSize);
|
||||
|
||||
/* Set the almanac data */
|
||||
|
||||
int GD_SetAlmanac(uint32_t satellite, FAR uint32_t *almanac);
|
||||
|
||||
/* Get the Ephemeris data */
|
||||
|
||||
int GD_GetEphemeris(uint32_t satellite, FAR uint32_t* ephemeris,
|
||||
FAR uint32_t *ephemerisSize);
|
||||
|
||||
/* Set the Ephemeris data */
|
||||
|
||||
int GD_SetEphemeris(uint32_t satellite, FAR uint32_t *ephemeris);
|
||||
|
||||
/* Select to use or not use the initial position calculation supporting
|
||||
* information of the QZSS L1-SAIF.
|
||||
*/
|
||||
|
||||
int GD_SetQzssPosAssist(uint32_t enable);
|
||||
|
||||
/* Get a setting of the initial position calculation supporting
|
||||
* information of the QZSS L1-SAIF.
|
||||
*/
|
||||
|
||||
int GD_GetQzssPosAssist(FAR uint32_t *enable);
|
||||
|
||||
/* Set IMES bitrates. */
|
||||
|
||||
int GD_SetImesBitrate(uint32_t bitrate);
|
||||
|
||||
/* Get IMES bitrates. */
|
||||
|
||||
int GD_GetImesBitrate(FAR uint32_t *bitrate);
|
||||
|
||||
/* Set IMES center frequency offset. */
|
||||
|
||||
int GD_SetImesCenterFreqOffset(uint32_t offset);
|
||||
|
||||
/* Set IMES preamble. */
|
||||
|
||||
int GD_SetImesPreamble(uint32_t preamble);
|
||||
|
||||
/* Start GPS test */
|
||||
|
||||
void GD_StartGpsTest(uint32_t satellite, uint32_t reserve1,
|
||||
uint32_t reserve2, uint32_t reserve3);
|
||||
|
||||
/* Stop GPS test */
|
||||
|
||||
int GD_StopGpsTest(void);
|
||||
|
||||
/* Get GPS test result */
|
||||
|
||||
int GD_GetGpsTestResult(FAR float* cn, FAR float* doppler);
|
||||
|
||||
/* Control Spectrum output */
|
||||
|
||||
int GD_SpectrumControl(unsigned long time, unsigned int enable,
|
||||
unsigned char moniPoint1, unsigned char step1,
|
||||
unsigned char moniPoint2, unsigned char step2);
|
||||
|
||||
/* Save the backup data to a Flash memory. */
|
||||
|
||||
int GD_SaveBackupdata(void);
|
||||
|
||||
/* CEP Check Assist Data Valid */
|
||||
|
||||
int GD_CepCheckAssistData(void);
|
||||
|
||||
/* CEP Get Age Data */
|
||||
|
||||
int GD_CepGetAgeData(FAR float *age, FAR float *cepi);
|
||||
|
||||
/* CEP Reset Assist Data init flag & valid flag */
|
||||
|
||||
int GD_CepInitAssistData(void);
|
||||
|
||||
/* AGPS Set tau */
|
||||
|
||||
int GD_SetTauGps(FAR double *tau);
|
||||
|
||||
/* AGPS Set Acquist */
|
||||
|
||||
int GD_SetAcquist(FAR uint8_t *pAcquistData, uint16_t acquistSize);
|
||||
|
||||
/* Set the estimated current time of the receiver.
|
||||
* 1st argument date & time are in GPS time.
|
||||
*/
|
||||
|
||||
int GD_SetTimeGps(FAR struct cxd56_gnss_date_s *date,
|
||||
FAR struct cxd56_gnss_time_s *time);
|
||||
|
||||
/* Clear Receiver Infomation */
|
||||
|
||||
int GD_ClearReceiverInfo(uint32_t type);
|
||||
|
||||
/* AGPS Set Tow Assist */
|
||||
|
||||
int GD_SetTowAssist(FAR uint8_t *pAssistData, uint16_t dataSize);
|
||||
|
||||
/* AGPS Set UTC Model */
|
||||
|
||||
int GD_SetUtcModel(FAR uint8_t *pModelData, uint16_t dataSize);
|
||||
|
||||
/* Read GNSS data to specified buffer */
|
||||
|
||||
int GD_ReadBuffer(uint8_t type, int32_t offset, FAR void *buf,
|
||||
uint32_t length);
|
||||
|
||||
/* Write GNSS data from specified buffer */
|
||||
|
||||
int GD_WriteBuffer(uint8_t type, int32_t offset, FAR void *buf,
|
||||
uint32_t length);
|
||||
|
||||
/* Set notify mask, this mask flag is cleared when notified(poll/signal) */
|
||||
|
||||
int GD_SetNotifyMask(uint8_t type, uint8_t clear);
|
||||
|
||||
/* Geofence Add Region */
|
||||
|
||||
int GD_GeoAddRegion(uint8_t id, long lat, long lon, uint16_t rad);
|
||||
|
||||
/* Geofence Modify Region */
|
||||
|
||||
int GD_GeoModifyRegion(uint8_t id, long lat, long lon, uint16_t rad);
|
||||
|
||||
/* Geofence Delete Region */
|
||||
|
||||
int GD_GeoDeleteRegione(uint8_t id);
|
||||
|
||||
/* Geofence All delete Region */
|
||||
|
||||
int GD_GeoDeleteAllRegion(void);
|
||||
|
||||
/* Geofence Region check */
|
||||
|
||||
int GD_GeoGetRegionData(uint8_t id, FAR long *lat, FAR long *lon,
|
||||
FAR uint16_t *rad);
|
||||
|
||||
/* Geofence Get Used Region ID */
|
||||
|
||||
uint32_t GD_GeoGetUsedRegionId(void);
|
||||
|
||||
/* Geofence Set mode */
|
||||
|
||||
int GD_GeoSetOpMode(uint16_t deadzone, uint16_t dwell_detecttime);
|
||||
|
||||
/* Geofence Request All region notify */
|
||||
|
||||
int GD_GeoSetAllRgionNotifyRequest(void);
|
||||
|
||||
/* Geofence Register to gnss_provider */
|
||||
|
||||
int GD_RegisterGeofence(void);
|
||||
|
||||
/* Geofence Release from gnss_provider */
|
||||
|
||||
int GD_ReleaseGeofence(void);
|
||||
|
||||
/* Pvtlog Register to gnss_provider */
|
||||
|
||||
int GD_RegisterPvtlog(uint32_t cycle, uint32_t threshold);
|
||||
|
||||
/* Pvtlog Release */
|
||||
|
||||
int GD_ReleasePvtlog(void);
|
||||
|
||||
/* Pvtlog Delete log data */
|
||||
|
||||
int GD_PvtlogDeleteLog(void);
|
||||
|
||||
/* Pvtlog Get Log status */
|
||||
|
||||
int GD_PvtlogGetLogStatus(FAR struct cxd56_gnss_status_s *pLogStatus);
|
||||
|
||||
/* Start outputting carrier phase info. */
|
||||
|
||||
int GD_RtkStart(FAR struct cxd56_rtk_setting_s *pParam);
|
||||
|
||||
/* Stop outputting carrier phase info. */
|
||||
|
||||
int GD_RtkStop(void);
|
||||
|
||||
/* Set output interval of carrier phase info.
|
||||
*
|
||||
* interval : CXD56_GNSS_RTK_INTERVAL_XXX (gd_type.h)
|
||||
*/
|
||||
|
||||
int GD_RtkSetOutputInterval(int interval);
|
||||
|
||||
/* Get output interval of carrier phase info. [ms] */
|
||||
|
||||
int GD_RtkGetOutputInterval(FAR int* interval);
|
||||
|
||||
/* Set GNSS of outputting carrier phase info. */
|
||||
|
||||
int GD_RtkSetGnss(uint32_t gnss);
|
||||
|
||||
/* Get GNSS of outputting carrier phase info. */
|
||||
|
||||
int GD_RtkGetGnss(FAR uint32_t* pGnss);
|
||||
|
||||
/* Set enable/disable GD to notify updating ephemeris */
|
||||
|
||||
int GD_RtkSetEphNotify(int enable);
|
||||
|
||||
/* Get enable/disable GD to notify updating ephemeris */
|
||||
|
||||
int GD_RtkGetEphNotify(FAR int* enable);
|
||||
|
||||
/* Set the Ephemeris data Ephemeris data size is variable. */
|
||||
|
||||
int GD_SetVarEphemeris(uint32_t *ephemeris, uint32_t ephemerisSize);
|
||||
|
||||
/* Get the Ephemeris data Ephemeris data size is variable. */
|
||||
|
||||
int GD_GetVarEphemeris(uint32_t satellite, uint32_t* ephemeris,
|
||||
uint32_t ephemerisSize);
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_CXD56XX_CXD56_GNSS_API_H */
|
||||
@@ -0,0 +1,325 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/cxd56xx/cxd56_uart0.c
|
||||
*
|
||||
* Copyright 2018 Sony Semiconductor Solutions Corporation
|
||||
*
|
||||
* 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 Sony Semiconductor Solutions Corporation nor
|
||||
* the names of its contributors 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 OWNER 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <nuttx/kmalloc.h>
|
||||
#include <nuttx/fs/fs.h>
|
||||
#include <nuttx/irq.h>
|
||||
#include <queue.h>
|
||||
#include <semaphore.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "up_arch.h"
|
||||
#include "chip.h"
|
||||
#include "cxd56_pinconfig.h"
|
||||
|
||||
#ifdef CONFIG_CXD56_UART0
|
||||
|
||||
#include <arch/chip/uart0.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_CXD56_UART0_BAUD
|
||||
# define CONFIG_CXD56_UART0_BAUD 921600
|
||||
#endif
|
||||
#ifndef CONFIG_CXD56_UART0_BITS
|
||||
# define CONFIG_CXD56_UART0_BITS 8
|
||||
#endif
|
||||
#ifndef CONFIG_CXD56_UART0_PARITY
|
||||
# define CONFIG_CXD56_UART0_PARITY 0
|
||||
#endif
|
||||
#ifndef CONFIG_CXD56_UART0_2STOP
|
||||
# define CONFIG_CXD56_UART0_2STOP 0
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static int uart0_open(FAR struct file *filep);
|
||||
static int uart0_close(FAR struct file *filep);
|
||||
static ssize_t uart0_read(FAR struct file *filep,
|
||||
FAR char *buffer, size_t len);
|
||||
static ssize_t uart0_write(FAR struct file *filep,
|
||||
FAR const char *buffer, size_t len);
|
||||
static int uart0_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
|
||||
static int uart0_semtake(sem_t *id);
|
||||
static void uart0_semgive(sem_t *id);
|
||||
|
||||
/****************************************************************************
|
||||
* FarAPI prototypes
|
||||
****************************************************************************/
|
||||
|
||||
int PD_UartInit(int ch);
|
||||
int PD_UartUninit(int ch);
|
||||
int PD_UartConfiguration(int ch, int baudrate, int databits,
|
||||
int parity, int stopbit, int flowctrl);
|
||||
int PD_UartEnable(int ch);
|
||||
int PD_UartDisable(int ch);
|
||||
int PD_UartReceive(int ch, void *buf, int size, int leave);
|
||||
int PD_UartSend(int ch, void *buf, int size, int leave);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
static const struct file_operations g_uart0fops =
|
||||
{
|
||||
.open = uart0_open,
|
||||
.close = uart0_close,
|
||||
.read = uart0_read,
|
||||
.write = uart0_write,
|
||||
.seek = 0,
|
||||
.ioctl = uart0_ioctl,
|
||||
};
|
||||
|
||||
static sem_t g_lock;
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: uart0_semtake
|
||||
****************************************************************************/
|
||||
|
||||
static int uart0_semtake(sem_t *id)
|
||||
{
|
||||
while (sem_wait(id) != 0)
|
||||
{
|
||||
ASSERT(errno == EINTR);
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: uart0_semgive
|
||||
****************************************************************************/
|
||||
|
||||
static void uart0_semgive(sem_t *id)
|
||||
{
|
||||
sem_post(id);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: uart0_open
|
||||
****************************************************************************/
|
||||
|
||||
static int uart0_open(FAR struct file *filep)
|
||||
{
|
||||
FAR struct inode *inode = filep->f_inode;
|
||||
int flowctl;
|
||||
int bits;
|
||||
int stop;
|
||||
int ret;
|
||||
|
||||
if (inode->i_crefs > 1)
|
||||
{
|
||||
return OK;
|
||||
}
|
||||
|
||||
ret = PD_UartInit(0);
|
||||
if (ret < 0)
|
||||
{
|
||||
set_errno(EFAULT);
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
/* 0 = 5bit, 1 = 6bit, 2 = 7bit, 3 = 8bit */
|
||||
|
||||
bits = CONFIG_CXD56_UART0_BITS - 5;
|
||||
|
||||
/* 1 = 1 stop, 2 = 2 stop bit */
|
||||
|
||||
stop = CONFIG_CXD56_UART0_2STOP + 1;
|
||||
|
||||
/* Enable UART0 pin configuration */
|
||||
|
||||
#ifdef CONFIG_UART0_FLOWCONTROL
|
||||
flowctl = 1;
|
||||
CXD56_PIN_CONFIGS(PINCONFS_SPI2_UART0);
|
||||
#else
|
||||
flowctl = 0;
|
||||
CXD56_PIN_CONFIGS(PINCONFS_SPI2A_UART0);
|
||||
#endif
|
||||
|
||||
ret = PD_UartConfiguration(0, CONFIG_CXD56_UART0_BAUD,
|
||||
bits,
|
||||
CONFIG_CXD56_UART0_PARITY,
|
||||
stop, flowctl);
|
||||
if (ret < 0)
|
||||
{
|
||||
PD_UartUninit(0);
|
||||
set_errno(EINVAL);
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
ret = PD_UartEnable(0);
|
||||
if (ret < 0)
|
||||
{
|
||||
PD_UartUninit(0);
|
||||
set_errno(EFAULT);
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: uart0_close
|
||||
****************************************************************************/
|
||||
|
||||
static int uart0_close(FAR struct file *filep)
|
||||
{
|
||||
FAR struct inode *inode = filep->f_inode;
|
||||
|
||||
if (inode->i_crefs == 1)
|
||||
{
|
||||
PD_UartDisable(0);
|
||||
PD_UartUninit(0);
|
||||
|
||||
/* Disable UART0 pin by changing Hi-Z GPIO */
|
||||
|
||||
#ifdef CONFIG_UART0_FLOWCONTROL
|
||||
CXD56_PIN_CONFIGS(PINCONFS_SPI2_GPIO);
|
||||
#else
|
||||
CXD56_PIN_CONFIGS(PINCONFS_SPI2A_GPIO);
|
||||
#endif
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: uart0_read
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t uart0_read(FAR struct file *filep,
|
||||
FAR char *buffer, size_t len)
|
||||
{
|
||||
int ret;
|
||||
|
||||
uart0_semtake(&g_lock);
|
||||
|
||||
/* Always blocking */
|
||||
|
||||
ret = PD_UartReceive(0, buffer, len, 0);
|
||||
|
||||
uart0_semgive(&g_lock);
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
set_errno(-ret);
|
||||
ret = 0; /* Receive no data */
|
||||
}
|
||||
|
||||
return (ssize_t)ret;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: uart0_write
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t uart0_write(FAR struct file *filep,
|
||||
FAR const char *buffer, size_t len)
|
||||
{
|
||||
int ret;
|
||||
|
||||
uart0_semtake(&g_lock);
|
||||
|
||||
/* Always blocking */
|
||||
|
||||
ret = PD_UartSend(0, (FAR void *)buffer, len, 0);
|
||||
|
||||
uart0_semgive(&g_lock);
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
set_errno(-ret);
|
||||
ret = 0;
|
||||
}
|
||||
return (ssize_t)ret;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: uart0_ioctl
|
||||
****************************************************************************/
|
||||
|
||||
static int uart0_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
{
|
||||
return -ENOTTY;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cxd56_uart0initialize
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_uart0initialize(FAR const char *devname)
|
||||
{
|
||||
int ret;
|
||||
|
||||
sem_init(&g_lock, 0, 1);
|
||||
|
||||
ret = register_driver(devname, &g_uart0fops, 0666, NULL);
|
||||
if (ret != 0)
|
||||
{
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cxd56_uart0uninitialize
|
||||
****************************************************************************/
|
||||
|
||||
void cxd56_uart0uninitialize(FAR const char *devname)
|
||||
{
|
||||
unregister_driver(devname);
|
||||
sem_destroy(&g_lock);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_CXD56_UART0 */
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* bsp/board/spresense/src/spresense_main.c
|
||||
* configs/spresense/src/spresense_main.c
|
||||
*
|
||||
* Copyright 2018 Sony Semiconductor Solutions Corporation
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user