9
0
Fork 0

Mostly cosmetic changes from Uros

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@3575 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo 2011-05-07 19:22:15 +00:00
parent 9c29dcd505
commit eb796b1e3b
11 changed files with 153 additions and 135 deletions

View File

@ -465,6 +465,19 @@ static int nsh_execute(FAR struct nsh_vtbl_s *vtbl, int argc, char *argv[])
*/
cmd = argv[0];
/* Try to find a command in the application library.
*/
#ifdef CONFIG_NSH_BUILTIN_APPS
if (nsh_execapp(vtbl, cmd, argv) == OK)
{
/* The pre-built application was successfully started -- return OK. */
return OK;
}
#endif
/* See if the command is one that we understand */
@ -503,21 +516,6 @@ static int nsh_execute(FAR struct nsh_vtbl_s *vtbl, int argc, char *argv[])
}
}
/* If the command was not found, then try to execute the command from
* a list of pre-built applications.
*/
#ifdef CONFIG_NSH_BUILTIN_APPS
if (handler == cmd_unrecognized && nsh_execapp(vtbl, cmd, argv) == OK)
{
/* The pre-built application was successfully started -- return OK.
* If not, then fall through to execute the cmd_nrecognized handler.
*/
return OK;
}
#endif
ret = handler(vtbl, argc, argv);
return ret;
}

View File

@ -33,61 +33,80 @@
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <nuttx/progmem.h>
#include <stdio.h>
#include <stdlib.h>
/****************************************************************************
* Definitions
****************************************************************************/
/****************************************************************************
* Private Types
****************************************************************************/
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Public Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/* \todo Max block size only works on uniform prog mem */
void free_getprogmeminfo(struct mallinfo * mem)
{
uint16_t page = 0, stpage = 0xFFFF;
uint16_t pagesize = 0;
int status;
mem->arena = 0;
mem->fordblks = 0;
mem->uordblks = 0;
mem->mxordblk = 0;
for (status=0, page=0; status >= 0; page++) {
status = up_progmem_ispageerased(page);
pagesize = up_progmem_pagesize(page);
mem->arena += pagesize;
/* Is this beginning of new free space section */
if (status == 0) {
if (stpage == 0xFFFF) stpage = page;
mem->fordblks += pagesize;
}
else if (status != 0) {
mem->uordblks += pagesize;
if (stpage != 0xFFFF && up_progmem_isuniform()) {
stpage = page - stpage;
if (stpage > mem->mxordblk)
mem->mxordblk = stpage;
stpage = 0xFFFF;
}
}
}
mem->mxordblk *= pagesize;
}
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: cmd_free
****************************************************************************/
int free_main(int argc, char **argv)
{
struct mallinfo mem;
struct mallinfo data;
struct mallinfo prog;
#ifdef CONFIG_CAN_PASS_STRUCTS
mem = mallinfo();
data = mallinfo();
#else
(void)mallinfo(&mem);
(void)mallinfo(&data);
#endif
printf(" total used free largest\n");
printf("Mem: %11d%11d%11d%11d\n",
mem.arena, mem.uordblks, mem.fordblks, mem.mxordblk);
free_getprogmeminfo(&prog);
printf(" total used free largest\n");
printf("Data: %11d%11d%11d%11d\n",
data.arena, data.uordblks, data.fordblks, data.mxordblk);
printf("Prog: %11d%11d%11d%11d\n",
prog.arena, prog.uordblks, prog.fordblks, prog.mxordblk);
return OK;
}

View File

@ -37,12 +37,12 @@
* \author Uros Platise
* \brief STM32 Flash - Program and Data Memory
*
* Provides standard flash access function, to be used also by the
* Provides standard flash access functions, to be used also by the
* drivers/mtd/progmem.c program memory flash mtd driver.
* The interface is to be defined in the include/nuttx/progmem.h
* The interface is defined in the include/nuttx/progmem.h
*
* Requirements:
* - During write/erase operatoins on FLASH, HSI must be ON.
* Requirements during write/erase operations on FLASH:
* - HSI must be ON.
* - Low Power Modes are not permitted during write/erase
*/

View File

@ -77,7 +77,7 @@
#include <nuttx/progmem.h>
#include <nuttx/i2c.h>
#include <nuttx/sensors/st_lis331dl.h>
#include <nuttx/sensors/lis331dl.h>
#include <stdio.h>
#include <stdlib.h>
@ -285,7 +285,7 @@ int sif_gpios_unlock(vsn_sif_state_t peripheral)
* Analog Outputs
****************************************************************************/
static volatile int test = 0, test_irq;
static volatile int test = 0, teirq;
static int sif_anout_isr(int irq, void *context)
@ -293,7 +293,7 @@ static int sif_anout_isr(int irq, void *context)
STM32_TIM_ACKINT(vsn_sif.tim8, 0);
test++;
test_irq = irq;
teirq = irq;
return OK;
}
@ -531,10 +531,12 @@ int sif_main(int argc, char *argv[])
}
}
while (status >= 0);
return 0;
}
else if (!strcmp(argv[1], "erase") && argc == 3 ) {
int page = atoi(argv[2]);
printf("Erase result: %d\n", up_progmem_erasepage(page) );
return 0;
}
else if (!strcmp(argv[1], "flash") && argc == 3 ) {
uint16_t page = atoi(argv[2]);
@ -542,27 +544,28 @@ int sif_main(int argc, char *argv[])
printf("Write result: %d (writing to address %xh)\n",
up_progmem_write( addr, "Test", 4 ), addr);
return 0;
}
else if (!strcmp(argv[1], "i2c") && argc == 3) {
int val = atoi(argv[2]);
I2C_SETFREQUENCY(vsn_sif.i2c1, 100000);
struct st_lis331dl_dev_s * lis = st_lis331dl_init(vsn_sif.i2c1, val);
struct lis331dl_dev_s * lis = lis331dl_init(vsn_sif.i2c1, val);
if (lis) {
const struct st_lis331dl_vector_s * a;
const struct lis331dl_vector_s * a;
int i;
uint32_t time_stamp = clock_systimer();
/* Set to 400 Hz : 3 = 133 Hz/axis */
st_lis331dl_setconversion(lis, false, true);
lis331dl_setconversion(lis, false, true);
/* Sample some values */
for (i=0; i<1000; ) {
if ( (a = st_lis331dl_getreadings(lis)) ) {
if ( (a = lis331dl_getreadings(lis)) ) {
i++;
printf("%d %d %d\n", a->x, a->y, a->z);
}
@ -574,7 +577,7 @@ int sif_main(int argc, char *argv[])
printf("Time diff = %d\n", clock_systimer() - time_stamp);
st_lis331dl_deinit(lis);
lis331dl_deinit(lis);
}
else printf("Exit point: errno=%d\n", errno);

View File

@ -39,6 +39,6 @@ SENSOR_CSRCS =
# These drivers depend on I2C support
ifeq ($(CONFIG_I2C),y)
SENSOR_CSRCS += st_lis331dl.c
SENSOR_CSRCS += lis331dl.c
endif

View File

@ -1,5 +1,5 @@
/****************************************************************************
* drivers/sensors/st_lis331dl.c
* drivers/sensors/lis331dl.c
*
* Copyright (C) 2011 Uros Platise. All rights reserved.
*
@ -47,7 +47,7 @@
#include <stdio.h>
#include <nuttx/kmalloc.h>
#include <nuttx/sensors/st_lis331dl.h>
#include <nuttx/sensors/lis331dl.h>
/************************************************************************************
* LIS331DL Internal Registers
@ -89,11 +89,11 @@
* Private Data Types
************************************************************************************/
struct st_lis331dl_dev_s {
struct lis331dl_dev_s {
struct i2c_dev_s * i2c;
uint8_t address;
struct st_lis331dl_vector_s a;
struct lis331dl_vector_s a;
uint8_t cr1;
uint8_t cr2;
uint8_t cr3;
@ -112,7 +112,7 @@ struct st_lis331dl_dev_s {
* \param length when >0 it denotes read access, when <0 it denotes write access of -length
* \return OK on success or errno is set.
**/
int st_lis331dl_access(struct st_lis331dl_dev_s * dev, uint8_t subaddr, uint8_t *buf, int length)
int lis331dl_access(struct lis331dl_dev_s * dev, uint8_t subaddr, uint8_t *buf, int length)
{
uint16_t flags = 0;
int retval;
@ -170,9 +170,9 @@ int st_lis331dl_access(struct st_lis331dl_dev_s * dev, uint8_t subaddr, uint8_t
}
int st_lis331dl_readregs(struct st_lis331dl_dev_s * dev)
int lis331dl_readregs(struct lis331dl_dev_s * dev)
{
if (st_lis331dl_access(dev, ST_LIS331DL_CTRL_REG1, &dev->cr1, 3) != 3) return ERROR;
if (lis331dl_access(dev, ST_LIS331DL_CTRL_REG1, &dev->cr1, 3) != 3) return ERROR;
return OK;
}
@ -181,24 +181,24 @@ int st_lis331dl_readregs(struct st_lis331dl_dev_s * dev)
* Public Functions
****************************************************************************/
struct st_lis331dl_dev_s * st_lis331dl_init(struct i2c_dev_s * i2c, uint16_t address)
struct lis331dl_dev_s * lis331dl_init(struct i2c_dev_s * i2c, uint16_t address)
{
struct st_lis331dl_dev_s * dev;
struct lis331dl_dev_s * dev;
uint8_t retval;
ASSERT(i2c);
ASSERT(address);
if ( (dev = kmalloc( sizeof(struct st_lis331dl_dev_s) )) == NULL )
if ( (dev = kmalloc( sizeof(struct lis331dl_dev_s) )) == NULL )
return NULL;
memset(dev, 0, sizeof(struct st_lis331dl_dev_s));
memset(dev, 0, sizeof(struct lis331dl_dev_s));
dev->i2c = i2c;
dev->address = address;
/* Probe device */
if (st_lis331dl_access(dev, ST_LIS331DL_WHOAMI, &retval, 1) > 0) {
if (lis331dl_access(dev, ST_LIS331DL_WHOAMI, &retval, 1) > 0) {
/* Check chip identification, in the future several more compatible parts
* may be added here.
@ -208,7 +208,7 @@ struct st_lis331dl_dev_s * st_lis331dl_init(struct i2c_dev_s * i2c, uint16_t add
/* Copy LIS331DL registers to our private structure and power-up device */
if (st_lis331dl_readregs(dev)==OK && st_lis331dl_powerup(dev)==OK) {
if (lis331dl_readregs(dev)==OK && lis331dl_powerup(dev)==OK) {
/* Normal exit point */
errno = 0;
@ -232,52 +232,52 @@ struct st_lis331dl_dev_s * st_lis331dl_init(struct i2c_dev_s * i2c, uint16_t add
}
int st_lis331dl_deinit(struct st_lis331dl_dev_s * dev)
int lis331dl_deinit(struct lis331dl_dev_s * dev)
{
ASSERT(dev);
st_lis331dl_powerdown(dev);
lis331dl_powerdown(dev);
kfree(dev);
return OK;
}
int st_lis331dl_powerup(struct st_lis331dl_dev_s * dev)
int lis331dl_powerup(struct lis331dl_dev_s * dev)
{
dev->cr1 = ST_LIS331DL_CR1_PD |
ST_LIS331DL_CR1_ZEN | ST_LIS331DL_CR1_YEN | ST_LIS331DL_CR1_XEN;
dev->cr2 = 0;
dev->cr3 = 0;
if (st_lis331dl_access(dev, ST_LIS331DL_CTRL_REG1, &dev->cr1, -3) == 3) return OK;
if (lis331dl_access(dev, ST_LIS331DL_CTRL_REG1, &dev->cr1, -3) == 3) return OK;
return ERROR;
}
int st_lis331dl_powerdown(struct st_lis331dl_dev_s * dev)
int lis331dl_powerdown(struct lis331dl_dev_s * dev)
{
dev->cr1 = ST_LIS331DL_CR1_ZEN | ST_LIS331DL_CR1_YEN | ST_LIS331DL_CR1_XEN;
dev->cr2 = 0;
dev->cr3 = 0;
if (st_lis331dl_access(dev, ST_LIS331DL_CTRL_REG1, &dev->cr1, -3) == 3) return OK;
if (lis331dl_access(dev, ST_LIS331DL_CTRL_REG1, &dev->cr1, -3) == 3) return OK;
return ERROR;
}
int st_lis331dl_setconversion(struct st_lis331dl_dev_s * dev, bool full, bool fast)
int lis331dl_setconversion(struct lis331dl_dev_s * dev, bool full, bool fast)
{
dev->cr1 = ST_LIS331DL_CR1_PD |
(full ? ST_LIS331DL_CR1_FS : 0) | (fast ? ST_LIS331DL_CR1_DR : 0) |
ST_LIS331DL_CR1_ZEN | ST_LIS331DL_CR1_YEN | ST_LIS331DL_CR1_XEN;
if (st_lis331dl_access(dev, ST_LIS331DL_CTRL_REG1, &dev->cr1, -1) == 1) return OK;
if (lis331dl_access(dev, ST_LIS331DL_CTRL_REG1, &dev->cr1, -1) == 1) return OK;
return ERROR;
}
int st_lis331dl_getprecision(struct st_lis331dl_dev_s * dev)
int lis331dl_getprecision(struct lis331dl_dev_s * dev)
{
if (dev->cr1 & ST_LIS331DL_CR1_FS)
return 9200/127; /* typ. 9.2g full scale */
@ -285,7 +285,7 @@ int st_lis331dl_getprecision(struct st_lis331dl_dev_s * dev)
}
int st_lis331dl_getsamplerate(struct st_lis331dl_dev_s * dev)
int lis331dl_getsamplerate(struct lis331dl_dev_s * dev)
{
if (dev->cr1 & ST_LIS331DL_CR1_DR)
return 400;
@ -293,13 +293,13 @@ int st_lis331dl_getsamplerate(struct st_lis331dl_dev_s * dev)
}
const struct st_lis331dl_vector_s * st_lis331dl_getreadings(struct st_lis331dl_dev_s * dev)
const struct lis331dl_vector_s * lis331dl_getreadings(struct lis331dl_dev_s * dev)
{
uint8_t retval[7];
ASSERT(dev);
if (st_lis331dl_access(dev, ST_LIS331DL_STATUS_REG, retval, 7) == 7) {
if (lis331dl_access(dev, ST_LIS331DL_STATUS_REG, retval, 7) == 7) {
/* If result is not yet ready, return NULL */

View File

@ -37,5 +37,5 @@ WIRELESS_ASRCS =
WIRELESS_CSRCS =
ifeq ($(CONFIG_WIRELESS),y)
WIRELESS_CSRCS += chipcon_cc1101.c
WIRELESS_CSRCS += cc1101.c
endif

View File

@ -1,5 +1,5 @@
/****************************************************************************
* drivers/wireless/chipcon_cc1101.c
* drivers/wireless/cc1101.c
*
* Copyright (C) 2011 Uros Platise. All rights reserved.
*
@ -49,7 +49,7 @@
#include <stdio.h>
#include <nuttx/kmalloc.h>
#include <nuttx/wireless/chipcon_cc1101.h>
#include <nuttx/wireless/cc1101.h>
/************************************************************************************
@ -351,7 +351,7 @@
* Private Data Types
************************************************************************************/
struct chipcon_c1101_rfsettings_s {
struct c1101_rfsettings_s {
uint8_t FSCTRL1; /* Frequency synthesizer control. */
uint8_t IOCFG0; /* GDO0 output pin configuration */
uint8_t FSCTRL0; /* Frequency synthesizer control. */
@ -389,9 +389,9 @@ struct chipcon_c1101_rfsettings_s {
uint8_t PKTLEN; /* Packet length. */
};
struct chipcon_cc1101_dev_s {
struct cc1101_dev_s {
struct spi_dev_s * spi;
struct chipcon_c1101_rfsettings_s * settings;
struct c1101_rfsettings_s * settings;
};
@ -408,7 +408,7 @@ struct chipcon_cc1101_dev_s {
* \param length when >0 it denotes read access, when <0 it denotes write access of -length
* \return OK on success or errno is set.
**/
int chipcon_cc1101_access(struct chipcon_cc1101_dev_s * dev, uint8_t subaddr, uint8_t *buf, int length)
int cc1101_access(struct cc1101_dev_s * dev, uint8_t subaddr, uint8_t *buf, int length)
{
return 0;
}
@ -427,7 +427,7 @@ int chipcon_cc1101_access(struct chipcon_cc1101_dev_s * dev, uint8_t subaddr, ui
* its callback, and it is up to peripheral to find, whether the cause
* of EXTI ISR was itself.
**/
void chipcon_cc1101_eventcb(void)
void cc1101_eventcb(void)
{
}
@ -436,7 +436,7 @@ void chipcon_cc1101_eventcb(void)
* Public Functions
****************************************************************************/
struct chipcon_cc1101_dev_s * chipcon_cc1101_init(struct spi_dev_s * spi)
struct cc1101_dev_s * cc1101_init(struct spi_dev_s * spi)
{
/* Powerup or wake-up, if it was previously set into some power-down state */
@ -452,7 +452,7 @@ struct chipcon_cc1101_dev_s * chipcon_cc1101_init(struct spi_dev_s * spi)
}
int chipcon_cc1101_deinit(struct chipcon_cc1101_dev_s * dev)
int cc1101_deinit(struct cc1101_dev_s * dev)
{
/* Power down chip, possibly in some inactive state */
@ -460,55 +460,55 @@ int chipcon_cc1101_deinit(struct chipcon_cc1101_dev_s * dev)
}
int chipcon_cc1101_setgdo(struct chipcon_cc1101_dev_s * dev, uint8_t pin, uint8_t function)
int cc1101_setgdo(struct cc1101_dev_s * dev, uint8_t pin, uint8_t function)
{
return 0;
}
int chipcon_cc1101_setrf(struct chipcon_cc1101_dev_s * dev, uint32_t frequency, int modulation)
int cc1101_setrf(struct cc1101_dev_s * dev, uint32_t frequency, int modulation)
{
return 0;
}
int chipcon_cc1101_read(struct chipcon_cc1101_dev_s * dev, uint8_t * data, size_t size)
int cc1101_read(struct cc1101_dev_s * dev, uint8_t * data, size_t size)
{
return 0;
}
int chipcon_cc1101_write(struct chipcon_cc1101_dev_s * dev, const uint8_t * data, size_t size)
int cc1101_write(struct cc1101_dev_s * dev, const uint8_t * data, size_t size)
{
return 0;
}
int chipcon_cc1101_listen(struct chipcon_cc1101_dev_s * dev)
int cc1101_listen(struct cc1101_dev_s * dev)
{
return 0;
}
int chipcon_cc1101_send(struct chipcon_cc1101_dev_s * dev)
int cc1101_send(struct cc1101_dev_s * dev)
{
return 0;
}
int chipcon_cc1101_idle(struct chipcon_cc1101_dev_s * dev)
int cc1101_idle(struct cc1101_dev_s * dev)
{
return 0;
}
int chipcon_cc1101_powerup(struct chipcon_cc1101_dev_s * dev)
int cc1101_powerup(struct cc1101_dev_s * dev)
{
return 0;
}
int chipcon_cc1101_powerdown(struct chipcon_cc1101_dev_s * dev)
int cc1101_powerdown(struct cc1101_dev_s * dev)
{
return 0;
}

View File

@ -41,6 +41,7 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>

View File

@ -1,5 +1,5 @@
/****************************************************************************
* include/nuttx/sensors/st_lis331dl.h
* include/nuttx/sensors/lis331dl.h
*
* Copyright (C) 2011 Uros Platise. All rights reserved.
*
@ -39,8 +39,8 @@
* \brief ST LIS331DL I2C Device Driver
**/
#ifndef __INCLUDE_NUTTX_SENSORS_ST_LIS331DL_H
#define __INCLUDE_NUTTX_SENSORS_ST_LIS331DL_H
#ifndef __INCLUDE_NUTTX_SENSORS_LIS331DL_H
#define __INCLUDE_NUTTX_SENSORS_LIS331DL_H
#include <nuttx/i2c.h>
#include <stdbool.h>
@ -64,9 +64,9 @@ extern "C" {
* Public Data Types
************************************************************************************/
struct st_lis331dl_dev_s;
struct lis331dl_dev_s;
struct st_lis331dl_vector_s {
struct lis331dl_vector_s {
int8_t x, y, z;
};
@ -86,21 +86,21 @@ struct st_lis331dl_vector_s {
* - EFAULT: When there is no device at given address.
* - EBUSY: When device is already addressed by other device driver (not yet supported by low-level driver)
**/
EXTERN struct st_lis331dl_dev_s * st_lis331dl_init(struct i2c_dev_s * i2c, uint16_t address);
EXTERN struct lis331dl_dev_s * lis331dl_init(struct i2c_dev_s * i2c, uint16_t address);
/** Deinitialize ST LIS331DL Chip
*
* \param dev Device to LIS331DL device structure, as returned by the st_lis331dl_init()
* \param dev Device to LIS331DL device structure, as returned by the lis331dl_init()
* \return OK On success
*
**/
EXTERN int st_lis331dl_deinit(struct st_lis331dl_dev_s * dev);
EXTERN int lis331dl_deinit(struct lis331dl_dev_s * dev);
/** Power up device, start conversion */
EXTERN int st_lis331dl_powerup(struct st_lis331dl_dev_s * dev);
EXTERN int lis331dl_powerup(struct lis331dl_dev_s * dev);
/** Power down device, stop conversion */
EXTERN int st_lis331dl_powerdown(struct st_lis331dl_dev_s * dev);
EXTERN int lis331dl_powerdown(struct lis331dl_dev_s * dev);
/** Configure conversion
*
@ -109,19 +109,19 @@ EXTERN int st_lis331dl_powerdown(struct st_lis331dl_dev_s * dev);
* \param fast When set, conversion operates at 400 Hz, otherwise at 100 Hz
* \return OK on success or errno is set
**/
EXTERN int st_lis331dl_setconversion(struct st_lis331dl_dev_s * dev, bool full, bool fast);
EXTERN int lis331dl_setconversion(struct lis331dl_dev_s * dev, bool full, bool fast);
/** Get precision
*
* \return Precision of 1 LSB in terms of unit [mg]
**/
EXTERN int st_lis331dl_getprecision(struct st_lis331dl_dev_s * dev);
EXTERN int lis331dl_getprecision(struct lis331dl_dev_s * dev);
/** Get sample rate
*
* \return Sample rate in unit of [Hz]
**/
EXTERN int st_lis331dl_getsamplerate(struct st_lis331dl_dev_s * dev);
EXTERN int lis331dl_getsamplerate(struct lis331dl_dev_s * dev);
/** Get readings, updates internal data structure
*
@ -130,8 +130,7 @@ EXTERN int st_lis331dl_getsamplerate(struct st_lis331dl_dev_s * dev);
* If data is not yet ready to be read from the LIS331 then errno is set to EAGAIN otherwise
* errno is set by I2C_TRANSFER().
*/
EXTERN const struct st_lis331dl_vector_s * st_lis331dl_getreadings(struct st_lis331dl_dev_s * dev);
EXTERN const struct lis331dl_vector_s * lis331dl_getreadings(struct lis331dl_dev_s * dev);
#undef EXTERN
@ -140,5 +139,4 @@ EXTERN const struct st_lis331dl_vector_s * st_lis331dl_getreadings(struct st_lis
#endif
#endif /* __ASSEMBLY__ */
#endif /* __INCLUDE_NUTTX_SENSORS_ST_LIS331DL_H */
#endif /* __INCLUDE_NUTTX_SENSORS_LIS331DL_H */

View File

@ -1,5 +1,5 @@
/****************************************************************************
* include/nuttx/wireless/chipcon_cc1101.h
* include/nuttx/wireless/cc1101.h
*
* Copyright (C) 2011 Uros Platise. All rights reserved.
*
@ -39,8 +39,8 @@
* \brief Chipcon CC1101 Device Driver
**/
#ifndef __INCLUDE_NUTTX_WIRELESS_CHIPCON_CC1101_H
#define __INCLUDE_NUTTX_WIRELESS_CHIPCON_CC1101_H
#ifndef __INCLUDE_NUTTX_WIRELESS_CC1101_H
#define __INCLUDE_NUTTX_WIRELESS_CC1101_H
#include <nuttx/config.h>
#include <nuttx/spi.h>
@ -67,7 +67,7 @@ extern "C" {
* Public Data Types
************************************************************************************/
struct chipcon_cc1101_dev_s;
struct cc1101_dev_s;
/************************************************************************************
@ -84,24 +84,24 @@ struct chipcon_cc1101_dev_s;
* - EFAULT: When there is no device
* - EBUSY: When device is already addressed by other device driver (not yet supported by low-level driver)
**/
EXTERN struct chipcon_cc1101_dev_s * chipcon_cc1101_init(struct spi_dev_s * spi);
EXTERN struct cc1101_dev_s * cc1101_init(struct spi_dev_s * spi);
/** Deinitialize Chipcon CC1101 Chip
*
* \param dev Device to CC1101 device structure, as returned by the chipcon_cc1101_init()
* \param dev Device to CC1101 device structure, as returned by the cc1101_init()
* \return OK On success
*
**/
EXTERN int chipcon_cc1101_deinit(struct chipcon_cc1101_dev_s * dev);
EXTERN int cc1101_deinit(struct cc1101_dev_s * dev);
/** Power up device, start conversion */
EXTERN int chipcon_cc1101_powerup(struct chipcon_cc1101_dev_s * dev);
EXTERN int cc1101_powerup(struct cc1101_dev_s * dev);
/** Power down device, stop conversion */
EXTERN int chipcon_cc1101_powerdown(struct chipcon_cc1101_dev_s * dev);
EXTERN int cc1101_powerdown(struct cc1101_dev_s * dev);
/** Set Multi Purpose Output Function */
EXTERN int chipcon_cc1101_setgdo(struct chipcon_cc1101_dev_s * dev, uint8_t pin, uint8_t function);
EXTERN int cc1101_setgdo(struct cc1101_dev_s * dev, uint8_t pin, uint8_t function);
#undef EXTERN
@ -109,5 +109,4 @@ EXTERN int chipcon_cc1101_setgdo(struct chipcon_cc1101_dev_s * dev, uint8_t pin,
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __INCLUDE_NUTTX_WIRELESS_CHIPCON_CC1101_H */
#endif /* __INCLUDE_NUTTX_WIRELESS_CC1101_H */