arch/arm: Remove FAR and CODE from board folder(3)

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2022-04-17 14:01:48 +08:00
committed by Petro Karashchenko
parent a3c9b413d8
commit c628529e2d
272 changed files with 1787 additions and 1787 deletions
@@ -45,10 +45,10 @@
* 10 DISPLAY_RESET 10 PB05 PORT 10 PB15 PORT * 10 DISPLAY_RESET 10 PB05 PORT 10 PB15 PORT
* ----------------- ---------------------- ---------------------- * ----------------- ---------------------- ----------------------
* 11 N/C 11 PA08 SERCOM2 PAD[0] 11 PA08 SERCOM2 PAD[0] * 11 N/C 11 PA08 SERCOM2 PAD[0] 11 PA08 SERCOM2 PAD[0]
* IC SDA IC SDA * I²C SDA I²C SDA
* ----------------- ---------------------- ---------------------- * ----------------- ---------------------- ----------------------
* 12 N/C 12 PA09 SERCOM2 PAD[1] 12 PA09 SERCOM2 PAD[1] * 12 N/C 12 PA09 SERCOM2 PAD[1] 12 PA09 SERCOM2 PAD[1]
* IC SCL IC SCL * I²C SCL I²C SCL
* ----------------- ---------------------- ---------------------- * ----------------- ---------------------- ----------------------
* 13 N/C 13 PB09 SERCOM4 PAD[1] 13 PB11 SERCOM4 PAD[1] * 13 N/C 13 PB09 SERCOM4 PAD[1] 13 PB11 SERCOM4 PAD[1]
* USART RX USART RX * USART RX USART RX
@@ -143,10 +143,10 @@
* *
****************************************************************************/ ****************************************************************************/
struct lcd_dev_s *board_graphics_setup(unsigned int devno) FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno)
{ {
struct spi_dev_s *spi; FAR struct spi_dev_s *spi;
struct lcd_dev_s *dev; FAR struct lcd_dev_s *dev;
/* Configure the OLED PORTs. This initial configuration is RESET low, /* Configure the OLED PORTs. This initial configuration is RESET low,
* putting the OLED into reset state. * putting the OLED into reset state.
@@ -57,21 +57,21 @@ struct stm32_mwinfo_s
* Private Functions * Private Functions
****************************************************************************/ ****************************************************************************/
static int adau1961_attach(FAR const struct adau1961_lower_s *lower, static int adau1961_attach(const struct adau1961_lower_s *lower,
adau1961_handler_t isr, FAR void *arg) adau1961_handler_t isr, void *arg)
{ {
audinfo("TODO\n"); audinfo("TODO\n");
return 0; return 0;
} }
static bool adau1961_enable(FAR const struct adau1961_lower_s *lower, static bool adau1961_enable(const struct adau1961_lower_s *lower,
bool enable) bool enable)
{ {
audinfo("TODO\n"); audinfo("TODO\n");
return 0; return 0;
} }
static void adau1961_hw_reset(FAR const struct adau1961_lower_s *lower) static void adau1961_hw_reset(const struct adau1961_lower_s *lower)
{ {
audinfo("TODO\n"); audinfo("TODO\n");
} }
@@ -125,9 +125,9 @@ static struct stm32_mwinfo_s g_adau1961info =
int stm32_adau1961_initialize(int minor) int stm32_adau1961_initialize(int minor)
{ {
FAR struct audio_lowerhalf_s *adau1961; struct audio_lowerhalf_s *adau1961;
FAR struct i2c_master_s *i2c; struct i2c_master_s *i2c;
FAR struct i2s_dev_s *i2s; struct i2s_dev_s *i2s;
static bool initialized = false; static bool initialized = false;
char devname[12]; char devname[12];
int ret; int ret;
+1 -1
View File
@@ -54,7 +54,7 @@
void stm32_boardinitialize(void) void stm32_boardinitialize(void)
{ {
#ifdef CONFIG_SCHED_CRITMONITOR #ifdef CONFIG_SCHED_CRITMONITOR
up_perf_init((FAR void *)STM32_SYSCLK_FREQUENCY); up_perf_init((void *)STM32_SYSCLK_FREQUENCY);
#endif #endif
#if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || \ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || \
+1 -1
View File
@@ -72,7 +72,7 @@
int stm32_bringup(void) int stm32_bringup(void)
{ {
#ifdef HAVE_RTC_DRIVER #ifdef HAVE_RTC_DRIVER
FAR struct rtc_lowerhalf_s *lower; struct rtc_lowerhalf_s *lower;
#endif #endif
int ret = OK; int ret = OK;
+1 -1
View File
@@ -131,7 +131,7 @@ uint32_t board_buttons(void)
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_ARCH_IRQBUTTONS #ifdef CONFIG_ARCH_IRQBUTTONS
int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) int board_button_irq(int id, xcpt_t irqhandler, void *arg)
{ {
int ret = -EINVAL; int ret = -EINVAL;
+2 -2
View File
@@ -52,7 +52,7 @@
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
static FAR struct sdio_dev_s *g_sdio_dev; static struct sdio_dev_s *g_sdio_dev;
#ifdef HAVE_NCD #ifdef HAVE_NCD
static bool g_sd_inserted = 0xff; /* Impossible value */ static bool g_sd_inserted = 0xff; /* Impossible value */
#endif #endif
@@ -70,7 +70,7 @@ static bool g_sd_inserted = 0xff; /* Impossible value */
****************************************************************************/ ****************************************************************************/
#ifdef HAVE_NCD #ifdef HAVE_NCD
static int stm32_ncd_interrupt(int irq, FAR void *context, FAR void *arg) static int stm32_ncd_interrupt(int irq, void *context, void *arg)
{ {
bool present; bool present;
+1 -1
View File
@@ -252,7 +252,7 @@ int stm32_usbhost_initialize(void)
uinfo("Start usbhost_waiter\n"); uinfo("Start usbhost_waiter\n");
ret = kthread_create("usbhost", CONFIG_AXOLOTI_USBHOST_PRIO, ret = kthread_create("usbhost", CONFIG_AXOLOTI_USBHOST_PRIO,
CONFIG_AXOLOTI_USBHOST_STACKSIZE, CONFIG_AXOLOTI_USBHOST_STACKSIZE,
(main_t)usbhost_waiter, (FAR char *const *)NULL); (main_t)usbhost_waiter, (char *const *)NULL);
return ret < 0 ? -ENOEXEC : OK; return ret < 0 ? -ENOEXEC : OK;
} }
@@ -94,7 +94,7 @@ uint32_t board_buttons(void)
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_ARCH_IRQBUTTONS #ifdef CONFIG_ARCH_IRQBUTTONS
int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) int board_button_irq(int id, xcpt_t irqhandler, void *arg)
{ {
int ret = -EINVAL; int ret = -EINVAL;
+26 -26
View File
@@ -195,17 +195,17 @@
* Private Function Protototypes * Private Function Protototypes
****************************************************************************/ ****************************************************************************/
static int board_foc_setup(FAR struct foc_dev_s *dev); static int board_foc_setup(struct foc_dev_s *dev);
static int board_foc_shutdown(FAR struct foc_dev_s *dev); static int board_foc_shutdown(struct foc_dev_s *dev);
static int board_foc_calibration(FAR struct foc_dev_s *dev, bool state); static int board_foc_calibration(struct foc_dev_s *dev, bool state);
static int board_foc_fault_clear(FAR struct foc_dev_s *dev); static int board_foc_fault_clear(struct foc_dev_s *dev);
static int board_foc_pwm_start(FAR struct foc_dev_s *dev, bool state); static int board_foc_pwm_start(struct foc_dev_s *dev, bool state);
static int board_foc_current_get(FAR struct foc_dev_s *dev, static int board_foc_current_get(struct foc_dev_s *dev,
FAR int16_t *curr_raw, int16_t *curr_raw,
FAR foc_current_t *curr); foc_current_t *curr);
#ifdef CONFIG_MOTOR_FOC_TRACE #ifdef CONFIG_MOTOR_FOC_TRACE
static int board_foc_trace_init(FAR struct foc_dev_s *dev); static int board_foc_trace_init(struct foc_dev_s *dev);
static void board_foc_trace(FAR struct foc_dev_s *dev, int type, bool state); static void board_foc_trace(struct foc_dev_s *dev, int type, bool state);
#endif #endif
/**************************************************************************** /****************************************************************************
@@ -336,7 +336,7 @@ static struct stm32_foc_board_s g_stm32_foc_board =
/* Global pointer to the upper FOC driver */ /* Global pointer to the upper FOC driver */
static FAR struct foc_dev_s *g_foc_dev = NULL; static struct foc_dev_s *g_foc_dev = NULL;
/**************************************************************************** /****************************************************************************
* Private Functions * Private Functions
@@ -346,7 +346,7 @@ static FAR struct foc_dev_s *g_foc_dev = NULL;
* Name: board_foc_setup * Name: board_foc_setup
****************************************************************************/ ****************************************************************************/
static int board_foc_setup(FAR struct foc_dev_s *dev) static int board_foc_setup(struct foc_dev_s *dev)
{ {
uint32_t regval = 0; uint32_t regval = 0;
@@ -412,7 +412,7 @@ static int board_foc_setup(FAR struct foc_dev_s *dev)
* Name: board_foc_shutdown * Name: board_foc_shutdown
****************************************************************************/ ****************************************************************************/
static int board_foc_shutdown(FAR struct foc_dev_s *dev) static int board_foc_shutdown(struct foc_dev_s *dev)
{ {
DEBUGASSERT(dev); DEBUGASSERT(dev);
@@ -425,7 +425,7 @@ static int board_foc_shutdown(FAR struct foc_dev_s *dev)
* Name: board_foc_calibration * Name: board_foc_calibration
****************************************************************************/ ****************************************************************************/
static int board_foc_calibration(FAR struct foc_dev_s *dev, bool state) static int board_foc_calibration(struct foc_dev_s *dev, bool state)
{ {
DEBUGASSERT(dev); DEBUGASSERT(dev);
@@ -438,7 +438,7 @@ static int board_foc_calibration(FAR struct foc_dev_s *dev, bool state)
* Name: board_foc_fault_clear * Name: board_foc_fault_clear
****************************************************************************/ ****************************************************************************/
static int board_foc_fault_clear(FAR struct foc_dev_s *dev) static int board_foc_fault_clear(struct foc_dev_s *dev)
{ {
DEBUGASSERT(dev); DEBUGASSERT(dev);
@@ -451,7 +451,7 @@ static int board_foc_fault_clear(FAR struct foc_dev_s *dev)
* Name: board_foc_pwm_start * Name: board_foc_pwm_start
****************************************************************************/ ****************************************************************************/
static int board_foc_pwm_start(FAR struct foc_dev_s *dev, bool state) static int board_foc_pwm_start(struct foc_dev_s *dev, bool state)
{ {
DEBUGASSERT(dev); DEBUGASSERT(dev);
@@ -464,9 +464,9 @@ static int board_foc_pwm_start(FAR struct foc_dev_s *dev, bool state)
* Name: board_foc_current_get * Name: board_foc_current_get
****************************************************************************/ ****************************************************************************/
static int board_foc_current_get(FAR struct foc_dev_s *dev, static int board_foc_current_get(struct foc_dev_s *dev,
FAR int16_t *curr_raw, int16_t *curr_raw,
FAR foc_current_t *curr) foc_current_t *curr)
{ {
DEBUGASSERT(dev); DEBUGASSERT(dev);
DEBUGASSERT(curr_raw); DEBUGASSERT(curr_raw);
@@ -489,7 +489,7 @@ static int board_foc_current_get(FAR struct foc_dev_s *dev,
* Name: board_foc_trace_init * Name: board_foc_trace_init
****************************************************************************/ ****************************************************************************/
static int board_foc_trace_init(FAR struct foc_dev_s *dev) static int board_foc_trace_init(struct foc_dev_s *dev)
{ {
DEBUGASSERT(dev); DEBUGASSERT(dev);
@@ -504,7 +504,7 @@ static int board_foc_trace_init(FAR struct foc_dev_s *dev)
* Name: board_foc_trace * Name: board_foc_trace
****************************************************************************/ ****************************************************************************/
static void board_foc_trace(FAR struct foc_dev_s *dev, int type, bool state) static void board_foc_trace(struct foc_dev_s *dev, int type, bool state)
{ {
DEBUGASSERT(dev); DEBUGASSERT(dev);
@@ -531,8 +531,8 @@ static void board_foc_trace(FAR struct foc_dev_s *dev, int type, bool state)
int stm32_foc_setup(void) int stm32_foc_setup(void)
{ {
FAR struct foc_dev_s *foc = NULL; struct foc_dev_s *foc = NULL;
int ret = OK; int ret = OK;
/* Initialize only once */ /* Initialize only once */
@@ -597,9 +597,9 @@ errout:
int stm32_adc_setup(void) int stm32_adc_setup(void)
{ {
FAR struct adc_dev_s *adc = NULL; struct adc_dev_s *adc = NULL;
int ret = OK; int ret = OK;
static bool initialized = false; static bool initialized = false;
/* Initialize only once */ /* Initialize only once */
@@ -96,7 +96,7 @@ int board_app_initialize(uintptr_t arg)
nxsig_usleep(CONFIG_CLICKER2_STM32_SYSLOG_FILE_DELAY * 1000); nxsig_usleep(CONFIG_CLICKER2_STM32_SYSLOG_FILE_DELAY * 1000);
FAR struct syslog_channel_s *channel; struct syslog_channel_s *channel;
channel = syslog_file_channel(CONFIG_CLICKER2_STM32_SYSLOG_FILE_PATH); channel = syslog_file_channel(CONFIG_CLICKER2_STM32_SYSLOG_FILE_PATH);
if (channel == NULL) if (channel == NULL)
{ {
@@ -51,10 +51,10 @@
struct stm32_automount_state_s struct stm32_automount_state_s
{ {
volatile automount_handler_t handler; /* Upper half handler */ volatile automount_handler_t handler; /* Upper half handler */
FAR void *arg; /* Handler argument */ void *arg; /* Handler argument */
bool enable; /* Fake interrupt enable */ bool enable; /* Fake interrupt enable */
bool pending; /* Set if there an event while disabled */ bool pending; /* Set if there an event while disabled */
}; };
/* This structure represents the static configuration of an automounter */ /* This structure represents the static configuration of an automounter */
@@ -65,20 +65,20 @@ struct stm32_automount_config_s
* struct automount_lower_s to struct stm32_automount_config_s * struct automount_lower_s to struct stm32_automount_config_s
*/ */
struct automount_lower_s lower; /* Publicly visible part */ struct automount_lower_s lower; /* Publicly visible part */
uint8_t mmcsd; /* MB1_MMCSD_SLOTNO or MB2_MMCSD_SLOTNO */ uint8_t mmcsd; /* MB1_MMCSD_SLOTNO or MB2_MMCSD_SLOTNO */
FAR struct stm32_automount_state_s *state; /* Changeable state */ struct stm32_automount_state_s *state; /* Changeable state */
}; };
/**************************************************************************** /****************************************************************************
* Private Function Prototypes * Private Function Prototypes
****************************************************************************/ ****************************************************************************/
static int stm32_attach(FAR const struct automount_lower_s *lower, static int stm32_attach(const struct automount_lower_s *lower,
automount_handler_t isr, FAR void *arg); automount_handler_t isr, void *arg);
static void stm32_enable(FAR const struct automount_lower_s *lower, static void stm32_enable(const struct automount_lower_s *lower,
bool enable); bool enable);
static bool stm32_inserted(FAR const struct automount_lower_s *lower); static bool stm32_inserted(const struct automount_lower_s *lower);
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
@@ -148,15 +148,15 @@ static const struct stm32_automount_config_s g_mb2_mmcsdconfig =
* *
****************************************************************************/ ****************************************************************************/
static int stm32_attach(FAR const struct automount_lower_s *lower, static int stm32_attach(const struct automount_lower_s *lower,
automount_handler_t isr, FAR void *arg) automount_handler_t isr, void *arg)
{ {
FAR const struct stm32_automount_config_s *config; const struct stm32_automount_config_s *config;
FAR struct stm32_automount_state_s *state; struct stm32_automount_state_s *state;
/* Recover references to our structure */ /* Recover references to our structure */
config = (FAR struct stm32_automount_config_s *)lower; config = (struct stm32_automount_config_s *)lower;
DEBUGASSERT(config && config->state); DEBUGASSERT(config && config->state);
state = config->state; state = config->state;
@@ -187,16 +187,16 @@ static int stm32_attach(FAR const struct automount_lower_s *lower,
* *
****************************************************************************/ ****************************************************************************/
static void stm32_enable(FAR const struct automount_lower_s *lower, static void stm32_enable(const struct automount_lower_s *lower,
bool enable) bool enable)
{ {
FAR const struct stm32_automount_config_s *config; const struct stm32_automount_config_s *config;
FAR struct stm32_automount_state_s *state; struct stm32_automount_state_s *state;
irqstate_t flags; irqstate_t flags;
/* Recover references to our structure */ /* Recover references to our structure */
config = (FAR struct stm32_automount_config_s *)lower; config = (struct stm32_automount_config_s *)lower;
DEBUGASSERT(config && config->state); DEBUGASSERT(config && config->state);
state = config->state; state = config->state;
@@ -238,11 +238,11 @@ static void stm32_enable(FAR const struct automount_lower_s *lower,
* *
****************************************************************************/ ****************************************************************************/
static bool stm32_inserted(FAR const struct automount_lower_s *lower) static bool stm32_inserted(const struct automount_lower_s *lower)
{ {
FAR const struct stm32_automount_config_s *config; const struct stm32_automount_config_s *config;
config = (FAR struct stm32_automount_config_s *)lower; config = (struct stm32_automount_config_s *)lower;
DEBUGASSERT(config && config->state); DEBUGASSERT(config && config->state);
return stm32_cardinserted(config->mmcsd); return stm32_cardinserted(config->mmcsd);
@@ -268,7 +268,7 @@ static bool stm32_inserted(FAR const struct automount_lower_s *lower)
int stm32_automount_initialize(void) int stm32_automount_initialize(void)
{ {
FAR void *handle; void *handle;
finfo("Initializing automounter(s)\n"); finfo("Initializing automounter(s)\n");
@@ -323,8 +323,8 @@ int stm32_automount_initialize(void)
void stm32_automount_event(int slotno, bool inserted) void stm32_automount_event(int slotno, bool inserted)
{ {
FAR const struct stm32_automount_config_s *config; const struct stm32_automount_config_s *config;
FAR struct stm32_automount_state_s *state; struct stm32_automount_state_s *state;
#ifdef CONFIG_CLICKER2_STM32_MB1_MMCSD_AUTOMOUNT #ifdef CONFIG_CLICKER2_STM32_MB1_MMCSD_AUTOMOUNT
/* Is this a change in the MB1 MMCSD slot insertion state? */ /* Is this a change in the MB1 MMCSD slot insertion state? */
@@ -110,7 +110,7 @@ uint32_t board_buttons(void)
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_ARCH_IRQBUTTONS #ifdef CONFIG_ARCH_IRQBUTTONS
int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) int board_button_irq(int id, xcpt_t irqhandler, void *arg)
{ {
uint32_t btncfg; uint32_t btncfg;
@@ -105,7 +105,7 @@ struct stm32_mmcsd_state_s
xcpt_t handler; /* Interrupt handler */ xcpt_t handler; /* Interrupt handler */
bool cd; /* TRUE: card is inserted */ bool cd; /* TRUE: card is inserted */
spi_mediachange_t callback; /* SPI media change callback */ spi_mediachange_t callback; /* SPI media change callback */
FAR void *cbarg; /* Argument to pass to media change callback */ void *cbarg; /* Argument to pass to media change callback */
struct work_s work; /* For deferring card detect interrupt work */ struct work_s work; /* For deferring card detect interrupt work */
}; };
@@ -114,19 +114,19 @@ struct stm32_mmcsd_state_s
****************************************************************************/ ****************************************************************************/
static bool stm32_cardinserted_internal(struct stm32_mmcsd_state_s *state); static bool stm32_cardinserted_internal(struct stm32_mmcsd_state_s *state);
static void stm32_mmcsd_carddetect(FAR void *arg); static void stm32_mmcsd_carddetect(void *arg);
static int stm32_mmcsd_setup(FAR struct stm32_mmcsd_state_s *); static int stm32_mmcsd_setup(struct stm32_mmcsd_state_s *);
#ifdef CONFIG_CLICKER2_STM32_MB1_MMCSD #ifdef CONFIG_CLICKER2_STM32_MB1_MMCSD
static int stm32_mb1_mmcsd_carddetect(int irq, static int stm32_mb1_mmcsd_carddetect(int irq,
FAR void *regs, void *regs,
FAR void *arg); void *arg);
#endif #endif
#ifdef CONFIG_CLICKER2_STM32_MB2_MMCSD #ifdef CONFIG_CLICKER2_STM32_MB2_MMCSD
static int stm32_mb2_mmcsd_carddetect(int irq, static int stm32_mb2_mmcsd_carddetect(int irq,
FAR void *regs, void *regs,
FAR void *arg); void *arg);
#endif #endif
/**************************************************************************** /****************************************************************************
@@ -136,7 +136,7 @@ static int stm32_mb2_mmcsd_carddetect(int irq,
/* MMCSD device state */ /* MMCSD device state */
#ifdef CONFIG_CLICKER2_STM32_MB1_MMCSD #ifdef CONFIG_CLICKER2_STM32_MB1_MMCSD
static int stm32_mb1_mmcsd_carddetect(int irq, void *regs, FAR void *arg); static int stm32_mb1_mmcsd_carddetect(int irq, void *regs, void *arg);
static struct stm32_mmcsd_state_s g_mb1_mmcsd = static struct stm32_mmcsd_state_s g_mb1_mmcsd =
{ {
@@ -151,7 +151,7 @@ static struct stm32_mmcsd_state_s g_mb1_mmcsd =
#endif #endif
#ifdef CONFIG_CLICKER2_STM32_MB2_MMCSD #ifdef CONFIG_CLICKER2_STM32_MB2_MMCSD
static int stm32_mb2_mmcsd_carddetect(int irq, void *regs, FAR void *arg); static int stm32_mb2_mmcsd_carddetect(int irq, void *regs, void *arg);
static struct stm32_mmcsd_state_s g_mb2_mmcsd = static struct stm32_mmcsd_state_s g_mb2_mmcsd =
{ {
@@ -197,11 +197,11 @@ static bool stm32_cardinserted_internal(struct stm32_mmcsd_state_s *state)
* *
****************************************************************************/ ****************************************************************************/
static void stm32_mmcsd_carddetect(FAR void *arg) static void stm32_mmcsd_carddetect(void *arg)
{ {
bool cd; bool cd;
FAR struct stm32_mmcsd_state_s *state = struct stm32_mmcsd_state_s *state =
(FAR struct stm32_mmcsd_state_s *)arg; (struct stm32_mmcsd_state_s *)arg;
/* Get the current card insertion state */ /* Get the current card insertion state */
@@ -231,7 +231,7 @@ static void stm32_mmcsd_carddetect(FAR void *arg)
} }
#ifdef CONFIG_CLICKER2_STM32_MB1_MMCSD #ifdef CONFIG_CLICKER2_STM32_MB1_MMCSD
static int stm32_mb1_mmcsd_carddetect(int irq, FAR void *regs, FAR void *arg) static int stm32_mb1_mmcsd_carddetect(int irq, void *regs, void *arg)
{ {
if (work_available(&g_mb1_mmcsd.work)) if (work_available(&g_mb1_mmcsd.work))
{ {
@@ -244,7 +244,7 @@ static int stm32_mb1_mmcsd_carddetect(int irq, FAR void *regs, FAR void *arg)
#endif #endif
#ifdef CONFIG_CLICKER2_STM32_MB2_MMCSD #ifdef CONFIG_CLICKER2_STM32_MB2_MMCSD
static int stm32_mb2_mmcsd_carddetect(int irq, FAR void *regs, FAR void *arg) static int stm32_mb2_mmcsd_carddetect(int irq, void *regs, void *arg)
{ {
if (work_available(&g_mb2_mmcsd.work)) if (work_available(&g_mb2_mmcsd.work))
{ {
@@ -76,7 +76,7 @@ struct stm32_priv_s
{ {
struct mrf24j40_lower_s dev; struct mrf24j40_lower_s dev;
xcpt_t handler; xcpt_t handler;
FAR void *arg; void *arg;
uint32_t intcfg; uint32_t intcfg;
uint8_t spidev; uint8_t spidev;
}; };
@@ -94,11 +94,11 @@ struct stm32_priv_s
* irq_enable - Enable or disable the GPIO interrupt * irq_enable - Enable or disable the GPIO interrupt
*/ */
static int stm32_attach_irq(FAR const struct mrf24j40_lower_s *lower, static int stm32_attach_irq(const struct mrf24j40_lower_s *lower,
xcpt_t handler, FAR void *arg); xcpt_t handler, void *arg);
static void stm32_enable_irq(FAR const struct mrf24j40_lower_s *lower, static void stm32_enable_irq(const struct mrf24j40_lower_s *lower,
bool state); bool state);
static int stm32_mrf24j40_devsetup(FAR struct stm32_priv_s *priv); static int stm32_mrf24j40_devsetup(struct stm32_priv_s *priv);
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
@@ -153,10 +153,10 @@ static struct stm32_priv_s g_mrf24j40_mb2_priv =
* irq_enable - Enable or disable the GPIO interrupt * irq_enable - Enable or disable the GPIO interrupt
*/ */
static int stm32_attach_irq(FAR const struct mrf24j40_lower_s *lower, static int stm32_attach_irq(const struct mrf24j40_lower_s *lower,
xcpt_t handler, FAR void *arg) xcpt_t handler, void *arg)
{ {
FAR struct stm32_priv_s *priv = (FAR struct stm32_priv_s *)lower; struct stm32_priv_s *priv = (struct stm32_priv_s *)lower;
DEBUGASSERT(priv != NULL); DEBUGASSERT(priv != NULL);
@@ -167,10 +167,10 @@ static int stm32_attach_irq(FAR const struct mrf24j40_lower_s *lower,
return OK; return OK;
} }
static void stm32_enable_irq(FAR const struct mrf24j40_lower_s *lower, static void stm32_enable_irq(const struct mrf24j40_lower_s *lower,
bool state) bool state)
{ {
FAR struct stm32_priv_s *priv = (FAR struct stm32_priv_s *)lower; struct stm32_priv_s *priv = (struct stm32_priv_s *)lower;
/* The caller should not attempt to enable interrupts if the handler /* The caller should not attempt to enable interrupts if the handler
* has not yet been 'attached' * has not yet been 'attached'
@@ -208,11 +208,11 @@ static void stm32_enable_irq(FAR const struct mrf24j40_lower_s *lower,
* *
****************************************************************************/ ****************************************************************************/
static int stm32_mrf24j40_devsetup(FAR struct stm32_priv_s *priv) static int stm32_mrf24j40_devsetup(struct stm32_priv_s *priv)
{ {
FAR struct ieee802154_radio_s *radio; struct ieee802154_radio_s *radio;
MACHANDLE mac; MACHANDLE mac;
FAR struct spi_dev_s *spi; struct spi_dev_s *spi;
int ret; int ret;
/* Configure the interrupt pin */ /* Configure the interrupt pin */
@@ -94,21 +94,21 @@ void weak_function stm32_spidev_initialize(void)
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_STM32_SPI1 #ifdef CONFIG_STM32_SPI1
void stm32_spi1select(FAR struct spi_dev_s *dev, void stm32_spi1select(struct spi_dev_s *dev,
uint32_t devid, bool selected) uint32_t devid, bool selected)
{ {
spiinfo("devid: %d CS: %s\n", spiinfo("devid: %d CS: %s\n",
(int)devid, selected ? "assert" : "de-assert"); (int)devid, selected ? "assert" : "de-assert");
} }
uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, uint32_t devid) uint8_t stm32_spi1status(struct spi_dev_s *dev, uint32_t devid)
{ {
return 0; return 0;
} }
#endif #endif
#ifdef CONFIG_STM32_SPI2 #ifdef CONFIG_STM32_SPI2
void stm32_spi2select(FAR struct spi_dev_s *dev, void stm32_spi2select(struct spi_dev_s *dev,
uint32_t devid, bool selected) uint32_t devid, bool selected)
{ {
spiinfo("devid: %d CS: %s\n", spiinfo("devid: %d CS: %s\n",
@@ -145,7 +145,7 @@ void stm32_spi2select(FAR struct spi_dev_s *dev,
} }
} }
uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, uint32_t devid) uint8_t stm32_spi2status(struct spi_dev_s *dev, uint32_t devid)
{ {
uint8_t status = 0; uint8_t status = 0;
@@ -161,7 +161,7 @@ uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, uint32_t devid)
#endif #endif
#ifdef CONFIG_STM32_SPI3 #ifdef CONFIG_STM32_SPI3
void stm32_spi3select(FAR struct spi_dev_s *dev, void stm32_spi3select(struct spi_dev_s *dev,
uint32_t devid, bool selected) uint32_t devid, bool selected)
{ {
spiinfo("devid: %d CS: %s\n", spiinfo("devid: %d CS: %s\n",
@@ -198,7 +198,7 @@ void stm32_spi3select(FAR struct spi_dev_s *dev,
} }
} }
uint8_t stm32_spi3status(FAR struct spi_dev_s *dev, uint32_t devid) uint8_t stm32_spi3status(struct spi_dev_s *dev, uint32_t devid)
{ {
uint8_t status = 0; uint8_t status = 0;
@@ -238,14 +238,14 @@ uint8_t stm32_spi3status(FAR struct spi_dev_s *dev, uint32_t devid)
#ifdef CONFIG_SPI_CMDDATA #ifdef CONFIG_SPI_CMDDATA
#ifdef CONFIG_STM32_SPI1 #ifdef CONFIG_STM32_SPI1
int stm32_spi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd) int stm32_spi1cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
{ {
return -ENODEV; return -ENODEV;
} }
#endif #endif
#ifdef CONFIG_STM32_SPI2 #ifdef CONFIG_STM32_SPI2
int stm32_spi2cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd) int stm32_spi2cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
{ {
/* To be provided */ /* To be provided */
@@ -254,7 +254,7 @@ int stm32_spi2cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
#endif #endif
#ifdef CONFIG_STM32_SPI3 #ifdef CONFIG_STM32_SPI3
int stm32_spi3cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd) int stm32_spi3cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
{ {
/* To be provided */ /* To be provided */
@@ -84,7 +84,7 @@ void stm32_usb_configure(void)
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_USBDEV #ifdef CONFIG_USBDEV
void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) void stm32_usbsuspend(struct usbdev_s *dev, bool resume)
{ {
uinfo("resume: %d\n", resume); uinfo("resume: %d\n", resume);
} }
@@ -98,7 +98,7 @@ struct stm32_priv_s
{ {
struct xbee_lower_s dev; struct xbee_lower_s dev;
xcpt_t handler; xcpt_t handler;
FAR void *arg; void *arg;
uint32_t rstcfg; uint32_t rstcfg;
uint32_t attncfg; uint32_t attncfg;
uint8_t spidev; uint8_t spidev;
@@ -121,13 +121,13 @@ struct stm32_priv_s
* attn_poll - Poll the current state of the GPIO interrupt (ATTN) * attn_poll - Poll the current state of the GPIO interrupt (ATTN)
*/ */
static void stm32_reset(FAR const struct xbee_lower_s *lower); static void stm32_reset(const struct xbee_lower_s *lower);
static int stm32_attach_attn(FAR const struct xbee_lower_s *lower, static int stm32_attach_attn(const struct xbee_lower_s *lower,
xcpt_t handler, FAR void *arg); xcpt_t handler, void *arg);
static void stm32_enable_attn(FAR const struct xbee_lower_s *lower, static void stm32_enable_attn(const struct xbee_lower_s *lower,
bool state); bool state);
static bool stm32_poll_attn(FAR const struct xbee_lower_s *lower); static bool stm32_poll_attn(const struct xbee_lower_s *lower);
static int stm32_xbee_devsetup(FAR struct stm32_priv_s *priv); static int stm32_xbee_devsetup(struct stm32_priv_s *priv);
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
@@ -190,9 +190,9 @@ static struct stm32_priv_s g_xbee_mb2_priv =
* attn_poll - Poll the current state of the GPIO interrupt (ATTN) * attn_poll - Poll the current state of the GPIO interrupt (ATTN)
*/ */
static void stm32_reset(FAR const struct xbee_lower_s *lower) static void stm32_reset(const struct xbee_lower_s *lower)
{ {
FAR struct stm32_priv_s *priv = (FAR struct stm32_priv_s *)lower; struct stm32_priv_s *priv = (struct stm32_priv_s *)lower;
DEBUGASSERT(priv != NULL); DEBUGASSERT(priv != NULL);
@@ -205,10 +205,10 @@ static void stm32_reset(FAR const struct xbee_lower_s *lower)
up_mdelay(100); up_mdelay(100);
} }
static int stm32_attach_attn(FAR const struct xbee_lower_s *lower, static int stm32_attach_attn(const struct xbee_lower_s *lower,
xcpt_t handler, FAR void *arg) xcpt_t handler, void *arg)
{ {
FAR struct stm32_priv_s *priv = (FAR struct stm32_priv_s *)lower; struct stm32_priv_s *priv = (struct stm32_priv_s *)lower;
DEBUGASSERT(priv != NULL); DEBUGASSERT(priv != NULL);
@@ -219,10 +219,10 @@ static int stm32_attach_attn(FAR const struct xbee_lower_s *lower,
return OK; return OK;
} }
static void stm32_enable_attn(FAR const struct xbee_lower_s *lower, static void stm32_enable_attn(const struct xbee_lower_s *lower,
bool state) bool state)
{ {
FAR struct stm32_priv_s *priv = (FAR struct stm32_priv_s *)lower; struct stm32_priv_s *priv = (struct stm32_priv_s *)lower;
/* The caller should not attempt to enable interrupts if the handler /* The caller should not attempt to enable interrupts if the handler
* has not yet been 'attached' * has not yet been 'attached'
@@ -248,9 +248,9 @@ static void stm32_enable_attn(FAR const struct xbee_lower_s *lower,
} }
} }
static bool stm32_poll_attn(FAR const struct xbee_lower_s *lower) static bool stm32_poll_attn(const struct xbee_lower_s *lower)
{ {
FAR struct stm32_priv_s *priv = (FAR struct stm32_priv_s *)lower; struct stm32_priv_s *priv = (struct stm32_priv_s *)lower;
return !stm32_gpioread(priv->attncfg); return !stm32_gpioread(priv->attncfg);
} }
@@ -267,9 +267,9 @@ static bool stm32_poll_attn(FAR const struct xbee_lower_s *lower)
* *
****************************************************************************/ ****************************************************************************/
static int stm32_xbee_devsetup(FAR struct stm32_priv_s *priv) static int stm32_xbee_devsetup(struct stm32_priv_s *priv)
{ {
FAR struct spi_dev_s *spi; struct spi_dev_s *spi;
XBEEHANDLE xbee; XBEEHANDLE xbee;
int ret; int ret;
@@ -145,7 +145,7 @@ uint32_t board_buttons(void)
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_ARCH_IRQBUTTONS #ifdef CONFIG_ARCH_IRQBUTTONS
int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) int board_button_irq(int id, xcpt_t irqhandler, void *arg)
{ {
int ret = -EINVAL; int ret = -EINVAL;
+4 -4
View File
@@ -98,7 +98,7 @@ void weak_function stm32_spidev_initialize(void)
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_STM32_SPI1 #ifdef CONFIG_STM32_SPI1
void stm32_spi1select(FAR struct spi_dev_s *dev, void stm32_spi1select(struct spi_dev_s *dev,
uint32_t devid, bool selected) uint32_t devid, bool selected)
{ {
spiinfo("devid: %d CS: %s\n", spiinfo("devid: %d CS: %s\n",
@@ -114,21 +114,21 @@ void stm32_spi1select(FAR struct spi_dev_s *dev,
} }
} }
uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, uint32_t devid) uint8_t stm32_spi1status(struct spi_dev_s *dev, uint32_t devid)
{ {
return SPI_STATUS_PRESENT; return SPI_STATUS_PRESENT;
} }
#endif #endif
#ifdef CONFIG_STM32_SPI3 #ifdef CONFIG_STM32_SPI3
void stm32_spi3select(FAR struct spi_dev_s *dev, void stm32_spi3select(struct spi_dev_s *dev,
uint32_t devid, bool selected) uint32_t devid, bool selected)
{ {
spiinfo("devid: %d CS: %s\n", spiinfo("devid: %d CS: %s\n",
(int)devid, selected ? "assert" : "de-assert"); (int)devid, selected ? "assert" : "de-assert");
} }
uint8_t stm32_spi3status(FAR struct spi_dev_s *dev, uint32_t devid) uint8_t stm32_spi3status(struct spi_dev_s *dev, uint32_t devid)
{ {
return 0; return 0;
} }
+2 -2
View File
@@ -200,7 +200,7 @@ int stm32_usbhost_initialize(void)
ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO, ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
CONFIG_USBHOST_STACKSIZE, CONFIG_USBHOST_STACKSIZE,
(main_t)usbhost_waiter, (FAR char * const *)NULL); (main_t)usbhost_waiter, (char * const *)NULL);
return ret < 0 ? -ENOEXEC : OK; return ret < 0 ? -ENOEXEC : OK;
} }
@@ -293,7 +293,7 @@ int stm32_setup_overcurrent(xcpt_t handler, void *arg)
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_USBDEV #ifdef CONFIG_USBDEV
void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) void stm32_usbsuspend(struct usbdev_s *dev, bool resume)
{ {
uinfo("resume: %d\n", resume); uinfo("resume: %d\n", resume);
} }
+2 -2
View File
@@ -79,8 +79,8 @@
int stm32_w25initialize(int minor) int stm32_w25initialize(int minor)
{ {
#ifdef HAVE_W25 #ifdef HAVE_W25
FAR struct spi_dev_s *spi; struct spi_dev_s *spi;
FAR struct mtd_dev_s *mtd; struct mtd_dev_s *mtd;
#ifdef CONFIG_FS_NXFFS #ifdef CONFIG_FS_NXFFS
char devname[12]; char devname[12];
#endif #endif
@@ -49,7 +49,7 @@ extern "C"
* Name: stm32_ihm07m1_initialize * Name: stm32_ihm07m1_initialize
****************************************************************************/ ****************************************************************************/
int board_ihm07m1_initialize(FAR struct stm32_foc_adc_s *adc_cfg); int board_ihm07m1_initialize(struct stm32_foc_adc_s *adc_cfg);
#undef EXTERN #undef EXTERN
#ifdef __cplusplus #ifdef __cplusplus
@@ -49,7 +49,7 @@ extern "C"
* Name: stm32_ihm08m1_initialize * Name: stm32_ihm08m1_initialize
****************************************************************************/ ****************************************************************************/
int board_ihm08m1_initialize(FAR struct stm32_foc_adc_s *adc_cfg); int board_ihm08m1_initialize(struct stm32_foc_adc_s *adc_cfg);
#undef EXTERN #undef EXTERN
#ifdef __cplusplus #ifdef __cplusplus
@@ -49,7 +49,7 @@ extern "C"
* Name: stm32_ihm16m1_initialize * Name: stm32_ihm16m1_initialize
****************************************************************************/ ****************************************************************************/
int board_ihm16m1_initialize(FAR struct stm32_foc_adc_s *adc_cfg); int board_ihm16m1_initialize(struct stm32_foc_adc_s *adc_cfg);
#undef EXTERN #undef EXTERN
#ifdef __cplusplus #ifdef __cplusplus
@@ -70,7 +70,7 @@ int board_ssd1306_initialize(int busno);
* *
****************************************************************************/ ****************************************************************************/
FAR struct lcd_dev_s *board_ssd1306_getdev(void); struct lcd_dev_s *board_ssd1306_getdev(void);
#undef EXTERN #undef EXTERN
#ifdef __cplusplus #ifdef __cplusplus
+1 -1
View File
@@ -81,7 +81,7 @@
int board_apa102_initialize(int devno, int spino) int board_apa102_initialize(int devno, int spino)
{ {
FAR struct spi_dev_s *spi; struct spi_dev_s *spi;
char devpath[13]; char devpath[13];
int ret; int ret;
+7 -7
View File
@@ -51,16 +51,16 @@ struct stm32_apds9960config_s
/* Additional private definitions only known to this driver */ /* Additional private definitions only known to this driver */
FAR void *arg; /* Argument to pass to the interrupt handler */ void *arg; /* Argument to pass to the interrupt handler */
FAR xcpt_t isr; /* ISR Handler */ xcpt_t isr; /* ISR Handler */
}; };
/**************************************************************************** /****************************************************************************
* Private Function Prototypes * Private Function Prototypes
****************************************************************************/ ****************************************************************************/
static int apds9960_irq_attach(FAR struct apds9960_config_s *state, static int apds9960_irq_attach(struct apds9960_config_s *state,
xcpt_t isr, FAR void *arg); xcpt_t isr, void *arg);
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
@@ -90,8 +90,8 @@ static struct stm32_apds9960config_s g_apds9960config =
/* Attach the APDS-9960 interrupt handler to the GPIO interrupt */ /* Attach the APDS-9960 interrupt handler to the GPIO interrupt */
static int apds9960_irq_attach(FAR struct apds9960_config_s *state, static int apds9960_irq_attach(struct apds9960_config_s *state,
xcpt_t isr, FAR void *arg) xcpt_t isr, void *arg)
{ {
irqstate_t flags; irqstate_t flags;
@@ -129,7 +129,7 @@ static int apds9960_irq_attach(FAR struct apds9960_config_s *state,
int board_apds9960_initialize(int devno, int busno) int board_apds9960_initialize(int devno, int busno)
{ {
FAR struct i2c_master_s *i2c; struct i2c_master_s *i2c;
char devpath[12]; char devpath[12];
int ret; int ret;
+1 -1
View File
@@ -60,7 +60,7 @@
int board_bh1750_initialize(int devno, int busno) int board_bh1750_initialize(int devno, int busno)
{ {
FAR struct i2c_master_s *i2c; struct i2c_master_s *i2c;
int ret; int ret;
sninfo("Initializing BH1750FVI!\n"); sninfo("Initializing BH1750FVI!\n");
+1 -1
View File
@@ -75,7 +75,7 @@
int board_bmp180_initialize(int devno, int busno) int board_bmp180_initialize(int devno, int busno)
{ {
FAR struct i2c_master_s *i2c; struct i2c_master_s *i2c;
char devpath[12]; char devpath[12];
int ret; int ret;
+8 -8
View File
@@ -45,11 +45,11 @@
* Private Function Prototypes * Private Function Prototypes
****************************************************************************/ ****************************************************************************/
static void dhtxx_config_data_pin(FAR struct dhtxx_config_s *state, static void dhtxx_config_data_pin(struct dhtxx_config_s *state,
bool mode); bool mode);
static void dhtxx_set_data_pin(FAR struct dhtxx_config_s *state, bool value); static void dhtxx_set_data_pin(struct dhtxx_config_s *state, bool value);
static bool dhtxx_read_data_pin(FAR struct dhtxx_config_s *state); static bool dhtxx_read_data_pin(struct dhtxx_config_s *state);
static int64_t dhtxx_get_clock(FAR struct dhtxx_config_s *state); static int64_t dhtxx_get_clock(struct dhtxx_config_s *state);
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
@@ -71,7 +71,7 @@ struct timespec ts;
* Private Functions * Private Functions
****************************************************************************/ ****************************************************************************/
static void dhtxx_config_data_pin(FAR struct dhtxx_config_s *state, static void dhtxx_config_data_pin(struct dhtxx_config_s *state,
bool mode) bool mode)
{ {
if (mode) if (mode)
@@ -84,17 +84,17 @@ static void dhtxx_config_data_pin(FAR struct dhtxx_config_s *state,
} }
} }
static void dhtxx_set_data_pin(FAR struct dhtxx_config_s *state, bool value) static void dhtxx_set_data_pin(struct dhtxx_config_s *state, bool value)
{ {
stm32_gpiowrite(BOARD_DHTXX_GPIO_OUTPUT, value); stm32_gpiowrite(BOARD_DHTXX_GPIO_OUTPUT, value);
} }
static bool dhtxx_read_data_pin(FAR struct dhtxx_config_s *state) static bool dhtxx_read_data_pin(struct dhtxx_config_s *state)
{ {
return stm32_gpioread(BOARD_DHTXX_GPIO_INPUT); return stm32_gpioread(BOARD_DHTXX_GPIO_INPUT);
} }
static int64_t dhtxx_get_clock(FAR struct dhtxx_config_s *state) static int64_t dhtxx_get_clock(struct dhtxx_config_s *state)
{ {
/* Get the time from free running timer */ /* Get the time from free running timer */
+25 -25
View File
@@ -56,26 +56,26 @@ struct stm32_hcsr04config_s
/* Additional private definitions only known to this driver */ /* Additional private definitions only known to this driver */
FAR void *arg; /* Argument to pass to the interrupt handler */ void *arg; /* Argument to pass to the interrupt handler */
FAR xcpt_t isr; /* ISR Handler */ xcpt_t isr; /* ISR Handler */
bool rising; /* Rising edge enabled */ bool rising; /* Rising edge enabled */
bool falling; /* Falling edge enabled */ bool falling; /* Falling edge enabled */
}; };
/**************************************************************************** /****************************************************************************
* Private Function Prototypes * Private Function Prototypes
****************************************************************************/ ****************************************************************************/
static int hcsr04_irq_attach(FAR struct hcsr04_config_s *state, xcpt_t isr, static int hcsr04_irq_attach(struct hcsr04_config_s *state, xcpt_t isr,
FAR void *arg); void *arg);
static void hcsr04_irq_enable(FAR const struct hcsr04_config_s *state, static void hcsr04_irq_enable(const struct hcsr04_config_s *state,
bool enable); bool enable);
static void hcsr04_irq_clear(FAR const struct hcsr04_config_s *state); static void hcsr04_irq_clear(const struct hcsr04_config_s *state);
static void hcsr04_irq_setmode(FAR struct hcsr04_config_s *state, static void hcsr04_irq_setmode(struct hcsr04_config_s *state,
bool rise_mode); bool rise_mode);
static void hcsr04_set_trigger(FAR const struct hcsr04_config_s *state, static void hcsr04_set_trigger(const struct hcsr04_config_s *state,
bool on); bool on);
static int64_t hcsr04_get_clock(FAR const struct hcsr04_config_s *state); static int64_t hcsr04_get_clock(const struct hcsr04_config_s *state);
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
@@ -113,11 +113,11 @@ struct timespec ts;
/* Attach the HC-SR04 interrupt handler to the GPIO interrupt */ /* Attach the HC-SR04 interrupt handler to the GPIO interrupt */
static int hcsr04_irq_attach(FAR struct hcsr04_config_s *state, xcpt_t isr, static int hcsr04_irq_attach(struct hcsr04_config_s *state, xcpt_t isr,
FAR void *arg) void *arg)
{ {
FAR struct stm32_hcsr04config_s *priv = struct stm32_hcsr04config_s *priv =
(FAR struct stm32_hcsr04config_s *)state; (struct stm32_hcsr04config_s *)state;
irqstate_t flags; irqstate_t flags;
sinfo("hcsr04_irq_attach\n"); sinfo("hcsr04_irq_attach\n");
@@ -139,11 +139,11 @@ static int hcsr04_irq_attach(FAR struct hcsr04_config_s *state, xcpt_t isr,
/* Setup the interruption mode: Rising or Falling */ /* Setup the interruption mode: Rising or Falling */
static void hcsr04_irq_setmode(FAR struct hcsr04_config_s *state, static void hcsr04_irq_setmode(struct hcsr04_config_s *state,
bool rise_mode) bool rise_mode)
{ {
FAR struct stm32_hcsr04config_s *priv = struct stm32_hcsr04config_s *priv =
(FAR struct stm32_hcsr04config_s *)state; (struct stm32_hcsr04config_s *)state;
if (rise_mode) if (rise_mode)
{ {
@@ -159,11 +159,11 @@ static void hcsr04_irq_setmode(FAR struct hcsr04_config_s *state,
/* Enable or disable the GPIO interrupt */ /* Enable or disable the GPIO interrupt */
static void hcsr04_irq_enable(FAR const struct hcsr04_config_s *state, static void hcsr04_irq_enable(const struct hcsr04_config_s *state,
bool enable) bool enable)
{ {
FAR struct stm32_hcsr04config_s *priv = struct stm32_hcsr04config_s *priv =
(FAR struct stm32_hcsr04config_s *)state; (struct stm32_hcsr04config_s *)state;
iinfo("%d\n", enable); iinfo("%d\n", enable);
@@ -173,14 +173,14 @@ static void hcsr04_irq_enable(FAR const struct hcsr04_config_s *state,
/* Acknowledge/clear any pending GPIO interrupt */ /* Acknowledge/clear any pending GPIO interrupt */
static void hcsr04_irq_clear(FAR const struct hcsr04_config_s *state) static void hcsr04_irq_clear(const struct hcsr04_config_s *state)
{ {
/* FIXME: Nothing to do ? */ /* FIXME: Nothing to do ? */
} }
/* Set the Trigger pin state */ /* Set the Trigger pin state */
static void hcsr04_set_trigger(FAR const struct hcsr04_config_s *state, static void hcsr04_set_trigger(const struct hcsr04_config_s *state,
bool on) bool on)
{ {
stm32_gpiowrite(BOARD_HCSR04_GPIO_TRIG, on); stm32_gpiowrite(BOARD_HCSR04_GPIO_TRIG, on);
@@ -188,7 +188,7 @@ static void hcsr04_set_trigger(FAR const struct hcsr04_config_s *state,
/* Return the current Free Running clock tick */ /* Return the current Free Running clock tick */
static int64_t hcsr04_get_clock(FAR const struct hcsr04_config_s *state) static int64_t hcsr04_get_clock(const struct hcsr04_config_s *state)
{ {
/* Get the time from free running timer */ /* Get the time from free running timer */
+27 -27
View File
@@ -105,17 +105,17 @@
* Private Function Protototypes * Private Function Protototypes
****************************************************************************/ ****************************************************************************/
static int board_foc_setup(FAR struct foc_dev_s *dev); static int board_foc_setup(struct foc_dev_s *dev);
static int board_foc_shutdown(FAR struct foc_dev_s *dev); static int board_foc_shutdown(struct foc_dev_s *dev);
static int board_foc_calibration(FAR struct foc_dev_s *dev, bool state); static int board_foc_calibration(struct foc_dev_s *dev, bool state);
static int board_foc_fault_clear(FAR struct foc_dev_s *dev); static int board_foc_fault_clear(struct foc_dev_s *dev);
static int board_foc_pwm_start(FAR struct foc_dev_s *dev, bool state); static int board_foc_pwm_start(struct foc_dev_s *dev, bool state);
static int board_foc_current_get(FAR struct foc_dev_s *dev, static int board_foc_current_get(struct foc_dev_s *dev,
FAR int16_t *curr_raw, int16_t *curr_raw,
FAR foc_current_t *curr); foc_current_t *curr);
#ifdef CONFIG_MOTOR_FOC_TRACE #ifdef CONFIG_MOTOR_FOC_TRACE
static int board_foc_trace_init(FAR struct foc_dev_s *dev); static int board_foc_trace_init(struct foc_dev_s *dev);
static void board_foc_trace(FAR struct foc_dev_s *dev, int type, bool state); static void board_foc_trace(struct foc_dev_s *dev, int type, bool state);
#endif #endif
/**************************************************************************** /****************************************************************************
@@ -158,7 +158,7 @@ static struct stm32_foc_board_s g_stm32_foc_board =
/* Global pointer to the upper FOC driver */ /* Global pointer to the upper FOC driver */
static FAR struct foc_dev_s *g_foc_dev = NULL; static struct foc_dev_s *g_foc_dev = NULL;
/**************************************************************************** /****************************************************************************
* Private Functions * Private Functions
@@ -168,7 +168,7 @@ static FAR struct foc_dev_s *g_foc_dev = NULL;
* Name: board_foc_setup * Name: board_foc_setup
****************************************************************************/ ****************************************************************************/
static int board_foc_setup(FAR struct foc_dev_s *dev) static int board_foc_setup(struct foc_dev_s *dev)
{ {
DEBUGASSERT(dev); DEBUGASSERT(dev);
@@ -189,7 +189,7 @@ static int board_foc_setup(FAR struct foc_dev_s *dev)
* Name: board_foc_shutdown * Name: board_foc_shutdown
****************************************************************************/ ****************************************************************************/
static int board_foc_shutdown(FAR struct foc_dev_s *dev) static int board_foc_shutdown(struct foc_dev_s *dev)
{ {
DEBUGASSERT(dev); DEBUGASSERT(dev);
@@ -202,7 +202,7 @@ static int board_foc_shutdown(FAR struct foc_dev_s *dev)
* Name: board_foc_calibration * Name: board_foc_calibration
****************************************************************************/ ****************************************************************************/
static int board_foc_calibration(FAR struct foc_dev_s *dev, bool state) static int board_foc_calibration(struct foc_dev_s *dev, bool state)
{ {
DEBUGASSERT(dev); DEBUGASSERT(dev);
@@ -215,7 +215,7 @@ static int board_foc_calibration(FAR struct foc_dev_s *dev, bool state)
* Name: board_foc_fault_clear * Name: board_foc_fault_clear
****************************************************************************/ ****************************************************************************/
static int board_foc_fault_clear(FAR struct foc_dev_s *dev) static int board_foc_fault_clear(struct foc_dev_s *dev)
{ {
DEBUGASSERT(dev); DEBUGASSERT(dev);
@@ -228,7 +228,7 @@ static int board_foc_fault_clear(FAR struct foc_dev_s *dev)
* Name: board_foc_pwm_start * Name: board_foc_pwm_start
****************************************************************************/ ****************************************************************************/
static int board_foc_pwm_start(FAR struct foc_dev_s *dev, bool state) static int board_foc_pwm_start(struct foc_dev_s *dev, bool state)
{ {
DEBUGASSERT(dev); DEBUGASSERT(dev);
@@ -251,9 +251,9 @@ static int board_foc_pwm_start(FAR struct foc_dev_s *dev, bool state)
* Name: board_foc_current_get * Name: board_foc_current_get
****************************************************************************/ ****************************************************************************/
static int board_foc_current_get(FAR struct foc_dev_s *dev, static int board_foc_current_get(struct foc_dev_s *dev,
FAR int16_t *curr_raw, int16_t *curr_raw,
FAR foc_current_t *curr) foc_current_t *curr)
{ {
DEBUGASSERT(dev); DEBUGASSERT(dev);
DEBUGASSERT(curr_raw); DEBUGASSERT(curr_raw);
@@ -273,7 +273,7 @@ static int board_foc_current_get(FAR struct foc_dev_s *dev,
* Name: board_foc_trace_init * Name: board_foc_trace_init
****************************************************************************/ ****************************************************************************/
static int board_foc_trace_init(FAR struct foc_dev_s *dev) static int board_foc_trace_init(struct foc_dev_s *dev)
{ {
DEBUGASSERT(dev); DEBUGASSERT(dev);
@@ -293,7 +293,7 @@ static int board_foc_trace_init(FAR struct foc_dev_s *dev)
* Name: board_foc_trace * Name: board_foc_trace
****************************************************************************/ ****************************************************************************/
static void board_foc_trace(FAR struct foc_dev_s *dev, int type, bool state) static void board_foc_trace(struct foc_dev_s *dev, int type, bool state)
{ {
DEBUGASSERT(dev); DEBUGASSERT(dev);
@@ -351,10 +351,10 @@ static void board_foc_trace(FAR struct foc_dev_s *dev, int type, bool state)
* Name: board_ihm07m1_initialize * Name: board_ihm07m1_initialize
****************************************************************************/ ****************************************************************************/
int board_ihm07m1_initialize(FAR struct stm32_foc_adc_s *adc_cfg) int board_ihm07m1_initialize(struct stm32_foc_adc_s *adc_cfg)
{ {
FAR struct foc_dev_s *foc = NULL; struct foc_dev_s *foc = NULL;
int ret = OK; int ret = OK;
DEBUGASSERT(adc_cfg); DEBUGASSERT(adc_cfg);
@@ -407,9 +407,9 @@ errout:
int stm32_adc_setup(void) int stm32_adc_setup(void)
{ {
FAR struct adc_dev_s *adc = NULL; struct adc_dev_s *adc = NULL;
int ret = OK; int ret = OK;
static bool initialized = false; static bool initialized = false;
/* Initialize only once */ /* Initialize only once */
+27 -27
View File
@@ -113,17 +113,17 @@
* Private Function Protototypes * Private Function Protototypes
****************************************************************************/ ****************************************************************************/
static int board_foc_setup(FAR struct foc_dev_s *dev); static int board_foc_setup(struct foc_dev_s *dev);
static int board_foc_shutdown(FAR struct foc_dev_s *dev); static int board_foc_shutdown(struct foc_dev_s *dev);
static int board_foc_calibration(FAR struct foc_dev_s *dev, bool state); static int board_foc_calibration(struct foc_dev_s *dev, bool state);
static int board_foc_fault_clear(FAR struct foc_dev_s *dev); static int board_foc_fault_clear(struct foc_dev_s *dev);
static int board_foc_pwm_start(FAR struct foc_dev_s *dev, bool state); static int board_foc_pwm_start(struct foc_dev_s *dev, bool state);
static int board_foc_current_get(FAR struct foc_dev_s *dev, static int board_foc_current_get(struct foc_dev_s *dev,
FAR int16_t *curr_raw, int16_t *curr_raw,
FAR foc_current_t *curr); foc_current_t *curr);
#ifdef CONFIG_MOTOR_FOC_TRACE #ifdef CONFIG_MOTOR_FOC_TRACE
static int board_foc_trace_init(FAR struct foc_dev_s *dev); static int board_foc_trace_init(struct foc_dev_s *dev);
static void board_foc_trace(FAR struct foc_dev_s *dev, int type, bool state); static void board_foc_trace(struct foc_dev_s *dev, int type, bool state);
#endif #endif
/**************************************************************************** /****************************************************************************
@@ -166,7 +166,7 @@ static struct stm32_foc_board_s g_stm32_foc_board =
/* Global pointer to the upper FOC driver */ /* Global pointer to the upper FOC driver */
static FAR struct foc_dev_s *g_foc_dev = NULL; static struct foc_dev_s *g_foc_dev = NULL;
/**************************************************************************** /****************************************************************************
* Private Functions * Private Functions
@@ -176,7 +176,7 @@ static FAR struct foc_dev_s *g_foc_dev = NULL;
* Name: board_foc_setup * Name: board_foc_setup
****************************************************************************/ ****************************************************************************/
static int board_foc_setup(FAR struct foc_dev_s *dev) static int board_foc_setup(struct foc_dev_s *dev)
{ {
DEBUGASSERT(dev); DEBUGASSERT(dev);
@@ -189,7 +189,7 @@ static int board_foc_setup(FAR struct foc_dev_s *dev)
* Name: board_foc_shutdown * Name: board_foc_shutdown
****************************************************************************/ ****************************************************************************/
static int board_foc_shutdown(FAR struct foc_dev_s *dev) static int board_foc_shutdown(struct foc_dev_s *dev)
{ {
DEBUGASSERT(dev); DEBUGASSERT(dev);
@@ -202,7 +202,7 @@ static int board_foc_shutdown(FAR struct foc_dev_s *dev)
* Name: board_foc_calibration * Name: board_foc_calibration
****************************************************************************/ ****************************************************************************/
static int board_foc_calibration(FAR struct foc_dev_s *dev, bool state) static int board_foc_calibration(struct foc_dev_s *dev, bool state)
{ {
DEBUGASSERT(dev); DEBUGASSERT(dev);
@@ -215,7 +215,7 @@ static int board_foc_calibration(FAR struct foc_dev_s *dev, bool state)
* Name: board_foc_fault_clear * Name: board_foc_fault_clear
****************************************************************************/ ****************************************************************************/
static int board_foc_fault_clear(FAR struct foc_dev_s *dev) static int board_foc_fault_clear(struct foc_dev_s *dev)
{ {
DEBUGASSERT(dev); DEBUGASSERT(dev);
@@ -228,7 +228,7 @@ static int board_foc_fault_clear(FAR struct foc_dev_s *dev)
* Name: board_foc_pwm_start * Name: board_foc_pwm_start
****************************************************************************/ ****************************************************************************/
static int board_foc_pwm_start(FAR struct foc_dev_s *dev, bool state) static int board_foc_pwm_start(struct foc_dev_s *dev, bool state)
{ {
DEBUGASSERT(dev); DEBUGASSERT(dev);
@@ -241,9 +241,9 @@ static int board_foc_pwm_start(FAR struct foc_dev_s *dev, bool state)
* Name: board_foc_current_get * Name: board_foc_current_get
****************************************************************************/ ****************************************************************************/
static int board_foc_current_get(FAR struct foc_dev_s *dev, static int board_foc_current_get(struct foc_dev_s *dev,
FAR int16_t *curr_raw, int16_t *curr_raw,
FAR foc_current_t *curr) foc_current_t *curr)
{ {
DEBUGASSERT(dev); DEBUGASSERT(dev);
DEBUGASSERT(curr_raw); DEBUGASSERT(curr_raw);
@@ -263,7 +263,7 @@ static int board_foc_current_get(FAR struct foc_dev_s *dev,
* Name: board_foc_trace_init * Name: board_foc_trace_init
****************************************************************************/ ****************************************************************************/
static int board_foc_trace_init(FAR struct foc_dev_s *dev) static int board_foc_trace_init(struct foc_dev_s *dev)
{ {
DEBUGASSERT(dev); DEBUGASSERT(dev);
@@ -283,7 +283,7 @@ static int board_foc_trace_init(FAR struct foc_dev_s *dev)
* Name: board_foc_trace * Name: board_foc_trace
****************************************************************************/ ****************************************************************************/
static void board_foc_trace(FAR struct foc_dev_s *dev, int type, bool state) static void board_foc_trace(struct foc_dev_s *dev, int type, bool state)
{ {
DEBUGASSERT(dev); DEBUGASSERT(dev);
@@ -341,10 +341,10 @@ static void board_foc_trace(FAR struct foc_dev_s *dev, int type, bool state)
* Name: board_ihm08m1_initialize * Name: board_ihm08m1_initialize
****************************************************************************/ ****************************************************************************/
int board_ihm08m1_initialize(FAR struct stm32_foc_adc_s *adc_cfg) int board_ihm08m1_initialize(struct stm32_foc_adc_s *adc_cfg)
{ {
FAR struct foc_dev_s *foc = NULL; struct foc_dev_s *foc = NULL;
int ret = OK; int ret = OK;
/* Initialize only once */ /* Initialize only once */
@@ -395,9 +395,9 @@ errout:
int stm32_adc_setup(void) int stm32_adc_setup(void)
{ {
FAR struct adc_dev_s *adc = NULL; struct adc_dev_s *adc = NULL;
int ret = OK; int ret = OK;
static bool initialized = false; static bool initialized = false;
/* Initialize only once */ /* Initialize only once */
+27 -27
View File
@@ -103,17 +103,17 @@
* Private Function Protototypes * Private Function Protototypes
****************************************************************************/ ****************************************************************************/
static int board_foc_setup(FAR struct foc_dev_s *dev); static int board_foc_setup(struct foc_dev_s *dev);
static int board_foc_shutdown(FAR struct foc_dev_s *dev); static int board_foc_shutdown(struct foc_dev_s *dev);
static int board_foc_calibration(FAR struct foc_dev_s *dev, bool state); static int board_foc_calibration(struct foc_dev_s *dev, bool state);
static int board_foc_fault_clear(FAR struct foc_dev_s *dev); static int board_foc_fault_clear(struct foc_dev_s *dev);
static int board_foc_pwm_start(FAR struct foc_dev_s *dev, bool state); static int board_foc_pwm_start(struct foc_dev_s *dev, bool state);
static int board_foc_current_get(FAR struct foc_dev_s *dev, static int board_foc_current_get(struct foc_dev_s *dev,
FAR int16_t *curr_raw, int16_t *curr_raw,
FAR foc_current_t *curr); foc_current_t *curr);
#ifdef CONFIG_MOTOR_FOC_TRACE #ifdef CONFIG_MOTOR_FOC_TRACE
static int board_foc_trace_init(FAR struct foc_dev_s *dev); static int board_foc_trace_init(struct foc_dev_s *dev);
static void board_foc_trace(FAR struct foc_dev_s *dev, int type, bool state); static void board_foc_trace(struct foc_dev_s *dev, int type, bool state);
#endif #endif
/**************************************************************************** /****************************************************************************
@@ -156,7 +156,7 @@ static struct stm32_foc_board_s g_stm32_foc_board =
/* Global pointer to the upper FOC driver */ /* Global pointer to the upper FOC driver */
static FAR struct foc_dev_s *g_foc_dev = NULL; static struct foc_dev_s *g_foc_dev = NULL;
/**************************************************************************** /****************************************************************************
* Private Functions * Private Functions
@@ -166,7 +166,7 @@ static FAR struct foc_dev_s *g_foc_dev = NULL;
* Name: board_foc_setup * Name: board_foc_setup
****************************************************************************/ ****************************************************************************/
static int board_foc_setup(FAR struct foc_dev_s *dev) static int board_foc_setup(struct foc_dev_s *dev)
{ {
DEBUGASSERT(dev); DEBUGASSERT(dev);
@@ -187,7 +187,7 @@ static int board_foc_setup(FAR struct foc_dev_s *dev)
* Name: board_foc_shutdown * Name: board_foc_shutdown
****************************************************************************/ ****************************************************************************/
static int board_foc_shutdown(FAR struct foc_dev_s *dev) static int board_foc_shutdown(struct foc_dev_s *dev)
{ {
DEBUGASSERT(dev); DEBUGASSERT(dev);
@@ -200,7 +200,7 @@ static int board_foc_shutdown(FAR struct foc_dev_s *dev)
* Name: board_foc_calibration * Name: board_foc_calibration
****************************************************************************/ ****************************************************************************/
static int board_foc_calibration(FAR struct foc_dev_s *dev, bool state) static int board_foc_calibration(struct foc_dev_s *dev, bool state)
{ {
DEBUGASSERT(dev); DEBUGASSERT(dev);
@@ -213,7 +213,7 @@ static int board_foc_calibration(FAR struct foc_dev_s *dev, bool state)
* Name: board_foc_fault_clear * Name: board_foc_fault_clear
****************************************************************************/ ****************************************************************************/
static int board_foc_fault_clear(FAR struct foc_dev_s *dev) static int board_foc_fault_clear(struct foc_dev_s *dev)
{ {
DEBUGASSERT(dev); DEBUGASSERT(dev);
@@ -226,7 +226,7 @@ static int board_foc_fault_clear(FAR struct foc_dev_s *dev)
* Name: board_foc_pwm_start * Name: board_foc_pwm_start
****************************************************************************/ ****************************************************************************/
static int board_foc_pwm_start(FAR struct foc_dev_s *dev, bool state) static int board_foc_pwm_start(struct foc_dev_s *dev, bool state)
{ {
DEBUGASSERT(dev); DEBUGASSERT(dev);
@@ -249,9 +249,9 @@ static int board_foc_pwm_start(FAR struct foc_dev_s *dev, bool state)
* Name: board_foc_current_get * Name: board_foc_current_get
****************************************************************************/ ****************************************************************************/
static int board_foc_current_get(FAR struct foc_dev_s *dev, static int board_foc_current_get(struct foc_dev_s *dev,
FAR int16_t *curr_raw, int16_t *curr_raw,
FAR foc_current_t *curr) foc_current_t *curr)
{ {
DEBUGASSERT(dev); DEBUGASSERT(dev);
DEBUGASSERT(curr_raw); DEBUGASSERT(curr_raw);
@@ -271,7 +271,7 @@ static int board_foc_current_get(FAR struct foc_dev_s *dev,
* Name: board_foc_trace_init * Name: board_foc_trace_init
****************************************************************************/ ****************************************************************************/
static int board_foc_trace_init(FAR struct foc_dev_s *dev) static int board_foc_trace_init(struct foc_dev_s *dev)
{ {
DEBUGASSERT(dev); DEBUGASSERT(dev);
@@ -291,7 +291,7 @@ static int board_foc_trace_init(FAR struct foc_dev_s *dev)
* Name: board_foc_trace * Name: board_foc_trace
****************************************************************************/ ****************************************************************************/
static void board_foc_trace(FAR struct foc_dev_s *dev, int type, bool state) static void board_foc_trace(struct foc_dev_s *dev, int type, bool state)
{ {
DEBUGASSERT(dev); DEBUGASSERT(dev);
@@ -349,10 +349,10 @@ static void board_foc_trace(FAR struct foc_dev_s *dev, int type, bool state)
* Name: board_ihm16m1_initialize * Name: board_ihm16m1_initialize
****************************************************************************/ ****************************************************************************/
int board_ihm16m1_initialize(FAR struct stm32_foc_adc_s *adc_cfg) int board_ihm16m1_initialize(struct stm32_foc_adc_s *adc_cfg)
{ {
FAR struct foc_dev_s *foc = NULL; struct foc_dev_s *foc = NULL;
int ret = OK; int ret = OK;
DEBUGASSERT(adc_cfg); DEBUGASSERT(adc_cfg);
@@ -405,9 +405,9 @@ errout:
int stm32_adc_setup(void) int stm32_adc_setup(void)
{ {
FAR struct adc_dev_s *adc = NULL; struct adc_dev_s *adc = NULL;
int ret = OK; int ret = OK;
static bool initialized = false; static bool initialized = false;
/* Initialize only once */ /* Initialize only once */
+1 -1
View File
@@ -76,7 +76,7 @@
int board_ina219_initialize(int devno, int busno) int board_ina219_initialize(int devno, int busno)
{ {
FAR struct i2c_master_s *i2c; struct i2c_master_s *i2c;
char devpath[12]; char devpath[12];
int ret; int ret;
+2 -2
View File
@@ -43,7 +43,7 @@
* Private Function Prototypes * Private Function Prototypes
****************************************************************************/ ****************************************************************************/
static int l3gd20_attach(FAR struct l3gd20_config_s * cfg, xcpt_t irq); static int l3gd20_attach(struct l3gd20_config_s * cfg, xcpt_t irq);
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
@@ -69,7 +69,7 @@ static struct l3gd20_config_s g_l3gd20_config =
* *
****************************************************************************/ ****************************************************************************/
static int l3gd20_attach(FAR struct l3gd20_config_s *cfg, xcpt_t irq) static int l3gd20_attach(struct l3gd20_config_s *cfg, xcpt_t irq)
{ {
return stm32_gpiosetevent(BOARD_L3GD20_GPIO_DREADY, true, false, return stm32_gpiosetevent(BOARD_L3GD20_GPIO_DREADY, true, false,
true, irq, NULL); true, irq, NULL);
@@ -58,9 +58,9 @@
int board_lcd_backpack_init(int devno, int busno, int rows, int cols) int board_lcd_backpack_init(int devno, int busno, int rows, int cols)
{ {
FAR struct pcf8574_lcd_backpack_config_s cfg = struct pcf8574_lcd_backpack_config_s cfg =
LCD_I2C_BACKPACK_CFG_SAINSMART; LCD_I2C_BACKPACK_CFG_SAINSMART;
FAR struct i2c_master_s *i2c; struct i2c_master_s *i2c;
char devpath[12]; char devpath[12];
int ret; int ret;
+1 -1
View File
@@ -60,7 +60,7 @@
* *
****************************************************************************/ ****************************************************************************/
int attach_disc_lis3dsh(FAR struct lis3dsh_config_s *config, int attach_disc_lis3dsh(struct lis3dsh_config_s *config,
xcpt_t interrupt_handler) xcpt_t interrupt_handler)
{ {
return stm32_gpiosetevent(BOARD_LIS3DSH_GPIO_EXT0, true, false, false, return stm32_gpiosetevent(BOARD_LIS3DSH_GPIO_EXT0, true, false, false,
+1 -1
View File
@@ -78,7 +78,7 @@
int board_lm75_initialize(int devno, int busno) int board_lm75_initialize(int devno, int busno)
{ {
FAR struct i2c_master_s *i2c; struct i2c_master_s *i2c;
char devpath[12]; char devpath[12];
int ret; int ret;
+1 -1
View File
@@ -56,7 +56,7 @@
int board_max31855_initialize(int devno, int busno) int board_max31855_initialize(int devno, int busno)
{ {
FAR struct spi_dev_s *spi; struct spi_dev_s *spi;
char devpath[12]; char devpath[12];
int ret; int ret;
+1 -1
View File
@@ -77,7 +77,7 @@
int board_max6675_initialize(int devno, int busno) int board_max6675_initialize(int devno, int busno)
{ {
FAR struct spi_dev_s *spi; struct spi_dev_s *spi;
char devpath[12]; char devpath[12];
int ret; int ret;
+1 -1
View File
@@ -61,7 +61,7 @@
int board_mlx90614_initialize(int devno, int busno) int board_mlx90614_initialize(int devno, int busno)
{ {
FAR struct i2c_master_s *i2c; struct i2c_master_s *i2c;
char devpath[12]; char devpath[12];
int ret; int ret;
+1 -1
View File
@@ -59,7 +59,7 @@
int board_mpl115a_initialize(int devno, int busno) int board_mpl115a_initialize(int devno, int busno)
{ {
FAR struct spi_dev_s *spi; struct spi_dev_s *spi;
char devpath[12]; char devpath[12];
int ret; int ret;
+5 -5
View File
@@ -52,21 +52,21 @@
* Private Function Prototypes * Private Function Prototypes
****************************************************************************/ ****************************************************************************/
static int nrf24l01_irq_attach(xcpt_t isr, FAR void *arg); static int nrf24l01_irq_attach(xcpt_t isr, void *arg);
static void nrf24l01_chip_enable(bool enable); static void nrf24l01_chip_enable(bool enable);
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
static FAR struct nrf24l01_config_s nrf_cfg = static struct nrf24l01_config_s nrf_cfg =
{ {
.irqattach = nrf24l01_irq_attach, .irqattach = nrf24l01_irq_attach,
.chipenable = nrf24l01_chip_enable, .chipenable = nrf24l01_chip_enable,
}; };
static xcpt_t g_isr; static xcpt_t g_isr;
static FAR void *g_arg; static void *g_arg;
/**************************************************************************** /****************************************************************************
* Public Data * Public Data
@@ -76,7 +76,7 @@ static FAR void *g_arg;
* Private Functions * Private Functions
****************************************************************************/ ****************************************************************************/
static int nrf24l01_irq_attach(xcpt_t isr, FAR void *arg) static int nrf24l01_irq_attach(xcpt_t isr, void *arg)
{ {
wlinfo("Attach IRQ\n"); wlinfo("Attach IRQ\n");
g_isr = isr; g_isr = isr;
@@ -112,7 +112,7 @@ static void nrf24l01_chip_enable(bool enable)
int board_nrf24l01_initialize(int busno) int board_nrf24l01_initialize(int busno)
{ {
FAR struct spi_dev_s *spidev; struct spi_dev_s *spidev;
int result; int result;
/* Setup CE & IRQ line IOs */ /* Setup CE & IRQ line IOs */
+1 -1
View File
@@ -82,7 +82,7 @@
int board_nunchuck_initialize(int devno, int busno) int board_nunchuck_initialize(int devno, int busno)
{ {
FAR struct i2c_master_s *i2c; struct i2c_master_s *i2c;
char devpath[15]; char devpath[15];
int ret; int ret;
+4 -4
View File
@@ -39,7 +39,7 @@
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
static FAR struct lcd_dev_s *g_lcddev; static struct lcd_dev_s *g_lcddev;
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
@@ -61,7 +61,7 @@ static FAR struct lcd_dev_s *g_lcddev;
#ifdef CONFIG_LCD_SSD1306_I2C #ifdef CONFIG_LCD_SSD1306_I2C
int board_ssd1306_initialize(int busno) int board_ssd1306_initialize(int busno)
{ {
FAR struct i2c_master_s *i2c; struct i2c_master_s *i2c;
const int devno = 0; const int devno = 0;
/* Initialize I2C */ /* Initialize I2C */
@@ -109,7 +109,7 @@ int board_ssd1306_initialize(int busno)
#ifdef CONFIG_LCD_SSD1306_SPI #ifdef CONFIG_LCD_SSD1306_SPI
int board_ssd1306_initialize(int busno) int board_ssd1306_initialize(int busno)
{ {
FAR struct spi_dev_s *spi; struct spi_dev_s *spi;
const int devno = 0; const int devno = 0;
/* Initialize SPI */ /* Initialize SPI */
@@ -152,7 +152,7 @@ int board_ssd1306_initialize(int busno)
* *
****************************************************************************/ ****************************************************************************/
FAR struct lcd_dev_s *board_ssd1306_getdev(void) struct lcd_dev_s *board_ssd1306_getdev(void)
{ {
return g_lcddev; return g_lcddev;
} }
+1 -1
View File
@@ -82,7 +82,7 @@
int board_veml6070_initialize(int devno, int busno) int board_veml6070_initialize(int devno, int busno)
{ {
FAR struct i2c_master_s *i2c; struct i2c_master_s *i2c;
char devpath[14]; char devpath[14];
int ret; int ret;
+1 -1
View File
@@ -82,7 +82,7 @@
int board_ws2812_initialize(int devno, int spino, uint16_t nleds) int board_ws2812_initialize(int devno, int spino, uint16_t nleds)
{ {
FAR struct spi_dev_s *spi; struct spi_dev_s *spi;
char devpath[13]; char devpath[13];
int ret; int ret;
+16 -16
View File
@@ -60,9 +60,9 @@ struct stm32_xen1210config_s
/* Additional private definitions only known to this driver */ /* Additional private definitions only known to this driver */
XEN1210_HANDLE handle; /* The XEN1210 driver handle */ XEN1210_HANDLE handle; /* The XEN1210 driver handle */
xen1210_handler_t handler; /* The XEN1210 interrupt handler */ xen1210_handler_t handler; /* The XEN1210 interrupt handler */
FAR void *arg; /* Argument to pass to the interrupt handler */ void *arg; /* Argument to pass to the interrupt handler */
}; };
/**************************************************************************** /****************************************************************************
@@ -78,10 +78,10 @@ struct stm32_xen1210config_s
* clear - Acknowledge/clear any pending GPIO interrupt * clear - Acknowledge/clear any pending GPIO interrupt
*/ */
static int xen1210_attach(FAR struct xen1210_config_s *state, static int xen1210_attach(struct xen1210_config_s *state,
xen1210_handler_t handler, FAR void *arg); xen1210_handler_t handler, void *arg);
static void xen1210_enable(FAR struct xen1210_config_s *state, bool enable); static void xen1210_enable(struct xen1210_config_s *state, bool enable);
static void xen1210_clear(FAR struct xen1210_config_s *state); static void xen1210_clear(struct xen1210_config_s *state);
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
@@ -114,7 +114,7 @@ static struct stm32_xen1210config_s g_xen1210config =
/* This is the XEN1210 Interrupt handler */ /* This is the XEN1210 Interrupt handler */
static int xen1210_interrupt(int irq, FAR void *context, FAR void *arg) static int xen1210_interrupt(int irq, void *context, void *arg)
{ {
/* Verify that we have a handler attached */ /* Verify that we have a handler attached */
@@ -137,11 +137,11 @@ static int xen1210_interrupt(int irq, FAR void *context, FAR void *arg)
* clear - Acknowledge/clear any pending GPIO interrupt * clear - Acknowledge/clear any pending GPIO interrupt
*/ */
static int xen1210_attach(FAR struct xen1210_config_s *state, static int xen1210_attach(struct xen1210_config_s *state,
xen1210_handler_t handler, FAR void *arg) xen1210_handler_t handler, void *arg)
{ {
FAR struct stm32_xen1210config_s *priv = struct stm32_xen1210config_s *priv =
(FAR struct stm32_xen1210config_s *)state; (struct stm32_xen1210config_s *)state;
sninfo("Saving handler %p\n", handler); sninfo("Saving handler %p\n", handler);
DEBUGASSERT(priv); DEBUGASSERT(priv);
@@ -155,7 +155,7 @@ static int xen1210_attach(FAR struct xen1210_config_s *state,
return OK; return OK;
} }
static void xen1210_enable(FAR struct xen1210_config_s *state, bool enable) static void xen1210_enable(struct xen1210_config_s *state, bool enable)
{ {
irqstate_t flags; irqstate_t flags;
@@ -184,7 +184,7 @@ static void xen1210_enable(FAR struct xen1210_config_s *state, bool enable)
leave_critical_section(flags); leave_critical_section(flags);
} }
static void xen1210_clear(FAR struct xen1210_config_s *state) static void xen1210_clear(struct xen1210_config_s *state)
{ {
/* Does nothing */ /* Does nothing */
} }
@@ -257,7 +257,7 @@ static int xen1210_pwm_setup(void)
int board_xen1210_initialize(int devno, int busno) int board_xen1210_initialize(int devno, int busno)
{ {
FAR struct spi_dev_s *dev; struct spi_dev_s *dev;
int ret; int ret;
/* Check if we are already initialized */ /* Check if we are already initialized */
@@ -289,7 +289,7 @@ int board_xen1210_initialize(int devno, int busno)
g_xen1210config.handle = g_xen1210config.handle =
xen1210_instantiate(dev, xen1210_instantiate(dev,
(FAR struct xen1210_config_s *) (struct xen1210_config_s *)
&g_xen1210config); &g_xen1210config);
if (!g_xen1210config.handle) if (!g_xen1210config.handle)
{ {
@@ -39,11 +39,11 @@
* Private Function Prototypes * Private Function Prototypes
****************************************************************************/ ****************************************************************************/
static void zcross_enable(FAR const struct zc_lowerhalf_s *lower, static void zcross_enable(const struct zc_lowerhalf_s *lower,
zc_interrupt_t handler, FAR void *arg); zc_interrupt_t handler, void *arg);
static void zcross_disable(void); static void zcross_disable(void);
static int zcross_interrupt(int irq, FAR void *context, FAR void *arg); static int zcross_interrupt(int irq, void *context, void *arg);
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
@@ -52,7 +52,7 @@ static int zcross_interrupt(int irq, FAR void *context, FAR void *arg);
/* Current interrupt handler and argument */ /* Current interrupt handler and argument */
static zc_interrupt_t g_zcrosshandler; static zc_interrupt_t g_zcrosshandler;
static FAR void *g_zcrossarg; static void *g_zcrossarg;
/* This is the zero cross lower half driver interface */ /* This is the zero cross lower half driver interface */
@@ -74,8 +74,8 @@ static struct zc_lowerhalf_s g_zcrosslower =
* *
****************************************************************************/ ****************************************************************************/
static void zcross_enable(FAR const struct zc_lowerhalf_s *lower, static void zcross_enable(const struct zc_lowerhalf_s *lower,
zc_interrupt_t handler, FAR void *arg) zc_interrupt_t handler, void *arg)
{ {
irqstate_t flags; irqstate_t flags;
bool rising = false; bool rising = false;
@@ -134,7 +134,7 @@ static void zcross_disable(void)
* *
****************************************************************************/ ****************************************************************************/
static int zcross_interrupt(int irq, FAR void *context, FAR void *arg) static int zcross_interrupt(int irq, void *context, void *arg)
{ {
DEBUGASSERT(g_zcrosshandler != NULL); DEBUGASSERT(g_zcrosshandler != NULL);
if (g_zcrosshandler) if (g_zcrosshandler)

Some files were not shown because too many files have changed in this diff Show More