arch/arm: Remove FAR and CODE from board folder(3)
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
a3c9b413d8
commit
c628529e2d
@ -45,10 +45,10 @@
|
||||
* 10 DISPLAY_RESET 10 PB05 PORT 10 PB15 PORT
|
||||
* ----------------- ---------------------- ----------------------
|
||||
* 11 N/C 11 PA08 SERCOM2 PAD[0] 11 PA08 SERCOM2 PAD[0]
|
||||
* I<EFBFBD>C SDA I<EFBFBD>C SDA
|
||||
* I²C SDA I²C SDA
|
||||
* ----------------- ---------------------- ----------------------
|
||||
* 12 N/C 12 PA09 SERCOM2 PAD[1] 12 PA09 SERCOM2 PAD[1]
|
||||
* I<EFBFBD>C SCL I<EFBFBD>C SCL
|
||||
* I²C SCL I²C SCL
|
||||
* ----------------- ---------------------- ----------------------
|
||||
* 13 N/C 13 PB09 SERCOM4 PAD[1] 13 PB11 SERCOM4 PAD[1]
|
||||
* 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;
|
||||
struct lcd_dev_s *dev;
|
||||
FAR struct spi_dev_s *spi;
|
||||
FAR struct lcd_dev_s *dev;
|
||||
|
||||
/* Configure the OLED PORTs. This initial configuration is RESET low,
|
||||
* putting the OLED into reset state.
|
||||
|
@ -57,21 +57,21 @@ struct stm32_mwinfo_s
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
static int adau1961_attach(FAR const struct adau1961_lower_s *lower,
|
||||
adau1961_handler_t isr, FAR void *arg)
|
||||
static int adau1961_attach(const struct adau1961_lower_s *lower,
|
||||
adau1961_handler_t isr, void *arg)
|
||||
{
|
||||
audinfo("TODO\n");
|
||||
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)
|
||||
{
|
||||
audinfo("TODO\n");
|
||||
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");
|
||||
}
|
||||
@ -125,9 +125,9 @@ static struct stm32_mwinfo_s g_adau1961info =
|
||||
|
||||
int stm32_adau1961_initialize(int minor)
|
||||
{
|
||||
FAR struct audio_lowerhalf_s *adau1961;
|
||||
FAR struct i2c_master_s *i2c;
|
||||
FAR struct i2s_dev_s *i2s;
|
||||
struct audio_lowerhalf_s *adau1961;
|
||||
struct i2c_master_s *i2c;
|
||||
struct i2s_dev_s *i2s;
|
||||
static bool initialized = false;
|
||||
char devname[12];
|
||||
int ret;
|
||||
|
@ -54,7 +54,7 @@
|
||||
void stm32_boardinitialize(void)
|
||||
{
|
||||
#ifdef CONFIG_SCHED_CRITMONITOR
|
||||
up_perf_init((FAR void *)STM32_SYSCLK_FREQUENCY);
|
||||
up_perf_init((void *)STM32_SYSCLK_FREQUENCY);
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || \
|
||||
|
@ -72,7 +72,7 @@
|
||||
int stm32_bringup(void)
|
||||
{
|
||||
#ifdef HAVE_RTC_DRIVER
|
||||
FAR struct rtc_lowerhalf_s *lower;
|
||||
struct rtc_lowerhalf_s *lower;
|
||||
#endif
|
||||
int ret = OK;
|
||||
|
||||
|
@ -131,7 +131,7 @@ uint32_t board_buttons(void)
|
||||
****************************************************************************/
|
||||
|
||||
#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;
|
||||
|
||||
|
@ -52,7 +52,7 @@
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
static FAR struct sdio_dev_s *g_sdio_dev;
|
||||
static struct sdio_dev_s *g_sdio_dev;
|
||||
#ifdef HAVE_NCD
|
||||
static bool g_sd_inserted = 0xff; /* Impossible value */
|
||||
#endif
|
||||
@ -70,7 +70,7 @@ static bool g_sd_inserted = 0xff; /* Impossible value */
|
||||
****************************************************************************/
|
||||
|
||||
#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;
|
||||
|
||||
|
@ -252,7 +252,7 @@ int stm32_usbhost_initialize(void)
|
||||
uinfo("Start usbhost_waiter\n");
|
||||
ret = kthread_create("usbhost", CONFIG_AXOLOTI_USBHOST_PRIO,
|
||||
CONFIG_AXOLOTI_USBHOST_STACKSIZE,
|
||||
(main_t)usbhost_waiter, (FAR char *const *)NULL);
|
||||
(main_t)usbhost_waiter, (char *const *)NULL);
|
||||
return ret < 0 ? -ENOEXEC : OK;
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ uint32_t board_buttons(void)
|
||||
****************************************************************************/
|
||||
|
||||
#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;
|
||||
|
||||
|
@ -195,17 +195,17 @@
|
||||
* Private Function Protototypes
|
||||
****************************************************************************/
|
||||
|
||||
static int board_foc_setup(FAR struct foc_dev_s *dev);
|
||||
static int board_foc_shutdown(FAR struct foc_dev_s *dev);
|
||||
static int board_foc_calibration(FAR struct foc_dev_s *dev, bool state);
|
||||
static int board_foc_fault_clear(FAR struct foc_dev_s *dev);
|
||||
static int board_foc_pwm_start(FAR struct foc_dev_s *dev, bool state);
|
||||
static int board_foc_current_get(FAR struct foc_dev_s *dev,
|
||||
FAR int16_t *curr_raw,
|
||||
FAR foc_current_t *curr);
|
||||
static int board_foc_setup(struct foc_dev_s *dev);
|
||||
static int board_foc_shutdown(struct foc_dev_s *dev);
|
||||
static int board_foc_calibration(struct foc_dev_s *dev, bool state);
|
||||
static int board_foc_fault_clear(struct foc_dev_s *dev);
|
||||
static int board_foc_pwm_start(struct foc_dev_s *dev, bool state);
|
||||
static int board_foc_current_get(struct foc_dev_s *dev,
|
||||
int16_t *curr_raw,
|
||||
foc_current_t *curr);
|
||||
#ifdef CONFIG_MOTOR_FOC_TRACE
|
||||
static int board_foc_trace_init(FAR struct foc_dev_s *dev);
|
||||
static void board_foc_trace(FAR struct foc_dev_s *dev, int type, bool state);
|
||||
static int board_foc_trace_init(struct foc_dev_s *dev);
|
||||
static void board_foc_trace(struct foc_dev_s *dev, int type, bool state);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@ -336,7 +336,7 @@ static struct stm32_foc_board_s g_stm32_foc_board =
|
||||
|
||||
/* 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
|
||||
@ -346,7 +346,7 @@ static FAR struct foc_dev_s *g_foc_dev = NULL;
|
||||
* 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;
|
||||
|
||||
@ -412,7 +412,7 @@ static int board_foc_setup(FAR struct foc_dev_s *dev)
|
||||
* 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);
|
||||
|
||||
@ -425,7 +425,7 @@ static int board_foc_shutdown(FAR struct foc_dev_s *dev)
|
||||
* 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);
|
||||
|
||||
@ -438,7 +438,7 @@ static int board_foc_calibration(FAR struct foc_dev_s *dev, bool state)
|
||||
* 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);
|
||||
|
||||
@ -451,7 +451,7 @@ static int board_foc_fault_clear(FAR struct foc_dev_s *dev)
|
||||
* 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);
|
||||
|
||||
@ -464,9 +464,9 @@ static int board_foc_pwm_start(FAR struct foc_dev_s *dev, bool state)
|
||||
* Name: board_foc_current_get
|
||||
****************************************************************************/
|
||||
|
||||
static int board_foc_current_get(FAR struct foc_dev_s *dev,
|
||||
FAR int16_t *curr_raw,
|
||||
FAR foc_current_t *curr)
|
||||
static int board_foc_current_get(struct foc_dev_s *dev,
|
||||
int16_t *curr_raw,
|
||||
foc_current_t *curr)
|
||||
{
|
||||
DEBUGASSERT(dev);
|
||||
DEBUGASSERT(curr_raw);
|
||||
@ -489,7 +489,7 @@ static int board_foc_current_get(FAR struct foc_dev_s *dev,
|
||||
* 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);
|
||||
|
||||
@ -504,7 +504,7 @@ static int board_foc_trace_init(FAR struct foc_dev_s *dev)
|
||||
* 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);
|
||||
|
||||
@ -531,8 +531,8 @@ static void board_foc_trace(FAR struct foc_dev_s *dev, int type, bool state)
|
||||
|
||||
int stm32_foc_setup(void)
|
||||
{
|
||||
FAR struct foc_dev_s *foc = NULL;
|
||||
int ret = OK;
|
||||
struct foc_dev_s *foc = NULL;
|
||||
int ret = OK;
|
||||
|
||||
/* Initialize only once */
|
||||
|
||||
@ -597,9 +597,9 @@ errout:
|
||||
|
||||
int stm32_adc_setup(void)
|
||||
{
|
||||
FAR struct adc_dev_s *adc = NULL;
|
||||
int ret = OK;
|
||||
static bool initialized = false;
|
||||
struct adc_dev_s *adc = NULL;
|
||||
int ret = OK;
|
||||
static bool initialized = false;
|
||||
|
||||
/* Initialize only once */
|
||||
|
||||
|
@ -96,7 +96,7 @@ int board_app_initialize(uintptr_t arg)
|
||||
|
||||
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);
|
||||
if (channel == NULL)
|
||||
{
|
||||
|
@ -51,10 +51,10 @@
|
||||
|
||||
struct stm32_automount_state_s
|
||||
{
|
||||
volatile automount_handler_t handler; /* Upper half handler */
|
||||
FAR void *arg; /* Handler argument */
|
||||
bool enable; /* Fake interrupt enable */
|
||||
bool pending; /* Set if there an event while disabled */
|
||||
volatile automount_handler_t handler; /* Upper half handler */
|
||||
void *arg; /* Handler argument */
|
||||
bool enable; /* Fake interrupt enable */
|
||||
bool pending; /* Set if there an event while disabled */
|
||||
};
|
||||
|
||||
/* 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 lower; /* Publicly visible part */
|
||||
uint8_t mmcsd; /* MB1_MMCSD_SLOTNO or MB2_MMCSD_SLOTNO */
|
||||
FAR struct stm32_automount_state_s *state; /* Changeable state */
|
||||
struct automount_lower_s lower; /* Publicly visible part */
|
||||
uint8_t mmcsd; /* MB1_MMCSD_SLOTNO or MB2_MMCSD_SLOTNO */
|
||||
struct stm32_automount_state_s *state; /* Changeable state */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static int stm32_attach(FAR const struct automount_lower_s *lower,
|
||||
automount_handler_t isr, FAR void *arg);
|
||||
static void stm32_enable(FAR const struct automount_lower_s *lower,
|
||||
static int stm32_attach(const struct automount_lower_s *lower,
|
||||
automount_handler_t isr, void *arg);
|
||||
static void stm32_enable(const struct automount_lower_s *lower,
|
||||
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
|
||||
@ -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,
|
||||
automount_handler_t isr, FAR void *arg)
|
||||
static int stm32_attach(const struct automount_lower_s *lower,
|
||||
automount_handler_t isr, void *arg)
|
||||
{
|
||||
FAR const struct stm32_automount_config_s *config;
|
||||
FAR struct stm32_automount_state_s *state;
|
||||
const struct stm32_automount_config_s *config;
|
||||
struct stm32_automount_state_s *state;
|
||||
|
||||
/* Recover references to our structure */
|
||||
|
||||
config = (FAR struct stm32_automount_config_s *)lower;
|
||||
config = (struct stm32_automount_config_s *)lower;
|
||||
DEBUGASSERT(config && 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)
|
||||
{
|
||||
FAR const struct stm32_automount_config_s *config;
|
||||
FAR struct stm32_automount_state_s *state;
|
||||
const struct stm32_automount_config_s *config;
|
||||
struct stm32_automount_state_s *state;
|
||||
irqstate_t flags;
|
||||
|
||||
/* Recover references to our structure */
|
||||
|
||||
config = (FAR struct stm32_automount_config_s *)lower;
|
||||
config = (struct stm32_automount_config_s *)lower;
|
||||
DEBUGASSERT(config && 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);
|
||||
|
||||
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)
|
||||
{
|
||||
FAR void *handle;
|
||||
void *handle;
|
||||
|
||||
finfo("Initializing automounter(s)\n");
|
||||
|
||||
@ -323,8 +323,8 @@ int stm32_automount_initialize(void)
|
||||
|
||||
void stm32_automount_event(int slotno, bool inserted)
|
||||
{
|
||||
FAR const struct stm32_automount_config_s *config;
|
||||
FAR struct stm32_automount_state_s *state;
|
||||
const struct stm32_automount_config_s *config;
|
||||
struct stm32_automount_state_s *state;
|
||||
|
||||
#ifdef CONFIG_CLICKER2_STM32_MB1_MMCSD_AUTOMOUNT
|
||||
/* Is this a change in the MB1 MMCSD slot insertion state? */
|
||||
|
@ -110,7 +110,7 @@ uint32_t board_buttons(void)
|
||||
****************************************************************************/
|
||||
|
||||
#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;
|
||||
|
||||
|
@ -105,7 +105,7 @@ struct stm32_mmcsd_state_s
|
||||
xcpt_t handler; /* Interrupt handler */
|
||||
bool cd; /* TRUE: card is inserted */
|
||||
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 */
|
||||
};
|
||||
|
||||
@ -114,19 +114,19 @@ struct stm32_mmcsd_state_s
|
||||
****************************************************************************/
|
||||
|
||||
static bool stm32_cardinserted_internal(struct stm32_mmcsd_state_s *state);
|
||||
static void stm32_mmcsd_carddetect(FAR void *arg);
|
||||
static int stm32_mmcsd_setup(FAR struct stm32_mmcsd_state_s *);
|
||||
static void stm32_mmcsd_carddetect(void *arg);
|
||||
static int stm32_mmcsd_setup(struct stm32_mmcsd_state_s *);
|
||||
|
||||
#ifdef CONFIG_CLICKER2_STM32_MB1_MMCSD
|
||||
static int stm32_mb1_mmcsd_carddetect(int irq,
|
||||
FAR void *regs,
|
||||
FAR void *arg);
|
||||
void *regs,
|
||||
void *arg);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CLICKER2_STM32_MB2_MMCSD
|
||||
static int stm32_mb2_mmcsd_carddetect(int irq,
|
||||
FAR void *regs,
|
||||
FAR void *arg);
|
||||
void *regs,
|
||||
void *arg);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@ -136,7 +136,7 @@ static int stm32_mb2_mmcsd_carddetect(int irq,
|
||||
/* MMCSD device state */
|
||||
|
||||
#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 =
|
||||
{
|
||||
@ -151,7 +151,7 @@ static struct stm32_mmcsd_state_s g_mb1_mmcsd =
|
||||
#endif
|
||||
|
||||
#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 =
|
||||
{
|
||||
@ -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;
|
||||
FAR struct stm32_mmcsd_state_s *state =
|
||||
(FAR struct stm32_mmcsd_state_s *)arg;
|
||||
struct stm32_mmcsd_state_s *state =
|
||||
(struct stm32_mmcsd_state_s *)arg;
|
||||
|
||||
/* Get the current card insertion state */
|
||||
|
||||
@ -231,7 +231,7 @@ static void stm32_mmcsd_carddetect(FAR void *arg)
|
||||
}
|
||||
|
||||
#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))
|
||||
{
|
||||
@ -244,7 +244,7 @@ static int stm32_mb1_mmcsd_carddetect(int irq, FAR void *regs, FAR void *arg)
|
||||
#endif
|
||||
|
||||
#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))
|
||||
{
|
||||
|
@ -76,7 +76,7 @@ struct stm32_priv_s
|
||||
{
|
||||
struct mrf24j40_lower_s dev;
|
||||
xcpt_t handler;
|
||||
FAR void *arg;
|
||||
void *arg;
|
||||
uint32_t intcfg;
|
||||
uint8_t spidev;
|
||||
};
|
||||
@ -94,11 +94,11 @@ struct stm32_priv_s
|
||||
* irq_enable - Enable or disable the GPIO interrupt
|
||||
*/
|
||||
|
||||
static int stm32_attach_irq(FAR const struct mrf24j40_lower_s *lower,
|
||||
xcpt_t handler, FAR void *arg);
|
||||
static void stm32_enable_irq(FAR const struct mrf24j40_lower_s *lower,
|
||||
static int stm32_attach_irq(const struct mrf24j40_lower_s *lower,
|
||||
xcpt_t handler, void *arg);
|
||||
static void stm32_enable_irq(const struct mrf24j40_lower_s *lower,
|
||||
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
|
||||
@ -153,10 +153,10 @@ static struct stm32_priv_s g_mrf24j40_mb2_priv =
|
||||
* irq_enable - Enable or disable the GPIO interrupt
|
||||
*/
|
||||
|
||||
static int stm32_attach_irq(FAR const struct mrf24j40_lower_s *lower,
|
||||
xcpt_t handler, FAR void *arg)
|
||||
static int stm32_attach_irq(const struct mrf24j40_lower_s *lower,
|
||||
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);
|
||||
|
||||
@ -167,10 +167,10 @@ static int stm32_attach_irq(FAR const struct mrf24j40_lower_s *lower,
|
||||
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)
|
||||
{
|
||||
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
|
||||
* 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;
|
||||
FAR struct spi_dev_s *spi;
|
||||
struct spi_dev_s *spi;
|
||||
int ret;
|
||||
|
||||
/* Configure the interrupt pin */
|
||||
|
@ -94,21 +94,21 @@ void weak_function stm32_spidev_initialize(void)
|
||||
****************************************************************************/
|
||||
|
||||
#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)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n",
|
||||
(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;
|
||||
}
|
||||
#endif
|
||||
|
||||
#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)
|
||||
{
|
||||
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;
|
||||
|
||||
@ -161,7 +161,7 @@ uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
#endif
|
||||
|
||||
#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)
|
||||
{
|
||||
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;
|
||||
|
||||
@ -238,14 +238,14 @@ uint8_t stm32_spi3status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
#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;
|
||||
}
|
||||
#endif
|
||||
|
||||
#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 */
|
||||
|
||||
@ -254,7 +254,7 @@ int stm32_spi2cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
#endif
|
||||
|
||||
#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 */
|
||||
|
||||
|
@ -84,7 +84,7 @@ void stm32_usb_configure(void)
|
||||
****************************************************************************/
|
||||
|
||||
#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);
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ struct stm32_priv_s
|
||||
{
|
||||
struct xbee_lower_s dev;
|
||||
xcpt_t handler;
|
||||
FAR void *arg;
|
||||
void *arg;
|
||||
uint32_t rstcfg;
|
||||
uint32_t attncfg;
|
||||
uint8_t spidev;
|
||||
@ -121,13 +121,13 @@ struct stm32_priv_s
|
||||
* attn_poll - Poll the current state of the GPIO interrupt (ATTN)
|
||||
*/
|
||||
|
||||
static void stm32_reset(FAR const struct xbee_lower_s *lower);
|
||||
static int stm32_attach_attn(FAR const struct xbee_lower_s *lower,
|
||||
xcpt_t handler, FAR void *arg);
|
||||
static void stm32_enable_attn(FAR const struct xbee_lower_s *lower,
|
||||
static void stm32_reset(const struct xbee_lower_s *lower);
|
||||
static int stm32_attach_attn(const struct xbee_lower_s *lower,
|
||||
xcpt_t handler, void *arg);
|
||||
static void stm32_enable_attn(const struct xbee_lower_s *lower,
|
||||
bool state);
|
||||
static bool stm32_poll_attn(FAR const struct xbee_lower_s *lower);
|
||||
static int stm32_xbee_devsetup(FAR struct stm32_priv_s *priv);
|
||||
static bool stm32_poll_attn(const struct xbee_lower_s *lower);
|
||||
static int stm32_xbee_devsetup(struct stm32_priv_s *priv);
|
||||
|
||||
/****************************************************************************
|
||||
* 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)
|
||||
*/
|
||||
|
||||
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);
|
||||
|
||||
@ -205,10 +205,10 @@ static void stm32_reset(FAR const struct xbee_lower_s *lower)
|
||||
up_mdelay(100);
|
||||
}
|
||||
|
||||
static int stm32_attach_attn(FAR const struct xbee_lower_s *lower,
|
||||
xcpt_t handler, FAR void *arg)
|
||||
static int stm32_attach_attn(const struct xbee_lower_s *lower,
|
||||
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);
|
||||
|
||||
@ -219,10 +219,10 @@ static int stm32_attach_attn(FAR const struct xbee_lower_s *lower,
|
||||
return OK;
|
||||
}
|
||||
|
||||
static void stm32_enable_attn(FAR const struct xbee_lower_s *lower,
|
||||
bool state)
|
||||
static void stm32_enable_attn(const struct xbee_lower_s *lower,
|
||||
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
|
||||
* 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);
|
||||
}
|
||||
@ -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;
|
||||
int ret;
|
||||
|
||||
|
@ -145,7 +145,7 @@ uint32_t board_buttons(void)
|
||||
****************************************************************************/
|
||||
|
||||
#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;
|
||||
|
||||
|
@ -98,7 +98,7 @@ void weak_function stm32_spidev_initialize(void)
|
||||
****************************************************************************/
|
||||
|
||||
#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)
|
||||
{
|
||||
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;
|
||||
}
|
||||
#endif
|
||||
|
||||
#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)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n",
|
||||
(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;
|
||||
}
|
||||
|
@ -200,7 +200,7 @@ int stm32_usbhost_initialize(void)
|
||||
|
||||
ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
|
||||
CONFIG_USBHOST_STACKSIZE,
|
||||
(main_t)usbhost_waiter, (FAR char * const *)NULL);
|
||||
(main_t)usbhost_waiter, (char * const *)NULL);
|
||||
return ret < 0 ? -ENOEXEC : OK;
|
||||
}
|
||||
|
||||
@ -293,7 +293,7 @@ int stm32_setup_overcurrent(xcpt_t handler, void *arg)
|
||||
****************************************************************************/
|
||||
|
||||
#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);
|
||||
}
|
||||
|
@ -79,8 +79,8 @@
|
||||
int stm32_w25initialize(int minor)
|
||||
{
|
||||
#ifdef HAVE_W25
|
||||
FAR struct spi_dev_s *spi;
|
||||
FAR struct mtd_dev_s *mtd;
|
||||
struct spi_dev_s *spi;
|
||||
struct mtd_dev_s *mtd;
|
||||
#ifdef CONFIG_FS_NXFFS
|
||||
char devname[12];
|
||||
#endif
|
||||
|
@ -49,7 +49,7 @@ extern "C"
|
||||
* 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
|
||||
#ifdef __cplusplus
|
||||
|
@ -49,7 +49,7 @@ extern "C"
|
||||
* 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
|
||||
#ifdef __cplusplus
|
||||
|
@ -49,7 +49,7 @@ extern "C"
|
||||
* 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
|
||||
#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
|
||||
#ifdef __cplusplus
|
||||
|
@ -81,7 +81,7 @@
|
||||
|
||||
int board_apa102_initialize(int devno, int spino)
|
||||
{
|
||||
FAR struct spi_dev_s *spi;
|
||||
struct spi_dev_s *spi;
|
||||
char devpath[13];
|
||||
int ret;
|
||||
|
||||
|
@ -51,16 +51,16 @@ struct stm32_apds9960config_s
|
||||
|
||||
/* Additional private definitions only known to this driver */
|
||||
|
||||
FAR void *arg; /* Argument to pass to the interrupt handler */
|
||||
FAR xcpt_t isr; /* ISR Handler */
|
||||
void *arg; /* Argument to pass to the interrupt handler */
|
||||
xcpt_t isr; /* ISR Handler */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static int apds9960_irq_attach(FAR struct apds9960_config_s *state,
|
||||
xcpt_t isr, FAR void *arg);
|
||||
static int apds9960_irq_attach(struct apds9960_config_s *state,
|
||||
xcpt_t isr, void *arg);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
@ -90,8 +90,8 @@ static struct stm32_apds9960config_s g_apds9960config =
|
||||
|
||||
/* Attach the APDS-9960 interrupt handler to the GPIO interrupt */
|
||||
|
||||
static int apds9960_irq_attach(FAR struct apds9960_config_s *state,
|
||||
xcpt_t isr, FAR void *arg)
|
||||
static int apds9960_irq_attach(struct apds9960_config_s *state,
|
||||
xcpt_t isr, void *arg)
|
||||
{
|
||||
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)
|
||||
{
|
||||
FAR struct i2c_master_s *i2c;
|
||||
struct i2c_master_s *i2c;
|
||||
char devpath[12];
|
||||
int ret;
|
||||
|
||||
|
@ -60,7 +60,7 @@
|
||||
|
||||
int board_bh1750_initialize(int devno, int busno)
|
||||
{
|
||||
FAR struct i2c_master_s *i2c;
|
||||
struct i2c_master_s *i2c;
|
||||
int ret;
|
||||
|
||||
sninfo("Initializing BH1750FVI!\n");
|
||||
|
@ -75,7 +75,7 @@
|
||||
|
||||
int board_bmp180_initialize(int devno, int busno)
|
||||
{
|
||||
FAR struct i2c_master_s *i2c;
|
||||
struct i2c_master_s *i2c;
|
||||
char devpath[12];
|
||||
int ret;
|
||||
|
||||
|
@ -45,11 +45,11 @@
|
||||
* 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);
|
||||
static void dhtxx_set_data_pin(FAR struct dhtxx_config_s *state, bool value);
|
||||
static bool dhtxx_read_data_pin(FAR struct dhtxx_config_s *state);
|
||||
static int64_t dhtxx_get_clock(FAR struct dhtxx_config_s *state);
|
||||
static void dhtxx_set_data_pin(struct dhtxx_config_s *state, bool value);
|
||||
static bool dhtxx_read_data_pin(struct dhtxx_config_s *state);
|
||||
static int64_t dhtxx_get_clock(struct dhtxx_config_s *state);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
@ -71,7 +71,7 @@ struct timespec ts;
|
||||
* 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)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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 */
|
||||
|
||||
|
@ -56,26 +56,26 @@ struct stm32_hcsr04config_s
|
||||
|
||||
/* Additional private definitions only known to this driver */
|
||||
|
||||
FAR void *arg; /* Argument to pass to the interrupt handler */
|
||||
FAR xcpt_t isr; /* ISR Handler */
|
||||
bool rising; /* Rising edge enabled */
|
||||
bool falling; /* Falling edge enabled */
|
||||
void *arg; /* Argument to pass to the interrupt handler */
|
||||
xcpt_t isr; /* ISR Handler */
|
||||
bool rising; /* Rising edge enabled */
|
||||
bool falling; /* Falling edge enabled */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static int hcsr04_irq_attach(FAR struct hcsr04_config_s *state, xcpt_t isr,
|
||||
FAR void *arg);
|
||||
static void hcsr04_irq_enable(FAR const struct hcsr04_config_s *state,
|
||||
static int hcsr04_irq_attach(struct hcsr04_config_s *state, xcpt_t isr,
|
||||
void *arg);
|
||||
static void hcsr04_irq_enable(const struct hcsr04_config_s *state,
|
||||
bool enable);
|
||||
static void hcsr04_irq_clear(FAR const struct hcsr04_config_s *state);
|
||||
static void hcsr04_irq_setmode(FAR struct hcsr04_config_s *state,
|
||||
static void hcsr04_irq_clear(const struct hcsr04_config_s *state);
|
||||
static void hcsr04_irq_setmode(struct hcsr04_config_s *state,
|
||||
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);
|
||||
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
|
||||
@ -113,11 +113,11 @@ struct timespec ts;
|
||||
|
||||
/* Attach the HC-SR04 interrupt handler to the GPIO interrupt */
|
||||
|
||||
static int hcsr04_irq_attach(FAR struct hcsr04_config_s *state, xcpt_t isr,
|
||||
FAR void *arg)
|
||||
static int hcsr04_irq_attach(struct hcsr04_config_s *state, xcpt_t isr,
|
||||
void *arg)
|
||||
{
|
||||
FAR struct stm32_hcsr04config_s *priv =
|
||||
(FAR struct stm32_hcsr04config_s *)state;
|
||||
struct stm32_hcsr04config_s *priv =
|
||||
(struct stm32_hcsr04config_s *)state;
|
||||
irqstate_t flags;
|
||||
|
||||
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 */
|
||||
|
||||
static void hcsr04_irq_setmode(FAR struct hcsr04_config_s *state,
|
||||
static void hcsr04_irq_setmode(struct hcsr04_config_s *state,
|
||||
bool rise_mode)
|
||||
{
|
||||
FAR struct stm32_hcsr04config_s *priv =
|
||||
(FAR struct stm32_hcsr04config_s *)state;
|
||||
struct stm32_hcsr04config_s *priv =
|
||||
(struct stm32_hcsr04config_s *)state;
|
||||
|
||||
if (rise_mode)
|
||||
{
|
||||
@ -159,11 +159,11 @@ static void hcsr04_irq_setmode(FAR struct hcsr04_config_s *state,
|
||||
|
||||
/* Enable or disable the GPIO interrupt */
|
||||
|
||||
static void hcsr04_irq_enable(FAR const struct hcsr04_config_s *state,
|
||||
bool enable)
|
||||
static void hcsr04_irq_enable(const struct hcsr04_config_s *state,
|
||||
bool enable)
|
||||
{
|
||||
FAR struct stm32_hcsr04config_s *priv =
|
||||
(FAR struct stm32_hcsr04config_s *)state;
|
||||
struct stm32_hcsr04config_s *priv =
|
||||
(struct stm32_hcsr04config_s *)state;
|
||||
|
||||
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 */
|
||||
|
||||
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 ? */
|
||||
}
|
||||
|
||||
/* 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)
|
||||
{
|
||||
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 */
|
||||
|
||||
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 */
|
||||
|
||||
|
@ -105,17 +105,17 @@
|
||||
* Private Function Protototypes
|
||||
****************************************************************************/
|
||||
|
||||
static int board_foc_setup(FAR struct foc_dev_s *dev);
|
||||
static int board_foc_shutdown(FAR struct foc_dev_s *dev);
|
||||
static int board_foc_calibration(FAR struct foc_dev_s *dev, bool state);
|
||||
static int board_foc_fault_clear(FAR struct foc_dev_s *dev);
|
||||
static int board_foc_pwm_start(FAR struct foc_dev_s *dev, bool state);
|
||||
static int board_foc_current_get(FAR struct foc_dev_s *dev,
|
||||
FAR int16_t *curr_raw,
|
||||
FAR foc_current_t *curr);
|
||||
static int board_foc_setup(struct foc_dev_s *dev);
|
||||
static int board_foc_shutdown(struct foc_dev_s *dev);
|
||||
static int board_foc_calibration(struct foc_dev_s *dev, bool state);
|
||||
static int board_foc_fault_clear(struct foc_dev_s *dev);
|
||||
static int board_foc_pwm_start(struct foc_dev_s *dev, bool state);
|
||||
static int board_foc_current_get(struct foc_dev_s *dev,
|
||||
int16_t *curr_raw,
|
||||
foc_current_t *curr);
|
||||
#ifdef CONFIG_MOTOR_FOC_TRACE
|
||||
static int board_foc_trace_init(FAR struct foc_dev_s *dev);
|
||||
static void board_foc_trace(FAR struct foc_dev_s *dev, int type, bool state);
|
||||
static int board_foc_trace_init(struct foc_dev_s *dev);
|
||||
static void board_foc_trace(struct foc_dev_s *dev, int type, bool state);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@ -158,7 +158,7 @@ static struct stm32_foc_board_s g_stm32_foc_board =
|
||||
|
||||
/* 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
|
||||
@ -168,7 +168,7 @@ static FAR struct foc_dev_s *g_foc_dev = NULL;
|
||||
* 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);
|
||||
|
||||
@ -189,7 +189,7 @@ static int board_foc_setup(FAR struct foc_dev_s *dev)
|
||||
* 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);
|
||||
|
||||
@ -202,7 +202,7 @@ static int board_foc_shutdown(FAR struct foc_dev_s *dev)
|
||||
* 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);
|
||||
|
||||
@ -215,7 +215,7 @@ static int board_foc_calibration(FAR struct foc_dev_s *dev, bool state)
|
||||
* 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);
|
||||
|
||||
@ -228,7 +228,7 @@ static int board_foc_fault_clear(FAR struct foc_dev_s *dev)
|
||||
* 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);
|
||||
|
||||
@ -251,9 +251,9 @@ static int board_foc_pwm_start(FAR struct foc_dev_s *dev, bool state)
|
||||
* Name: board_foc_current_get
|
||||
****************************************************************************/
|
||||
|
||||
static int board_foc_current_get(FAR struct foc_dev_s *dev,
|
||||
FAR int16_t *curr_raw,
|
||||
FAR foc_current_t *curr)
|
||||
static int board_foc_current_get(struct foc_dev_s *dev,
|
||||
int16_t *curr_raw,
|
||||
foc_current_t *curr)
|
||||
{
|
||||
DEBUGASSERT(dev);
|
||||
DEBUGASSERT(curr_raw);
|
||||
@ -273,7 +273,7 @@ static int board_foc_current_get(FAR struct foc_dev_s *dev,
|
||||
* 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);
|
||||
|
||||
@ -293,7 +293,7 @@ static int board_foc_trace_init(FAR struct foc_dev_s *dev)
|
||||
* 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);
|
||||
|
||||
@ -351,10 +351,10 @@ static void board_foc_trace(FAR struct foc_dev_s *dev, int type, bool state)
|
||||
* 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;
|
||||
int ret = OK;
|
||||
struct foc_dev_s *foc = NULL;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(adc_cfg);
|
||||
|
||||
@ -407,9 +407,9 @@ errout:
|
||||
|
||||
int stm32_adc_setup(void)
|
||||
{
|
||||
FAR struct adc_dev_s *adc = NULL;
|
||||
int ret = OK;
|
||||
static bool initialized = false;
|
||||
struct adc_dev_s *adc = NULL;
|
||||
int ret = OK;
|
||||
static bool initialized = false;
|
||||
|
||||
/* Initialize only once */
|
||||
|
||||
|
@ -113,17 +113,17 @@
|
||||
* Private Function Protototypes
|
||||
****************************************************************************/
|
||||
|
||||
static int board_foc_setup(FAR struct foc_dev_s *dev);
|
||||
static int board_foc_shutdown(FAR struct foc_dev_s *dev);
|
||||
static int board_foc_calibration(FAR struct foc_dev_s *dev, bool state);
|
||||
static int board_foc_fault_clear(FAR struct foc_dev_s *dev);
|
||||
static int board_foc_pwm_start(FAR struct foc_dev_s *dev, bool state);
|
||||
static int board_foc_current_get(FAR struct foc_dev_s *dev,
|
||||
FAR int16_t *curr_raw,
|
||||
FAR foc_current_t *curr);
|
||||
static int board_foc_setup(struct foc_dev_s *dev);
|
||||
static int board_foc_shutdown(struct foc_dev_s *dev);
|
||||
static int board_foc_calibration(struct foc_dev_s *dev, bool state);
|
||||
static int board_foc_fault_clear(struct foc_dev_s *dev);
|
||||
static int board_foc_pwm_start(struct foc_dev_s *dev, bool state);
|
||||
static int board_foc_current_get(struct foc_dev_s *dev,
|
||||
int16_t *curr_raw,
|
||||
foc_current_t *curr);
|
||||
#ifdef CONFIG_MOTOR_FOC_TRACE
|
||||
static int board_foc_trace_init(FAR struct foc_dev_s *dev);
|
||||
static void board_foc_trace(FAR struct foc_dev_s *dev, int type, bool state);
|
||||
static int board_foc_trace_init(struct foc_dev_s *dev);
|
||||
static void board_foc_trace(struct foc_dev_s *dev, int type, bool state);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@ -166,7 +166,7 @@ static struct stm32_foc_board_s g_stm32_foc_board =
|
||||
|
||||
/* 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
|
||||
@ -176,7 +176,7 @@ static FAR struct foc_dev_s *g_foc_dev = NULL;
|
||||
* 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);
|
||||
|
||||
@ -189,7 +189,7 @@ static int board_foc_setup(FAR struct foc_dev_s *dev)
|
||||
* 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);
|
||||
|
||||
@ -202,7 +202,7 @@ static int board_foc_shutdown(FAR struct foc_dev_s *dev)
|
||||
* 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);
|
||||
|
||||
@ -215,7 +215,7 @@ static int board_foc_calibration(FAR struct foc_dev_s *dev, bool state)
|
||||
* 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);
|
||||
|
||||
@ -228,7 +228,7 @@ static int board_foc_fault_clear(FAR struct foc_dev_s *dev)
|
||||
* 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);
|
||||
|
||||
@ -241,9 +241,9 @@ static int board_foc_pwm_start(FAR struct foc_dev_s *dev, bool state)
|
||||
* Name: board_foc_current_get
|
||||
****************************************************************************/
|
||||
|
||||
static int board_foc_current_get(FAR struct foc_dev_s *dev,
|
||||
FAR int16_t *curr_raw,
|
||||
FAR foc_current_t *curr)
|
||||
static int board_foc_current_get(struct foc_dev_s *dev,
|
||||
int16_t *curr_raw,
|
||||
foc_current_t *curr)
|
||||
{
|
||||
DEBUGASSERT(dev);
|
||||
DEBUGASSERT(curr_raw);
|
||||
@ -263,7 +263,7 @@ static int board_foc_current_get(FAR struct foc_dev_s *dev,
|
||||
* 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);
|
||||
|
||||
@ -283,7 +283,7 @@ static int board_foc_trace_init(FAR struct foc_dev_s *dev)
|
||||
* 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);
|
||||
|
||||
@ -341,10 +341,10 @@ static void board_foc_trace(FAR struct foc_dev_s *dev, int type, bool state)
|
||||
* 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;
|
||||
int ret = OK;
|
||||
struct foc_dev_s *foc = NULL;
|
||||
int ret = OK;
|
||||
|
||||
/* Initialize only once */
|
||||
|
||||
@ -395,9 +395,9 @@ errout:
|
||||
|
||||
int stm32_adc_setup(void)
|
||||
{
|
||||
FAR struct adc_dev_s *adc = NULL;
|
||||
int ret = OK;
|
||||
static bool initialized = false;
|
||||
struct adc_dev_s *adc = NULL;
|
||||
int ret = OK;
|
||||
static bool initialized = false;
|
||||
|
||||
/* Initialize only once */
|
||||
|
||||
|
@ -103,17 +103,17 @@
|
||||
* Private Function Protototypes
|
||||
****************************************************************************/
|
||||
|
||||
static int board_foc_setup(FAR struct foc_dev_s *dev);
|
||||
static int board_foc_shutdown(FAR struct foc_dev_s *dev);
|
||||
static int board_foc_calibration(FAR struct foc_dev_s *dev, bool state);
|
||||
static int board_foc_fault_clear(FAR struct foc_dev_s *dev);
|
||||
static int board_foc_pwm_start(FAR struct foc_dev_s *dev, bool state);
|
||||
static int board_foc_current_get(FAR struct foc_dev_s *dev,
|
||||
FAR int16_t *curr_raw,
|
||||
FAR foc_current_t *curr);
|
||||
static int board_foc_setup(struct foc_dev_s *dev);
|
||||
static int board_foc_shutdown(struct foc_dev_s *dev);
|
||||
static int board_foc_calibration(struct foc_dev_s *dev, bool state);
|
||||
static int board_foc_fault_clear(struct foc_dev_s *dev);
|
||||
static int board_foc_pwm_start(struct foc_dev_s *dev, bool state);
|
||||
static int board_foc_current_get(struct foc_dev_s *dev,
|
||||
int16_t *curr_raw,
|
||||
foc_current_t *curr);
|
||||
#ifdef CONFIG_MOTOR_FOC_TRACE
|
||||
static int board_foc_trace_init(FAR struct foc_dev_s *dev);
|
||||
static void board_foc_trace(FAR struct foc_dev_s *dev, int type, bool state);
|
||||
static int board_foc_trace_init(struct foc_dev_s *dev);
|
||||
static void board_foc_trace(struct foc_dev_s *dev, int type, bool state);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@ -156,7 +156,7 @@ static struct stm32_foc_board_s g_stm32_foc_board =
|
||||
|
||||
/* 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
|
||||
@ -166,7 +166,7 @@ static FAR struct foc_dev_s *g_foc_dev = NULL;
|
||||
* 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);
|
||||
|
||||
@ -187,7 +187,7 @@ static int board_foc_setup(FAR struct foc_dev_s *dev)
|
||||
* 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);
|
||||
|
||||
@ -200,7 +200,7 @@ static int board_foc_shutdown(FAR struct foc_dev_s *dev)
|
||||
* 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);
|
||||
|
||||
@ -213,7 +213,7 @@ static int board_foc_calibration(FAR struct foc_dev_s *dev, bool state)
|
||||
* 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);
|
||||
|
||||
@ -226,7 +226,7 @@ static int board_foc_fault_clear(FAR struct foc_dev_s *dev)
|
||||
* 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);
|
||||
|
||||
@ -249,9 +249,9 @@ static int board_foc_pwm_start(FAR struct foc_dev_s *dev, bool state)
|
||||
* Name: board_foc_current_get
|
||||
****************************************************************************/
|
||||
|
||||
static int board_foc_current_get(FAR struct foc_dev_s *dev,
|
||||
FAR int16_t *curr_raw,
|
||||
FAR foc_current_t *curr)
|
||||
static int board_foc_current_get(struct foc_dev_s *dev,
|
||||
int16_t *curr_raw,
|
||||
foc_current_t *curr)
|
||||
{
|
||||
DEBUGASSERT(dev);
|
||||
DEBUGASSERT(curr_raw);
|
||||
@ -271,7 +271,7 @@ static int board_foc_current_get(FAR struct foc_dev_s *dev,
|
||||
* 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);
|
||||
|
||||
@ -291,7 +291,7 @@ static int board_foc_trace_init(FAR struct foc_dev_s *dev)
|
||||
* 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);
|
||||
|
||||
@ -349,10 +349,10 @@ static void board_foc_trace(FAR struct foc_dev_s *dev, int type, bool state)
|
||||
* 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;
|
||||
int ret = OK;
|
||||
struct foc_dev_s *foc = NULL;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(adc_cfg);
|
||||
|
||||
@ -405,9 +405,9 @@ errout:
|
||||
|
||||
int stm32_adc_setup(void)
|
||||
{
|
||||
FAR struct adc_dev_s *adc = NULL;
|
||||
int ret = OK;
|
||||
static bool initialized = false;
|
||||
struct adc_dev_s *adc = NULL;
|
||||
int ret = OK;
|
||||
static bool initialized = false;
|
||||
|
||||
/* Initialize only once */
|
||||
|
||||
|
@ -76,7 +76,7 @@
|
||||
|
||||
int board_ina219_initialize(int devno, int busno)
|
||||
{
|
||||
FAR struct i2c_master_s *i2c;
|
||||
struct i2c_master_s *i2c;
|
||||
char devpath[12];
|
||||
int ret;
|
||||
|
||||
|
@ -43,7 +43,7 @@
|
||||
* 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
|
||||
@ -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,
|
||||
true, irq, NULL);
|
||||
|
@ -58,9 +58,9 @@
|
||||
|
||||
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;
|
||||
FAR struct i2c_master_s *i2c;
|
||||
struct i2c_master_s *i2c;
|
||||
char devpath[12];
|
||||
int ret;
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
return stm32_gpiosetevent(BOARD_LIS3DSH_GPIO_EXT0, true, false, false,
|
||||
|
@ -78,7 +78,7 @@
|
||||
|
||||
int board_lm75_initialize(int devno, int busno)
|
||||
{
|
||||
FAR struct i2c_master_s *i2c;
|
||||
struct i2c_master_s *i2c;
|
||||
char devpath[12];
|
||||
int ret;
|
||||
|
||||
|
@ -56,7 +56,7 @@
|
||||
|
||||
int board_max31855_initialize(int devno, int busno)
|
||||
{
|
||||
FAR struct spi_dev_s *spi;
|
||||
struct spi_dev_s *spi;
|
||||
char devpath[12];
|
||||
int ret;
|
||||
|
||||
|
@ -77,7 +77,7 @@
|
||||
|
||||
int board_max6675_initialize(int devno, int busno)
|
||||
{
|
||||
FAR struct spi_dev_s *spi;
|
||||
struct spi_dev_s *spi;
|
||||
char devpath[12];
|
||||
int ret;
|
||||
|
||||
|
@ -61,7 +61,7 @@
|
||||
|
||||
int board_mlx90614_initialize(int devno, int busno)
|
||||
{
|
||||
FAR struct i2c_master_s *i2c;
|
||||
struct i2c_master_s *i2c;
|
||||
char devpath[12];
|
||||
int ret;
|
||||
|
||||
|
@ -59,7 +59,7 @@
|
||||
|
||||
int board_mpl115a_initialize(int devno, int busno)
|
||||
{
|
||||
FAR struct spi_dev_s *spi;
|
||||
struct spi_dev_s *spi;
|
||||
char devpath[12];
|
||||
int ret;
|
||||
|
||||
|
@ -52,21 +52,21 @@
|
||||
* 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);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
static FAR struct nrf24l01_config_s nrf_cfg =
|
||||
static struct nrf24l01_config_s nrf_cfg =
|
||||
{
|
||||
.irqattach = nrf24l01_irq_attach,
|
||||
.chipenable = nrf24l01_chip_enable,
|
||||
};
|
||||
|
||||
static xcpt_t g_isr;
|
||||
static FAR void *g_arg;
|
||||
static void *g_arg;
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
@ -76,7 +76,7 @@ static FAR void *g_arg;
|
||||
* 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");
|
||||
g_isr = isr;
|
||||
@ -112,7 +112,7 @@ static void nrf24l01_chip_enable(bool enable)
|
||||
|
||||
int board_nrf24l01_initialize(int busno)
|
||||
{
|
||||
FAR struct spi_dev_s *spidev;
|
||||
struct spi_dev_s *spidev;
|
||||
int result;
|
||||
|
||||
/* Setup CE & IRQ line IOs */
|
||||
|
@ -82,7 +82,7 @@
|
||||
|
||||
int board_nunchuck_initialize(int devno, int busno)
|
||||
{
|
||||
FAR struct i2c_master_s *i2c;
|
||||
struct i2c_master_s *i2c;
|
||||
char devpath[15];
|
||||
int ret;
|
||||
|
||||
|
@ -39,7 +39,7 @@
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
static FAR struct lcd_dev_s *g_lcddev;
|
||||
static struct lcd_dev_s *g_lcddev;
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
@ -61,7 +61,7 @@ static FAR struct lcd_dev_s *g_lcddev;
|
||||
#ifdef CONFIG_LCD_SSD1306_I2C
|
||||
int board_ssd1306_initialize(int busno)
|
||||
{
|
||||
FAR struct i2c_master_s *i2c;
|
||||
struct i2c_master_s *i2c;
|
||||
const int devno = 0;
|
||||
|
||||
/* Initialize I2C */
|
||||
@ -109,7 +109,7 @@ int board_ssd1306_initialize(int busno)
|
||||
#ifdef CONFIG_LCD_SSD1306_SPI
|
||||
int board_ssd1306_initialize(int busno)
|
||||
{
|
||||
FAR struct spi_dev_s *spi;
|
||||
struct spi_dev_s *spi;
|
||||
const int devno = 0;
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
@ -82,7 +82,7 @@
|
||||
|
||||
int board_veml6070_initialize(int devno, int busno)
|
||||
{
|
||||
FAR struct i2c_master_s *i2c;
|
||||
struct i2c_master_s *i2c;
|
||||
char devpath[14];
|
||||
int ret;
|
||||
|
||||
|
@ -82,7 +82,7 @@
|
||||
|
||||
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];
|
||||
int ret;
|
||||
|
||||
|
@ -60,9 +60,9 @@ struct stm32_xen1210config_s
|
||||
|
||||
/* Additional private definitions only known to this driver */
|
||||
|
||||
XEN1210_HANDLE handle; /* The XEN1210 driver handle */
|
||||
xen1210_handler_t handler; /* The XEN1210 interrupt handler */
|
||||
FAR void *arg; /* Argument to pass to the interrupt handler */
|
||||
XEN1210_HANDLE handle; /* The XEN1210 driver handle */
|
||||
xen1210_handler_t handler; /* The XEN1210 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
|
||||
*/
|
||||
|
||||
static int xen1210_attach(FAR struct xen1210_config_s *state,
|
||||
xen1210_handler_t handler, FAR void *arg);
|
||||
static void xen1210_enable(FAR struct xen1210_config_s *state, bool enable);
|
||||
static void xen1210_clear(FAR struct xen1210_config_s *state);
|
||||
static int xen1210_attach(struct xen1210_config_s *state,
|
||||
xen1210_handler_t handler, void *arg);
|
||||
static void xen1210_enable(struct xen1210_config_s *state, bool enable);
|
||||
static void xen1210_clear(struct xen1210_config_s *state);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
@ -114,7 +114,7 @@ static struct stm32_xen1210config_s g_xen1210config =
|
||||
|
||||
/* 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 */
|
||||
|
||||
@ -137,11 +137,11 @@ static int xen1210_interrupt(int irq, FAR void *context, FAR void *arg)
|
||||
* clear - Acknowledge/clear any pending GPIO interrupt
|
||||
*/
|
||||
|
||||
static int xen1210_attach(FAR struct xen1210_config_s *state,
|
||||
xen1210_handler_t handler, FAR void *arg)
|
||||
static int xen1210_attach(struct xen1210_config_s *state,
|
||||
xen1210_handler_t handler, void *arg)
|
||||
{
|
||||
FAR struct stm32_xen1210config_s *priv =
|
||||
(FAR struct stm32_xen1210config_s *)state;
|
||||
struct stm32_xen1210config_s *priv =
|
||||
(struct stm32_xen1210config_s *)state;
|
||||
|
||||
sninfo("Saving handler %p\n", handler);
|
||||
DEBUGASSERT(priv);
|
||||
@ -155,7 +155,7 @@ static int xen1210_attach(FAR struct xen1210_config_s *state,
|
||||
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;
|
||||
|
||||
@ -184,7 +184,7 @@ static void xen1210_enable(FAR struct xen1210_config_s *state, bool enable)
|
||||
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 */
|
||||
}
|
||||
@ -257,7 +257,7 @@ static int xen1210_pwm_setup(void)
|
||||
|
||||
int board_xen1210_initialize(int devno, int busno)
|
||||
{
|
||||
FAR struct spi_dev_s *dev;
|
||||
struct spi_dev_s *dev;
|
||||
int ret;
|
||||
|
||||
/* Check if we are already initialized */
|
||||
@ -289,7 +289,7 @@ int board_xen1210_initialize(int devno, int busno)
|
||||
|
||||
g_xen1210config.handle =
|
||||
xen1210_instantiate(dev,
|
||||
(FAR struct xen1210_config_s *)
|
||||
(struct xen1210_config_s *)
|
||||
&g_xen1210config);
|
||||
if (!g_xen1210config.handle)
|
||||
{
|
||||
|
@ -39,11 +39,11 @@
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static void zcross_enable(FAR const struct zc_lowerhalf_s *lower,
|
||||
zc_interrupt_t handler, FAR void *arg);
|
||||
static void zcross_enable(const struct zc_lowerhalf_s *lower,
|
||||
zc_interrupt_t handler, void *arg);
|
||||
|
||||
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
|
||||
@ -52,7 +52,7 @@ static int zcross_interrupt(int irq, FAR void *context, FAR void *arg);
|
||||
/* Current interrupt handler and argument */
|
||||
|
||||
static zc_interrupt_t g_zcrosshandler;
|
||||
static FAR void *g_zcrossarg;
|
||||
static void *g_zcrossarg;
|
||||
|
||||
/* 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,
|
||||
zc_interrupt_t handler, FAR void *arg)
|
||||
static void zcross_enable(const struct zc_lowerhalf_s *lower,
|
||||
zc_interrupt_t handler, void *arg)
|
||||
{
|
||||
irqstate_t flags;
|
||||
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);
|
||||
if (g_zcrosshandler)
|
||||
|
@ -128,7 +128,7 @@
|
||||
#ifdef HAVE_I2CTOOL
|
||||
static void stm32_i2c_register(int bus)
|
||||
{
|
||||
FAR struct i2c_master_s *i2c;
|
||||
struct i2c_master_s *i2c;
|
||||
int ret;
|
||||
|
||||
i2c = stm32_i2cbus_initialize(bus);
|
||||
|
@ -122,7 +122,7 @@ uint32_t board_buttons(void)
|
||||
****************************************************************************/
|
||||
|
||||
#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)
|
||||
{
|
||||
uint16_t gpio;
|
||||
int ret;
|
||||
|
@ -99,17 +99,17 @@ struct stm32_lower_s
|
||||
{
|
||||
const struct enc_lower_s lower; /* Low-level MCU interface */
|
||||
xcpt_t handler; /* ENC28J60 interrupt handler */
|
||||
FAR void *arg; /* Argument that accompanies the interrupt */
|
||||
void *arg; /* Argument that accompanies the interrupt */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static int up_attach(FAR const struct enc_lower_s *lower, xcpt_t handler,
|
||||
FAR void *arg);
|
||||
static void up_enable(FAR const struct enc_lower_s *lower);
|
||||
static void up_disable(FAR const struct enc_lower_s *lower);
|
||||
static int up_attach(const struct enc_lower_s *lower, xcpt_t handler,
|
||||
void *arg);
|
||||
static void up_enable(const struct enc_lower_s *lower);
|
||||
static void up_disable(const struct enc_lower_s *lower);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
@ -140,10 +140,10 @@ static struct stm32_lower_s g_enclower =
|
||||
* Name: struct enc_lower_s methods
|
||||
****************************************************************************/
|
||||
|
||||
static int up_attach(FAR const struct enc_lower_s *lower, xcpt_t handler,
|
||||
FAR void *arg)
|
||||
static int up_attach(const struct enc_lower_s *lower, xcpt_t handler,
|
||||
void *arg)
|
||||
{
|
||||
FAR struct stm32_lower_s *priv = (FAR struct stm32_lower_s *)lower;
|
||||
struct stm32_lower_s *priv = (struct stm32_lower_s *)lower;
|
||||
|
||||
/* Just save the handler for use when the interrupt is enabled */
|
||||
|
||||
@ -152,9 +152,9 @@ static int up_attach(FAR const struct enc_lower_s *lower, xcpt_t handler,
|
||||
return OK;
|
||||
}
|
||||
|
||||
static void up_enable(FAR const struct enc_lower_s *lower)
|
||||
static void up_enable(const struct enc_lower_s *lower)
|
||||
{
|
||||
FAR struct stm32_lower_s *priv = (FAR struct stm32_lower_s *)lower;
|
||||
struct stm32_lower_s *priv = (struct stm32_lower_s *)lower;
|
||||
|
||||
DEBUGASSERT(priv->handler);
|
||||
stm32_gpiosetevent(GPIO_ENC28J60_INTR, false, true, true,
|
||||
@ -166,7 +166,7 @@ static void up_enable(FAR const struct enc_lower_s *lower)
|
||||
* lost.
|
||||
*/
|
||||
|
||||
static void up_disable(FAR const struct enc_lower_s *lower)
|
||||
static void up_disable(const struct enc_lower_s *lower)
|
||||
{
|
||||
stm32_gpiosetevent(GPIO_ENC28J60_INTR, false, true, true,
|
||||
NULL, NULL);
|
||||
@ -182,7 +182,7 @@ static void up_disable(FAR const struct enc_lower_s *lower)
|
||||
|
||||
void arm_netinitialize(void)
|
||||
{
|
||||
FAR struct spi_dev_s *spi;
|
||||
struct spi_dev_s *spi;
|
||||
int ret;
|
||||
|
||||
/* Assumptions:
|
||||
|
@ -71,7 +71,7 @@
|
||||
int stm32_sdinitialize(int minor)
|
||||
{
|
||||
#ifdef HAVE_MMCSD
|
||||
FAR struct sdio_dev_s *sdio;
|
||||
struct sdio_dev_s *sdio;
|
||||
int ret;
|
||||
|
||||
/* First, get an instance of the SDIO interface */
|
||||
|
@ -117,7 +117,7 @@ void weak_function stm32_spidev_initialize(void)
|
||||
****************************************************************************/
|
||||
|
||||
#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)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n",
|
||||
@ -149,14 +149,14 @@ void stm32_spi1select(FAR struct spi_dev_s *dev,
|
||||
#endif
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
#endif
|
||||
|
||||
#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)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n",
|
||||
@ -170,7 +170,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)
|
||||
{
|
||||
return SPI_STATUS_PRESENT;
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ void stm32_usbinitialize(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int stm32_usbpullup(FAR struct usbdev_s *dev, bool enable)
|
||||
int stm32_usbpullup(struct usbdev_s *dev, bool enable)
|
||||
{
|
||||
usbtrace(TRACE_DEVPULLUP, (uint16_t)enable);
|
||||
#if 0 /* REVISIT */
|
||||
@ -99,7 +99,7 @@ int stm32_usbpullup(FAR struct usbdev_s *dev, bool enable)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume)
|
||||
void stm32_usbsuspend(struct usbdev_s *dev, bool resume)
|
||||
{
|
||||
uinfo("resume: %d\n", resume);
|
||||
}
|
||||
|
@ -79,8 +79,8 @@
|
||||
int stm32_w25initialize(int minor)
|
||||
{
|
||||
#ifdef HAVE_W25
|
||||
FAR struct spi_dev_s *spi;
|
||||
FAR struct mtd_dev_s *mtd;
|
||||
struct spi_dev_s *spi;
|
||||
struct mtd_dev_s *mtd;
|
||||
#ifdef CONFIG_FS_NXFFS
|
||||
char devname[12];
|
||||
#endif
|
||||
|
@ -94,7 +94,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_MMCSD
|
||||
static FAR struct sdio_dev_s *g_sdiodev;
|
||||
static struct sdio_dev_s *g_sdiodev;
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@ -110,7 +110,7 @@ static FAR struct sdio_dev_s *g_sdiodev;
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef NSH_HAVEMMCSD
|
||||
static int nsh_cdinterrupt(int irq, FAR void *context, FAR void *arg)
|
||||
static int nsh_cdinterrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
static bool inserted = 0xff; /* Impossible value */
|
||||
bool present;
|
||||
|
@ -117,7 +117,7 @@ uint32_t board_buttons(void)
|
||||
****************************************************************************/
|
||||
|
||||
#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 pinset = GPIO_BTN_KEYA;
|
||||
int ret = -EINVAL;
|
||||
|
@ -119,17 +119,17 @@ static void lcd_clear(uint16_t color);
|
||||
/* LCD Data Transfer Methods */
|
||||
|
||||
static int lcd_putrun(fb_coord_t row, fb_coord_t col,
|
||||
FAR const uint8_t *buffer, size_t npixels);
|
||||
const uint8_t *buffer, size_t npixels);
|
||||
static int lcd_getrun(fb_coord_t row, fb_coord_t col,
|
||||
FAR uint8_t *buffer, size_t npixels);
|
||||
uint8_t *buffer, size_t npixels);
|
||||
|
||||
/* LCD Configuration */
|
||||
|
||||
static int lcd_getvideoinfo(FAR struct lcd_dev_s *dev,
|
||||
FAR struct fb_videoinfo_s *vinfo);
|
||||
static int lcd_getplaneinfo(FAR struct lcd_dev_s *dev,
|
||||
static int lcd_getvideoinfo(struct lcd_dev_s *dev,
|
||||
struct fb_videoinfo_s *vinfo);
|
||||
static int lcd_getplaneinfo(struct lcd_dev_s *dev,
|
||||
unsigned int planeno,
|
||||
FAR struct lcd_planeinfo_s *pinfo);
|
||||
struct lcd_planeinfo_s *pinfo);
|
||||
|
||||
/* LCD RGB Mapping */
|
||||
|
||||
@ -429,11 +429,11 @@ static void lcd_setcursor(unsigned int x, unsigned int y)
|
||||
****************************************************************************/
|
||||
|
||||
static int lcd_putrun(fb_coord_t row, fb_coord_t col,
|
||||
FAR const uint8_t *buffer,
|
||||
const uint8_t *buffer,
|
||||
size_t npixels)
|
||||
{
|
||||
int i;
|
||||
FAR const uint16_t *src = (FAR const uint16_t *) buffer;
|
||||
const uint16_t *src = (const uint16_t *) buffer;
|
||||
|
||||
/* Buffer must be provided and aligned to a 16-bit address boundary */
|
||||
|
||||
@ -466,10 +466,10 @@ static int lcd_putrun(fb_coord_t row, fb_coord_t col,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int lcd_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer,
|
||||
static int lcd_getrun(fb_coord_t row, fb_coord_t col, uint8_t *buffer,
|
||||
size_t npixels)
|
||||
{
|
||||
FAR uint16_t *dest = (FAR uint16_t *) buffer;
|
||||
uint16_t *dest = (uint16_t *) buffer;
|
||||
int i;
|
||||
|
||||
/* Buffer must be provided and aligned to a 16-bit address boundary */
|
||||
@ -501,8 +501,8 @@ static int lcd_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int lcd_getvideoinfo(FAR struct lcd_dev_s *dev,
|
||||
FAR struct fb_videoinfo_s *vinfo)
|
||||
static int lcd_getvideoinfo(struct lcd_dev_s *dev,
|
||||
struct fb_videoinfo_s *vinfo)
|
||||
{
|
||||
DEBUGASSERT(dev && vinfo);
|
||||
ginfo("fmt: %d xres: %d yres: %d nplanes: %d\n",
|
||||
@ -521,8 +521,8 @@ static int lcd_getvideoinfo(FAR struct lcd_dev_s *dev,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int lcd_getplaneinfo(FAR struct lcd_dev_s *dev, unsigned int planeno,
|
||||
FAR struct lcd_planeinfo_s *pinfo)
|
||||
static int lcd_getplaneinfo(struct lcd_dev_s *dev, unsigned int planeno,
|
||||
struct lcd_planeinfo_s *pinfo)
|
||||
{
|
||||
DEBUGASSERT(dev && pinfo && planeno == 0);
|
||||
ginfo("planeno: %d bpp: %d\n", planeno, g_planeinfo.bpp);
|
||||
@ -915,7 +915,7 @@ int board_lcd_initialize(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct lcd_dev_s *board_lcd_getdev(int lcddev)
|
||||
struct lcd_dev_s *board_lcd_getdev(int lcddev)
|
||||
{
|
||||
DEBUGASSERT(lcddev == 0);
|
||||
return &g_lcddev.dev;
|
||||
|
@ -95,7 +95,7 @@ void stm32_spidev_initialize(void)
|
||||
****************************************************************************/
|
||||
|
||||
#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)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n",
|
||||
@ -109,35 +109,35 @@ 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;
|
||||
}
|
||||
#endif
|
||||
|
||||
#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)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n",
|
||||
(int)devid, selected ? "assert" : "de-assert");
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
return SPI_STATUS_PRESENT;
|
||||
}
|
||||
#endif
|
||||
|
||||
#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)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n",
|
||||
(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 SPI_STATUS_PRESENT;
|
||||
}
|
||||
|
@ -88,14 +88,14 @@
|
||||
|
||||
/* Low Level LCD access */
|
||||
|
||||
static void stm32_select(FAR struct ssd1289_lcd_s *dev);
|
||||
static void stm32_deselect(FAR struct ssd1289_lcd_s *dev);
|
||||
static void stm32_index(FAR struct ssd1289_lcd_s *dev, uint8_t index);
|
||||
static void stm32_select(struct ssd1289_lcd_s *dev);
|
||||
static void stm32_deselect(struct ssd1289_lcd_s *dev);
|
||||
static void stm32_index(struct ssd1289_lcd_s *dev, uint8_t index);
|
||||
#ifndef CONFIG_SSD1289_WRONLY
|
||||
static uint16_t stm32_read(FAR struct ssd1289_lcd_s *dev);
|
||||
static uint16_t stm32_read(struct ssd1289_lcd_s *dev);
|
||||
#endif
|
||||
static void stm32_write(FAR struct ssd1289_lcd_s *dev, uint16_t data);
|
||||
static void stm32_backlight(FAR struct ssd1289_lcd_s *dev, int power);
|
||||
static void stm32_write(struct ssd1289_lcd_s *dev, uint16_t data);
|
||||
static void stm32_backlight(struct ssd1289_lcd_s *dev, int power);
|
||||
|
||||
static void stm32_extmemgpios(const uint16_t *gpios, int ngpios);
|
||||
|
||||
@ -144,7 +144,7 @@ static struct ssd1289_lcd_s g_ssd1289 =
|
||||
|
||||
/* The saved instance of the LCD driver */
|
||||
|
||||
static FAR struct lcd_dev_s *g_ssd1289drvr;
|
||||
static struct lcd_dev_s *g_ssd1289drvr;
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
@ -158,7 +158,7 @@ static FAR struct lcd_dev_s *g_ssd1289drvr;
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void stm32_select(FAR struct ssd1289_lcd_s *dev)
|
||||
static void stm32_select(struct ssd1289_lcd_s *dev)
|
||||
{
|
||||
/* Does not apply to this hardware */
|
||||
}
|
||||
@ -171,7 +171,7 @@ static void stm32_select(FAR struct ssd1289_lcd_s *dev)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void stm32_deselect(FAR struct ssd1289_lcd_s *dev)
|
||||
static void stm32_deselect(struct ssd1289_lcd_s *dev)
|
||||
{
|
||||
/* Does not apply to this hardware */
|
||||
}
|
||||
@ -184,7 +184,7 @@ static void stm32_deselect(FAR struct ssd1289_lcd_s *dev)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void stm32_index(FAR struct ssd1289_lcd_s *dev, uint8_t index)
|
||||
static void stm32_index(struct ssd1289_lcd_s *dev, uint8_t index)
|
||||
{
|
||||
putreg16((uint16_t)index, LCD_INDEX);
|
||||
}
|
||||
@ -198,7 +198,7 @@ static void stm32_index(FAR struct ssd1289_lcd_s *dev, uint8_t index)
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_SSD1289_WRONLY
|
||||
static uint16_t stm32_read(FAR struct ssd1289_lcd_s *dev)
|
||||
static uint16_t stm32_read(struct ssd1289_lcd_s *dev)
|
||||
{
|
||||
return getreg16(LCD_DATA);
|
||||
}
|
||||
@ -212,7 +212,7 @@ static uint16_t stm32_read(FAR struct ssd1289_lcd_s *dev)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void stm32_write(FAR struct ssd1289_lcd_s *dev, uint16_t data)
|
||||
static void stm32_write(struct ssd1289_lcd_s *dev, uint16_t data)
|
||||
{
|
||||
putreg16((uint16_t)data, LCD_DATA);
|
||||
}
|
||||
@ -227,7 +227,7 @@ static void stm32_write(FAR struct ssd1289_lcd_s *dev, uint16_t data)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void stm32_backlight(FAR struct ssd1289_lcd_s *dev, int power)
|
||||
static void stm32_backlight(struct ssd1289_lcd_s *dev, int power)
|
||||
{
|
||||
DEBUGASSERT(power <= CONFIG_LCD_MAXPOWER);
|
||||
|
||||
@ -463,7 +463,7 @@ int board_lcd_initialize(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct lcd_dev_s *board_lcd_getdev(int lcddev)
|
||||
struct lcd_dev_s *board_lcd_getdev(int lcddev)
|
||||
{
|
||||
DEBUGASSERT(lcddev == 0);
|
||||
return g_ssd1289drvr;
|
||||
|
@ -48,19 +48,19 @@
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static int hymini_ts_irq_attach(FAR struct ads7843e_config_s *state,
|
||||
static int hymini_ts_irq_attach(struct ads7843e_config_s *state,
|
||||
xcpt_t isr);
|
||||
static void hymini_ts_irq_enable(FAR struct ads7843e_config_s *state,
|
||||
static void hymini_ts_irq_enable(struct ads7843e_config_s *state,
|
||||
bool enable);
|
||||
static void hymini_ts_irq_clear(FAR struct ads7843e_config_s *state);
|
||||
static bool hymini_ts_busy(FAR struct ads7843e_config_s *state);
|
||||
static bool hymini_ts_pendown(FAR struct ads7843e_config_s *state);
|
||||
static void hymini_ts_irq_clear(struct ads7843e_config_s *state);
|
||||
static bool hymini_ts_busy(struct ads7843e_config_s *state);
|
||||
static bool hymini_ts_pendown(struct ads7843e_config_s *state);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
static FAR struct ads7843e_config_s ts_cfg =
|
||||
static struct ads7843e_config_s ts_cfg =
|
||||
{
|
||||
.frequency = CONFIG_ADS7843E_FREQUENCY,
|
||||
|
||||
@ -79,7 +79,7 @@ static xcpt_t tc_isr;
|
||||
|
||||
/* Attach the ADS7843E interrupt handler to the GPIO interrupt */
|
||||
|
||||
static int hymini_ts_irq_attach(FAR struct ads7843e_config_s *state,
|
||||
static int hymini_ts_irq_attach(struct ads7843e_config_s *state,
|
||||
xcpt_t isr)
|
||||
{
|
||||
iinfo("hymini_ts_irq_attach\n");
|
||||
@ -91,7 +91,7 @@ static int hymini_ts_irq_attach(FAR struct ads7843e_config_s *state,
|
||||
|
||||
/* Enable or disable the GPIO interrupt */
|
||||
|
||||
static void hymini_ts_irq_enable(FAR struct ads7843e_config_s *state,
|
||||
static void hymini_ts_irq_enable(struct ads7843e_config_s *state,
|
||||
bool enable)
|
||||
{
|
||||
iinfo("%d\n", enable);
|
||||
@ -102,14 +102,14 @@ static void hymini_ts_irq_enable(FAR struct ads7843e_config_s *state,
|
||||
|
||||
/* Acknowledge/clear any pending GPIO interrupt */
|
||||
|
||||
static void hymini_ts_irq_clear(FAR struct ads7843e_config_s *state)
|
||||
static void hymini_ts_irq_clear(struct ads7843e_config_s *state)
|
||||
{
|
||||
/* FIXME Nothing to do ? */
|
||||
}
|
||||
|
||||
/* As the busy line is not connected, we just wait a little bit here */
|
||||
|
||||
static bool hymini_ts_busy(FAR struct ads7843e_config_s *state)
|
||||
static bool hymini_ts_busy(struct ads7843e_config_s *state)
|
||||
{
|
||||
up_mdelay(50);
|
||||
return false;
|
||||
@ -117,7 +117,7 @@ static bool hymini_ts_busy(FAR struct ads7843e_config_s *state)
|
||||
|
||||
/* Return the state of the pen down GPIO input */
|
||||
|
||||
static bool hymini_ts_pendown(FAR struct ads7843e_config_s *state)
|
||||
static bool hymini_ts_pendown(struct ads7843e_config_s *state)
|
||||
{
|
||||
bool pin_value = stm32_gpioread(GPIO_TS_IRQ);
|
||||
return !pin_value;
|
||||
@ -142,7 +142,7 @@ static bool hymini_ts_pendown(FAR struct ads7843e_config_s *state)
|
||||
|
||||
int stm32_tsc_setup(int minor)
|
||||
{
|
||||
FAR struct spi_dev_s *dev;
|
||||
struct spi_dev_s *dev;
|
||||
|
||||
iinfo("minor %d\n", minor);
|
||||
|
||||
|
@ -78,7 +78,7 @@ void stm32_usbinitialize(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int stm32_usbpullup(FAR struct usbdev_s *dev, bool enable)
|
||||
int stm32_usbpullup(struct usbdev_s *dev, bool enable)
|
||||
{
|
||||
usbtrace(TRACE_DEVPULLUP, (uint16_t)enable);
|
||||
stm32_gpiowrite(GPIO_USB_PULLUP, !enable);
|
||||
@ -97,7 +97,7 @@ int stm32_usbpullup(FAR struct usbdev_s *dev, bool enable)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume)
|
||||
void stm32_usbsuspend(struct usbdev_s *dev, bool resume)
|
||||
{
|
||||
uinfo("resume: %d\n", resume);
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ int board_usbmsc_initialize(int port)
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_NSH_BUILTIN_APPS
|
||||
FAR struct sdio_dev_s *sdio;
|
||||
struct sdio_dev_s *sdio;
|
||||
int ret;
|
||||
|
||||
/* First, get an instance of the SDIO interface */
|
||||
|
@ -127,7 +127,7 @@ static void up_lcdsetvcomfreq(unsigned int freq)
|
||||
STM32_TIM_SETPERIOD(tim, TIMER_FREQ / freq);
|
||||
}
|
||||
|
||||
static FAR struct memlcd_priv_s memlcd_priv =
|
||||
static struct memlcd_priv_s memlcd_priv =
|
||||
{
|
||||
.attachirq = up_lcdirqattach,
|
||||
.dispcontrol = up_lcddispcontrol,
|
||||
@ -151,7 +151,7 @@ static FAR struct memlcd_priv_s memlcd_priv =
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR int board_lcd_initialize(void)
|
||||
int board_lcd_initialize(void)
|
||||
{
|
||||
lcdinfo("Initializing lcd\n");
|
||||
|
||||
@ -189,7 +189,7 @@ FAR int board_lcd_initialize(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct lcd_dev_s *board_lcd_getdev(int lcddev)
|
||||
struct lcd_dev_s *board_lcd_getdev(int lcddev)
|
||||
{
|
||||
DEBUGASSERT(lcddev == 0);
|
||||
return l_lcddev;
|
||||
|
@ -89,7 +89,7 @@ void weak_function stm32_spidev_initialize(void)
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_STM32_SPI1
|
||||
void stm32_spi1select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void stm32_spi1select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n",
|
||||
@ -103,12 +103,12 @@ void stm32_spi1select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
# endif
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
int stm32_spi1cmddata(FAR struct spi_dev_s *dev,
|
||||
int stm32_spi1cmddata(struct spi_dev_s *dev,
|
||||
uint32_t devid, bool cmd)
|
||||
{
|
||||
return -ENODEV;
|
||||
@ -116,17 +116,17 @@ int stm32_spi1cmddata(FAR struct spi_dev_s *dev,
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32_SPI2
|
||||
void stm32_spi2select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void stm32_spi2select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int stm32_spi1cmddata(FAR struct spi_dev_s *dev,
|
||||
int stm32_spi1cmddata(struct spi_dev_s *dev,
|
||||
uint32_t devid, bool cmd)
|
||||
{
|
||||
return -ENODEV;
|
||||
|
@ -77,7 +77,7 @@ void stm32_usbinitialize(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int stm32_usbpullup(FAR struct usbdev_s *dev, bool enable)
|
||||
int stm32_usbpullup(struct usbdev_s *dev, bool enable)
|
||||
{
|
||||
usbtrace(TRACE_DEVPULLUP, (uint16_t)enable);
|
||||
stm32_gpiowrite(GPIO_USB_PULLUP, !enable);
|
||||
@ -95,7 +95,7 @@ int stm32_usbpullup(FAR struct usbdev_s *dev, bool enable)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume)
|
||||
void stm32_usbsuspend(struct usbdev_s *dev, bool resume)
|
||||
{
|
||||
uinfo("resume: %d\n", resume);
|
||||
}
|
||||
|
@ -287,7 +287,7 @@ int stm32_tsc_setup(int minor);
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_AUDIO_VS1053
|
||||
void up_vs1053initialize(FAR struct spi_dev_s *spi);
|
||||
void up_vs1053initialize(struct spi_dev_s *spi);
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
@ -176,8 +176,8 @@
|
||||
int board_app_initialize(uintptr_t arg)
|
||||
{
|
||||
#ifdef CONFIG_STM32_SPI3
|
||||
FAR struct spi_dev_s *spi;
|
||||
FAR struct mtd_dev_s *mtd;
|
||||
struct spi_dev_s *spi;
|
||||
struct mtd_dev_s *mtd;
|
||||
#endif
|
||||
int ret = OK;
|
||||
|
||||
@ -219,7 +219,7 @@ int board_app_initialize(uintptr_t arg)
|
||||
int partoffset;
|
||||
const char *partstring = CONFIG_MIKROE_FLASH_PART_LIST;
|
||||
const char *ptr;
|
||||
FAR struct mtd_dev_s *mtd_part;
|
||||
struct mtd_dev_s *mtd_part;
|
||||
char partname[16];
|
||||
|
||||
/* Now create a partition on the FLASH device */
|
||||
|
@ -94,7 +94,7 @@ struct stm32f4_dev_s
|
||||
struct mio283qt2_lcd_s dev; /* The externally visible part of the driver */
|
||||
bool grammode; /* true=Writing to GRAM (16-bit write vs 8-bit) */
|
||||
bool firstread; /* First GRAM read? */
|
||||
FAR struct lcd_dev_s *drvr; /* The saved instance of the LCD driver */
|
||||
struct lcd_dev_s *drvr; /* The saved instance of the LCD driver */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
@ -103,14 +103,14 @@ struct stm32f4_dev_s
|
||||
|
||||
/* Low Level LCD access */
|
||||
|
||||
static void stm32_select(FAR struct mio283qt2_lcd_s *dev);
|
||||
static void stm32_deselect(FAR struct mio283qt2_lcd_s *dev);
|
||||
static void stm32_index(FAR struct mio283qt2_lcd_s *dev, uint8_t index);
|
||||
static void stm32_select(struct mio283qt2_lcd_s *dev);
|
||||
static void stm32_deselect(struct mio283qt2_lcd_s *dev);
|
||||
static void stm32_index(struct mio283qt2_lcd_s *dev, uint8_t index);
|
||||
#if !defined(CONFIG_MIO283QT2_WRONLY) && !defined(CONFIG_LCD_NOGETRUN)
|
||||
static uint16_t stm32_read(FAR struct mio283qt2_lcd_s *dev);
|
||||
static uint16_t stm32_read(struct mio283qt2_lcd_s *dev);
|
||||
#endif
|
||||
static void stm32_write(FAR struct mio283qt2_lcd_s *dev, uint16_t data);
|
||||
static void stm32_backlight(FAR struct mio283qt2_lcd_s *dev, int power);
|
||||
static void stm32_write(struct mio283qt2_lcd_s *dev, uint16_t data);
|
||||
static void stm32_backlight(struct mio283qt2_lcd_s *dev, int power);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
@ -196,7 +196,7 @@ static inline void stm32_data(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void stm32_select(FAR struct mio283qt2_lcd_s *dev)
|
||||
static void stm32_select(struct mio283qt2_lcd_s *dev)
|
||||
{
|
||||
/* CS low selects */
|
||||
|
||||
@ -211,7 +211,7 @@ static void stm32_select(FAR struct mio283qt2_lcd_s *dev)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void stm32_deselect(FAR struct mio283qt2_lcd_s *dev)
|
||||
static void stm32_deselect(struct mio283qt2_lcd_s *dev)
|
||||
{
|
||||
/* CS high de-selects */
|
||||
|
||||
@ -226,9 +226,9 @@ static void stm32_deselect(FAR struct mio283qt2_lcd_s *dev)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void stm32_index(FAR struct mio283qt2_lcd_s *dev, uint8_t index)
|
||||
static void stm32_index(struct mio283qt2_lcd_s *dev, uint8_t index)
|
||||
{
|
||||
FAR struct stm32f4_dev_s *priv = (FAR struct stm32f4_dev_s *)dev;
|
||||
struct stm32f4_dev_s *priv = (struct stm32f4_dev_s *)dev;
|
||||
|
||||
/* Setup to write in command mode (vs data mode) */
|
||||
|
||||
@ -271,9 +271,9 @@ static void stm32_index(FAR struct mio283qt2_lcd_s *dev, uint8_t index)
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_MIO283QT2_WRONLY) && !defined(CONFIG_LCD_NOGETRUN)
|
||||
static uint16_t stm32_read(FAR struct mio283qt2_lcd_s *dev)
|
||||
static uint16_t stm32_read(struct mio283qt2_lcd_s *dev)
|
||||
{
|
||||
FAR struct stm32f4_dev_s *priv = (FAR struct stm32f4_dev_s *)dev;
|
||||
struct stm32f4_dev_s *priv = (struct stm32f4_dev_s *)dev;
|
||||
uint32_t * volatile portsetreset = (uint32_t *) STM32_GPIOE_BSRR;
|
||||
uint32_t * volatile portmode = (uint32_t *) STM32_GPIOE_MODER;
|
||||
uint32_t * volatile portinput = (uint32_t *) STM32_GPIOE_IDR;
|
||||
@ -347,9 +347,9 @@ static uint16_t stm32_read(FAR struct mio283qt2_lcd_s *dev)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void stm32_write(FAR struct mio283qt2_lcd_s *dev, uint16_t data)
|
||||
static void stm32_write(struct mio283qt2_lcd_s *dev, uint16_t data)
|
||||
{
|
||||
FAR struct stm32f4_dev_s *priv = (FAR struct stm32f4_dev_s *)dev;
|
||||
struct stm32f4_dev_s *priv = (struct stm32f4_dev_s *)dev;
|
||||
|
||||
/* Write the data register to the 8-bit GPIO pin bus. We are violating the
|
||||
* datasheet here a little by driving the WR pin low at the same time as
|
||||
@ -386,7 +386,7 @@ static void stm32_write(FAR struct mio283qt2_lcd_s *dev, uint16_t data)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void stm32_backlight(FAR struct mio283qt2_lcd_s *dev, int power)
|
||||
static void stm32_backlight(struct mio283qt2_lcd_s *dev, int power)
|
||||
{
|
||||
/* For now, we just control the backlight as a discrete. Pulse width
|
||||
* modulation would be required to vary the backlight level. A low value
|
||||
@ -504,7 +504,7 @@ int board_lcd_initialize(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct lcd_dev_s *board_lcd_getdev(int lcddev)
|
||||
struct lcd_dev_s *board_lcd_getdev(int lcddev)
|
||||
{
|
||||
DEBUGASSERT(lcddev == 0);
|
||||
return g_stm32f4_lcd.drvr;
|
||||
|
@ -91,10 +91,10 @@
|
||||
|
||||
struct stm32f4_dev_s
|
||||
{
|
||||
struct mio283qt9a_lcd_s dev; /* The externally visible part of the driver */
|
||||
bool grammode; /* true=Writing to GRAM (16-bit write vs 8-bit) */
|
||||
bool firstread; /* First GRAM read? */
|
||||
FAR struct lcd_dev_s *drvr; /* The saved instance of the LCD driver */
|
||||
struct mio283qt9a_lcd_s dev; /* The externally visible part of the driver */
|
||||
bool grammode; /* true=Writing to GRAM (16-bit write vs 8-bit) */
|
||||
bool firstread; /* First GRAM read? */
|
||||
struct lcd_dev_s *drvr; /* The saved instance of the LCD driver */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
@ -103,14 +103,14 @@ struct stm32f4_dev_s
|
||||
|
||||
/* Low Level LCD access */
|
||||
|
||||
static void stm32_select(FAR struct mio283qt9a_lcd_s *dev);
|
||||
static void stm32_deselect(FAR struct mio283qt9a_lcd_s *dev);
|
||||
static void stm32_index(FAR struct mio283qt9a_lcd_s *dev, uint8_t index);
|
||||
static void stm32_select(struct mio283qt9a_lcd_s *dev);
|
||||
static void stm32_deselect(struct mio283qt9a_lcd_s *dev);
|
||||
static void stm32_index(struct mio283qt9a_lcd_s *dev, uint8_t index);
|
||||
#if !defined(CONFIG_MIO283QT2_WRONLY) && !defined(CONFIG_LCD_NOGETRUN)
|
||||
static uint16_t stm32_read(FAR struct mio283qt9a_lcd_s *dev);
|
||||
static uint16_t stm32_read(struct mio283qt9a_lcd_s *dev);
|
||||
#endif
|
||||
static void stm32_write(FAR struct mio283qt9a_lcd_s *dev, uint16_t data);
|
||||
static void stm32_backlight(FAR struct mio283qt9a_lcd_s *dev, int power);
|
||||
static void stm32_write(struct mio283qt9a_lcd_s *dev, uint16_t data);
|
||||
static void stm32_backlight(struct mio283qt9a_lcd_s *dev, int power);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
@ -196,7 +196,7 @@ static inline void stm32_data(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void stm32_select(FAR struct mio283qt9a_lcd_s *dev)
|
||||
static void stm32_select(struct mio283qt9a_lcd_s *dev)
|
||||
{
|
||||
/* CS low selects */
|
||||
|
||||
@ -211,7 +211,7 @@ static void stm32_select(FAR struct mio283qt9a_lcd_s *dev)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void stm32_deselect(FAR struct mio283qt9a_lcd_s *dev)
|
||||
static void stm32_deselect(struct mio283qt9a_lcd_s *dev)
|
||||
{
|
||||
/* CS high de-selects */
|
||||
|
||||
@ -226,9 +226,9 @@ static void stm32_deselect(FAR struct mio283qt9a_lcd_s *dev)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void stm32_index(FAR struct mio283qt9a_lcd_s *dev, uint8_t index)
|
||||
static void stm32_index(struct mio283qt9a_lcd_s *dev, uint8_t index)
|
||||
{
|
||||
FAR struct stm32f4_dev_s *priv = (FAR struct stm32f4_dev_s *)dev;
|
||||
struct stm32f4_dev_s *priv = (struct stm32f4_dev_s *)dev;
|
||||
|
||||
/* Setup to write in command mode (vs data mode) */
|
||||
|
||||
@ -271,9 +271,9 @@ static void stm32_index(FAR struct mio283qt9a_lcd_s *dev, uint8_t index)
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_MIO283QT2_WRONLY) && !defined(CONFIG_LCD_NOGETRUN)
|
||||
static uint16_t stm32_read(FAR struct mio283qt9a_lcd_s *dev)
|
||||
static uint16_t stm32_read(struct mio283qt9a_lcd_s *dev)
|
||||
{
|
||||
FAR struct stm32f4_dev_s *priv = (FAR struct stm32f4_dev_s *)dev;
|
||||
struct stm32f4_dev_s *priv = (struct stm32f4_dev_s *)dev;
|
||||
uint32_t * volatile portsetreset = (uint32_t *) STM32_GPIOE_BSRR;
|
||||
uint32_t * volatile portmode = (uint32_t *) STM32_GPIOE_MODER;
|
||||
uint32_t * volatile portinput = (uint32_t *) STM32_GPIOE_IDR;
|
||||
@ -347,9 +347,9 @@ static uint16_t stm32_read(FAR struct mio283qt9a_lcd_s *dev)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void stm32_write(FAR struct mio283qt9a_lcd_s *dev, uint16_t data)
|
||||
static void stm32_write(struct mio283qt9a_lcd_s *dev, uint16_t data)
|
||||
{
|
||||
FAR struct stm32f4_dev_s *priv = (FAR struct stm32f4_dev_s *)dev;
|
||||
struct stm32f4_dev_s *priv = (struct stm32f4_dev_s *)dev;
|
||||
|
||||
/* Write the data register to the 8-bit GPIO pin bus. We are violating the
|
||||
* datasheet here a little by driving the WR pin low at the same time as
|
||||
@ -386,7 +386,7 @@ static void stm32_write(FAR struct mio283qt9a_lcd_s *dev, uint16_t data)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void stm32_backlight(FAR struct mio283qt9a_lcd_s *dev, int power)
|
||||
static void stm32_backlight(struct mio283qt9a_lcd_s *dev, int power)
|
||||
{
|
||||
/* For now, we just control the backlight as a discrete. Pulse width
|
||||
* modulation would be required to vary the backlight level. A low value
|
||||
@ -503,7 +503,7 @@ int board_lcd_initialize(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct lcd_dev_s *board_lcd_getdev(int lcddev)
|
||||
struct lcd_dev_s *board_lcd_getdev(int lcddev)
|
||||
{
|
||||
DEBUGASSERT(lcddev == 0);
|
||||
return g_stm32f4_lcd.drvr;
|
||||
|
@ -105,7 +105,7 @@ void weak_function stm32_spidev_initialize(void)
|
||||
****************************************************************************/
|
||||
|
||||
#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)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n",
|
||||
@ -147,7 +147,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 ret = 0;
|
||||
|
||||
@ -168,28 +168,28 @@ uint8_t stm32_spi3status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
#endif
|
||||
|
||||
#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)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n",
|
||||
(int)devid, selected ? "assert" : "de-assert");
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#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)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n",
|
||||
(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;
|
||||
}
|
||||
@ -220,21 +220,21 @@ uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
#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;
|
||||
}
|
||||
#endif
|
||||
|
||||
#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)
|
||||
{
|
||||
return OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
#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)
|
||||
{
|
||||
return OK;
|
||||
}
|
||||
|
@ -237,20 +237,20 @@ static void tc_y_sample(void);
|
||||
static void tc_x_sample(void);
|
||||
static inline bool tc_valid_sample(uint16_t sample);
|
||||
|
||||
static void tc_notify(FAR struct tc_dev_s *priv);
|
||||
static int tc_sample(FAR struct tc_dev_s *priv,
|
||||
FAR struct tc_sample_s *sample);
|
||||
static int tc_waitsample(FAR struct tc_dev_s *priv,
|
||||
FAR struct tc_sample_s *sample);
|
||||
static void tc_worker(FAR void *arg);
|
||||
static void tc_notify(struct tc_dev_s *priv);
|
||||
static int tc_sample(struct tc_dev_s *priv,
|
||||
struct tc_sample_s *sample);
|
||||
static int tc_waitsample(struct tc_dev_s *priv,
|
||||
struct tc_sample_s *sample);
|
||||
static void tc_worker(void *arg);
|
||||
|
||||
/* Character driver methods */
|
||||
|
||||
static int tc_open(FAR struct file *filep);
|
||||
static int tc_close(FAR struct file *filep);
|
||||
static ssize_t tc_read(FAR struct file *filep, FAR char *buffer, size_t len);
|
||||
static int tc_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
|
||||
static int tc_poll(FAR struct file *filep, struct pollfd *fds, bool setup);
|
||||
static int tc_open(struct file *filep);
|
||||
static int tc_close(struct file *filep);
|
||||
static ssize_t tc_read(struct file *filep, char *buffer, size_t len);
|
||||
static int tc_ioctl(struct file *filep, int cmd, unsigned long arg);
|
||||
static int tc_poll(struct file *filep, struct pollfd *fds, bool setup);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
@ -573,7 +573,7 @@ static inline bool tc_valid_sample(uint16_t sample)
|
||||
* Name: tc_notify
|
||||
****************************************************************************/
|
||||
|
||||
static void tc_notify(FAR struct tc_dev_s *priv)
|
||||
static void tc_notify(struct tc_dev_s *priv)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -627,8 +627,8 @@ static void tc_notify(FAR struct tc_dev_s *priv)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int tc_sample(FAR struct tc_dev_s *priv,
|
||||
FAR struct tc_sample_s *sample)
|
||||
static int tc_sample(struct tc_dev_s *priv,
|
||||
struct tc_sample_s *sample)
|
||||
{
|
||||
int ret = -EAGAIN;
|
||||
|
||||
@ -672,8 +672,8 @@ static int tc_sample(FAR struct tc_dev_s *priv,
|
||||
* Name: tc_waitsample
|
||||
****************************************************************************/
|
||||
|
||||
static int tc_waitsample(FAR struct tc_dev_s *priv,
|
||||
FAR struct tc_sample_s *sample)
|
||||
static int tc_waitsample(struct tc_dev_s *priv,
|
||||
struct tc_sample_s *sample)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@ -730,9 +730,9 @@ errout:
|
||||
* Name: tc_worker
|
||||
****************************************************************************/
|
||||
|
||||
static void tc_worker(FAR void *arg)
|
||||
static void tc_worker(void *arg)
|
||||
{
|
||||
FAR struct tc_dev_s *priv = (FAR struct tc_dev_s *)arg;
|
||||
struct tc_dev_s *priv = (struct tc_dev_s *)arg;
|
||||
uint32_t delay = TC_PENUP_POLL_TICKS;
|
||||
uint16_t value;
|
||||
uint16_t newx = 0;
|
||||
@ -1097,19 +1097,19 @@ static void tc_worker(FAR void *arg)
|
||||
* Name: tc_open
|
||||
****************************************************************************/
|
||||
|
||||
static int tc_open(FAR struct file *filep)
|
||||
static int tc_open(struct file *filep)
|
||||
{
|
||||
#ifdef CONFIG_TOUCHSCREEN_REFCNT
|
||||
FAR struct inode *inode;
|
||||
FAR struct tc_dev_s *priv;
|
||||
uint8_t tmp;
|
||||
int ret;
|
||||
struct inode *inode;
|
||||
struct tc_dev_s *priv;
|
||||
uint8_t tmp;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
priv = (FAR struct tc_dev_s *)inode->i_private;
|
||||
priv = (struct tc_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the driver data structure */
|
||||
|
||||
@ -1150,18 +1150,18 @@ errout_with_sem:
|
||||
* Name: tc_close
|
||||
****************************************************************************/
|
||||
|
||||
static int tc_close(FAR struct file *filep)
|
||||
static int tc_close(struct file *filep)
|
||||
{
|
||||
#ifdef CONFIG_TOUCHSCREEN_REFCNT
|
||||
FAR struct inode *inode;
|
||||
FAR struct tc_dev_s *priv;
|
||||
int ret;
|
||||
struct inode *inode;
|
||||
struct tc_dev_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
priv = (FAR struct tc_dev_s *)inode->i_private;
|
||||
priv = (struct tc_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the driver data structure */
|
||||
|
||||
@ -1190,19 +1190,19 @@ static int tc_close(FAR struct file *filep)
|
||||
* Name: tc_read
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t tc_read(FAR struct file *filep, FAR char *buffer, size_t len)
|
||||
static ssize_t tc_read(struct file *filep, char *buffer, size_t len)
|
||||
{
|
||||
FAR struct inode *inode;
|
||||
FAR struct tc_dev_s *priv;
|
||||
FAR struct touch_sample_s *report;
|
||||
struct inode *inode;
|
||||
struct tc_dev_s *priv;
|
||||
struct touch_sample_s *report;
|
||||
struct tc_sample_s sample;
|
||||
int ret;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
priv = (FAR struct tc_dev_s *)inode->i_private;
|
||||
priv = (struct tc_dev_s *)inode->i_private;
|
||||
|
||||
/* Verify that the caller has provided a buffer large enough to receive
|
||||
* the touch data.
|
||||
@ -1256,7 +1256,7 @@ static ssize_t tc_read(FAR struct file *filep, FAR char *buffer, size_t len)
|
||||
* to the caller.
|
||||
*/
|
||||
|
||||
report = (FAR struct touch_sample_s *)buffer;
|
||||
report = (struct touch_sample_s *)buffer;
|
||||
memset(report, 0, SIZEOF_TOUCH_SAMPLE_S(1));
|
||||
report->npoints = 1;
|
||||
report->point[0].id = sample.id;
|
||||
@ -1311,14 +1311,14 @@ errout:
|
||||
* Name: tc_ioctl
|
||||
****************************************************************************/
|
||||
|
||||
static int tc_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
static int tc_ioctl(struct file *filep, int cmd, unsigned long arg)
|
||||
{
|
||||
#if 1
|
||||
iinfo("cmd: %d arg: %ld\n", cmd, arg);
|
||||
return -ENOTTY; /* None yet supported */
|
||||
#else
|
||||
FAR struct inode *inode;
|
||||
FAR struct tc_dev_s *priv;
|
||||
struct inode *inode;
|
||||
struct tc_dev_s *priv;
|
||||
int ret;
|
||||
|
||||
iinfo("cmd: %d arg: %ld\n", cmd, arg);
|
||||
@ -1326,7 +1326,7 @@ static int tc_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
priv = (FAR struct tc_dev_s *)inode->i_private;
|
||||
priv = (struct tc_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the driver data structure */
|
||||
|
||||
@ -1356,20 +1356,20 @@ static int tc_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
* Name: tc_poll
|
||||
****************************************************************************/
|
||||
|
||||
static int tc_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||
static int tc_poll(struct file *filep, struct pollfd *fds,
|
||||
bool setup)
|
||||
{
|
||||
FAR struct inode *inode;
|
||||
FAR struct tc_dev_s *priv;
|
||||
int ret;
|
||||
int i;
|
||||
struct inode *inode;
|
||||
struct tc_dev_s *priv;
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
iinfo("setup: %d\n", (int)setup);
|
||||
DEBUGASSERT(filep && fds);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
priv = (FAR struct tc_dev_s *)inode->i_private;
|
||||
priv = (struct tc_dev_s *)inode->i_private;
|
||||
|
||||
/* Are we setting up the poll? Or tearing it down? */
|
||||
|
||||
@ -1465,7 +1465,7 @@ errout:
|
||||
|
||||
int stm32_tsc_setup(int minor)
|
||||
{
|
||||
FAR struct tc_dev_s *priv;
|
||||
struct tc_dev_s *priv;
|
||||
char devname[DEV_NAMELEN];
|
||||
#ifdef CONFIG_TOUCHSCREEN_MULTIPLE
|
||||
irqstate_t flags;
|
||||
@ -1501,7 +1501,7 @@ int stm32_tsc_setup(int minor)
|
||||
#ifndef CONFIG_TOUCHSCREEN_MULTIPLE
|
||||
priv = &g_touchscreen;
|
||||
#else
|
||||
priv = (FAR struct tc_dev_s *)kmm_malloc(sizeof(struct tc_dev_s));
|
||||
priv = (struct tc_dev_s *)kmm_malloc(sizeof(struct tc_dev_s));
|
||||
if (!priv)
|
||||
{
|
||||
ierr("ERROR: kmm_malloc(%d) failed\n", sizeof(struct tc_dev_s));
|
||||
|
@ -200,7 +200,7 @@ int stm32_usbhost_initialize(void)
|
||||
|
||||
ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
|
||||
CONFIG_USBHOST_STACKSIZE,
|
||||
(main_t)usbhost_waiter, (FAR char * const *)NULL);
|
||||
(main_t)usbhost_waiter, (char * const *)NULL);
|
||||
return ret < 0 ? -ENOEXEC : OK;
|
||||
}
|
||||
|
||||
@ -293,7 +293,7 @@ int stm32_setup_overcurrent(xcpt_t handler, void *arg)
|
||||
****************************************************************************/
|
||||
|
||||
#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);
|
||||
}
|
||||
|
@ -64,19 +64,19 @@ struct stm32_lower_s
|
||||
{
|
||||
const struct vs1053_lower_s lower; /* Low-level MCU interface */
|
||||
xcpt_t handler; /* VS1053 interrupt handler */
|
||||
FAR void *arg; /* Interrupt handler argument */
|
||||
void *arg; /* Interrupt handler argument */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static int up_attach(FAR const struct vs1053_lower_s *lower, xcpt_t handler,
|
||||
FAR void *arg);
|
||||
static void up_enable(FAR const struct vs1053_lower_s *lower);
|
||||
static void up_disable(FAR const struct vs1053_lower_s *lower);
|
||||
static void up_reset(FAR const struct vs1053_lower_s *lower, bool state);
|
||||
static int up_read_dreq(FAR const struct vs1053_lower_s *lower);
|
||||
static int up_attach(const struct vs1053_lower_s *lower, xcpt_t handler,
|
||||
void *arg);
|
||||
static void up_enable(const struct vs1053_lower_s *lower);
|
||||
static void up_disable(const struct vs1053_lower_s *lower);
|
||||
static void up_reset(const struct vs1053_lower_s *lower, bool state);
|
||||
static int up_read_dreq(const struct vs1053_lower_s *lower);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
@ -110,36 +110,36 @@ static struct stm32_lower_s g_vs1053lower =
|
||||
* Name: struct vs1053_lower_s methods
|
||||
****************************************************************************/
|
||||
|
||||
static int up_attach(FAR const struct vs1053_lower_s *lower, xcpt_t handler,
|
||||
FAR void *arg)
|
||||
static int up_attach(const struct vs1053_lower_s *lower, xcpt_t handler,
|
||||
void *arg)
|
||||
{
|
||||
FAR struct stm32_lower_s *priv = (FAR struct stm32_lower_s *)lower;
|
||||
struct stm32_lower_s *priv = (struct stm32_lower_s *)lower;
|
||||
|
||||
priv->handler = handler; /* Save the handler for later */
|
||||
priv->arg = arg; /* Along with the handler argument */
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void up_enable(FAR const struct vs1053_lower_s *lower)
|
||||
static void up_enable(const struct vs1053_lower_s *lower)
|
||||
{
|
||||
FAR struct stm32_lower_s *priv = (FAR struct stm32_lower_s *)lower;
|
||||
struct stm32_lower_s *priv = (struct stm32_lower_s *)lower;
|
||||
|
||||
DEBUGASSERT(priv->handler);
|
||||
stm32_gpiosetevent(GPIO_VS1053_DREQ, true, false, false,
|
||||
priv->handler, priv->arg);
|
||||
}
|
||||
|
||||
static void up_disable(FAR const struct vs1053_lower_s *lower)
|
||||
static void up_disable(const struct vs1053_lower_s *lower)
|
||||
{
|
||||
stm32_gpiosetevent(GPIO_VS1053_DREQ, false, false, false, NULL, NULL);
|
||||
}
|
||||
|
||||
static void up_reset(FAR const struct vs1053_lower_s *lower, bool state)
|
||||
static void up_reset(const struct vs1053_lower_s *lower, bool state)
|
||||
{
|
||||
stm32_gpiowrite(GPIO_VS1053_RST, state);
|
||||
}
|
||||
|
||||
static int up_read_dreq(FAR const struct vs1053_lower_s *lower)
|
||||
static int up_read_dreq(const struct vs1053_lower_s *lower)
|
||||
{
|
||||
return stm32_gpioread(GPIO_VS1053_DREQ);
|
||||
}
|
||||
@ -152,11 +152,11 @@ static int up_read_dreq(FAR const struct vs1053_lower_s *lower)
|
||||
* Name: up_vs1053initialize
|
||||
****************************************************************************/
|
||||
|
||||
void up_vs1053initialize(FAR struct spi_dev_s * spi)
|
||||
void up_vs1053initialize(struct spi_dev_s * spi)
|
||||
{
|
||||
int ret;
|
||||
char name[16];
|
||||
FAR struct audio_lowerhalf_s *PVS1053;
|
||||
struct audio_lowerhalf_s *PVS1053;
|
||||
|
||||
/* Assumptions:
|
||||
* 1) SPI pins were configured in up_spi.c early in the boot-up phase.
|
||||
|
@ -166,7 +166,7 @@ static const uint32_t g_pinlist2[3] =
|
||||
int stm32_adc_setup(void)
|
||||
{
|
||||
static bool initialized = false;
|
||||
FAR struct adc_dev_s *adc;
|
||||
struct adc_dev_s *adc;
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
|
@ -94,7 +94,7 @@ uint32_t board_buttons(void)
|
||||
****************************************************************************/
|
||||
|
||||
#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;
|
||||
|
||||
|
@ -168,7 +168,7 @@ static const uint32_t g_pinlist2[3] =
|
||||
int stm32_adc_setup(void)
|
||||
{
|
||||
static bool initialized = false;
|
||||
FAR struct adc_dev_s *adc;
|
||||
struct adc_dev_s *adc;
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
|
@ -89,7 +89,7 @@ uint32_t board_buttons(void)
|
||||
****************************************************************************/
|
||||
|
||||
#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;
|
||||
|
||||
|
@ -227,7 +227,7 @@ int stm32_usbhost_initialize(void)
|
||||
|
||||
ret = kthread_create("usbhost", CONFIG_NUCLEOF207ZG_USBHOST_PRIO,
|
||||
CONFIG_NUCLEOF207ZG_USBHOST_STACKSIZE,
|
||||
(main_t)usbhost_waiter, (FAR char * const *)NULL);
|
||||
(main_t)usbhost_waiter, (char * const *)NULL);
|
||||
return ret < 0 ? -ENOEXEC : OK;
|
||||
}
|
||||
|
||||
@ -311,7 +311,7 @@ int stm32_setup_overcurrent(xcpt_t handler, void *arg)
|
||||
****************************************************************************/
|
||||
|
||||
#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);
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ uint32_t board_buttons(void)
|
||||
****************************************************************************/
|
||||
|
||||
#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;
|
||||
|
||||
|
@ -120,7 +120,7 @@
|
||||
|
||||
struct highpri_s
|
||||
{
|
||||
FAR struct stm32_adc_dev_s *adc1;
|
||||
struct stm32_adc_dev_s *adc1;
|
||||
#ifdef HIGHPRI_HAVE_TIM1
|
||||
struct stm32_pwm_dev_s *pwm;
|
||||
#endif
|
||||
@ -191,7 +191,7 @@ static struct highpri_s g_highpri;
|
||||
#if !defined(CONFIG_STM32_ADC1_DMA) || defined(HIGHPRI_HAVE_INJECTED)
|
||||
void adc12_handler(void)
|
||||
{
|
||||
FAR struct stm32_adc_dev_s *adc = g_highpri.adc1;
|
||||
struct stm32_adc_dev_s *adc = g_highpri.adc1;
|
||||
float ref = ADC_REF_VOLTAGE;
|
||||
float bit = ADC_VAL_MAX;
|
||||
uint32_t pending;
|
||||
@ -329,8 +329,8 @@ int highpri_main(int argc, char *argv[])
|
||||
#ifdef HIGHPRI_HAVE_TIM1
|
||||
struct stm32_pwm_dev_s *pwm1;
|
||||
#endif
|
||||
FAR struct adc_dev_s *adc1;
|
||||
FAR struct highpri_s *highpri;
|
||||
struct adc_dev_s *adc1;
|
||||
struct highpri_s *highpri;
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
@ -364,7 +364,7 @@ int highpri_main(int argc, char *argv[])
|
||||
#ifdef HIGHPRI_HAVE_TIM1
|
||||
/* Initialize TIM1 */
|
||||
|
||||
pwm1 = (FAR struct stm32_pwm_dev_s *) stm32_pwminitialize(1);
|
||||
pwm1 = (struct stm32_pwm_dev_s *) stm32_pwminitialize(1);
|
||||
if (pwm1 == NULL)
|
||||
{
|
||||
printf("ERROR: Failed to get PWM1 interface\n");
|
||||
|
@ -139,7 +139,7 @@ void weak_function stm32_spidev_initialize(void);
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_TIMER
|
||||
int stm32_timer_driver_setup(FAR const char *devpath, int timer);
|
||||
int stm32_timer_driver_setup(const char *devpath, int timer);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -304,7 +304,7 @@ static const uint32_t g_pinlist2[1] =
|
||||
|
||||
int stm32_adc_setup(void)
|
||||
{
|
||||
FAR struct adc_dev_s *adc;
|
||||
struct adc_dev_s *adc;
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
|
@ -94,7 +94,7 @@ uint32_t board_buttons(void)
|
||||
****************************************************************************/
|
||||
|
||||
#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;
|
||||
|
||||
|
@ -86,7 +86,7 @@ void weak_function stm32_spidev_initialize(void)
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_STM32_SPI1
|
||||
void stm32_spi1select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void stm32_spi1select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n",
|
||||
@ -100,35 +100,35 @@ void stm32_spi1select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
#endif
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32_SPI2
|
||||
void stm32_spi2select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void stm32_spi2select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n",
|
||||
(int)devid, selected ? "assert" : "de-assert");
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32_SPI3
|
||||
void stm32_spi3select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void stm32_spi3select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n",
|
||||
(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;
|
||||
}
|
||||
@ -158,7 +158,7 @@ uint8_t stm32_spi3status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
#ifdef CONFIG_STM32_SPI1
|
||||
int stm32_spi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
int stm32_spi1cmddata(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool cmd)
|
||||
{
|
||||
#ifdef CONFIG_LCD_SSD1351
|
||||
@ -174,7 +174,7 @@ int stm32_spi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32_SPI2
|
||||
int stm32_spi2cmddata(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
int stm32_spi2cmddata(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool cmd)
|
||||
{
|
||||
return -ENODEV;
|
||||
@ -182,7 +182,7 @@ int stm32_spi2cmddata(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32_SPI3
|
||||
int stm32_spi3cmddata(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
int stm32_spi3cmddata(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool cmd)
|
||||
{
|
||||
return -ENODEV;
|
||||
|
@ -67,10 +67,10 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno)
|
||||
struct lcd_dev_s *board_graphics_setup(unsigned int devno)
|
||||
{
|
||||
FAR struct spi_dev_s *spi;
|
||||
FAR struct lcd_dev_s *dev;
|
||||
struct spi_dev_s *spi;
|
||||
struct lcd_dev_s *dev;
|
||||
|
||||
/* Configure the OLED GPIOs. This initial configuration is RESET low,
|
||||
* putting the OLED into reset state.
|
||||
|
@ -57,7 +57,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int stm32_timer_driver_setup(FAR const char *devpath, int timer)
|
||||
int stm32_timer_driver_setup(const char *devpath, int timer)
|
||||
{
|
||||
return stm32_timer_initialize(devpath, timer);
|
||||
}
|
||||
|
@ -168,7 +168,7 @@ static const uint32_t g_pinlist2[3] =
|
||||
int stm32_adc_setup(void)
|
||||
{
|
||||
static bool initialized = false;
|
||||
FAR struct adc_dev_s *adc;
|
||||
struct adc_dev_s *adc;
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
|
@ -89,7 +89,7 @@ uint32_t board_buttons(void)
|
||||
****************************************************************************/
|
||||
|
||||
#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;
|
||||
|
||||
|
@ -72,7 +72,7 @@ int board_lcd_initialize(void)
|
||||
* Name: board_lcd_getdev
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct lcd_dev_s *board_lcd_getdev(int devno)
|
||||
struct lcd_dev_s *board_lcd_getdev(int devno)
|
||||
{
|
||||
return board_ssd1306_getdev();
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ void weak_function stm32_spidev_initialize(void);
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_TIMER
|
||||
int stm32_timer_driver_setup(FAR const char *devpath, int timer);
|
||||
int stm32_timer_driver_setup(const char *devpath, int timer);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -166,7 +166,7 @@ static const uint32_t g_pinlist2[3] =
|
||||
int stm32_adc_setup(void)
|
||||
{
|
||||
static bool initialized = false;
|
||||
FAR struct adc_dev_s *adc;
|
||||
struct adc_dev_s *adc;
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
|
@ -132,12 +132,12 @@
|
||||
|
||||
struct highpri_s
|
||||
{
|
||||
FAR struct stm32_adc_dev_s *adc1;
|
||||
struct stm32_adc_dev_s *adc1;
|
||||
#ifdef HIGHPRI_HAVE_HRTIM
|
||||
FAR struct hrtim_dev_s *hrtim;
|
||||
struct hrtim_dev_s *hrtim;
|
||||
#endif
|
||||
#ifdef HIGHPRI_HAVE_TIM1
|
||||
struct stm32_pwm_dev_s *pwm;
|
||||
struct stm32_pwm_dev_s *pwm;
|
||||
#endif
|
||||
volatile uint32_t cntr1;
|
||||
volatile uint32_t cntr2;
|
||||
@ -206,7 +206,7 @@ static struct highpri_s g_highpri;
|
||||
#if !defined(CONFIG_STM32_ADC1_DMA) || defined(HIGHPRI_HAVE_INJECTED)
|
||||
void adc12_handler(void)
|
||||
{
|
||||
FAR struct stm32_adc_dev_s *adc = g_highpri.adc1;
|
||||
struct stm32_adc_dev_s *adc = g_highpri.adc1;
|
||||
float ref = ADC_REF_VOLTAGE;
|
||||
float bit = ADC_VAL_MAX;
|
||||
uint32_t pending;
|
||||
@ -342,13 +342,13 @@ irq_out:
|
||||
int highpri_main(int argc, char *argv[])
|
||||
{
|
||||
#ifdef HIGHPRI_HAVE_HRTIM
|
||||
FAR struct hrtim_dev_s *hrtim;
|
||||
struct hrtim_dev_s *hrtim;
|
||||
#endif
|
||||
#ifdef HIGHPRI_HAVE_TIM1
|
||||
struct stm32_pwm_dev_s *pwm1;
|
||||
#endif
|
||||
FAR struct adc_dev_s *adc1;
|
||||
FAR struct highpri_s *highpri;
|
||||
struct adc_dev_s *adc1;
|
||||
struct highpri_s *highpri;
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
@ -400,7 +400,7 @@ int highpri_main(int argc, char *argv[])
|
||||
#ifdef HIGHPRI_HAVE_TIM1
|
||||
/* Initialize TIM1 */
|
||||
|
||||
pwm1 = (FAR struct stm32_pwm_dev_s *) stm32_pwminitialize(1);
|
||||
pwm1 = (struct stm32_pwm_dev_s *) stm32_pwminitialize(1);
|
||||
if (pwm1 == NULL)
|
||||
{
|
||||
printf("ERROR: Failed to get PWM1 interface\n");
|
||||
|
@ -199,9 +199,9 @@
|
||||
|
||||
struct spwm_s
|
||||
{
|
||||
FAR struct pwm_timer_s *pwm;
|
||||
struct pwm_timer_s *pwm;
|
||||
#ifdef CONFIG_NUCLEOF334R8_SPWM_USE_TIM1
|
||||
FAR struct stm32_tim_dev_s *tim;
|
||||
struct stm32_tim_dev_s *tim;
|
||||
#endif
|
||||
float waveform[SAMPLES_NUM]; /* Waveform samples */
|
||||
float phase_step; /* Waveform phase step */
|
||||
@ -231,27 +231,27 @@ static struct spwm_s g_spwm =
|
||||
****************************************************************************/
|
||||
|
||||
static float waveform_func(float x);
|
||||
static int waveform_init(FAR struct spwm_s *spwm, float (*f)(float));
|
||||
static int spwm_start(FAR struct spwm_s *spwm);
|
||||
static int spwm_start(FAR struct spwm_s *spwm);
|
||||
static int spwm_stop(FAR struct spwm_s *spwm);
|
||||
static int waveform_init(struct spwm_s *spwm, float (*f)(float));
|
||||
static int spwm_start(struct spwm_s *spwm);
|
||||
static int spwm_start(struct spwm_s *spwm);
|
||||
static int spwm_stop(struct spwm_s *spwm);
|
||||
#ifdef CONFIG_NUCLEOF334R8_SPWM_USE_HRTIM1
|
||||
static int master_configure(FAR struct spwm_s *spwm);
|
||||
static int slaves_configure(FAR struct spwm_s *spwm);
|
||||
static int master_configure(struct spwm_s *spwm);
|
||||
static int slaves_configure(struct spwm_s *spwm);
|
||||
static void hrtim_master_handler(void);
|
||||
static int spwm_hrtim_setup(FAR struct spwm_s *spwm);
|
||||
static int spwm_hrtim_start(FAR struct spwm_s *spwm);
|
||||
static int spwm_hrtim_stop(FAR struct spwm_s *spwm);
|
||||
static int spwm_hrtim_setup(struct spwm_s *spwm);
|
||||
static int spwm_hrtim_start(struct spwm_s *spwm);
|
||||
static int spwm_hrtim_stop(struct spwm_s *spwm);
|
||||
#endif /* CONFIG_NUCLEOF334R8_SPWM_USE_HRTIM1 */
|
||||
#ifdef CONFIG_NUCLEOF334R8_SPWM_USE_TIM1
|
||||
static int spwm_tim1_setup(FAR struct spwm_s *spwm);
|
||||
static int spwm_tim6_setup(FAR struct spwm_s *spwm);
|
||||
static int spwm_tim1_start(FAR struct spwm_s *spwm);
|
||||
static int spwm_tim6_start(FAR struct spwm_s *spwm);
|
||||
static int spwm_tim1_stop(FAR struct spwm_s *spwm);
|
||||
static int spwm_tim6_stop(FAR struct spwm_s *spwm);
|
||||
static int spwm_tim1_setup(struct spwm_s *spwm);
|
||||
static int spwm_tim6_setup(struct spwm_s *spwm);
|
||||
static int spwm_tim1_start(struct spwm_s *spwm);
|
||||
static int spwm_tim6_start(struct spwm_s *spwm);
|
||||
static int spwm_tim1_stop(struct spwm_s *spwm);
|
||||
static int spwm_tim6_stop(struct spwm_s *spwm);
|
||||
#endif /* CONFIG_NUCLEOF334R8_SPWM_USE_TIM1 */
|
||||
static int spwm_setup(FAR struct spwm_s *spwm);
|
||||
static int spwm_setup(struct spwm_s *spwm);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
@ -282,7 +282,7 @@ static float waveform_func(float x)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int waveform_init(FAR struct spwm_s *spwm, float (*f)(float))
|
||||
static int waveform_init(struct spwm_s *spwm, float (*f)(float))
|
||||
{
|
||||
uint16_t i = 0;
|
||||
int ret = 0;
|
||||
@ -340,7 +340,7 @@ static int waveform_init(FAR struct spwm_s *spwm, float (*f)(float))
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int spwm_start(FAR struct spwm_s *spwm)
|
||||
static int spwm_start(struct spwm_s *spwm)
|
||||
{
|
||||
#if defined(CONFIG_NUCLEOF334R8_SPWM_USE_HRTIM1)
|
||||
/* Start HRTIM */
|
||||
@ -370,7 +370,7 @@ static int spwm_start(FAR struct spwm_s *spwm)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int spwm_stop(FAR struct spwm_s *spwm)
|
||||
static int spwm_stop(struct spwm_s *spwm)
|
||||
{
|
||||
#if defined(CONFIG_NUCLEOF334R8_SPWM_USE_HRTIM1)
|
||||
/* Stop HRTIM */
|
||||
@ -398,9 +398,9 @@ static int spwm_stop(FAR struct spwm_s *spwm)
|
||||
* Name: master_configure
|
||||
****************************************************************************/
|
||||
|
||||
static int master_configure(FAR struct spwm_s *spwm)
|
||||
static int master_configure(struct spwm_s *spwm)
|
||||
{
|
||||
FAR struct hrtim_dev_s *hrtim = spwm->pwm;
|
||||
struct hrtim_dev_s *hrtim = spwm->pwm;
|
||||
uint64_t per = 0;
|
||||
uint64_t fclk = 0;
|
||||
uint64_t freq = 0;
|
||||
@ -440,9 +440,9 @@ errout:
|
||||
* Name: slaves_configure
|
||||
****************************************************************************/
|
||||
|
||||
static int slaves_configure(FAR struct spwm_s *spwm)
|
||||
static int slaves_configure(struct spwm_s *spwm)
|
||||
{
|
||||
FAR struct hrtim_dev_s *hrtim = spwm->pwm;
|
||||
struct hrtim_dev_s *hrtim = spwm->pwm;
|
||||
uint64_t fclk = 0;
|
||||
uint64_t per = 0;
|
||||
uint8_t index = 0;
|
||||
@ -494,8 +494,8 @@ errout:
|
||||
|
||||
static void hrtim_master_handler(void)
|
||||
{
|
||||
FAR struct spwm_s *spwm = &g_spwm;
|
||||
FAR struct hrtim_dev_s *hrtim = spwm->pwm;
|
||||
struct spwm_s *spwm = &g_spwm;
|
||||
struct hrtim_dev_s *hrtim = spwm->pwm;
|
||||
uint32_t pending = 0;
|
||||
uint8_t i = 0;
|
||||
|
||||
@ -537,9 +537,9 @@ static void hrtim_master_handler(void)
|
||||
* Name: spwm_hrtim_setup
|
||||
****************************************************************************/
|
||||
|
||||
static int spwm_hrtim_setup(FAR struct spwm_s *spwm)
|
||||
static int spwm_hrtim_setup(struct spwm_s *spwm)
|
||||
{
|
||||
FAR struct hrtim_dev_s *pwm = NULL;
|
||||
struct hrtim_dev_s *pwm = NULL;
|
||||
int ret = OK;
|
||||
|
||||
/* Configure HRTIM */
|
||||
@ -608,9 +608,9 @@ errout:
|
||||
* Name: spwm_hrtim_start
|
||||
****************************************************************************/
|
||||
|
||||
static int spwm_hrtim_start(FAR struct spwm_s *spwm)
|
||||
static int spwm_hrtim_start(struct spwm_s *spwm)
|
||||
{
|
||||
FAR struct hrtim_dev_s *hrtim = spwm->pwm;
|
||||
struct hrtim_dev_s *hrtim = spwm->pwm;
|
||||
uint8_t timers = 0;
|
||||
uint16_t outputs = 0;
|
||||
int i = 0;
|
||||
@ -648,9 +648,9 @@ static int spwm_hrtim_start(FAR struct spwm_s *spwm)
|
||||
* Name: spwm_hrtim_stop
|
||||
****************************************************************************/
|
||||
|
||||
static int spwm_hrtim_stop(FAR struct spwm_s *spwm)
|
||||
static int spwm_hrtim_stop(struct spwm_s *spwm)
|
||||
{
|
||||
FAR struct hrtim_dev_s *hrtim = spwm->pwm;
|
||||
struct hrtim_dev_s *hrtim = spwm->pwm;
|
||||
uint8_t timers = 0;
|
||||
uint16_t outputs = 0;
|
||||
int i = 0;
|
||||
@ -694,9 +694,9 @@ static int spwm_hrtim_stop(FAR struct spwm_s *spwm)
|
||||
|
||||
static void tim6_handler(void)
|
||||
{
|
||||
FAR struct spwm_s *spwm = &g_spwm;
|
||||
FAR struct stm32_pwm_dev_s *pwm = spwm->pwm;
|
||||
FAR struct stm32_tim_dev_s *tim = spwm->tim;
|
||||
struct spwm_s *spwm = &g_spwm;
|
||||
struct stm32_pwm_dev_s *pwm = spwm->pwm;
|
||||
struct stm32_tim_dev_s *tim = spwm->tim;
|
||||
uint8_t i = 0;
|
||||
|
||||
for (i = 0; i < spwm->phases; i += 1)
|
||||
@ -724,9 +724,9 @@ static void tim6_handler(void)
|
||||
* Name: spwm_tim6_setup
|
||||
****************************************************************************/
|
||||
|
||||
static int spwm_tim6_setup(FAR struct spwm_s *spwm)
|
||||
static int spwm_tim6_setup(struct spwm_s *spwm)
|
||||
{
|
||||
FAR struct stm32_tim_dev_s *tim = NULL;
|
||||
struct stm32_tim_dev_s *tim = NULL;
|
||||
uint64_t freq = 0;
|
||||
uint32_t per = 0;
|
||||
int ret = OK;
|
||||
@ -792,9 +792,9 @@ errout:
|
||||
* Name: spwm_tim6_start
|
||||
****************************************************************************/
|
||||
|
||||
static int spwm_tim6_start(FAR struct spwm_s *spwm)
|
||||
static int spwm_tim6_start(struct spwm_s *spwm)
|
||||
{
|
||||
FAR struct stm32_tim_dev_s *tim = spwm->tim;
|
||||
struct stm32_tim_dev_s *tim = spwm->tim;
|
||||
|
||||
/* Enable the timer interrupt at the NVIC and at TIM6 */
|
||||
|
||||
@ -808,9 +808,9 @@ static int spwm_tim6_start(FAR struct spwm_s *spwm)
|
||||
* Name: spwm_tim6_stop
|
||||
****************************************************************************/
|
||||
|
||||
static int spwm_tim6_stop(FAR struct spwm_s *spwm)
|
||||
static int spwm_tim6_stop(struct spwm_s *spwm)
|
||||
{
|
||||
FAR struct stm32_tim_dev_s *tim = spwm->tim;
|
||||
struct stm32_tim_dev_s *tim = spwm->tim;
|
||||
|
||||
/* Disable the timer interrupt at the NVIC and at TIM6 */
|
||||
|
||||
@ -824,14 +824,14 @@ static int spwm_tim6_stop(FAR struct spwm_s *spwm)
|
||||
* Name: spwm_tim1_setup
|
||||
****************************************************************************/
|
||||
|
||||
static int spwm_tim1_setup(FAR struct spwm_s *spwm)
|
||||
static int spwm_tim1_setup(struct spwm_s *spwm)
|
||||
{
|
||||
FAR struct stm32_pwm_dev_s *pwm = NULL;
|
||||
struct stm32_pwm_dev_s *pwm = NULL;
|
||||
int ret = OK;
|
||||
|
||||
/* Get TIM1 PWM interface */
|
||||
|
||||
pwm = (FAR struct stm32_pwm_dev_s *)stm32_pwminitialize(1);
|
||||
pwm = (struct stm32_pwm_dev_s *)stm32_pwminitialize(1);
|
||||
if (pwm == NULL)
|
||||
{
|
||||
printf("ERROR: Failed to get TIM1 PWM interface\n");
|
||||
@ -875,9 +875,9 @@ errout:
|
||||
* Name: spwm_tim1_start
|
||||
****************************************************************************/
|
||||
|
||||
static int spwm_tim1_start(FAR struct spwm_s *spwm)
|
||||
static int spwm_tim1_start(struct spwm_s *spwm)
|
||||
{
|
||||
FAR struct stm32_pwm_dev_s *pwm = spwm->pwm;
|
||||
struct stm32_pwm_dev_s *pwm = spwm->pwm;
|
||||
uint16_t outputs = 0;
|
||||
int i = 0;
|
||||
|
||||
@ -903,9 +903,9 @@ static int spwm_tim1_start(FAR struct spwm_s *spwm)
|
||||
* Name: spwm_tim1_stop
|
||||
****************************************************************************/
|
||||
|
||||
static int spwm_tim1_stop(FAR struct spwm_s *spwm)
|
||||
static int spwm_tim1_stop(struct spwm_s *spwm)
|
||||
{
|
||||
FAR struct stm32_pwm_dev_s *pwm = spwm->pwm;
|
||||
struct stm32_pwm_dev_s *pwm = spwm->pwm;
|
||||
uint16_t outputs = 0;
|
||||
int i = 0;
|
||||
|
||||
@ -933,7 +933,7 @@ static int spwm_tim1_stop(FAR struct spwm_s *spwm)
|
||||
* Name: spwm_setup
|
||||
****************************************************************************/
|
||||
|
||||
static int spwm_setup(FAR struct spwm_s *spwm)
|
||||
static int spwm_setup(struct spwm_s *spwm)
|
||||
{
|
||||
int ret = OK;
|
||||
|
||||
@ -985,7 +985,7 @@ errout:
|
||||
|
||||
int spwm_main(int argc, char *argv[])
|
||||
{
|
||||
FAR struct spwm_s *spwm = NULL;
|
||||
struct spwm_s *spwm = NULL;
|
||||
int ret = OK;
|
||||
int i = 0;
|
||||
|
||||
|
@ -97,7 +97,7 @@ uint32_t board_buttons(void)
|
||||
****************************************************************************/
|
||||
|
||||
#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;
|
||||
|
||||
|
@ -250,7 +250,7 @@ int stm32_usbhost_initialize(void)
|
||||
|
||||
ret = kthread_create("usbhost", CONFIG_STM32F411DISCO_USBHOST_PRIO,
|
||||
CONFIG_STM32F411DISCO_USBHOST_STACKSIZE,
|
||||
(main_t)usbhost_waiter, (FAR char * const *)NULL);
|
||||
(main_t)usbhost_waiter, (char * const *)NULL);
|
||||
return ret < 0 ? -ENOEXEC : OK;
|
||||
}
|
||||
|
||||
@ -343,7 +343,7 @@ int stm32_setup_overcurrent(xcpt_t handler, void *arg)
|
||||
****************************************************************************/
|
||||
|
||||
#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);
|
||||
}
|
||||
|
@ -277,7 +277,7 @@ static uint8_t g_sdata[STM32F4_BBSRAM_SIZE];
|
||||
|
||||
static int hardfault_get_desc(struct bbsramd_s *desc)
|
||||
{
|
||||
FAR struct file filestruct;
|
||||
struct file filestruct;
|
||||
int ret;
|
||||
|
||||
ret = file_open(&filestruct, HARDFAULT_PATH, O_RDONLY);
|
||||
@ -379,16 +379,16 @@ int stm32_bbsram_int(void)
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_STM32F4_SAVE_CRASHDUMP)
|
||||
void board_crashdump(uintptr_t currentsp, FAR void *tcb,
|
||||
FAR const char *filename, int lineno)
|
||||
void board_crashdump(uintptr_t currentsp, void *tcb,
|
||||
const char *filename, int lineno)
|
||||
{
|
||||
fullcontext_t *pdump = (fullcontext_t *)&g_sdata;
|
||||
FAR struct tcb_s *rtcb;
|
||||
struct tcb_s *rtcb;
|
||||
int rv;
|
||||
|
||||
enter_critical_section();
|
||||
|
||||
rtcb = (FAR struct tcb_s *)tcb;
|
||||
rtcb = (struct tcb_s *)tcb;
|
||||
|
||||
/* Zero out everything */
|
||||
|
||||
|
@ -91,7 +91,7 @@ uint32_t board_buttons(void)
|
||||
****************************************************************************/
|
||||
|
||||
#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;
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user