arch/mips: Remove FAR from chip and board folder
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
1ce592e8b5
commit
977fa987e2
63 changed files with 693 additions and 693 deletions
|
@ -64,9 +64,9 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
|
||||
void up_allocate_heap(void **heap_start, size_t *heap_size)
|
||||
{
|
||||
board_autoled_on(LED_HEAPALLOCATE);
|
||||
*heap_start = (FAR void *)g_idle_topstack;
|
||||
*heap_start = (void *)g_idle_topstack;
|
||||
*heap_size = CONFIG_RAM_END - g_idle_topstack;
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||
int up_create_stack(struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||
{
|
||||
#ifdef CONFIG_TLS_ALIGNED
|
||||
/* The allocated stack size must not exceed the maximum possible for the
|
||||
|
|
|
@ -63,9 +63,9 @@
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_DUMP_ON_EXIT
|
||||
static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg)
|
||||
static void _up_dumponexit(struct tcb_s *tcb, void *arg)
|
||||
{
|
||||
FAR struct filelist *filelist;
|
||||
struct filelist *filelist;
|
||||
int i;
|
||||
int j;
|
||||
|
||||
|
|
|
@ -215,7 +215,7 @@ uint32_t *up_doirq(int irq, uint32_t *regs);
|
|||
|
||||
/* Software interrupt 0 handler */
|
||||
|
||||
int up_swint0(int irq, FAR void *context, FAR void *arg);
|
||||
int up_swint0(int irq, void *context, void *arg);
|
||||
|
||||
/* Signals */
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_release_stack(FAR struct tcb_s *dtcb, uint8_t ttype)
|
||||
void up_release_stack(struct tcb_s *dtcb, uint8_t ttype)
|
||||
{
|
||||
/* Is there a stack allocated? */
|
||||
|
||||
|
|
|
@ -68,9 +68,9 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR void *up_stack_frame(FAR struct tcb_s *tcb, size_t frame_size)
|
||||
void *up_stack_frame(struct tcb_s *tcb, size_t frame_size)
|
||||
{
|
||||
FAR void *ret;
|
||||
void *ret;
|
||||
|
||||
/* Align the frame_size */
|
||||
|
||||
|
@ -88,7 +88,7 @@ FAR void *up_stack_frame(FAR struct tcb_s *tcb, size_t frame_size)
|
|||
|
||||
/* Save the adjusted stack values in the struct tcb_s */
|
||||
|
||||
tcb->stack_base_ptr = (FAR uint8_t *)tcb->stack_base_ptr + frame_size;
|
||||
tcb->stack_base_ptr = (uint8_t *)tcb->stack_base_ptr + frame_size;
|
||||
tcb->adj_stack_size -= frame_size;
|
||||
|
||||
/* And return the pointer to the allocated region */
|
||||
|
|
|
@ -99,7 +99,7 @@ static void _up_assert(void)
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_ARCH_USBDUMP
|
||||
static int usbtrace_syslog(FAR const char *fmt, ...)
|
||||
static int usbtrace_syslog(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
|
@ -111,7 +111,7 @@ static int usbtrace_syslog(FAR const char *fmt, ...)
|
|||
return OK;
|
||||
}
|
||||
|
||||
static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
|
||||
static int assert_tracecallback(struct usbtrace_s *trace, void *arg)
|
||||
{
|
||||
usbtrace_trprintf(usbtrace_syslog, trace->event, trace->value);
|
||||
return 0;
|
||||
|
|
|
@ -128,7 +128,7 @@ static inline void mips_registerdump(void)
|
|||
|
||||
void up_dumpstate(void)
|
||||
{
|
||||
FAR struct tcb_s *rtcb = running_task();
|
||||
struct tcb_s *rtcb = running_task();
|
||||
uint32_t sp = up_getsp();
|
||||
uint32_t ustackbase;
|
||||
uint32_t ustacksize;
|
||||
|
|
|
@ -127,7 +127,7 @@ static void dispatch_syscall(void)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_swint0(int irq, FAR void *context, FAR void *arg)
|
||||
int up_swint0(int irq, void *context, void *arg)
|
||||
{
|
||||
uint32_t *regs = (uint32_t *)context;
|
||||
uint32_t cause;
|
||||
|
@ -243,7 +243,7 @@ int up_swint0(int irq, FAR void *context, FAR void *arg)
|
|||
default:
|
||||
{
|
||||
#ifdef CONFIG_BUILD_KERNEL
|
||||
FAR struct tcb_s *rtcb = nxsched_self();
|
||||
struct tcb_s *rtcb = nxsched_self();
|
||||
int index = rtcb->xcp.nsyscalls;
|
||||
|
||||
/* Verify that the SYS call number is within range */
|
||||
|
|
|
@ -111,7 +111,7 @@
|
|||
* Public Types
|
||||
************************************************************************************/
|
||||
|
||||
typedef FAR void *DMA_HANDLE;
|
||||
typedef void *DMA_HANDLE;
|
||||
typedef void (*dma_callback_t)(DMA_HANDLE handle, void *arg, int result);
|
||||
|
||||
/* The following is used for sampling DMA registers when CONFIG DEBUG_DMA
|
||||
|
@ -388,7 +388,7 @@ void pic32mx_dumpgpio(uint32_t pinset, const char *msg);
|
|||
************************************************************************************/
|
||||
|
||||
struct spi_dev_s; /* Forward reference */
|
||||
FAR struct spi_dev_s *pic32mx_spibus_initialize(int port);
|
||||
struct spi_dev_s *pic32mx_spibus_initialize(int port);
|
||||
|
||||
/************************************************************************************
|
||||
* Name: pic32mx_spiNselect, pic32mx_spiNstatus, and pic32mx_spiNcmddata
|
||||
|
@ -419,38 +419,38 @@ FAR struct spi_dev_s *pic32mx_spibus_initialize(int port);
|
|||
************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PIC32MX_SPI1
|
||||
void pic32mx_spi1select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mx_spi1select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected);
|
||||
uint8_t pic32mx_spi1status(FAR struct spi_dev_s *dev, uint32_t devid);
|
||||
uint8_t pic32mx_spi1status(struct spi_dev_s *dev, uint32_t devid);
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mx_spi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd);
|
||||
int pic32mx_spi1cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PIC32MX_SPI2
|
||||
void pic32mx_spi2select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mx_spi2select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected);
|
||||
uint8_t pic32mx_spi2status(FAR struct spi_dev_s *dev, uint32_t devid);
|
||||
uint8_t pic32mx_spi2status(struct spi_dev_s *dev, uint32_t devid);
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mx_spi2cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd);
|
||||
int pic32mx_spi2cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PIC32MX_SPI3
|
||||
void pic32mx_spi3select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mx_spi3select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected);
|
||||
uint8_t pic32mx_spi3status(FAR struct spi_dev_s *dev, uint32_t devid);
|
||||
uint8_t pic32mx_spi3status(struct spi_dev_s *dev, uint32_t devid);
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mx_spi3cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd);
|
||||
int pic32mx_spi3cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PIC32MX_SPI3
|
||||
void pic32mx_spi3select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mx_spi3select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected);
|
||||
uint8_t pic32mx_spi3status(FAR struct spi_dev_s *dev, uint32_t devid);
|
||||
uint8_t pic32mx_spi3status(struct spi_dev_s *dev, uint32_t devid);
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mx_spi3cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd);
|
||||
int pic32mx_spi3cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -589,7 +589,7 @@ void pic32mx_dmadump(DMA_HANDLE handle, const struct pic32mx_dmaregs_s *regs,
|
|||
|
||||
#ifdef CONFIG_PIC32MX_USBDEV
|
||||
struct usbdev_s;
|
||||
int pic32mx_usbpullup(FAR struct usbdev_s *dev, bool enable);
|
||||
int pic32mx_usbpullup(struct usbdev_s *dev, bool enable);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
|
@ -604,7 +604,7 @@ int pic32mx_usbpullup(FAR struct usbdev_s *dev, bool enable);
|
|||
************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PIC32MX_USBDEV
|
||||
void pic32mx_usbsuspend(FAR struct usbdev_s *dev, bool resume);
|
||||
void pic32mx_usbsuspend(struct usbdev_s *dev, bool resume);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
|
|
|
@ -215,7 +215,7 @@
|
|||
* header
|
||||
*/
|
||||
|
||||
#define BUF ((FAR struct eth_hdr_s *)priv->pd_dev.d_buf)
|
||||
#define BUF ((struct eth_hdr_s *)priv->pd_dev.d_buf)
|
||||
|
||||
/* PHYs *********************************************************************/
|
||||
|
||||
|
@ -1889,7 +1889,7 @@ static void pic32mx_interrupt_work(void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int pic32mx_interrupt(int irq, void *context, FAR void *arg)
|
||||
static int pic32mx_interrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
struct pic32mx_driver_s *priv;
|
||||
uint32_t status;
|
||||
|
|
|
@ -84,7 +84,7 @@ static inline bool pic32mx_pullup(uint16_t pinset)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int pic32mx_cninterrupt(int irq, FAR void *context)
|
||||
static int pic32mx_cninterrupt(int irq, void *context)
|
||||
{
|
||||
int status;
|
||||
int ret = OK;
|
||||
|
|
|
@ -87,22 +87,22 @@ struct pic32mx_dev_s
|
|||
|
||||
/* Low-level register access */
|
||||
|
||||
static uint32_t spi_getreg(FAR struct pic32mx_dev_s *priv,
|
||||
static uint32_t spi_getreg(struct pic32mx_dev_s *priv,
|
||||
unsigned int offset);
|
||||
static void spi_putreg(FAR struct pic32mx_dev_s *priv,
|
||||
static void spi_putreg(struct pic32mx_dev_s *priv,
|
||||
unsigned int offset, uint32_t value);
|
||||
|
||||
/* SPI methods */
|
||||
|
||||
static int spi_lock(FAR struct spi_dev_s *dev, bool lock);
|
||||
static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev,
|
||||
static int spi_lock(struct spi_dev_s *dev, bool lock);
|
||||
static uint32_t spi_setfrequency(struct spi_dev_s *dev,
|
||||
uint32_t frequency);
|
||||
static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode);
|
||||
static void spi_setbits(FAR struct spi_dev_s *dev, int nbits);
|
||||
static uint32_t spi_send(FAR struct spi_dev_s *dev, uint32_t wd);
|
||||
static void spi_sndblock(FAR struct spi_dev_s *dev,
|
||||
FAR const void *buffer, size_t nwords);
|
||||
static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer,
|
||||
static void spi_setmode(struct spi_dev_s *dev, enum spi_mode_e mode);
|
||||
static void spi_setbits(struct spi_dev_s *dev, int nbits);
|
||||
static uint32_t spi_send(struct spi_dev_s *dev, uint32_t wd);
|
||||
static void spi_sndblock(struct spi_dev_s *dev,
|
||||
const void *buffer, size_t nwords);
|
||||
static void spi_recvblock(struct spi_dev_s *dev, void *buffer,
|
||||
size_t nwords);
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -288,7 +288,7 @@ static struct pic32mx_dev_s g_spi4dev =
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PIC32MX_SPI_REGDEBUG
|
||||
static uint32_t spi_getreg(FAR struct pic32mx_dev_s *priv,
|
||||
static uint32_t spi_getreg(struct pic32mx_dev_s *priv,
|
||||
unsigned int offset)
|
||||
{
|
||||
/* Last address, value, and count */
|
||||
|
@ -350,7 +350,7 @@ static uint32_t spi_getreg(FAR struct pic32mx_dev_s *priv,
|
|||
return value;
|
||||
}
|
||||
#else
|
||||
static uint32_t spi_getreg(FAR struct pic32mx_dev_s *priv,
|
||||
static uint32_t spi_getreg(struct pic32mx_dev_s *priv,
|
||||
unsigned int offset)
|
||||
{
|
||||
return getreg32(priv->base + offset);
|
||||
|
@ -374,7 +374,7 @@ static uint32_t spi_getreg(FAR struct pic32mx_dev_s *priv,
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PIC32MX_SPI_REGDEBUG
|
||||
static void spi_putreg(FAR struct pic32mx_dev_s *priv, unsigned int offset,
|
||||
static void spi_putreg(struct pic32mx_dev_s *priv, unsigned int offset,
|
||||
uint32_t value)
|
||||
{
|
||||
uint32_t addr;
|
||||
|
@ -392,7 +392,7 @@ static void spi_putreg(FAR struct pic32mx_dev_s *priv, unsigned int offset,
|
|||
putreg32(value, addr);
|
||||
}
|
||||
#else
|
||||
static void spi_putreg(FAR struct pic32mx_dev_s *priv, unsigned int offset,
|
||||
static void spi_putreg(struct pic32mx_dev_s *priv, unsigned int offset,
|
||||
uint32_t value)
|
||||
{
|
||||
putreg32(value, priv->base + offset);
|
||||
|
@ -420,9 +420,9 @@ static void spi_putreg(FAR struct pic32mx_dev_s *priv, unsigned int offset,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int spi_lock(FAR struct spi_dev_s *dev, bool lock)
|
||||
static int spi_lock(struct spi_dev_s *dev, bool lock)
|
||||
{
|
||||
FAR struct pic32mx_dev_s *priv = (FAR struct pic32mx_dev_s *)dev;
|
||||
struct pic32mx_dev_s *priv = (struct pic32mx_dev_s *)dev;
|
||||
int ret;
|
||||
|
||||
if (lock)
|
||||
|
@ -452,10 +452,10 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev,
|
||||
static uint32_t spi_setfrequency(struct spi_dev_s *dev,
|
||||
uint32_t frequency)
|
||||
{
|
||||
FAR struct pic32mx_dev_s *priv = (FAR struct pic32mx_dev_s *)dev;
|
||||
struct pic32mx_dev_s *priv = (struct pic32mx_dev_s *)dev;
|
||||
uint32_t divisor;
|
||||
uint32_t actual;
|
||||
uint32_t regval;
|
||||
|
@ -534,9 +534,9 @@ static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode)
|
||||
static void spi_setmode(struct spi_dev_s *dev, enum spi_mode_e mode)
|
||||
{
|
||||
FAR struct pic32mx_dev_s *priv = (FAR struct pic32mx_dev_s *)dev;
|
||||
struct pic32mx_dev_s *priv = (struct pic32mx_dev_s *)dev;
|
||||
uint32_t regval;
|
||||
|
||||
spiinfo("Old mode: %d New mode: %d\n", priv->mode, mode);
|
||||
|
@ -624,9 +624,9 @@ static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void spi_setbits(FAR struct spi_dev_s *dev, int nbits)
|
||||
static void spi_setbits(struct spi_dev_s *dev, int nbits)
|
||||
{
|
||||
FAR struct pic32mx_dev_s *priv = (FAR struct pic32mx_dev_s *)dev;
|
||||
struct pic32mx_dev_s *priv = (struct pic32mx_dev_s *)dev;
|
||||
uint32_t setting;
|
||||
uint32_t regval;
|
||||
|
||||
|
@ -688,9 +688,9 @@ static void spi_setbits(FAR struct spi_dev_s *dev, int nbits)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static uint32_t spi_send(FAR struct spi_dev_s *dev, uint32_t wd)
|
||||
static uint32_t spi_send(struct spi_dev_s *dev, uint32_t wd)
|
||||
{
|
||||
FAR struct pic32mx_dev_s *priv = (FAR struct pic32mx_dev_s *)dev;
|
||||
struct pic32mx_dev_s *priv = (struct pic32mx_dev_s *)dev;
|
||||
|
||||
spiinfo("wd: %04" PRIx32 "\n", wd);
|
||||
|
||||
|
@ -739,11 +739,11 @@ static uint32_t spi_send(FAR struct spi_dev_s *dev, uint32_t wd)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer,
|
||||
static void spi_sndblock(struct spi_dev_s *dev, const void *buffer,
|
||||
size_t nwords)
|
||||
{
|
||||
FAR struct pic32mx_dev_s *priv = (FAR struct pic32mx_dev_s *)dev;
|
||||
FAR uint8_t *ptr = (FAR uint8_t *)buffer;
|
||||
struct pic32mx_dev_s *priv = (struct pic32mx_dev_s *)dev;
|
||||
uint8_t *ptr = (uint8_t *)buffer;
|
||||
uint32_t regval;
|
||||
uint8_t data;
|
||||
|
||||
|
@ -801,11 +801,11 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer,
|
||||
static void spi_recvblock(struct spi_dev_s *dev, void *buffer,
|
||||
size_t nwords)
|
||||
{
|
||||
FAR struct pic32mx_dev_s *priv = (FAR struct pic32mx_dev_s *)dev;
|
||||
FAR uint8_t *ptr = (FAR uint8_t *)buffer;
|
||||
struct pic32mx_dev_s *priv = (struct pic32mx_dev_s *)dev;
|
||||
uint8_t *ptr = (uint8_t *)buffer;
|
||||
|
||||
spiinfo("nwords: %d\n", nwords);
|
||||
while (nwords)
|
||||
|
@ -859,9 +859,9 @@ static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct spi_dev_s *pic32mx_spibus_initialize(int port)
|
||||
struct spi_dev_s *pic32mx_spibus_initialize(int port)
|
||||
{
|
||||
FAR struct pic32mx_dev_s *priv;
|
||||
struct pic32mx_dev_s *priv;
|
||||
irqstate_t flags;
|
||||
uint32_t regval;
|
||||
|
||||
|
@ -937,7 +937,7 @@ FAR struct spi_dev_s *pic32mx_spibus_initialize(int port)
|
|||
|
||||
/* Select a default frequency of approx. 400KHz */
|
||||
|
||||
spi_setfrequency((FAR struct spi_dev_s *)priv, 400000);
|
||||
spi_setfrequency((struct spi_dev_s *)priv, 400000);
|
||||
|
||||
/* Clear the SPIROV overflow bit (SPIxSTAT:6). */
|
||||
|
||||
|
|
|
@ -484,7 +484,7 @@ static void pic32mx_ep0outcomplete(struct pic32mx_usbdev_s *priv);
|
|||
static void pic32mx_ep0incomplete(struct pic32mx_usbdev_s *priv);
|
||||
static void pic32mx_ep0transfer(struct pic32mx_usbdev_s *priv,
|
||||
uint16_t ustat);
|
||||
static int pic32mx_interrupt(int irq, void *context, FAR void *arg);
|
||||
static int pic32mx_interrupt(int irq, void *context, void *arg);
|
||||
|
||||
/* Endpoint helpers *********************************************************/
|
||||
|
||||
|
@ -2697,7 +2697,7 @@ static void pic32mx_ep0transfer(struct pic32mx_usbdev_s *priv,
|
|||
* Name: pic32mx_interrupt
|
||||
****************************************************************************/
|
||||
|
||||
static int pic32mx_interrupt(int irq, void *context, FAR void *arg)
|
||||
static int pic32mx_interrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
/* For now there is only one USB controller, but we will always refer to
|
||||
* it using a pointer to make any future ports to multiple USB controllers
|
||||
|
|
|
@ -86,46 +86,46 @@ struct pic32mz_dmac_s
|
|||
static int pic32mz_dma_takesem(struct pic32mz_dmac_s *dmac);
|
||||
static inline void pic32mz_dma_givesem(struct pic32mz_dmac_s *dmac);
|
||||
|
||||
static inline uint32_t pic32mz_dma_getreg(FAR struct pic32mz_dmach_s *dmach,
|
||||
static inline uint32_t pic32mz_dma_getreg(struct pic32mz_dmach_s *dmach,
|
||||
uint8_t offset);
|
||||
static inline void pic32mz_dma_putreg(FAR struct pic32mz_dmach_s *dmach,
|
||||
static inline void pic32mz_dma_putreg(struct pic32mz_dmach_s *dmach,
|
||||
uint8_t offset, uint32_t value);
|
||||
static inline void pic32mz_dma_modifyreg(FAR struct pic32mz_dmach_s *dmach,
|
||||
static inline void pic32mz_dma_modifyreg(struct pic32mz_dmach_s *dmach,
|
||||
uint8_t offset,
|
||||
uint32_t clrbits, uint32_t setbits);
|
||||
static inline uint32_t pic32mz_dma_getglobal(uint8_t offset);
|
||||
static inline void pic32mz_dma_putglobal(uint8_t offset, uint32_t value);
|
||||
|
||||
static inline void pic32mz_dma_enable(FAR struct pic32mz_dmach_s *dmach);
|
||||
static inline void pic32mz_dma_disable(FAR struct pic32mz_dmach_s *dmach);
|
||||
static inline void pic32mz_dma_priority(FAR struct pic32mz_dmach_s *dmach,
|
||||
static inline void pic32mz_dma_enable(struct pic32mz_dmach_s *dmach);
|
||||
static inline void pic32mz_dma_disable(struct pic32mz_dmach_s *dmach);
|
||||
static inline void pic32mz_dma_priority(struct pic32mz_dmach_s *dmach,
|
||||
uint8_t priority);
|
||||
static inline void pic32mz_dma_srcaddr(FAR struct pic32mz_dmach_s *dmach,
|
||||
static inline void pic32mz_dma_srcaddr(struct pic32mz_dmach_s *dmach,
|
||||
uint32_t addr);
|
||||
static inline void pic32mz_dma_destaddr(FAR struct pic32mz_dmach_s *dmach,
|
||||
static inline void pic32mz_dma_destaddr(struct pic32mz_dmach_s *dmach,
|
||||
uint32_t addr);
|
||||
static inline void pic32mz_dma_srcsize(FAR struct pic32mz_dmach_s *dmach,
|
||||
static inline void pic32mz_dma_srcsize(struct pic32mz_dmach_s *dmach,
|
||||
uint16_t size);
|
||||
static inline void pic32mz_dma_destsize(FAR struct pic32mz_dmach_s *dmach,
|
||||
static inline void pic32mz_dma_destsize(struct pic32mz_dmach_s *dmach,
|
||||
uint16_t size);
|
||||
static inline void pic32mz_dma_cellsize(FAR struct pic32mz_dmach_s *dmach,
|
||||
static inline void pic32mz_dma_cellsize(struct pic32mz_dmach_s *dmach,
|
||||
uint16_t size);
|
||||
static inline void pic32mz_dma_startirq(FAR struct pic32mz_dmach_s *dmach,
|
||||
static inline void pic32mz_dma_startirq(struct pic32mz_dmach_s *dmach,
|
||||
int irq);
|
||||
static inline void pic32mz_dma_forcestart(FAR struct pic32mz_dmach_s *dmach);
|
||||
static inline void pic32mz_dma_abortirq(FAR struct pic32mz_dmach_s *dmach,
|
||||
static inline void pic32mz_dma_forcestart(struct pic32mz_dmach_s *dmach);
|
||||
static inline void pic32mz_dma_abortirq(struct pic32mz_dmach_s *dmach,
|
||||
int irq);
|
||||
static inline void pic32mz_dma_forceabort(FAR struct pic32mz_dmach_s *dmach);
|
||||
static inline void pic32mz_dma_forceabort(struct pic32mz_dmach_s *dmach);
|
||||
|
||||
static inline void pic32mz_dma_intctrl(FAR struct pic32mz_dmach_s *dmach,
|
||||
static inline void pic32mz_dma_intctrl(struct pic32mz_dmach_s *dmach,
|
||||
uint8_t cfg);
|
||||
static inline void pic32mz_dma_intclr(FAR struct pic32mz_dmach_s *dmach);
|
||||
static int pic32mz_dma_interrupt(int irq, void *context, FAR void *arg);
|
||||
static inline void pic32mz_dma_intclr(struct pic32mz_dmach_s *dmach);
|
||||
static int pic32mz_dma_interrupt(int irq, void *context, void *arg);
|
||||
|
||||
static void pic32mz_dma_mode(FAR struct pic32mz_dmach_s *dmach,
|
||||
static void pic32mz_dma_mode(struct pic32mz_dmach_s *dmach,
|
||||
uint8_t mode);
|
||||
static void pic32mz_dma_config(FAR struct pic32mz_dmach_s *dmach,
|
||||
FAR const struct pic32mz_dma_chcfg_s *cfg);
|
||||
static void pic32mz_dma_config(struct pic32mz_dmach_s *dmach,
|
||||
const struct pic32mz_dma_chcfg_s *cfg);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
|
@ -218,7 +218,7 @@ static inline void pic32mz_dma_givesem(struct pic32mz_dmac_s *dmac)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline uint32_t pic32mz_dma_getreg(FAR struct pic32mz_dmach_s *dmach,
|
||||
static inline uint32_t pic32mz_dma_getreg(struct pic32mz_dmach_s *dmach,
|
||||
uint8_t offset)
|
||||
{
|
||||
return getreg32(dmach->base + offset);
|
||||
|
@ -232,7 +232,7 @@ static inline uint32_t pic32mz_dma_getreg(FAR struct pic32mz_dmach_s *dmach,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void pic32mz_dma_putreg(FAR struct pic32mz_dmach_s *dmach,
|
||||
static inline void pic32mz_dma_putreg(struct pic32mz_dmach_s *dmach,
|
||||
uint8_t offset, uint32_t value)
|
||||
{
|
||||
putreg32(value, dmach->base + offset);
|
||||
|
@ -246,7 +246,7 @@ static inline void pic32mz_dma_putreg(FAR struct pic32mz_dmach_s *dmach,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void pic32mz_dma_modifyreg(FAR struct pic32mz_dmach_s *dmach,
|
||||
static inline void pic32mz_dma_modifyreg(struct pic32mz_dmach_s *dmach,
|
||||
uint8_t offset,
|
||||
uint32_t clrbits, uint32_t setbits)
|
||||
{
|
||||
|
@ -287,7 +287,7 @@ static inline void pic32mz_dma_putglobal(uint8_t offset, uint32_t value)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void pic32mz_dma_enable(FAR struct pic32mz_dmach_s *dmach)
|
||||
static inline void pic32mz_dma_enable(struct pic32mz_dmach_s *dmach)
|
||||
{
|
||||
pic32mz_dma_putreg(dmach, PIC32MZ_DMA_CONSET_OFFSET, DMACH_CON_CHEN);
|
||||
}
|
||||
|
@ -300,7 +300,7 @@ static inline void pic32mz_dma_enable(FAR struct pic32mz_dmach_s *dmach)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void pic32mz_dma_disable(FAR struct pic32mz_dmach_s *dmach)
|
||||
static inline void pic32mz_dma_disable(struct pic32mz_dmach_s *dmach)
|
||||
{
|
||||
pic32mz_dma_putreg(dmach, PIC32MZ_DMA_CONCLR_OFFSET, DMACH_CON_CHEN);
|
||||
}
|
||||
|
@ -313,7 +313,7 @@ static inline void pic32mz_dma_disable(FAR struct pic32mz_dmach_s *dmach)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void pic32mz_dma_priority(FAR struct pic32mz_dmach_s *dmach,
|
||||
static inline void pic32mz_dma_priority(struct pic32mz_dmach_s *dmach,
|
||||
uint8_t priority)
|
||||
{
|
||||
/* Highest priority is 3. */
|
||||
|
@ -334,7 +334,7 @@ static inline void pic32mz_dma_priority(FAR struct pic32mz_dmach_s *dmach,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void pic32mz_dma_srcaddr(FAR struct pic32mz_dmach_s *dmach,
|
||||
static inline void pic32mz_dma_srcaddr(struct pic32mz_dmach_s *dmach,
|
||||
uint32_t addr)
|
||||
{
|
||||
pic32mz_dma_putreg(dmach, PIC32MZ_DMACH_SSA_OFFSET, PHYS_ADDR(addr));
|
||||
|
@ -348,7 +348,7 @@ static inline void pic32mz_dma_srcaddr(FAR struct pic32mz_dmach_s *dmach,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void pic32mz_dma_destaddr(FAR struct pic32mz_dmach_s *dmach,
|
||||
static inline void pic32mz_dma_destaddr(struct pic32mz_dmach_s *dmach,
|
||||
uint32_t addr)
|
||||
{
|
||||
pic32mz_dma_putreg(dmach, PIC32MZ_DMACH_DSA_OFFSET, PHYS_ADDR(addr));
|
||||
|
@ -362,7 +362,7 @@ static inline void pic32mz_dma_destaddr(FAR struct pic32mz_dmach_s *dmach,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void pic32mz_dma_srcsize(FAR struct pic32mz_dmach_s *dmach,
|
||||
static inline void pic32mz_dma_srcsize(struct pic32mz_dmach_s *dmach,
|
||||
uint16_t size)
|
||||
{
|
||||
pic32mz_dma_putreg(dmach, PIC32MZ_DMACH_SSIZ_OFFSET, size);
|
||||
|
@ -376,7 +376,7 @@ static inline void pic32mz_dma_srcsize(FAR struct pic32mz_dmach_s *dmach,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void pic32mz_dma_destsize(FAR struct pic32mz_dmach_s *dmach,
|
||||
static inline void pic32mz_dma_destsize(struct pic32mz_dmach_s *dmach,
|
||||
uint16_t size)
|
||||
{
|
||||
pic32mz_dma_putreg(dmach, PIC32MZ_DMACH_DSIZ_OFFSET, size);
|
||||
|
@ -390,7 +390,7 @@ static inline void pic32mz_dma_destsize(FAR struct pic32mz_dmach_s *dmach,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void pic32mz_dma_cellsize(FAR struct pic32mz_dmach_s *dmach,
|
||||
static inline void pic32mz_dma_cellsize(struct pic32mz_dmach_s *dmach,
|
||||
uint16_t size)
|
||||
{
|
||||
pic32mz_dma_putreg(dmach, PIC32MZ_DMACH_CSIZ_OFFSET, size);
|
||||
|
@ -404,7 +404,7 @@ static inline void pic32mz_dma_cellsize(FAR struct pic32mz_dmach_s *dmach,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void pic32mz_dma_startirq(FAR struct pic32mz_dmach_s *dmach,
|
||||
static inline void pic32mz_dma_startirq(struct pic32mz_dmach_s *dmach,
|
||||
int irq)
|
||||
{
|
||||
/* Enable start irq matching. */
|
||||
|
@ -426,7 +426,7 @@ static inline void pic32mz_dma_startirq(FAR struct pic32mz_dmach_s *dmach,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void pic32mz_dma_forcestart(FAR struct pic32mz_dmach_s *dmach)
|
||||
static inline void pic32mz_dma_forcestart(struct pic32mz_dmach_s *dmach)
|
||||
{
|
||||
pic32mz_dma_putreg(dmach, PIC32MZ_DMACH_ECONSET_OFFSET, DMACH_ECON_CFORCE);
|
||||
}
|
||||
|
@ -439,7 +439,7 @@ static inline void pic32mz_dma_forcestart(FAR struct pic32mz_dmach_s *dmach)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void pic32mz_dma_abortirq(FAR struct pic32mz_dmach_s *dmach,
|
||||
static inline void pic32mz_dma_abortirq(struct pic32mz_dmach_s *dmach,
|
||||
int irq)
|
||||
{
|
||||
/* Enable abort irq matching. */
|
||||
|
@ -461,7 +461,7 @@ static inline void pic32mz_dma_abortirq(FAR struct pic32mz_dmach_s *dmach,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void pic32mz_dma_forceabort(FAR struct pic32mz_dmach_s *dmach)
|
||||
static inline void pic32mz_dma_forceabort(struct pic32mz_dmach_s *dmach)
|
||||
{
|
||||
pic32mz_dma_putreg(dmach, PIC32MZ_DMACH_ECONSET_OFFSET, DMACH_ECON_CABORT);
|
||||
}
|
||||
|
@ -474,7 +474,7 @@ static inline void pic32mz_dma_forceabort(FAR struct pic32mz_dmach_s *dmach)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void pic32mz_dma_intclr(FAR struct pic32mz_dmach_s *dmach)
|
||||
static inline void pic32mz_dma_intclr(struct pic32mz_dmach_s *dmach)
|
||||
{
|
||||
pic32mz_dma_putreg(dmach, PIC32MZ_DMACH_INTCLR_OFFSET,
|
||||
DMACH_INT_FLAGS_MASK);
|
||||
|
@ -488,7 +488,7 @@ static inline void pic32mz_dma_intclr(FAR struct pic32mz_dmach_s *dmach)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void pic32mz_dma_intctrl(FAR struct pic32mz_dmach_s *dmach,
|
||||
static inline void pic32mz_dma_intctrl(struct pic32mz_dmach_s *dmach,
|
||||
uint8_t cfg)
|
||||
{
|
||||
/* Clear all interrupts flags */
|
||||
|
@ -514,7 +514,7 @@ static inline void pic32mz_dma_intctrl(FAR struct pic32mz_dmach_s *dmach,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int pic32mz_dma_interrupt(int irq, void *context, FAR void *arg)
|
||||
static int pic32mz_dma_interrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
struct pic32mz_dmach_s *dmach;
|
||||
uint8_t status;
|
||||
|
@ -553,7 +553,7 @@ static int pic32mz_dma_interrupt(int irq, void *context, FAR void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void pic32mz_dma_mode(FAR struct pic32mz_dmach_s *dmach,
|
||||
static void pic32mz_dma_mode(struct pic32mz_dmach_s *dmach,
|
||||
uint8_t mode)
|
||||
{
|
||||
if (mode & PIC32MZ_DMA_MODE_BASIC)
|
||||
|
@ -576,8 +576,8 @@ static void pic32mz_dma_mode(FAR struct pic32mz_dmach_s *dmach,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void pic32mz_dma_config(FAR struct pic32mz_dmach_s *dmach,
|
||||
FAR const struct pic32mz_dma_chcfg_s *cfg)
|
||||
static void pic32mz_dma_config(struct pic32mz_dmach_s *dmach,
|
||||
const struct pic32mz_dma_chcfg_s *cfg)
|
||||
{
|
||||
/* Set the channel's priority */
|
||||
|
||||
|
@ -888,7 +888,7 @@ void pic32mz_dma_free(DMA_HANDLE handle)
|
|||
****************************************************************************/
|
||||
|
||||
int pic32mz_dma_chcfg(DMA_HANDLE handle,
|
||||
FAR const struct pic32mz_dma_chcfg_s *cfg)
|
||||
const struct pic32mz_dma_chcfg_s *cfg)
|
||||
{
|
||||
struct pic32mz_dmach_s *dmach = (struct pic32mz_dmach_s *)handle;
|
||||
|
||||
|
@ -908,7 +908,7 @@ int pic32mz_dma_chcfg(DMA_HANDLE handle,
|
|||
****************************************************************************/
|
||||
|
||||
int pic32mz_dma_xfrsetup(DMA_HANDLE handle,
|
||||
FAR const struct pic32mz_dma_xfrcfg_s *cfg)
|
||||
const struct pic32mz_dma_xfrcfg_s *cfg)
|
||||
{
|
||||
struct pic32mz_dmach_s *dmach = (struct pic32mz_dmach_s *)handle;
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@
|
|||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
typedef FAR void *DMA_HANDLE;
|
||||
typedef void *DMA_HANDLE;
|
||||
typedef void (*dma_callback_t)(DMA_HANDLE handle, uint8_t status, void *arg);
|
||||
|
||||
/* DMA channel modes, arguments for pic32mz_dma_mode. */
|
||||
|
@ -247,7 +247,7 @@ void pic32mz_dma_free(DMA_HANDLE handle);
|
|||
****************************************************************************/
|
||||
|
||||
int pic32mz_dma_chcfg(DMA_HANDLE handle,
|
||||
FAR const struct pic32mz_dma_chcfg_s *cfg);
|
||||
const struct pic32mz_dma_chcfg_s *cfg);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: pic32mz_dma_xfrsetup
|
||||
|
@ -258,7 +258,7 @@ int pic32mz_dma_chcfg(DMA_HANDLE handle,
|
|||
****************************************************************************/
|
||||
|
||||
int pic32mz_dma_xfrsetup(DMA_HANDLE handle,
|
||||
FAR const struct pic32mz_dma_xfrcfg_s *cfg);
|
||||
const struct pic32mz_dma_xfrcfg_s *cfg);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: pic32mz_dma_start
|
||||
|
|
|
@ -252,7 +252,7 @@
|
|||
* header
|
||||
*/
|
||||
|
||||
#define BUF ((FAR struct eth_hdr_s *)priv->pd_dev.d_buf)
|
||||
#define BUF ((struct eth_hdr_s *)priv->pd_dev.d_buf)
|
||||
|
||||
/* PHYs *********************************************************************/
|
||||
|
||||
|
@ -454,7 +454,7 @@ static void pic32mz_rxdone(struct pic32mz_driver_s *priv);
|
|||
static void pic32mz_txdone(struct pic32mz_driver_s *priv);
|
||||
|
||||
static void pic32mz_interrupt_work(void *arg);
|
||||
static int pic32mz_interrupt(int irq, void *context, FAR void *arg);
|
||||
static int pic32mz_interrupt(int irq, void *context, void *arg);
|
||||
|
||||
/* Watchdog timer expirations */
|
||||
|
||||
|
@ -2019,7 +2019,7 @@ static void pic32mz_interrupt_work(void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int pic32mz_interrupt(int irq, void *context, FAR void *arg)
|
||||
static int pic32mz_interrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
struct pic32mz_driver_s *priv;
|
||||
uint32_t status;
|
||||
|
|
|
@ -47,13 +47,13 @@
|
|||
|
||||
struct pic32mz_freerun_s
|
||||
{
|
||||
uint8_t chan; /* The timer in use */
|
||||
uint8_t width; /* Width of timer (16- or 32) */
|
||||
FAR struct pic32mz_timer_dev_s *timer; /* PIC32MZ timer driver */
|
||||
uint32_t freq; /* Timer's frequency (Hz) */
|
||||
uint8_t chan; /* The timer in use */
|
||||
uint8_t width; /* Width of timer (16- or 32) */
|
||||
struct pic32mz_timer_dev_s *timer; /* PIC32MZ timer driver */
|
||||
uint32_t freq; /* Timer's frequency (Hz) */
|
||||
|
||||
#ifndef CONFIG_CLOCK_TIMEKEEPING
|
||||
uint32_t overflow; /* Timer's counter overflow */
|
||||
uint32_t overflow; /* Timer's counter overflow */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CLOCK_TIMEKEEPING
|
||||
|
|
|
@ -58,7 +58,7 @@ static inline bool pic32mz_edgedetect(pinset_t pinset);
|
|||
static inline unsigned int pic32mz_edgemode(pinset_t pinset);
|
||||
static inline bool pic32mz_pullup(pinset_t pinset);
|
||||
static inline bool pic32mz_pulldown(pinset_t pinset);
|
||||
static int pic32mz_cninterrupt(int irq, FAR void *context, FAR void *arg);
|
||||
static int pic32mz_cninterrupt(int irq, void *context, void *arg);
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
|
@ -206,7 +206,7 @@ static inline unsigned int pic32mz_pin(pinset_t pinset)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int pic32mz_cninterrupt(int irq, FAR void *context, FAR void *arg)
|
||||
static int pic32mz_cninterrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
struct ioport_level2_s *handlers;
|
||||
xcpt_t handler;
|
||||
|
|
|
@ -219,47 +219,47 @@ struct pic32mz_i2c_priv_s
|
|||
****************************************************************************/
|
||||
|
||||
static inline uint32_t
|
||||
pic32mz_i2c_getreg(FAR struct pic32mz_i2c_priv_s *priv,
|
||||
pic32mz_i2c_getreg(struct pic32mz_i2c_priv_s *priv,
|
||||
uint8_t offset);
|
||||
static inline void pic32mz_i2c_putreg(FAR struct pic32mz_i2c_priv_s *priv,
|
||||
static inline void pic32mz_i2c_putreg(struct pic32mz_i2c_priv_s *priv,
|
||||
uint8_t offset, uint32_t value);
|
||||
static inline void pic32mz_i2c_modifyreg(FAR struct pic32mz_i2c_priv_s *priv,
|
||||
static inline void pic32mz_i2c_modifyreg(struct pic32mz_i2c_priv_s *priv,
|
||||
uint8_t offset, uint32_t clearbits,
|
||||
uint32_t setbits);
|
||||
|
||||
#ifdef CONFIG_PICM32MZ_I2C_DYNTIMEO
|
||||
static useconds_t pic32mz_i2c_tousecs(int msgc, FAR struct i2c_msg_s *msgs);
|
||||
static useconds_t pic32mz_i2c_tousecs(int msgc, struct i2c_msg_s *msgs);
|
||||
#endif /* CONFIG_PIC32MZ_I2C_DYNTIMEO */
|
||||
|
||||
static inline int
|
||||
pic32mz_i2c_sem_waitdone(FAR struct pic32mz_i2c_priv_s *priv);
|
||||
pic32mz_i2c_sem_waitdone(struct pic32mz_i2c_priv_s *priv);
|
||||
static inline void
|
||||
pic32mz_i2c_sem_waitidle(FAR struct pic32mz_i2c_priv_s *priv);
|
||||
static inline void pic32mz_i2c_sem_post(FAR struct pic32mz_i2c_priv_s *priv);
|
||||
static inline void pic32mz_i2c_sem_init(FAR struct pic32mz_i2c_priv_s *priv);
|
||||
pic32mz_i2c_sem_waitidle(struct pic32mz_i2c_priv_s *priv);
|
||||
static inline void pic32mz_i2c_sem_post(struct pic32mz_i2c_priv_s *priv);
|
||||
static inline void pic32mz_i2c_sem_init(struct pic32mz_i2c_priv_s *priv);
|
||||
static inline void
|
||||
pic32mz_i2c_sem_destroy(FAR struct pic32mz_i2c_priv_s *priv);
|
||||
pic32mz_i2c_sem_destroy(struct pic32mz_i2c_priv_s *priv);
|
||||
|
||||
#ifdef CONFIG_I2C_TRACE
|
||||
static void pic32mz_i2c_tracereset(FAR struct pic32mz_i2c_priv_s *priv);
|
||||
static void pic32mz_i2c_tracenew(FAR struct pic32mz_i2c_priv_s *priv,
|
||||
static void pic32mz_i2c_tracereset(struct pic32mz_i2c_priv_s *priv);
|
||||
static void pic32mz_i2c_tracenew(struct pic32mz_i2c_priv_s *priv,
|
||||
uint32_t status);
|
||||
static void
|
||||
pic32mz_i2c_traceevent(FAR struct pic32mz_i2c_priv_s *priv,
|
||||
pic32mz_i2c_traceevent(struct pic32mz_i2c_priv_s *priv,
|
||||
enum pic32mz_trace_e event, uint32_t parm);
|
||||
static void pic32mz_i2c_tracedump(FAR struct pic32mz_i2c_priv_s *priv);
|
||||
static void pic32mz_i2c_tracedump(struct pic32mz_i2c_priv_s *priv);
|
||||
#endif /* CONFIG_I2C_TRACE */
|
||||
|
||||
static inline int
|
||||
pic32mz_i2c_setbaudrate(FAR struct pic32mz_i2c_priv_s *priv,
|
||||
pic32mz_i2c_setbaudrate(struct pic32mz_i2c_priv_s *priv,
|
||||
uint32_t frequency);
|
||||
static inline void
|
||||
pic32mz_i2c_send_start(FAR struct pic32mz_i2c_priv_s *priv);
|
||||
pic32mz_i2c_send_start(struct pic32mz_i2c_priv_s *priv);
|
||||
static inline void
|
||||
pic32mz_i2c_send_stop(FAR struct pic32mz_i2c_priv_s *priv);
|
||||
pic32mz_i2c_send_stop(struct pic32mz_i2c_priv_s *priv);
|
||||
static inline void
|
||||
pic32mz_i2c_send_repeatedstart(FAR struct pic32mz_i2c_priv_s *priv);
|
||||
static inline void pic32mz_i2c_send_ack(FAR struct pic32mz_i2c_priv_s *priv,
|
||||
pic32mz_i2c_send_repeatedstart(struct pic32mz_i2c_priv_s *priv);
|
||||
static inline void pic32mz_i2c_send_ack(struct pic32mz_i2c_priv_s *priv,
|
||||
bool ack);
|
||||
static inline void pic32mz_i2c_transmitbyte(struct pic32mz_i2c_priv_s *priv,
|
||||
uint8_t data);
|
||||
|
@ -267,23 +267,23 @@ static inline uint32_t
|
|||
pic32mz_i2c_receivebyte(struct pic32mz_i2c_priv_s *priv);
|
||||
|
||||
static inline uint32_t
|
||||
pic32mz_i2c_getstatus(FAR struct pic32mz_i2c_priv_s *priv);
|
||||
pic32mz_i2c_getstatus(struct pic32mz_i2c_priv_s *priv);
|
||||
static inline bool
|
||||
pic32mz_i2c_master_inactive(FAR struct pic32mz_i2c_priv_s *priv);
|
||||
pic32mz_i2c_master_inactive(struct pic32mz_i2c_priv_s *priv);
|
||||
|
||||
static int pic32mz_i2c_isr_process(struct pic32mz_i2c_priv_s * priv);
|
||||
|
||||
#ifndef CONFIG_I2C_POLLED
|
||||
static int pic32mz_i2c_isr(int irq, void *context, FAR void *arg);
|
||||
static int pic32mz_i2c_isr(int irq, void *context, void *arg);
|
||||
#endif /* !CONFIG_I2C_POLLED */
|
||||
|
||||
static int pic32mz_i2c_init(FAR struct pic32mz_i2c_priv_s *priv);
|
||||
static int pic32mz_i2c_deinit(FAR struct pic32mz_i2c_priv_s *priv);
|
||||
static int pic32mz_i2c_init(struct pic32mz_i2c_priv_s *priv);
|
||||
static int pic32mz_i2c_deinit(struct pic32mz_i2c_priv_s *priv);
|
||||
|
||||
static int pic32mz_i2c_transfer(FAR struct i2c_master_s *dev,
|
||||
FAR struct i2c_msg_s *msgs, int count);
|
||||
static int pic32mz_i2c_transfer(struct i2c_master_s *dev,
|
||||
struct i2c_msg_s *msgs, int count);
|
||||
#ifdef CONFIG_I2C_RESET
|
||||
static int pic32mz_i2c_reset(FAR struct i2c_master_s *dev);
|
||||
static int pic32mz_i2c_reset(struct i2c_master_s *dev);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -465,7 +465,7 @@ static struct pic32mz_i2c_priv_s pic32mz_i2c5_priv =
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_I2C_TRACE
|
||||
static void pic32mz_i2c_traceclear(FAR struct pic32mz_i2c_priv_s *priv)
|
||||
static void pic32mz_i2c_traceclear(struct pic32mz_i2c_priv_s *priv)
|
||||
{
|
||||
struct pic32mz_trace_s *trace = &priv->trace[priv->tndx];
|
||||
|
||||
|
@ -476,7 +476,7 @@ static void pic32mz_i2c_traceclear(FAR struct pic32mz_i2c_priv_s *priv)
|
|||
trace->time = 0; /* Time of first status or event */
|
||||
}
|
||||
|
||||
static void pic32mz_i2c_tracereset(FAR struct pic32mz_i2c_priv_s *priv)
|
||||
static void pic32mz_i2c_tracereset(struct pic32mz_i2c_priv_s *priv)
|
||||
{
|
||||
/* Reset the trace info for a new data collection */
|
||||
|
||||
|
@ -485,7 +485,7 @@ static void pic32mz_i2c_tracereset(FAR struct pic32mz_i2c_priv_s *priv)
|
|||
pic32mz_i2c_traceclear(priv);
|
||||
}
|
||||
|
||||
static void pic32mz_i2c_tracenew(FAR struct pic32mz_i2c_priv_s *priv,
|
||||
static void pic32mz_i2c_tracenew(struct pic32mz_i2c_priv_s *priv,
|
||||
uint32_t status)
|
||||
{
|
||||
struct pic32mz_trace_s *trace = &priv->trace[priv->tndx];
|
||||
|
@ -525,7 +525,7 @@ static void pic32mz_i2c_tracenew(FAR struct pic32mz_i2c_priv_s *priv,
|
|||
}
|
||||
}
|
||||
|
||||
static void pic32mz_i2c_traceevent(FAR struct pic32mz_i2c_priv_s *priv,
|
||||
static void pic32mz_i2c_traceevent(struct pic32mz_i2c_priv_s *priv,
|
||||
enum pic32mz_trace_e event, uint32_t parm)
|
||||
{
|
||||
struct pic32mz_trace_s *trace;
|
||||
|
@ -552,7 +552,7 @@ static void pic32mz_i2c_traceevent(FAR struct pic32mz_i2c_priv_s *priv,
|
|||
}
|
||||
}
|
||||
|
||||
static void pic32mz_i2c_tracedump(FAR struct pic32mz_i2c_priv_s *priv)
|
||||
static void pic32mz_i2c_tracedump(struct pic32mz_i2c_priv_s *priv)
|
||||
{
|
||||
struct pic32mz_trace_s *trace;
|
||||
int i;
|
||||
|
@ -581,7 +581,7 @@ static void pic32mz_i2c_tracedump(FAR struct pic32mz_i2c_priv_s *priv)
|
|||
****************************************************************************/
|
||||
|
||||
static inline uint32_t
|
||||
pic32mz_i2c_getreg(FAR struct pic32mz_i2c_priv_s *priv, uint8_t offset)
|
||||
pic32mz_i2c_getreg(struct pic32mz_i2c_priv_s *priv, uint8_t offset)
|
||||
{
|
||||
return getreg32(priv->config->base + offset);
|
||||
}
|
||||
|
@ -594,7 +594,7 @@ static inline uint32_t
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void pic32mz_i2c_putreg(FAR struct pic32mz_i2c_priv_s *priv,
|
||||
static inline void pic32mz_i2c_putreg(struct pic32mz_i2c_priv_s *priv,
|
||||
uint8_t offset, uint32_t value)
|
||||
{
|
||||
putreg32(value, priv->config->base + offset);
|
||||
|
@ -608,7 +608,7 @@ static inline void pic32mz_i2c_putreg(FAR struct pic32mz_i2c_priv_s *priv,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void pic32mz_i2c_modifyreg(FAR struct pic32mz_i2c_priv_s *priv,
|
||||
static inline void pic32mz_i2c_modifyreg(struct pic32mz_i2c_priv_s *priv,
|
||||
uint8_t offset, uint32_t clearbits,
|
||||
uint32_t setbits)
|
||||
{
|
||||
|
@ -625,7 +625,7 @@ static inline void pic32mz_i2c_modifyreg(FAR struct pic32mz_i2c_priv_s *priv,
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_I2C_DYNTIMEO
|
||||
static useconds_t pic32mz_i2c_tousecs(int msgc, FAR struct i2c_msg_s *msgs)
|
||||
static useconds_t pic32mz_i2c_tousecs(int msgc, struct i2c_msg_s *msgs)
|
||||
{
|
||||
size_t bytecount = 0;
|
||||
int i;
|
||||
|
@ -658,7 +658,7 @@ static useconds_t pic32mz_i2c_tousecs(int msgc, FAR struct i2c_msg_s *msgs)
|
|||
|
||||
#ifndef CONFIG_I2C_POLLED
|
||||
static inline int
|
||||
pic32mz_i2c_sem_waitdone(FAR struct pic32mz_i2c_priv_s *priv)
|
||||
pic32mz_i2c_sem_waitdone(struct pic32mz_i2c_priv_s *priv)
|
||||
{
|
||||
struct timespec abstime;
|
||||
irqstate_t flags;
|
||||
|
@ -731,7 +731,7 @@ static inline int
|
|||
}
|
||||
#else
|
||||
static inline int
|
||||
pic32mz_i2c_sem_waitdone(FAR struct pic32mz_i2c_priv_s *priv)
|
||||
pic32mz_i2c_sem_waitdone(struct pic32mz_i2c_priv_s *priv)
|
||||
{
|
||||
clock_t timeout;
|
||||
clock_t start;
|
||||
|
@ -791,7 +791,7 @@ static inline int
|
|||
****************************************************************************/
|
||||
|
||||
static inline void
|
||||
pic32mz_i2c_sem_waitidle(FAR struct pic32mz_i2c_priv_s *priv)
|
||||
pic32mz_i2c_sem_waitidle(struct pic32mz_i2c_priv_s *priv)
|
||||
{
|
||||
uint32_t timeout;
|
||||
uint32_t start;
|
||||
|
@ -838,7 +838,7 @@ static inline void
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void pic32mz_i2c_sem_post(FAR struct pic32mz_i2c_priv_s *priv)
|
||||
static inline void pic32mz_i2c_sem_post(struct pic32mz_i2c_priv_s *priv)
|
||||
{
|
||||
nxsem_post(&priv->sem_excl);
|
||||
}
|
||||
|
@ -851,7 +851,7 @@ static inline void pic32mz_i2c_sem_post(FAR struct pic32mz_i2c_priv_s *priv)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void pic32mz_i2c_sem_init(FAR struct pic32mz_i2c_priv_s *priv)
|
||||
static inline void pic32mz_i2c_sem_init(struct pic32mz_i2c_priv_s *priv)
|
||||
{
|
||||
nxsem_init(&priv->sem_excl, 0, 1);
|
||||
|
||||
|
@ -874,7 +874,7 @@ static inline void pic32mz_i2c_sem_init(FAR struct pic32mz_i2c_priv_s *priv)
|
|||
****************************************************************************/
|
||||
|
||||
static inline void
|
||||
pic32mz_i2c_sem_destroy(FAR struct pic32mz_i2c_priv_s *priv)
|
||||
pic32mz_i2c_sem_destroy(struct pic32mz_i2c_priv_s *priv)
|
||||
{
|
||||
nxsem_destroy(&priv->sem_excl);
|
||||
#ifndef CONFIG_I2C_POLLED
|
||||
|
@ -1279,7 +1279,7 @@ static int pic32mz_i2c_isr_process(struct pic32mz_i2c_priv_s *priv)
|
|||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_I2C_POLLED
|
||||
static int pic32mz_i2c_isr(int irq, void *context, FAR void *arg)
|
||||
static int pic32mz_i2c_isr(int irq, void *context, void *arg)
|
||||
{
|
||||
struct pic32mz_i2c_priv_s *priv = (struct pic32mz_i2c_priv_s *)arg;
|
||||
|
||||
|
@ -1297,7 +1297,7 @@ static int pic32mz_i2c_isr(int irq, void *context, FAR void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
static inline int
|
||||
pic32mz_i2c_setbaudrate(FAR struct pic32mz_i2c_priv_s *priv,
|
||||
pic32mz_i2c_setbaudrate(struct pic32mz_i2c_priv_s *priv,
|
||||
uint32_t frequency)
|
||||
{
|
||||
uint32_t baudrate;
|
||||
|
@ -1347,7 +1347,7 @@ static inline int
|
|||
****************************************************************************/
|
||||
|
||||
static inline void
|
||||
pic32mz_i2c_send_start(FAR struct pic32mz_i2c_priv_s *priv)
|
||||
pic32mz_i2c_send_start(struct pic32mz_i2c_priv_s *priv)
|
||||
{
|
||||
pic32mz_i2c_putreg(priv, PIC32MZ_I2C_CONSET_OFFSET, I2C_CON_SEN);
|
||||
|
||||
|
@ -1367,7 +1367,7 @@ static inline void
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void pic32mz_i2c_send_stop(FAR struct pic32mz_i2c_priv_s *priv)
|
||||
static inline void pic32mz_i2c_send_stop(struct pic32mz_i2c_priv_s *priv)
|
||||
{
|
||||
pic32mz_i2c_putreg(priv, PIC32MZ_I2C_CONSET_OFFSET, I2C_CON_PEN);
|
||||
|
||||
|
@ -1388,7 +1388,7 @@ static inline void pic32mz_i2c_send_stop(FAR struct pic32mz_i2c_priv_s *priv)
|
|||
****************************************************************************/
|
||||
|
||||
static inline void
|
||||
pic32mz_i2c_send_repeatedstart(FAR struct pic32mz_i2c_priv_s *priv)
|
||||
pic32mz_i2c_send_repeatedstart(struct pic32mz_i2c_priv_s *priv)
|
||||
{
|
||||
pic32mz_i2c_putreg(priv, PIC32MZ_I2C_CONSET_OFFSET, I2C_CON_RSEN);
|
||||
|
||||
|
@ -1408,7 +1408,7 @@ static inline void
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void pic32mz_i2c_send_ack(FAR struct pic32mz_i2c_priv_s *priv,
|
||||
static inline void pic32mz_i2c_send_ack(struct pic32mz_i2c_priv_s *priv,
|
||||
bool ack)
|
||||
{
|
||||
if (ack)
|
||||
|
@ -1486,7 +1486,7 @@ static inline uint32_t
|
|||
****************************************************************************/
|
||||
|
||||
static inline bool
|
||||
pic32mz_i2c_master_inactive(FAR struct pic32mz_i2c_priv_s *priv)
|
||||
pic32mz_i2c_master_inactive(struct pic32mz_i2c_priv_s *priv)
|
||||
{
|
||||
uint32_t con;
|
||||
|
||||
|
@ -1504,7 +1504,7 @@ static inline bool
|
|||
****************************************************************************/
|
||||
|
||||
static inline uint32_t
|
||||
pic32mz_i2c_getstatus(FAR struct pic32mz_i2c_priv_s *priv)
|
||||
pic32mz_i2c_getstatus(struct pic32mz_i2c_priv_s *priv)
|
||||
{
|
||||
return pic32mz_i2c_getreg(priv, PIC32MZ_I2C_STAT_OFFSET);
|
||||
}
|
||||
|
@ -1517,7 +1517,7 @@ static inline uint32_t
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int pic32mz_i2c_init(FAR struct pic32mz_i2c_priv_s *priv)
|
||||
static int pic32mz_i2c_init(struct pic32mz_i2c_priv_s *priv)
|
||||
{
|
||||
/* Force a frequency update */
|
||||
|
||||
|
@ -1550,7 +1550,7 @@ static int pic32mz_i2c_init(FAR struct pic32mz_i2c_priv_s *priv)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int pic32mz_i2c_deinit(FAR struct pic32mz_i2c_priv_s *priv)
|
||||
static int pic32mz_i2c_deinit(struct pic32mz_i2c_priv_s *priv)
|
||||
{
|
||||
/* Disable I2C */
|
||||
|
||||
|
@ -1580,10 +1580,10 @@ static int pic32mz_i2c_deinit(FAR struct pic32mz_i2c_priv_s *priv)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int pic32mz_i2c_transfer(FAR struct i2c_master_s *dev,
|
||||
FAR struct i2c_msg_s *msgs, int count)
|
||||
static int pic32mz_i2c_transfer(struct i2c_master_s *dev,
|
||||
struct i2c_msg_s *msgs, int count)
|
||||
{
|
||||
FAR struct pic32mz_i2c_priv_s *priv = (struct pic32mz_i2c_priv_s *)dev;
|
||||
struct pic32mz_i2c_priv_s *priv = (struct pic32mz_i2c_priv_s *)dev;
|
||||
uint32_t status = 0;
|
||||
int ret;
|
||||
|
||||
|
@ -1702,9 +1702,9 @@ static int pic32mz_i2c_transfer(FAR struct i2c_master_s *dev,
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_I2C_RESET
|
||||
static int pic32mz_i2c_reset(FAR struct i2c_master_s *dev)
|
||||
static int pic32mz_i2c_reset(struct i2c_master_s *dev)
|
||||
{
|
||||
FAR struct pic32mz_i2c_priv_s *priv = (struct pic32mz_i2c_priv_s *)dev;
|
||||
struct pic32mz_i2c_priv_s *priv = (struct pic32mz_i2c_priv_s *)dev;
|
||||
unsigned int clock_count;
|
||||
unsigned int stretch_count;
|
||||
uint32_t frequency;
|
||||
|
@ -1829,7 +1829,7 @@ out:
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct i2c_master_s *pic32mz_i2cbus_initialize(int port)
|
||||
struct i2c_master_s *pic32mz_i2cbus_initialize(int port)
|
||||
{
|
||||
struct pic32mz_i2c_priv_s * priv = NULL;
|
||||
irqstate_t flags;
|
||||
|
@ -1895,9 +1895,9 @@ FAR struct i2c_master_s *pic32mz_i2cbus_initialize(int port)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int pic32mz_i2cbus_uninitialize(FAR struct i2c_master_s *dev)
|
||||
int pic32mz_i2cbus_uninitialize(struct i2c_master_s *dev)
|
||||
{
|
||||
FAR struct pic32mz_i2c_priv_s *priv = (struct pic32mz_i2c_priv_s *)dev;
|
||||
struct pic32mz_i2c_priv_s *priv = (struct pic32mz_i2c_priv_s *)dev;
|
||||
irqstate_t flags;
|
||||
|
||||
DEBUGASSERT(dev);
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct i2c_master_s *pic32mz_i2cbus_initialize(int port);
|
||||
struct i2c_master_s *pic32mz_i2cbus_initialize(int port);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: pic32mz_i2cbus_uninitialize
|
||||
|
@ -70,6 +70,6 @@ FAR struct i2c_master_s *pic32mz_i2cbus_initialize(int port);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int pic32mz_i2cbus_uninitialize(FAR struct i2c_master_s *dev);
|
||||
int pic32mz_i2cbus_uninitialize(struct i2c_master_s *dev);
|
||||
|
||||
#endif /* __ARCH_MIPS_SRC_PIC32MZ_PIC32MZ_I2C_H */
|
||||
|
|
|
@ -66,17 +66,17 @@ typedef void (*oneshot_handler_t)(void *arg);
|
|||
|
||||
struct pic32mz_oneshot_s
|
||||
{
|
||||
uint8_t chan; /* The timer/counter in use */
|
||||
uint8_t chan; /* The timer/counter in use */
|
||||
#if CONFIG_PIC32MZ_ONESHOT_MAXTIMERS > 1
|
||||
uint8_t cbndx; /* Timer callback handler index */
|
||||
uint8_t cbndx; /* Timer callback handler index */
|
||||
#endif
|
||||
volatile bool running; /* True: the timer is running */
|
||||
FAR struct pic32mz_timer_dev_s *timer; /* PIC32MZ timer driver */
|
||||
volatile oneshot_handler_t handler; /* Oneshot expiration callback */
|
||||
volatile void *arg; /* Callback's argument */
|
||||
uint32_t freq; /* Timer's frequency */
|
||||
uint32_t period; /* Timer's period */
|
||||
uint8_t width; /* Timer's width */
|
||||
volatile bool running; /* True: the timer is running */
|
||||
struct pic32mz_timer_dev_s *timer; /* PIC32MZ timer driver */
|
||||
volatile oneshot_handler_t handler; /* Oneshot expiration callback */
|
||||
volatile void *arg; /* Callback's argument */
|
||||
uint32_t freq; /* Timer's frequency */
|
||||
uint32_t period; /* Timer's period */
|
||||
uint8_t width; /* Timer's width */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
@ -55,7 +55,7 @@ struct pic32mz_oneshot_lowerhalf_s
|
|||
|
||||
struct pic32mz_oneshot_s oneshot; /* PIC32MZ-specific oneshot state */
|
||||
oneshot_callback_t callback; /* Handler that receives callback */
|
||||
FAR void *arg; /* Argument passed to the handler */
|
||||
void *arg; /* Argument passed to the handler */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -64,13 +64,13 @@ struct pic32mz_oneshot_lowerhalf_s
|
|||
|
||||
static void pic32mz_oneshot_handler(void *arg);
|
||||
|
||||
static int pic32mz_max_delay(FAR struct oneshot_lowerhalf_s *lower,
|
||||
FAR struct timespec *ts);
|
||||
static int pic32mz_start(FAR struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, FAR void *arg,
|
||||
FAR const struct timespec *ts);
|
||||
static int pic32mz_cancel(FAR struct oneshot_lowerhalf_s *lower,
|
||||
FAR struct timespec *ts);
|
||||
static int pic32mz_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
static int pic32mz_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts);
|
||||
static int pic32mz_cancel(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
|
@ -106,10 +106,10 @@ static const struct oneshot_operations_s g_oneshot_ops =
|
|||
|
||||
static void pic32mz_oneshot_handler(void *arg)
|
||||
{
|
||||
FAR struct pic32mz_oneshot_lowerhalf_s *priv =
|
||||
(FAR struct pic32mz_oneshot_lowerhalf_s *)arg;
|
||||
struct pic32mz_oneshot_lowerhalf_s *priv =
|
||||
(struct pic32mz_oneshot_lowerhalf_s *)arg;
|
||||
oneshot_callback_t callback;
|
||||
FAR void *cbarg;
|
||||
void *cbarg;
|
||||
|
||||
DEBUGASSERT(priv != NULL);
|
||||
|
||||
|
@ -152,11 +152,11 @@ static void pic32mz_oneshot_handler(void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int pic32mz_max_delay(FAR struct oneshot_lowerhalf_s *lower,
|
||||
FAR struct timespec *ts)
|
||||
static int pic32mz_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts)
|
||||
{
|
||||
FAR struct pic32mz_oneshot_lowerhalf_s *priv =
|
||||
(FAR struct pic32mz_oneshot_lowerhalf_s *)lower;
|
||||
struct pic32mz_oneshot_lowerhalf_s *priv =
|
||||
(struct pic32mz_oneshot_lowerhalf_s *)lower;
|
||||
uint64_t usecs;
|
||||
int ret;
|
||||
|
||||
|
@ -197,12 +197,12 @@ static int pic32mz_max_delay(FAR struct oneshot_lowerhalf_s *lower,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int pic32mz_start(FAR struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, FAR void *arg,
|
||||
FAR const struct timespec *ts)
|
||||
static int pic32mz_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts)
|
||||
{
|
||||
FAR struct pic32mz_oneshot_lowerhalf_s *priv =
|
||||
(FAR struct pic32mz_oneshot_lowerhalf_s *)lower;
|
||||
struct pic32mz_oneshot_lowerhalf_s *priv =
|
||||
(struct pic32mz_oneshot_lowerhalf_s *)lower;
|
||||
irqstate_t flags;
|
||||
int ret;
|
||||
|
||||
|
@ -250,11 +250,11 @@ static int pic32mz_start(FAR struct oneshot_lowerhalf_s *lower,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int pic32mz_cancel(FAR struct oneshot_lowerhalf_s *lower,
|
||||
FAR struct timespec *ts)
|
||||
static int pic32mz_cancel(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts)
|
||||
{
|
||||
FAR struct pic32mz_oneshot_lowerhalf_s *priv =
|
||||
(FAR struct pic32mz_oneshot_lowerhalf_s *)lower;
|
||||
struct pic32mz_oneshot_lowerhalf_s *priv =
|
||||
(struct pic32mz_oneshot_lowerhalf_s *)lower;
|
||||
irqstate_t flags;
|
||||
int ret;
|
||||
|
||||
|
@ -299,15 +299,15 @@ static int pic32mz_cancel(FAR struct oneshot_lowerhalf_s *lower,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct oneshot_lowerhalf_s *oneshot_initialize(int chan,
|
||||
struct oneshot_lowerhalf_s *oneshot_initialize(int chan,
|
||||
uint16_t resolution)
|
||||
{
|
||||
FAR struct pic32mz_oneshot_lowerhalf_s *priv;
|
||||
struct pic32mz_oneshot_lowerhalf_s *priv;
|
||||
int ret;
|
||||
|
||||
/* Allocate an instance of the lower half driver */
|
||||
|
||||
priv = (FAR struct pic32mz_oneshot_lowerhalf_s *)
|
||||
priv = (struct pic32mz_oneshot_lowerhalf_s *)
|
||||
kmm_zalloc(sizeof(struct pic32mz_oneshot_lowerhalf_s));
|
||||
|
||||
if (priv == NULL)
|
||||
|
|
|
@ -260,7 +260,7 @@ static int up_setup(struct uart_dev_s *dev);
|
|||
static void up_shutdown(struct uart_dev_s *dev);
|
||||
static int up_attach(struct uart_dev_s *dev);
|
||||
static void up_detach(struct uart_dev_s *dev);
|
||||
static int up_interrupt(int irq, void *context, FAR void *arg);
|
||||
static int up_interrupt(int irq, void *context, void *arg);
|
||||
static int up_ioctl(struct file *filep, int cmd, unsigned long arg);
|
||||
static int up_receive(struct uart_dev_s *dev, unsigned int *status);
|
||||
static void up_rxint(struct uart_dev_s *dev, bool enable);
|
||||
|
@ -692,7 +692,7 @@ static void up_detach(struct uart_dev_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int up_interrupt(int irq, void *context, FAR void *arg)
|
||||
static int up_interrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
struct uart_dev_s *dev = (struct uart_dev_s *)arg;
|
||||
struct up_dev_s *priv;
|
||||
|
|
|
@ -126,7 +126,7 @@ struct pic32mz_config_s
|
|||
struct pic32mz_dev_s
|
||||
{
|
||||
struct spi_dev_s spidev; /* Externally visible part of the SPI interface */
|
||||
FAR const struct pic32mz_config_s *config;
|
||||
const struct pic32mz_config_s *config;
|
||||
sem_t exclsem; /* Held while chip is selected for mutual exclusion */
|
||||
uint32_t frequency; /* Requested clock frequency */
|
||||
uint32_t actual; /* Actual clock frequency */
|
||||
|
@ -161,27 +161,27 @@ struct pic32mz_dev_s
|
|||
/* Low-level register access */
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI_REGDEBUG
|
||||
static bool spi_checkreg(FAR struct pic32mz_dev_s *priv,
|
||||
static bool spi_checkreg(struct pic32mz_dev_s *priv,
|
||||
uintptr_t regaddr, uint32_t regvaql, bool wr);
|
||||
static uint32_t spi_getreg(FAR struct pic32mz_dev_s *priv,
|
||||
static uint32_t spi_getreg(struct pic32mz_dev_s *priv,
|
||||
unsigned int offset);
|
||||
static void spi_putaddr(FAR struct pic32mz_dev_s *priv,
|
||||
static void spi_putaddr(struct pic32mz_dev_s *priv,
|
||||
uintptr_t regaddr, uint32_t value);
|
||||
#else
|
||||
static inline uint32_t spi_getreg(FAR struct pic32mz_dev_s *priv,
|
||||
static inline uint32_t spi_getreg(struct pic32mz_dev_s *priv,
|
||||
unsigned int offset);
|
||||
static inline void spi_putaddr(FAR struct pic32mz_dev_s *priv,
|
||||
static inline void spi_putaddr(struct pic32mz_dev_s *priv,
|
||||
uintptr_t regaddr, uint32_t value);
|
||||
#endif
|
||||
static inline void spi_putreg(FAR struct pic32mz_dev_s *priv,
|
||||
static inline void spi_putreg(struct pic32mz_dev_s *priv,
|
||||
unsigned int offset, uint32_t value);
|
||||
static inline void spi_flush(FAR struct pic32mz_dev_s *priv);
|
||||
static inline void spi_flush(struct pic32mz_dev_s *priv);
|
||||
|
||||
static void spi_exchange16(FAR struct pic32mz_dev_s *priv,
|
||||
FAR const uint16_t *txbuffer, FAR uint16_t *rxbuffer,
|
||||
static void spi_exchange16(struct pic32mz_dev_s *priv,
|
||||
const uint16_t *txbuffer, uint16_t *rxbuffer,
|
||||
size_t nwords);
|
||||
static void spi_exchange8(FAR struct pic32mz_dev_s *priv,
|
||||
FAR const uint8_t *txbuffer, FAR uint8_t *rxbuffer,
|
||||
static void spi_exchange8(struct pic32mz_dev_s *priv,
|
||||
const uint8_t *txbuffer, uint8_t *rxbuffer,
|
||||
size_t nbytes);
|
||||
|
||||
/* DMA Support */
|
||||
|
@ -192,8 +192,8 @@ static void spi_exchange8(FAR struct pic32mz_dev_s *priv,
|
|||
&(s)->rxdmaregs[i])
|
||||
# define spi_txdma_sample(s,i) pic32mz_dma_sample((s)->txdma,\
|
||||
&(s)->txdmaregs[i])
|
||||
static void spi_dma_sampleinit(FAR struct pic32mz_dev_s *priv);
|
||||
static void spi_dma_sampledone(FAR struct pic32mz_dev_s *priv);
|
||||
static void spi_dma_sampleinit(struct pic32mz_dev_s *priv);
|
||||
static void spi_dma_sampledone(struct pic32mz_dev_s *priv);
|
||||
# else
|
||||
# define spi_rxdma_sample(s,i)
|
||||
# define spi_txdma_sample(s,i)
|
||||
|
@ -207,26 +207,26 @@ static void spi_dmatimeout(wdparm_t arg);
|
|||
|
||||
/* SPI methods */
|
||||
|
||||
static int spi_lock(FAR struct spi_dev_s *dev, bool lock);
|
||||
static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev,
|
||||
static int spi_lock(struct spi_dev_s *dev, bool lock);
|
||||
static uint32_t spi_setfrequency(struct spi_dev_s *dev,
|
||||
uint32_t frequency);
|
||||
static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode);
|
||||
static void spi_setbits(FAR struct spi_dev_s *dev, int nbits);
|
||||
static uint32_t spi_send(FAR struct spi_dev_s *dev, uint32_t wd);
|
||||
static void spi_exchange(FAR struct spi_dev_s *dev,
|
||||
FAR const void *txbuffer, FAR void *rxbuffer,
|
||||
static void spi_setmode(struct spi_dev_s *dev, enum spi_mode_e mode);
|
||||
static void spi_setbits(struct spi_dev_s *dev, int nbits);
|
||||
static uint32_t spi_send(struct spi_dev_s *dev, uint32_t wd);
|
||||
static void spi_exchange(struct spi_dev_s *dev,
|
||||
const void *txbuffer, void *rxbuffer,
|
||||
size_t nwords);
|
||||
#ifdef CONFIG_PIC32MZ_SPI_DMA
|
||||
static void spi_exchange_nodma(FAR struct spi_dev_s *dev,
|
||||
FAR const void *txbuffer,
|
||||
FAR void *rxbuffer,
|
||||
static void spi_exchange_nodma(struct spi_dev_s *dev,
|
||||
const void *txbuffer,
|
||||
void *rxbuffer,
|
||||
size_t nwords);
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_SPI_EXCHANGE
|
||||
static void spi_sndblock(FAR struct spi_dev_s *dev,
|
||||
FAR const void *buffer, size_t nwords);
|
||||
static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer,
|
||||
static void spi_sndblock(struct spi_dev_s *dev,
|
||||
const void *buffer, size_t nwords);
|
||||
static void spi_recvblock(struct spi_dev_s *dev, void *buffer,
|
||||
size_t nwords);
|
||||
#endif
|
||||
|
||||
|
@ -612,7 +612,7 @@ static bool spi_checkreg(struct pic32mz_dev_s *priv, uintptr_t regaddr,
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI_REGDEBUG
|
||||
static uint32_t spi_getreg(FAR struct pic32mz_dev_s *priv,
|
||||
static uint32_t spi_getreg(struct pic32mz_dev_s *priv,
|
||||
unsigned int offset)
|
||||
{
|
||||
uintptr_t regaddr;
|
||||
|
@ -638,7 +638,7 @@ static uint32_t spi_getreg(FAR struct pic32mz_dev_s *priv,
|
|||
return regval;
|
||||
}
|
||||
#else
|
||||
static inline uint32_t spi_getreg(FAR struct pic32mz_dev_s *priv,
|
||||
static inline uint32_t spi_getreg(struct pic32mz_dev_s *priv,
|
||||
unsigned int offset)
|
||||
{
|
||||
return getreg32(priv->config->base + offset);
|
||||
|
@ -662,7 +662,7 @@ static inline uint32_t spi_getreg(FAR struct pic32mz_dev_s *priv,
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI_REGDEBUG
|
||||
static void spi_putaddr(FAR struct pic32mz_dev_s *priv, uintptr_t regaddr,
|
||||
static void spi_putaddr(struct pic32mz_dev_s *priv, uintptr_t regaddr,
|
||||
uint32_t regval)
|
||||
{
|
||||
/* Should we print something? */
|
||||
|
@ -680,7 +680,7 @@ static void spi_putaddr(FAR struct pic32mz_dev_s *priv, uintptr_t regaddr,
|
|||
putreg32(regval, regaddr);
|
||||
}
|
||||
#else
|
||||
static inline void spi_putaddr(FAR struct pic32mz_dev_s *priv,
|
||||
static inline void spi_putaddr(struct pic32mz_dev_s *priv,
|
||||
uintptr_t regaddr, uint32_t regval)
|
||||
{
|
||||
/* Write the value to the register */
|
||||
|
@ -705,7 +705,7 @@ static inline void spi_putaddr(FAR struct pic32mz_dev_s *priv,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void spi_putreg(FAR struct pic32mz_dev_s *priv,
|
||||
static inline void spi_putreg(struct pic32mz_dev_s *priv,
|
||||
unsigned int offset, uint32_t regval)
|
||||
{
|
||||
spi_putaddr(priv, priv->config->base + offset, regval);
|
||||
|
@ -725,7 +725,7 @@ static inline void spi_putreg(FAR struct pic32mz_dev_s *priv,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void spi_flush(FAR struct pic32mz_dev_s *priv)
|
||||
static inline void spi_flush(struct pic32mz_dev_s *priv)
|
||||
{
|
||||
/* Make sure that no TX activity is in progress... waiting if necessary */
|
||||
|
||||
|
@ -756,7 +756,7 @@ static inline void spi_flush(FAR struct pic32mz_dev_s *priv)
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI_DMADEBUG
|
||||
static void spi_dma_sampleinit(FAR struct pic32mz_dev_s *priv)
|
||||
static void spi_dma_sampleinit(struct pic32mz_dev_s *priv)
|
||||
{
|
||||
/* Put contents of register samples into a known state */
|
||||
|
||||
|
@ -787,7 +787,7 @@ static void spi_dma_sampleinit(FAR struct pic32mz_dev_s *priv)
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI_DMADEBUG
|
||||
static void spi_dma_sampledone(FAR struct pic32mz_dev_s *priv)
|
||||
static void spi_dma_sampledone(struct pic32mz_dev_s *priv)
|
||||
{
|
||||
/* Sample the final registers */
|
||||
|
||||
|
@ -1016,8 +1016,8 @@ static void spi_dmatimeout(wdparm_t arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void spi_exchange8(FAR struct pic32mz_dev_s *priv,
|
||||
FAR const uint8_t *txbuffer, FAR uint8_t *rxbuffer,
|
||||
static void spi_exchange8(struct pic32mz_dev_s *priv,
|
||||
const uint8_t *txbuffer, uint8_t *rxbuffer,
|
||||
size_t nbytes)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
@ -1091,9 +1091,9 @@ static void spi_exchange8(FAR struct pic32mz_dev_s *priv,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void spi_exchange16(FAR struct pic32mz_dev_s *priv,
|
||||
FAR const uint16_t *txbuffer,
|
||||
FAR uint16_t *rxbuffer, size_t nwords)
|
||||
static void spi_exchange16(struct pic32mz_dev_s *priv,
|
||||
const uint16_t *txbuffer,
|
||||
uint16_t *rxbuffer, size_t nwords)
|
||||
{
|
||||
uint32_t regval;
|
||||
uint16_t data;
|
||||
|
@ -1169,9 +1169,9 @@ static void spi_exchange16(FAR struct pic32mz_dev_s *priv,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int spi_lock(FAR struct spi_dev_s *dev, bool lock)
|
||||
static int spi_lock(struct spi_dev_s *dev, bool lock)
|
||||
{
|
||||
FAR struct pic32mz_dev_s *priv = (FAR struct pic32mz_dev_s *)dev;
|
||||
struct pic32mz_dev_s *priv = (struct pic32mz_dev_s *)dev;
|
||||
int ret;
|
||||
|
||||
if (lock)
|
||||
|
@ -1201,10 +1201,10 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev,
|
||||
static uint32_t spi_setfrequency(struct spi_dev_s *dev,
|
||||
uint32_t frequency)
|
||||
{
|
||||
FAR struct pic32mz_dev_s *priv = (FAR struct pic32mz_dev_s *)dev;
|
||||
struct pic32mz_dev_s *priv = (struct pic32mz_dev_s *)dev;
|
||||
uint32_t divisor;
|
||||
uint32_t actual;
|
||||
uint32_t regval;
|
||||
|
@ -1273,9 +1273,9 @@ static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode)
|
||||
static void spi_setmode(struct spi_dev_s *dev, enum spi_mode_e mode)
|
||||
{
|
||||
FAR struct pic32mz_dev_s *priv = (FAR struct pic32mz_dev_s *)dev;
|
||||
struct pic32mz_dev_s *priv = (struct pic32mz_dev_s *)dev;
|
||||
|
||||
/* Has the mode changed? */
|
||||
|
||||
|
@ -1359,9 +1359,9 @@ static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void spi_setbits(FAR struct spi_dev_s *dev, int nbits)
|
||||
static void spi_setbits(struct spi_dev_s *dev, int nbits)
|
||||
{
|
||||
FAR struct pic32mz_dev_s *priv = (FAR struct pic32mz_dev_s *)dev;
|
||||
struct pic32mz_dev_s *priv = (struct pic32mz_dev_s *)dev;
|
||||
uint32_t setting;
|
||||
uint32_t regval;
|
||||
|
||||
|
@ -1419,9 +1419,9 @@ static void spi_setbits(FAR struct spi_dev_s *dev, int nbits)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static uint32_t spi_send(FAR struct spi_dev_s *dev, uint32_t wd)
|
||||
static uint32_t spi_send(struct spi_dev_s *dev, uint32_t wd)
|
||||
{
|
||||
FAR struct pic32mz_dev_s *priv = (FAR struct pic32mz_dev_s *)dev;
|
||||
struct pic32mz_dev_s *priv = (struct pic32mz_dev_s *)dev;
|
||||
|
||||
DEBUGASSERT(priv);
|
||||
|
||||
|
@ -1489,15 +1489,15 @@ static uint32_t spi_send(FAR struct spi_dev_s *dev, uint32_t wd)
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI_DMA
|
||||
static void spi_exchange_nodma(FAR struct spi_dev_s *dev,
|
||||
FAR const void *txbuffer,
|
||||
FAR void *rxbuffer, size_t nwords)
|
||||
static void spi_exchange_nodma(struct spi_dev_s *dev,
|
||||
const void *txbuffer,
|
||||
void *rxbuffer, size_t nwords)
|
||||
#else
|
||||
static void spi_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer,
|
||||
FAR void *rxbuffer, size_t nwords)
|
||||
static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer,
|
||||
void *rxbuffer, size_t nwords)
|
||||
#endif
|
||||
{
|
||||
FAR struct pic32mz_dev_s *priv = (FAR struct pic32mz_dev_s *)dev;
|
||||
struct pic32mz_dev_s *priv = (struct pic32mz_dev_s *)dev;
|
||||
|
||||
DEBUGASSERT(priv);
|
||||
|
||||
|
@ -1509,23 +1509,23 @@ static void spi_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer,
|
|||
{
|
||||
/* spi_exchange16() can do this. */
|
||||
|
||||
spi_exchange16(priv, (FAR const uint16_t *)txbuffer,
|
||||
(FAR uint16_t *)rxbuffer, nwords);
|
||||
spi_exchange16(priv, (const uint16_t *)txbuffer,
|
||||
(uint16_t *)rxbuffer, nwords);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* spi_exchange8() can do this. */
|
||||
|
||||
spi_exchange8(priv, (FAR const uint8_t *)txbuffer,
|
||||
(FAR uint8_t *)rxbuffer, nwords);
|
||||
spi_exchange8(priv, (const uint8_t *)txbuffer,
|
||||
(uint8_t *)rxbuffer, nwords);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI_DMA
|
||||
static void spi_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer,
|
||||
FAR void *rxbuffer, size_t nwords)
|
||||
static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer,
|
||||
void *rxbuffer, size_t nwords)
|
||||
{
|
||||
FAR struct pic32mz_dev_s *priv = (FAR struct pic32mz_dev_s *)dev;
|
||||
struct pic32mz_dev_s *priv = (struct pic32mz_dev_s *)dev;
|
||||
struct pic32mz_dma_chcfg_s rxcfg;
|
||||
struct pic32mz_dma_chcfg_s txcfg;
|
||||
struct pic32mz_dma_xfrcfg_s rxxfr;
|
||||
|
@ -1850,7 +1850,7 @@ static void spi_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer,
|
|||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_SPI_EXCHANGE
|
||||
static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer,
|
||||
static void spi_sndblock(struct spi_dev_s *dev, const void *buffer,
|
||||
size_t nwords)
|
||||
{
|
||||
/* spi_exchange() can do this. */
|
||||
|
@ -1881,7 +1881,7 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer,
|
|||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_SPI_EXCHANGE
|
||||
static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer,
|
||||
static void spi_recvblock(struct spi_dev_s *dev, void *buffer,
|
||||
size_t nwords)
|
||||
{
|
||||
/* spi_exchange() can do this. */
|
||||
|
@ -1908,9 +1908,9 @@ static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct spi_dev_s *pic32mz_spibus_initialize(int port)
|
||||
struct spi_dev_s *pic32mz_spibus_initialize(int port)
|
||||
{
|
||||
FAR struct pic32mz_dev_s *priv;
|
||||
struct pic32mz_dev_s *priv;
|
||||
uintptr_t regaddr;
|
||||
irqstate_t flags;
|
||||
uint32_t regval;
|
||||
|
@ -2056,7 +2056,7 @@ FAR struct spi_dev_s *pic32mz_spibus_initialize(int port)
|
|||
|
||||
/* Select a default frequency of approx. 400KHz */
|
||||
|
||||
spi_setfrequency((FAR struct spi_dev_s *)priv, 400000);
|
||||
spi_setfrequency((struct spi_dev_s *)priv, 400000);
|
||||
|
||||
/* Clear the SPIROV overflow bit (SPIxSTAT:6). */
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ struct spi_dev_s; /* Forward reference */
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct spi_dev_s *pic32mz_spibus_initialize(int port);
|
||||
struct spi_dev_s *pic32mz_spibus_initialize(int port);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: pic32mz_spiNselect, pic32mz_spiNstatus, and pic32mz_spiNcmddata
|
||||
|
@ -103,56 +103,56 @@ FAR struct spi_dev_s *pic32mz_spibus_initialize(int port);
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI1
|
||||
void pic32mz_spi1select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mz_spi1select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected);
|
||||
uint8_t pic32mz_spi1status(FAR struct spi_dev_s *dev, uint32_t devid);
|
||||
uint8_t pic32mz_spi1status(struct spi_dev_s *dev, uint32_t devid);
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mz_spi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd);
|
||||
int pic32mz_spi1cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI2
|
||||
void pic32mz_spi2select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mz_spi2select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected);
|
||||
uint8_t pic32mz_spi2status(FAR struct spi_dev_s *dev, uint32_t devid);
|
||||
uint8_t pic32mz_spi2status(struct spi_dev_s *dev, uint32_t devid);
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mz_spi2cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd);
|
||||
int pic32mz_spi2cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI3
|
||||
void pic32mz_spi3select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mz_spi3select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected);
|
||||
uint8_t pic32mz_spi3status(FAR struct spi_dev_s *dev, uint32_t devid);
|
||||
uint8_t pic32mz_spi3status(struct spi_dev_s *dev, uint32_t devid);
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mz_spi3cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd);
|
||||
int pic32mz_spi3cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI4
|
||||
void pic32mz_spi4select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mz_spi4select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected);
|
||||
uint8_t pic32mz_spi4status(FAR struct spi_dev_s *dev, uint32_t devid);
|
||||
uint8_t pic32mz_spi4status(struct spi_dev_s *dev, uint32_t devid);
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mz_spi4cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd);
|
||||
int pic32mz_spi4cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI5
|
||||
void pic32mz_spi5select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mz_spi5select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected);
|
||||
uint8_t pic32mz_spi5status(FAR struct spi_dev_s *dev, uint32_t devid);
|
||||
uint8_t pic32mz_spi5status(struct spi_dev_s *dev, uint32_t devid);
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mz_spi5cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd);
|
||||
int pic32mz_spi5cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI6
|
||||
void pic32mz_spi6select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mz_spi6select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected);
|
||||
uint8_t pic32mz_spi6status(FAR struct spi_dev_s *dev, uint32_t devid);
|
||||
uint8_t pic32mz_spi6status(struct spi_dev_s *dev, uint32_t devid);
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mz_spi6cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd);
|
||||
int pic32mz_spi6cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -178,39 +178,39 @@ int pic32mz_spi6cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd);
|
|||
|
||||
#ifdef CONFIG_SPI_CALLBACK
|
||||
#ifdef CONFIG_PIC32MZ_SPI1
|
||||
int pic32mz_spi1register(FAR struct spi_dev_s *dev,
|
||||
int pic32mz_spi1register(struct spi_dev_s *dev,
|
||||
spi_mediachange_t callback,
|
||||
FAR void *arg);
|
||||
void *arg);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI2
|
||||
int pic32mz_spi2register(FAR struct spi_dev_s *dev,
|
||||
int pic32mz_spi2register(struct spi_dev_s *dev,
|
||||
spi_mediachange_t callback,
|
||||
FAR void *arg);
|
||||
void *arg);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI3
|
||||
int pic32mz_spi3register(FAR struct spi_dev_s *dev,
|
||||
int pic32mz_spi3register(struct spi_dev_s *dev,
|
||||
spi_mediachange_t callback,
|
||||
FAR void *arg);
|
||||
void *arg);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI4
|
||||
int pic32mz_spi4register(FAR struct spi_dev_s *dev,
|
||||
int pic32mz_spi4register(struct spi_dev_s *dev,
|
||||
spi_mediachange_t callback,
|
||||
FAR void *arg);
|
||||
void *arg);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI5
|
||||
int pic32mz_spi5register(FAR struct spi_dev_s *dev,
|
||||
int pic32mz_spi5register(struct spi_dev_s *dev,
|
||||
spi_mediachange_t callback,
|
||||
FAR void *arg);
|
||||
void *arg);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI6
|
||||
int pic32mz_spi6register(FAR struct spi_dev_s *dev,
|
||||
int pic32mz_spi6register(struct spi_dev_s *dev,
|
||||
spi_mediachange_t callback,
|
||||
FAR void *arg);
|
||||
void *arg);
|
||||
#endif
|
||||
#endif /* CONFIG_SPI_CALLBACK */
|
||||
|
||||
|
|
|
@ -126,46 +126,46 @@ struct pic32mz_timer_priv_s
|
|||
|
||||
/* Helpers */
|
||||
|
||||
static inline uint32_t pic32mz_getreg(FAR struct pic32mz_timer_dev_s *dev,
|
||||
static inline uint32_t pic32mz_getreg(struct pic32mz_timer_dev_s *dev,
|
||||
uint16_t offset);
|
||||
static inline void pic32mz_putreg(FAR struct pic32mz_timer_dev_s *dev,
|
||||
static inline void pic32mz_putreg(struct pic32mz_timer_dev_s *dev,
|
||||
uint16_t offset, uint32_t value);
|
||||
static inline bool pic32mz_timer_mode32(FAR struct pic32mz_timer_dev_s *dev);
|
||||
static inline bool pic32mz_timer_mode32(struct pic32mz_timer_dev_s *dev);
|
||||
static inline uint32_t pic32mz_timer_oddoffset(uint32_t evenoffset);
|
||||
static inline uint32_t
|
||||
pic32mz_timer_nextirq(FAR struct pic32mz_timer_dev_s *dev);
|
||||
pic32mz_timer_nextirq(struct pic32mz_timer_dev_s *dev);
|
||||
|
||||
static void pic32mz_timer_stopinidle(FAR struct pic32mz_timer_dev_s *dev,
|
||||
static void pic32mz_timer_stopinidle(struct pic32mz_timer_dev_s *dev,
|
||||
bool stop);
|
||||
static void pic32mz_timer_enablegate(FAR struct pic32mz_timer_dev_s *dev,
|
||||
static void pic32mz_timer_enablegate(struct pic32mz_timer_dev_s *dev,
|
||||
bool enable);
|
||||
static void pic32mz_timer_setprescale(FAR struct pic32mz_timer_dev_s *dev,
|
||||
static void pic32mz_timer_setprescale(struct pic32mz_timer_dev_s *dev,
|
||||
uint8_t prescale);
|
||||
static void pic32mz_timer_setmode32(FAR struct pic32mz_timer_dev_s *dev,
|
||||
static void pic32mz_timer_setmode32(struct pic32mz_timer_dev_s *dev,
|
||||
bool enable);
|
||||
static void pic32mz_timer_extclocksource(FAR struct pic32mz_timer_dev_s *dev,
|
||||
static void pic32mz_timer_extclocksource(struct pic32mz_timer_dev_s *dev,
|
||||
bool enable);
|
||||
static void pic32mz_timer_inithardware(FAR struct pic32mz_timer_dev_s *dev);
|
||||
static void pic32mz_timer_inithardware(struct pic32mz_timer_dev_s *dev);
|
||||
|
||||
/* Timer's methods */
|
||||
|
||||
static void pic32mz_timer_start(FAR struct pic32mz_timer_dev_s *dev);
|
||||
static void pic32mz_timer_stop(FAR struct pic32mz_timer_dev_s *dev);
|
||||
static void pic32mz_timer_setperiod(FAR struct pic32mz_timer_dev_s *dev,
|
||||
static void pic32mz_timer_start(struct pic32mz_timer_dev_s *dev);
|
||||
static void pic32mz_timer_stop(struct pic32mz_timer_dev_s *dev);
|
||||
static void pic32mz_timer_setperiod(struct pic32mz_timer_dev_s *dev,
|
||||
uint32_t period);
|
||||
static
|
||||
uint32_t pic32mz_timer_getcounter(FAR struct pic32mz_timer_dev_s *dev);
|
||||
static void pic32mz_timer_setcounter(FAR struct pic32mz_timer_dev_s *dev,
|
||||
uint32_t pic32mz_timer_getcounter(struct pic32mz_timer_dev_s *dev);
|
||||
static void pic32mz_timer_setcounter(struct pic32mz_timer_dev_s *dev,
|
||||
uint32_t count);
|
||||
static uint32_t pic32mz_timer_getfreq(FAR struct pic32mz_timer_dev_s *dev);
|
||||
static bool pic32mz_timer_setfreq(FAR struct pic32mz_timer_dev_s *dev,
|
||||
static uint32_t pic32mz_timer_getfreq(struct pic32mz_timer_dev_s *dev);
|
||||
static bool pic32mz_timer_setfreq(struct pic32mz_timer_dev_s *dev,
|
||||
uint32_t freq);
|
||||
static uint8_t pic32mz_timer_getwidth(FAR struct pic32mz_timer_dev_s *dev);
|
||||
static uint8_t pic32mz_timer_getwidth(struct pic32mz_timer_dev_s *dev);
|
||||
|
||||
static int pic32mz_timer_setisr(FAR struct pic32mz_timer_dev_s *dev,
|
||||
static int pic32mz_timer_setisr(struct pic32mz_timer_dev_s *dev,
|
||||
xcpt_t handler, void *arg);
|
||||
static void pic32mz_timer_ackint(FAR struct pic32mz_timer_dev_s *dev);
|
||||
static bool pic32mz_timer_checkint(FAR struct pic32mz_timer_dev_s *dev);
|
||||
static void pic32mz_timer_ackint(struct pic32mz_timer_dev_s *dev);
|
||||
static bool pic32mz_timer_checkint(struct pic32mz_timer_dev_s *dev);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
|
@ -519,11 +519,11 @@ static struct pic32mz_timer_priv_s pic32mz_t9_priv =
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline uint32_t pic32mz_getreg(FAR struct pic32mz_timer_dev_s *dev,
|
||||
static inline uint32_t pic32mz_getreg(struct pic32mz_timer_dev_s *dev,
|
||||
uint16_t offset)
|
||||
{
|
||||
FAR struct pic32mz_timer_priv_s *priv =
|
||||
(FAR struct pic32mz_timer_priv_s *)dev;
|
||||
struct pic32mz_timer_priv_s *priv =
|
||||
(struct pic32mz_timer_priv_s *)dev;
|
||||
|
||||
return getreg32(priv->config->base + offset);
|
||||
}
|
||||
|
@ -536,11 +536,11 @@ static inline uint32_t pic32mz_getreg(FAR struct pic32mz_timer_dev_s *dev,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void pic32mz_putreg(FAR struct pic32mz_timer_dev_s *dev,
|
||||
static inline void pic32mz_putreg(struct pic32mz_timer_dev_s *dev,
|
||||
uint16_t offset, uint32_t value)
|
||||
{
|
||||
FAR struct pic32mz_timer_priv_s *priv =
|
||||
(FAR struct pic32mz_timer_priv_s *)dev;
|
||||
struct pic32mz_timer_priv_s *priv =
|
||||
(struct pic32mz_timer_priv_s *)dev;
|
||||
|
||||
putreg32(value, priv->config->base + offset);
|
||||
}
|
||||
|
@ -553,9 +553,9 @@ static inline void pic32mz_putreg(FAR struct pic32mz_timer_dev_s *dev,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline bool pic32mz_timer_mode32(FAR struct pic32mz_timer_dev_s *dev)
|
||||
static inline bool pic32mz_timer_mode32(struct pic32mz_timer_dev_s *dev)
|
||||
{
|
||||
return ((FAR struct pic32mz_timer_priv_s *)dev)->config->mode32;
|
||||
return ((struct pic32mz_timer_priv_s *)dev)->config->mode32;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -588,11 +588,11 @@ static inline uint32_t pic32mz_timer_oddoffset(uint32_t evenoffset)
|
|||
****************************************************************************/
|
||||
|
||||
static inline uint32_t
|
||||
pic32mz_timer_nextirq(FAR struct pic32mz_timer_dev_s *dev)
|
||||
pic32mz_timer_nextirq(struct pic32mz_timer_dev_s *dev)
|
||||
{
|
||||
uint32_t irq;
|
||||
|
||||
irq = ((FAR struct pic32mz_timer_priv_s *)dev)->config->irq;
|
||||
irq = ((struct pic32mz_timer_priv_s *)dev)->config->irq;
|
||||
|
||||
/* The irq offsets between odd and even timers
|
||||
* are not always the same.
|
||||
|
@ -616,7 +616,7 @@ static inline uint32_t
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void pic32mz_timer_start(FAR struct pic32mz_timer_dev_s *dev)
|
||||
static void pic32mz_timer_start(struct pic32mz_timer_dev_s *dev)
|
||||
{
|
||||
pic32mz_putreg(dev, PIC32MZ_TIMER_CONSET_OFFSET, TIMER_CON_ON);
|
||||
}
|
||||
|
@ -629,7 +629,7 @@ static void pic32mz_timer_start(FAR struct pic32mz_timer_dev_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void pic32mz_timer_stop(FAR struct pic32mz_timer_dev_s *dev)
|
||||
static void pic32mz_timer_stop(struct pic32mz_timer_dev_s *dev)
|
||||
{
|
||||
pic32mz_putreg(dev, PIC32MZ_TIMER_CONCLR_OFFSET, TIMER_CON_ON);
|
||||
}
|
||||
|
@ -642,7 +642,7 @@ static void pic32mz_timer_stop(FAR struct pic32mz_timer_dev_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void pic32mz_timer_stopinidle(FAR struct pic32mz_timer_dev_s *dev,
|
||||
static void pic32mz_timer_stopinidle(struct pic32mz_timer_dev_s *dev,
|
||||
bool stop)
|
||||
{
|
||||
if (stop)
|
||||
|
@ -665,7 +665,7 @@ static void pic32mz_timer_stopinidle(FAR struct pic32mz_timer_dev_s *dev,
|
|||
}
|
||||
}
|
||||
|
||||
((FAR struct pic32mz_timer_priv_s *)dev)->config->stopinidle = stop;
|
||||
((struct pic32mz_timer_priv_s *)dev)->config->stopinidle = stop;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -677,11 +677,11 @@ static void pic32mz_timer_stopinidle(FAR struct pic32mz_timer_dev_s *dev,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void pic32mz_timer_enablegate(FAR struct pic32mz_timer_dev_s *dev,
|
||||
static void pic32mz_timer_enablegate(struct pic32mz_timer_dev_s *dev,
|
||||
bool enable)
|
||||
{
|
||||
FAR struct pic32mz_timer_priv_s *priv =
|
||||
(FAR struct pic32mz_timer_priv_s *)dev;
|
||||
struct pic32mz_timer_priv_s *priv =
|
||||
(struct pic32mz_timer_priv_s *)dev;
|
||||
|
||||
if (enable)
|
||||
{
|
||||
|
@ -708,13 +708,13 @@ static void pic32mz_timer_enablegate(FAR struct pic32mz_timer_dev_s *dev,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void pic32mz_timer_setprescale(FAR struct pic32mz_timer_dev_s *dev,
|
||||
static void pic32mz_timer_setprescale(struct pic32mz_timer_dev_s *dev,
|
||||
uint8_t prescale)
|
||||
{
|
||||
pic32mz_putreg(dev, PIC32MZ_TIMER_CONSET_OFFSET,
|
||||
(prescale << TIMER_CON_TCKPS_SHIFT));
|
||||
|
||||
((FAR struct pic32mz_timer_priv_s *)dev)->config->prescale = prescale;
|
||||
((struct pic32mz_timer_priv_s *)dev)->config->prescale = prescale;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -726,7 +726,7 @@ static void pic32mz_timer_setprescale(FAR struct pic32mz_timer_dev_s *dev,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void pic32mz_timer_setmode32(FAR struct pic32mz_timer_dev_s *dev,
|
||||
static void pic32mz_timer_setmode32(struct pic32mz_timer_dev_s *dev,
|
||||
bool enable)
|
||||
{
|
||||
/* Only even timers have the TIMER_CON_T32 bit. */
|
||||
|
@ -740,7 +740,7 @@ static void pic32mz_timer_setmode32(FAR struct pic32mz_timer_dev_s *dev,
|
|||
pic32mz_putreg(dev, PIC32MZ_TIMER_CONCLR_OFFSET, TIMER_CON_T32);
|
||||
}
|
||||
|
||||
((FAR struct pic32mz_timer_priv_s *)dev)->config->mode32 = enable;
|
||||
((struct pic32mz_timer_priv_s *)dev)->config->mode32 = enable;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -751,11 +751,11 @@ static void pic32mz_timer_setmode32(FAR struct pic32mz_timer_dev_s *dev,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void pic32mz_timer_extclocksource(FAR struct pic32mz_timer_dev_s *dev,
|
||||
static void pic32mz_timer_extclocksource(struct pic32mz_timer_dev_s *dev,
|
||||
bool enable)
|
||||
{
|
||||
FAR struct pic32mz_timer_priv_s *priv =
|
||||
(FAR struct pic32mz_timer_priv_s *)dev;
|
||||
struct pic32mz_timer_priv_s *priv =
|
||||
(struct pic32mz_timer_priv_s *)dev;
|
||||
|
||||
if (enable)
|
||||
{
|
||||
|
@ -784,10 +784,10 @@ static void pic32mz_timer_extclocksource(FAR struct pic32mz_timer_dev_s *dev,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void pic32mz_timer_inithardware(FAR struct pic32mz_timer_dev_s *dev)
|
||||
static void pic32mz_timer_inithardware(struct pic32mz_timer_dev_s *dev)
|
||||
{
|
||||
FAR struct pic32mz_timer_priv_s *priv =
|
||||
(FAR struct pic32mz_timer_priv_s *)dev;
|
||||
struct pic32mz_timer_priv_s *priv =
|
||||
(struct pic32mz_timer_priv_s *)dev;
|
||||
|
||||
/* Initialize the hardware using the startup configuration.
|
||||
*
|
||||
|
@ -828,7 +828,7 @@ static void pic32mz_timer_inithardware(FAR struct pic32mz_timer_dev_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void pic32mz_timer_setperiod(FAR struct pic32mz_timer_dev_s *dev,
|
||||
static void pic32mz_timer_setperiod(struct pic32mz_timer_dev_s *dev,
|
||||
uint32_t period)
|
||||
{
|
||||
/* In 32bit mode:
|
||||
|
@ -857,7 +857,7 @@ static void pic32mz_timer_setperiod(FAR struct pic32mz_timer_dev_s *dev,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static uint32_t pic32mz_timer_getcounter(FAR struct pic32mz_timer_dev_s *dev)
|
||||
static uint32_t pic32mz_timer_getcounter(struct pic32mz_timer_dev_s *dev)
|
||||
{
|
||||
/* In 32bit mode:
|
||||
* - even timers represent the least significant half words.
|
||||
|
@ -890,7 +890,7 @@ static uint32_t pic32mz_timer_getcounter(FAR struct pic32mz_timer_dev_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void pic32mz_timer_setcounter(FAR struct pic32mz_timer_dev_s *dev,
|
||||
static void pic32mz_timer_setcounter(struct pic32mz_timer_dev_s *dev,
|
||||
uint32_t count)
|
||||
{
|
||||
/* In 32bit mode:
|
||||
|
@ -919,12 +919,12 @@ static void pic32mz_timer_setcounter(FAR struct pic32mz_timer_dev_s *dev,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static uint32_t pic32mz_timer_getfreq(FAR struct pic32mz_timer_dev_s *dev)
|
||||
static uint32_t pic32mz_timer_getfreq(struct pic32mz_timer_dev_s *dev)
|
||||
{
|
||||
uint8_t prescale;
|
||||
uint32_t freq;
|
||||
|
||||
prescale = ((FAR struct pic32mz_timer_priv_s *)dev)->config->prescale;
|
||||
prescale = ((struct pic32mz_timer_priv_s *)dev)->config->prescale;
|
||||
|
||||
/* The prescale values are not a continuous power of 2.
|
||||
* There is a gap between 64 and 256 (the 128 is skipped).
|
||||
|
@ -950,7 +950,7 @@ static uint32_t pic32mz_timer_getfreq(FAR struct pic32mz_timer_dev_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static bool pic32mz_timer_setfreq(FAR struct pic32mz_timer_dev_s *dev,
|
||||
static bool pic32mz_timer_setfreq(struct pic32mz_timer_dev_s *dev,
|
||||
uint32_t freq)
|
||||
{
|
||||
uint16_t prescale;
|
||||
|
@ -1038,7 +1038,7 @@ static bool pic32mz_timer_setfreq(FAR struct pic32mz_timer_dev_s *dev,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static uint8_t pic32mz_timer_getwidth(FAR struct pic32mz_timer_dev_s *dev)
|
||||
static uint8_t pic32mz_timer_getwidth(struct pic32mz_timer_dev_s *dev)
|
||||
{
|
||||
return pic32mz_timer_mode32(dev) ? 32 : 16;
|
||||
}
|
||||
|
@ -1051,11 +1051,11 @@ static uint8_t pic32mz_timer_getwidth(FAR struct pic32mz_timer_dev_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int pic32mz_timer_setisr(FAR struct pic32mz_timer_dev_s *dev,
|
||||
xcpt_t handler, FAR void *arg)
|
||||
static int pic32mz_timer_setisr(struct pic32mz_timer_dev_s *dev,
|
||||
xcpt_t handler, void *arg)
|
||||
{
|
||||
FAR struct pic32mz_timer_priv_s *priv =
|
||||
(FAR struct pic32mz_timer_priv_s *)dev;
|
||||
struct pic32mz_timer_priv_s *priv =
|
||||
(struct pic32mz_timer_priv_s *)dev;
|
||||
|
||||
/* Disable interrupt when callback is removed */
|
||||
|
||||
|
@ -1108,9 +1108,9 @@ static int pic32mz_timer_setisr(FAR struct pic32mz_timer_dev_s *dev,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void pic32mz_timer_ackint(FAR struct pic32mz_timer_dev_s *dev)
|
||||
static void pic32mz_timer_ackint(struct pic32mz_timer_dev_s *dev)
|
||||
{
|
||||
up_clrpend_irq(((FAR struct pic32mz_timer_priv_s *)dev)->config->irq);
|
||||
up_clrpend_irq(((struct pic32mz_timer_priv_s *)dev)->config->irq);
|
||||
|
||||
if (pic32mz_timer_mode32(dev))
|
||||
{
|
||||
|
@ -1128,7 +1128,7 @@ static void pic32mz_timer_ackint(FAR struct pic32mz_timer_dev_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static bool pic32mz_timer_checkint(FAR struct pic32mz_timer_dev_s *dev)
|
||||
static bool pic32mz_timer_checkint(struct pic32mz_timer_dev_s *dev)
|
||||
{
|
||||
if (pic32mz_timer_mode32(dev))
|
||||
{
|
||||
|
@ -1138,8 +1138,8 @@ static bool pic32mz_timer_checkint(FAR struct pic32mz_timer_dev_s *dev)
|
|||
}
|
||||
else
|
||||
{
|
||||
FAR struct pic32mz_timer_priv_s *priv =
|
||||
(FAR struct pic32mz_timer_priv_s *)dev;
|
||||
struct pic32mz_timer_priv_s *priv =
|
||||
(struct pic32mz_timer_priv_s *)dev;
|
||||
|
||||
return up_pending_irq(priv->config->irq);
|
||||
}
|
||||
|
@ -1153,7 +1153,7 @@ static bool pic32mz_timer_checkint(FAR struct pic32mz_timer_dev_s *dev)
|
|||
* Name: pic32mz_timer_init
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct pic32mz_timer_dev_s *pic32mz_timer_init(int timer)
|
||||
struct pic32mz_timer_dev_s *pic32mz_timer_init(int timer)
|
||||
{
|
||||
struct pic32mz_timer_dev_s *dev = NULL;
|
||||
|
||||
|
@ -1161,49 +1161,49 @@ FAR struct pic32mz_timer_dev_s *pic32mz_timer_init(int timer)
|
|||
{
|
||||
#ifdef CONFIG_PIC32MZ_T2
|
||||
case 2:
|
||||
dev = (FAR struct pic32mz_timer_dev_s *)&pic32mz_t2_priv;
|
||||
dev = (struct pic32mz_timer_dev_s *)&pic32mz_t2_priv;
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_PIC32MZ_T3
|
||||
case 3:
|
||||
dev = (FAR struct pic32mz_timer_dev_s *)&pic32mz_t3_priv;
|
||||
dev = (struct pic32mz_timer_dev_s *)&pic32mz_t3_priv;
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_PIC32MZ_T4
|
||||
case 4:
|
||||
dev = (FAR struct pic32mz_timer_dev_s *)&pic32mz_t4_priv;
|
||||
dev = (struct pic32mz_timer_dev_s *)&pic32mz_t4_priv;
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_PIC32MZ_T5
|
||||
case 5:
|
||||
dev = (FAR struct pic32mz_timer_dev_s *)&pic32mz_t5_priv;
|
||||
dev = (struct pic32mz_timer_dev_s *)&pic32mz_t5_priv;
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_PIC32MZ_T6
|
||||
case 6:
|
||||
dev = (FAR struct pic32mz_timer_dev_s *)&pic32mz_t6_priv;
|
||||
dev = (struct pic32mz_timer_dev_s *)&pic32mz_t6_priv;
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_PIC32MZ_T7
|
||||
case 7:
|
||||
dev = (FAR struct pic32mz_timer_dev_s *)&pic32mz_t7_priv;
|
||||
dev = (struct pic32mz_timer_dev_s *)&pic32mz_t7_priv;
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_PIC32MZ_T8
|
||||
case 8:
|
||||
dev = (FAR struct pic32mz_timer_dev_s *)&pic32mz_t8_priv;
|
||||
dev = (struct pic32mz_timer_dev_s *)&pic32mz_t8_priv;
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_PIC32MZ_T9
|
||||
case 9:
|
||||
dev = (FAR struct pic32mz_timer_dev_s *)&pic32mz_t9_priv;
|
||||
dev = (struct pic32mz_timer_dev_s *)&pic32mz_t9_priv;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (((FAR struct pic32mz_timer_priv_s *)dev)->inuse)
|
||||
if (((struct pic32mz_timer_priv_s *)dev)->inuse)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
@ -1213,20 +1213,20 @@ FAR struct pic32mz_timer_dev_s *pic32mz_timer_init(int timer)
|
|||
|
||||
pic32mz_timer_inithardware(dev);
|
||||
|
||||
((FAR struct pic32mz_timer_priv_s *)dev)->inuse = true;
|
||||
((struct pic32mz_timer_priv_s *)dev)->inuse = true;
|
||||
|
||||
return dev;
|
||||
}
|
||||
}
|
||||
|
||||
int pic32mz_timer_deinit(FAR struct pic32mz_timer_dev_s *dev)
|
||||
int pic32mz_timer_deinit(struct pic32mz_timer_dev_s *dev)
|
||||
{
|
||||
/* Stop the timer in case it was still running
|
||||
* and mark it as unused.
|
||||
*/
|
||||
|
||||
pic32mz_timer_stop(dev);
|
||||
((FAR struct pic32mz_timer_priv_s *)dev)->inuse = false;
|
||||
((struct pic32mz_timer_priv_s *)dev)->inuse = false;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
|
|
@ -69,28 +69,28 @@ struct pic32mz_timer_ops_s
|
|||
{
|
||||
/* Timer's methods */
|
||||
|
||||
void (*start)(FAR struct pic32mz_timer_dev_s *dev);
|
||||
void (*stop)(FAR struct pic32mz_timer_dev_s *dev);
|
||||
void (*setperiod)(FAR struct pic32mz_timer_dev_s *dev, uint32_t p);
|
||||
uint32_t (*getcounter)(FAR struct pic32mz_timer_dev_s *dev);
|
||||
void (*setcounter)(FAR struct pic32mz_timer_dev_s *dev, uint32_t c);
|
||||
uint32_t (*getfreq)(FAR struct pic32mz_timer_dev_s *dev);
|
||||
bool (*setfreq)(FAR struct pic32mz_timer_dev_s *dev, uint32_t freq);
|
||||
uint8_t (*getwidth)(FAR struct pic32mz_timer_dev_s *dev);
|
||||
void (*start)(struct pic32mz_timer_dev_s *dev);
|
||||
void (*stop)(struct pic32mz_timer_dev_s *dev);
|
||||
void (*setperiod)(struct pic32mz_timer_dev_s *dev, uint32_t p);
|
||||
uint32_t (*getcounter)(struct pic32mz_timer_dev_s *dev);
|
||||
void (*setcounter)(struct pic32mz_timer_dev_s *dev, uint32_t c);
|
||||
uint32_t (*getfreq)(struct pic32mz_timer_dev_s *dev);
|
||||
bool (*setfreq)(struct pic32mz_timer_dev_s *dev, uint32_t freq);
|
||||
uint8_t (*getwidth)(struct pic32mz_timer_dev_s *dev);
|
||||
|
||||
/* Timer's interrupts */
|
||||
|
||||
int (*setisr)(FAR struct pic32mz_timer_dev_s *dev, xcpt_t handler,
|
||||
int (*setisr)(struct pic32mz_timer_dev_s *dev, xcpt_t handler,
|
||||
void * arg);
|
||||
void (*ackint)(FAR struct pic32mz_timer_dev_s *dev);
|
||||
bool (*checkint)(FAR struct pic32mz_timer_dev_s *dev);
|
||||
void (*ackint)(struct pic32mz_timer_dev_s *dev);
|
||||
bool (*checkint)(struct pic32mz_timer_dev_s *dev);
|
||||
};
|
||||
|
||||
/* Timer's Device Structure */
|
||||
|
||||
struct pic32mz_timer_dev_s
|
||||
{
|
||||
FAR struct pic32mz_timer_ops_s *ops;
|
||||
struct pic32mz_timer_ops_s *ops;
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -105,7 +105,7 @@ struct pic32mz_timer_dev_s
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct pic32mz_timer_dev_s *pic32mz_timer_init(int timer);
|
||||
struct pic32mz_timer_dev_s *pic32mz_timer_init(int timer);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: pic32mz_timer_deinit
|
||||
|
@ -115,7 +115,7 @@ FAR struct pic32mz_timer_dev_s *pic32mz_timer_init(int timer);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int pic32mz_timer_deinit(FAR struct pic32mz_timer_dev_s *dev);
|
||||
int pic32mz_timer_deinit(struct pic32mz_timer_dev_s *dev);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: pic32mz_timer_initialize
|
||||
|
@ -136,7 +136,7 @@ int pic32mz_timer_deinit(FAR struct pic32mz_timer_dev_s *dev);
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_TIMER
|
||||
int pic32mz_timer_initialize(FAR const char *devpath, int timer);
|
||||
int pic32mz_timer_initialize(const char *devpath, int timer);
|
||||
#endif
|
||||
|
||||
#undef EXTERN
|
||||
|
|
|
@ -58,16 +58,16 @@
|
|||
|
||||
struct pic32mz_lowerhalf_s
|
||||
{
|
||||
FAR const struct timer_ops_s *ops; /* Lower half operations */
|
||||
FAR struct pic32mz_timer_dev_s *timer; /* pic32mz timer driver */
|
||||
tccb_t callback; /* Current user interrupt cb */
|
||||
FAR void *arg; /* Argument to upper half cb */
|
||||
uint32_t timeout; /* Current timeout value (us) */
|
||||
uint32_t ticks; /* Timeout converted in ticks */
|
||||
uint32_t freq; /* Timer's frequency (Hz) */
|
||||
uint8_t width; /* Timer's width */
|
||||
uint32_t maxticks; /* Maximum ticks for this timer */
|
||||
bool started; /* True: Timer has been started */
|
||||
const struct timer_ops_s *ops; /* Lower half operations */
|
||||
struct pic32mz_timer_dev_s *timer; /* pic32mz timer driver */
|
||||
tccb_t callback; /* Current user interrupt cb */
|
||||
void *arg; /* Argument to upper half cb */
|
||||
uint32_t timeout; /* Current timeout value (us) */
|
||||
uint32_t ticks; /* Timeout converted in ticks */
|
||||
uint32_t freq; /* Timer's frequency (Hz) */
|
||||
uint8_t width; /* Timer's width */
|
||||
uint32_t maxticks; /* Maximum ticks for this timer */
|
||||
bool started; /* True: Timer has been started */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -87,18 +87,18 @@ static int pic32mz_timer_handler(int irq, void * context, void * arg);
|
|||
|
||||
/* "Lower half" driver methods **********************************************/
|
||||
|
||||
static int pic32mz_start(FAR struct timer_lowerhalf_s *lower);
|
||||
static int pic32mz_stop(FAR struct timer_lowerhalf_s *lower);
|
||||
static int pic32mz_start(struct timer_lowerhalf_s *lower);
|
||||
static int pic32mz_stop(struct timer_lowerhalf_s *lower);
|
||||
static int pic32mz_getstatus(struct timer_lowerhalf_s *lower,
|
||||
struct timer_status_s *status);
|
||||
static int pic32mz_settimeout(FAR struct timer_lowerhalf_s *lower,
|
||||
static int pic32mz_settimeout(struct timer_lowerhalf_s *lower,
|
||||
uint32_t timeout);
|
||||
static void pic32mz_setcallback(FAR struct timer_lowerhalf_s *lower,
|
||||
tccb_t callback, FAR void *arg);
|
||||
static void pic32mz_setcallback(struct timer_lowerhalf_s *lower,
|
||||
tccb_t callback, void *arg);
|
||||
static int pic32mz_ioctl(struct timer_lowerhalf_s *lower, int cmd,
|
||||
unsigned long arg);
|
||||
static int pic32mz_maxtimeout(FAR struct timer_lowerhalf_s *lower,
|
||||
FAR uint32_t *maxtimeout);
|
||||
static int pic32mz_maxtimeout(struct timer_lowerhalf_s *lower,
|
||||
uint32_t *maxtimeout);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
|
@ -192,7 +192,7 @@ static struct pic32mz_lowerhalf_s g_t9_lowerhalf =
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static uint32_t pic32mz_usec2ticks(FAR struct pic32mz_lowerhalf_s *priv,
|
||||
static uint32_t pic32mz_usec2ticks(struct pic32mz_lowerhalf_s *priv,
|
||||
uint32_t usecs)
|
||||
{
|
||||
uint64_t bigticks;
|
||||
|
@ -222,7 +222,7 @@ static uint32_t pic32mz_usec2ticks(FAR struct pic32mz_lowerhalf_s *priv,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static uint32_t pic32mz_ticks2usec(FAR struct pic32mz_lowerhalf_s *priv,
|
||||
static uint32_t pic32mz_ticks2usec(struct pic32mz_lowerhalf_s *priv,
|
||||
uint32_t ticks)
|
||||
{
|
||||
uint64_t bigusec;
|
||||
|
@ -248,10 +248,10 @@ static uint32_t pic32mz_ticks2usec(FAR struct pic32mz_lowerhalf_s *priv,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int pic32mz_timer_handler(int irq, FAR void *context, FAR void *arg)
|
||||
static int pic32mz_timer_handler(int irq, void *context, void *arg)
|
||||
{
|
||||
FAR struct pic32mz_lowerhalf_s *lower =
|
||||
(FAR struct pic32mz_lowerhalf_s *)arg;
|
||||
struct pic32mz_lowerhalf_s *lower =
|
||||
(struct pic32mz_lowerhalf_s *)arg;
|
||||
uint32_t next_interval_us = 0;
|
||||
|
||||
PIC32MZ_TIMER_ACKINT(lower->timer);
|
||||
|
@ -294,10 +294,10 @@ static int pic32mz_timer_handler(int irq, FAR void *context, FAR void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int pic32mz_start(FAR struct timer_lowerhalf_s *lower)
|
||||
static int pic32mz_start(struct timer_lowerhalf_s *lower)
|
||||
{
|
||||
FAR struct pic32mz_lowerhalf_s *priv =
|
||||
(FAR struct pic32mz_lowerhalf_s *)lower;
|
||||
struct pic32mz_lowerhalf_s *priv =
|
||||
(struct pic32mz_lowerhalf_s *)lower;
|
||||
|
||||
if (!priv->started)
|
||||
{
|
||||
|
@ -333,10 +333,10 @@ static int pic32mz_start(FAR struct timer_lowerhalf_s *lower)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int pic32mz_stop(FAR struct timer_lowerhalf_s *lower)
|
||||
static int pic32mz_stop(struct timer_lowerhalf_s *lower)
|
||||
{
|
||||
FAR struct pic32mz_lowerhalf_s *priv =
|
||||
(FAR struct pic32mz_lowerhalf_s *)lower;
|
||||
struct pic32mz_lowerhalf_s *priv =
|
||||
(struct pic32mz_lowerhalf_s *)lower;
|
||||
|
||||
if (priv->started)
|
||||
{
|
||||
|
@ -368,11 +368,11 @@ static int pic32mz_stop(FAR struct timer_lowerhalf_s *lower)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int pic32mz_getstatus(FAR struct timer_lowerhalf_s *lower,
|
||||
FAR struct timer_status_s *status)
|
||||
static int pic32mz_getstatus(struct timer_lowerhalf_s *lower,
|
||||
struct timer_status_s *status)
|
||||
{
|
||||
FAR struct pic32mz_lowerhalf_s *priv =
|
||||
(FAR struct pic32mz_lowerhalf_s *)lower;
|
||||
struct pic32mz_lowerhalf_s *priv =
|
||||
(struct pic32mz_lowerhalf_s *)lower;
|
||||
uint32_t remainingticks;
|
||||
|
||||
DEBUGASSERT(priv);
|
||||
|
@ -421,11 +421,11 @@ static int pic32mz_getstatus(FAR struct timer_lowerhalf_s *lower,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int pic32mz_settimeout(FAR struct timer_lowerhalf_s *lower,
|
||||
static int pic32mz_settimeout(struct timer_lowerhalf_s *lower,
|
||||
uint32_t timeout)
|
||||
{
|
||||
FAR struct pic32mz_lowerhalf_s *priv =
|
||||
(FAR struct pic32mz_lowerhalf_s *)lower;
|
||||
struct pic32mz_lowerhalf_s *priv =
|
||||
(struct pic32mz_lowerhalf_s *)lower;
|
||||
|
||||
DEBUGASSERT(priv);
|
||||
|
||||
|
@ -492,11 +492,11 @@ static int pic32mz_settimeout(FAR struct timer_lowerhalf_s *lower,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void pic32mz_setcallback(FAR struct timer_lowerhalf_s *lower,
|
||||
tccb_t callback, FAR void *arg)
|
||||
static void pic32mz_setcallback(struct timer_lowerhalf_s *lower,
|
||||
tccb_t callback, void *arg)
|
||||
{
|
||||
FAR struct pic32mz_lowerhalf_s *priv =
|
||||
(FAR struct pic32mz_lowerhalf_s *)lower;
|
||||
struct pic32mz_lowerhalf_s *priv =
|
||||
(struct pic32mz_lowerhalf_s *)lower;
|
||||
|
||||
irqstate_t flags = enter_critical_section();
|
||||
|
||||
|
@ -530,7 +530,7 @@ static void pic32mz_setcallback(FAR struct timer_lowerhalf_s *lower,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int pic32mz_ioctl(FAR struct timer_lowerhalf_s *lower, int cmd,
|
||||
static int pic32mz_ioctl(struct timer_lowerhalf_s *lower, int cmd,
|
||||
unsigned long arg)
|
||||
{
|
||||
int ret = -ENOTTY;
|
||||
|
@ -557,11 +557,11 @@ static int pic32mz_ioctl(FAR struct timer_lowerhalf_s *lower, int cmd,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int pic32mz_maxtimeout(FAR struct timer_lowerhalf_s *lower,
|
||||
FAR uint32_t *maxtimeout)
|
||||
static int pic32mz_maxtimeout(struct timer_lowerhalf_s *lower,
|
||||
uint32_t *maxtimeout)
|
||||
{
|
||||
FAR struct pic32mz_lowerhalf_s *priv =
|
||||
(FAR struct pic32mz_lowerhalf_s *)lower;
|
||||
struct pic32mz_lowerhalf_s *priv =
|
||||
(struct pic32mz_lowerhalf_s *)lower;
|
||||
|
||||
DEBUGASSERT(priv);
|
||||
|
||||
|
@ -594,10 +594,10 @@ static int pic32mz_maxtimeout(FAR struct timer_lowerhalf_s *lower,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int pic32mz_timer_initialize(FAR const char *devpath, int timer)
|
||||
int pic32mz_timer_initialize(const char *devpath, int timer)
|
||||
{
|
||||
FAR struct pic32mz_lowerhalf_s *lower;
|
||||
FAR void *drvr;
|
||||
struct pic32mz_lowerhalf_s *lower;
|
||||
void *drvr;
|
||||
|
||||
tmrinfo("Initializing %s - timer %d\n", devpath, timer);
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ extern "C"
|
|||
|
||||
#ifdef CONFIG_PIC32MZ_USBDEV
|
||||
struct usbdev_s;
|
||||
int pic32mz_usbpullup(FAR struct usbdev_s *dev, bool enable);
|
||||
int pic32mz_usbpullup(struct usbdev_s *dev, bool enable);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
|
@ -86,7 +86,7 @@ int pic32mz_usbpullup(FAR struct usbdev_s *dev, bool enable);
|
|||
************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_USBDEV
|
||||
void pic32mz_usbsuspend(FAR struct usbdev_s *dev, bool resume);
|
||||
void pic32mz_usbsuspend(struct usbdev_s *dev, bool resume);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
|
|
|
@ -583,7 +583,7 @@ Analog Input
|
|||
#include <nuttx/spi/spi.h>
|
||||
#include <nuttx/analog/pga11x.h>
|
||||
|
||||
FAR struct spi_dev_s *spi;
|
||||
struct spi_dev_s *spi;
|
||||
PGA11X_HANDLE handle;
|
||||
|
||||
/* Get the SPI port */
|
||||
|
|
|
@ -101,8 +101,8 @@
|
|||
int board_app_initialize(uintptr_t arg)
|
||||
{
|
||||
#ifdef HAVE_SST25
|
||||
FAR struct spi_dev_s *spi;
|
||||
FAR struct mtd_dev_s *mtd;
|
||||
struct spi_dev_s *spi;
|
||||
struct mtd_dev_s *mtd;
|
||||
int ret;
|
||||
|
||||
/* Get the SPI port */
|
||||
|
|
|
@ -139,7 +139,7 @@ static const uint16_t g_ledpincfg[PIC32MX_MIRTOO_NLEDS] =
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_ARCH_LEDS
|
||||
static void pic32mx_setleds(FAR const struct led_setting_s *setting)
|
||||
static void pic32mx_setleds(const struct led_setting_s *setting)
|
||||
{
|
||||
/* LEDs are pulled up so writing a low value (false) illuminates them */
|
||||
|
||||
|
|
|
@ -146,7 +146,7 @@ void weak_function pic32mx_spi2initialize(void)
|
|||
|
||||
struct spi_dev_s;
|
||||
|
||||
void pic32mx_spi2select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mx_spi2select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n", (int)devid,
|
||||
|
@ -162,13 +162,13 @@ void pic32mx_spi2select(FAR struct spi_dev_s *dev, uint32_t devid,
|
|||
}
|
||||
}
|
||||
|
||||
uint8_t pic32mx_spi2status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
uint8_t pic32mx_spi2status(struct spi_dev_s *dev, uint32_t devid)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mx_spi2cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
int pic32mx_spi2cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -206,7 +206,7 @@ static int nsh_waiter(int argc, char *argv[])
|
|||
#ifdef NSH_HAVEMMCSD
|
||||
static int nsh_sdinitialize(void)
|
||||
{
|
||||
FAR struct spi_dev_s *spi;
|
||||
struct spi_dev_s *spi;
|
||||
int ret;
|
||||
|
||||
/* Get the SPI port */
|
||||
|
@ -302,7 +302,7 @@ static int nsh_usbhostinitialize(void)
|
|||
|
||||
ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
|
||||
CONFIG_USBHOST_STACKSIZE,
|
||||
(main_t)nsh_waiter, (FAR char * const *)NULL);
|
||||
(main_t)nsh_waiter, (char * const *)NULL);
|
||||
return ret < 0 ? -ENOEXEC : OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -144,7 +144,7 @@ static const uint16_t g_ledpincfg[PIC32MX_STARTERKIT_NLEDS] =
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_ARCH_LEDS
|
||||
static void pic32mx_setleds(FAR const struct led_setting_s *setting)
|
||||
static void pic32mx_setleds(const struct led_setting_s *setting)
|
||||
{
|
||||
if (setting->led1 != LED_NC)
|
||||
{
|
||||
|
|
|
@ -93,7 +93,7 @@ void weak_function pic32mx_spidev_initialize(void)
|
|||
struct spi_dev_s;
|
||||
|
||||
#ifdef CONFIG_PIC32MX_SPI1
|
||||
void pic32mx_spi1select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mx_spi1select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n",
|
||||
|
@ -101,7 +101,7 @@ void pic32mx_spi1select(FAR struct spi_dev_s *dev, uint32_t devid,
|
|||
#warning "Missing logic"
|
||||
}
|
||||
|
||||
uint8_t pic32mx_spi1status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
uint8_t pic32mx_spi1status(struct spi_dev_s *dev, uint32_t devid)
|
||||
{
|
||||
spiinfo("Returning nothing\n");
|
||||
#warning "Missing logic"
|
||||
|
@ -109,7 +109,7 @@ uint8_t pic32mx_spi1status(FAR struct spi_dev_s *dev, uint32_t devid)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mx_spi1cmddata(FAR struct spi_dev_s *dev,
|
||||
int pic32mx_spi1cmddata(struct spi_dev_s *dev,
|
||||
uint32_t devid, bool cmd)
|
||||
{
|
||||
#warning "Missing logic"
|
||||
|
@ -119,7 +119,7 @@ int pic32mx_spi1cmddata(FAR struct spi_dev_s *dev,
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_PIC32MX_SPI1
|
||||
void pic32mx_spi1select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mx_spi1select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n", (int)devid,
|
||||
|
@ -127,7 +127,7 @@ void pic32mx_spi1select(FAR struct spi_dev_s *dev, uint32_t devid,
|
|||
#warning "Missing logic"
|
||||
}
|
||||
|
||||
uint8_t pic32mx_spi1status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
uint8_t pic32mx_spi1status(struct spi_dev_s *dev, uint32_t devid)
|
||||
{
|
||||
spiinfo("Returning nothing\n");
|
||||
#warning "Missing logic"
|
||||
|
@ -135,7 +135,7 @@ uint8_t pic32mx_spi1status(FAR struct spi_dev_s *dev, uint32_t devid)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mx_spi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
int pic32mx_spi1cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
{
|
||||
#warning "Missing logic"
|
||||
return 0;
|
||||
|
@ -144,7 +144,7 @@ int pic32mx_spi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_PIC32MX_SPI3
|
||||
void pic32mx_spi3select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mx_spi3select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n", (int)devid,
|
||||
|
@ -152,7 +152,7 @@ void pic32mx_spi3select(FAR struct spi_dev_s *dev, uint32_t devid,
|
|||
#warning "Missing logic"
|
||||
}
|
||||
|
||||
uint8_t pic32mx_spi3status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
uint8_t pic32mx_spi3status(struct spi_dev_s *dev, uint32_t devid)
|
||||
{
|
||||
spiinfo("Returning nothing\n");
|
||||
#warning "Missing logic"
|
||||
|
@ -160,7 +160,7 @@ uint8_t pic32mx_spi3status(FAR struct spi_dev_s *dev, uint32_t devid)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mx_spi3cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
int pic32mx_spi3cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
{
|
||||
#warning "Missing logic"
|
||||
return 0;
|
||||
|
@ -169,7 +169,7 @@ int pic32mx_spi3cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_PIC32MX_SPI4
|
||||
void pic32mx_spi4select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mx_spi4select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n", (int)devid,
|
||||
|
@ -177,7 +177,7 @@ void pic32mx_spi4select(FAR struct spi_dev_s *dev, uint32_t devid,
|
|||
#warning "Missing logic"
|
||||
}
|
||||
|
||||
uint8_t pic32mx_spi4status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
uint8_t pic32mx_spi4status(struct spi_dev_s *dev, uint32_t devid)
|
||||
{
|
||||
spiinfo("Returning nothing\n");
|
||||
#warning "Missing logic"
|
||||
|
@ -185,7 +185,7 @@ uint8_t pic32mx_spi4status(FAR struct spi_dev_s *dev, uint32_t devid)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mx_spi4cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
int pic32mx_spi4cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
{
|
||||
#warning "Missing logic"
|
||||
return 0;
|
||||
|
|
|
@ -130,7 +130,7 @@ void weak_function pic32mx_usbdevinitialize(void)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int pic32mx_usbpullup(FAR struct usbdev_s *dev, bool enable)
|
||||
int pic32mx_usbpullup(struct usbdev_s *dev, bool enable)
|
||||
{
|
||||
/* The PIC32 Ethernet Starter Kit does not have a USB pull-up */
|
||||
|
||||
|
@ -148,7 +148,7 @@ int pic32mx_usbpullup(FAR struct usbdev_s *dev, bool enable)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void pic32mx_usbsuspend(FAR struct usbdev_s *dev, bool resume)
|
||||
void pic32mx_usbsuspend(struct usbdev_s *dev, bool resume)
|
||||
{
|
||||
/* Do nothing */
|
||||
}
|
||||
|
|
|
@ -208,7 +208,7 @@ static int nsh_waiter(int argc, char *argv[])
|
|||
#ifdef NSH_HAVEMMCSD
|
||||
static int nsh_sdinitialize(void)
|
||||
{
|
||||
FAR struct spi_dev_s *spi;
|
||||
struct spi_dev_s *spi;
|
||||
int ret;
|
||||
|
||||
/* Get the SPI port */
|
||||
|
@ -315,7 +315,7 @@ static int nsh_usbhostinitialize(void)
|
|||
|
||||
ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
|
||||
CONFIG_USBHOST_STACKSIZE,
|
||||
(main_t)nsh_waiter, (FAR char * const *)NULL);
|
||||
(main_t)nsh_waiter, (char * const *)NULL);
|
||||
return ret < 0 ? -ENOEXEC : OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -149,7 +149,7 @@ static const uint16_t g_ledpincfg[PIC32MX_PIC32MX7MMB_NLEDS] =
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_ARCH_LEDS
|
||||
static void pic32mx_setleds(FAR const struct led_setting_s *setting)
|
||||
static void pic32mx_setleds(const struct led_setting_s *setting)
|
||||
{
|
||||
/* LEDs are pulled up so writing a low value (false) illuminates them */
|
||||
|
||||
|
|
|
@ -125,7 +125,7 @@ struct pic32mx7mmb_dev_s
|
|||
bool data; /* true=data selected */
|
||||
bool selected; /* true=LCD selected */
|
||||
bool reading; /* true=We are in a read sequence */
|
||||
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 */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -134,14 +134,14 @@ struct pic32mx7mmb_dev_s
|
|||
|
||||
/* Low Level LCD access */
|
||||
|
||||
static void pic32mx_select(FAR struct mio283qt2_lcd_s *dev);
|
||||
static void pic32mx_deselect(FAR struct mio283qt2_lcd_s *dev);
|
||||
static void pic32mx_index(FAR struct mio283qt2_lcd_s *dev, uint8_t index);
|
||||
static void pic32mx_select(struct mio283qt2_lcd_s *dev);
|
||||
static void pic32mx_deselect(struct mio283qt2_lcd_s *dev);
|
||||
static void pic32mx_index(struct mio283qt2_lcd_s *dev, uint8_t index);
|
||||
#ifndef CONFIG_MIO283QT2_WRONLY
|
||||
static uint16_t pic32mx_read(FAR struct mio283qt2_lcd_s *dev);
|
||||
static uint16_t pic32mx_read(struct mio283qt2_lcd_s *dev);
|
||||
#endif
|
||||
static void pic32mx_write(FAR struct mio283qt2_lcd_s *dev, uint16_t data);
|
||||
static void pic32mx_backlight(FAR struct mio283qt2_lcd_s *dev, int power);
|
||||
static void pic32mx_write(struct mio283qt2_lcd_s *dev, uint16_t data);
|
||||
static void pic32mx_backlight(struct mio283qt2_lcd_s *dev, int power);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
|
@ -177,7 +177,7 @@ static struct pic32mx7mmb_dev_s g_pic32mx7mmb_lcd =
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void pic32mx_command(FAR struct pic32mx7mmb_dev_s *priv)
|
||||
static void pic32mx_command(struct pic32mx7mmb_dev_s *priv)
|
||||
{
|
||||
/* Low selects command */
|
||||
|
||||
|
@ -198,7 +198,7 @@ static void pic32mx_command(FAR struct pic32mx7mmb_dev_s *priv)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void pic32mx_data(FAR struct pic32mx7mmb_dev_s *priv)
|
||||
static void pic32mx_data(struct pic32mx7mmb_dev_s *priv)
|
||||
{
|
||||
/* Hi selects data */
|
||||
|
||||
|
@ -232,9 +232,9 @@ static void pic32mx_busywait(void)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void pic32mx_select(FAR struct mio283qt2_lcd_s *dev)
|
||||
static void pic32mx_select(struct mio283qt2_lcd_s *dev)
|
||||
{
|
||||
FAR struct pic32mx7mmb_dev_s *priv = (FAR struct pic32mx7mmb_dev_s *)dev;
|
||||
struct pic32mx7mmb_dev_s *priv = (struct pic32mx7mmb_dev_s *)dev;
|
||||
|
||||
/* CS low selects */
|
||||
|
||||
|
@ -255,9 +255,9 @@ static void pic32mx_select(FAR struct mio283qt2_lcd_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void pic32mx_deselect(FAR struct mio283qt2_lcd_s *dev)
|
||||
static void pic32mx_deselect(struct mio283qt2_lcd_s *dev)
|
||||
{
|
||||
FAR struct pic32mx7mmb_dev_s *priv = (FAR struct pic32mx7mmb_dev_s *)dev;
|
||||
struct pic32mx7mmb_dev_s *priv = (struct pic32mx7mmb_dev_s *)dev;
|
||||
|
||||
/* CS high de-selects */
|
||||
|
||||
|
@ -278,9 +278,9 @@ static void pic32mx_deselect(FAR struct mio283qt2_lcd_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void pic32mx_index(FAR struct mio283qt2_lcd_s *dev, uint8_t index)
|
||||
static void pic32mx_index(struct mio283qt2_lcd_s *dev, uint8_t index)
|
||||
{
|
||||
FAR struct pic32mx7mmb_dev_s *priv = (FAR struct pic32mx7mmb_dev_s *)dev;
|
||||
struct pic32mx7mmb_dev_s *priv = (struct pic32mx7mmb_dev_s *)dev;
|
||||
|
||||
/* Make sure that the PMP is not busy from the last transaction.
|
||||
* Read data is not available until the busy bit becomes zero.
|
||||
|
@ -303,9 +303,9 @@ static void pic32mx_index(FAR struct mio283qt2_lcd_s *dev, uint8_t index)
|
|||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_MIO283QT2_WRONLY
|
||||
static uint16_t pic32mx_read(FAR struct mio283qt2_lcd_s *dev)
|
||||
static uint16_t pic32mx_read(struct mio283qt2_lcd_s *dev)
|
||||
{
|
||||
FAR struct pic32mx7mmb_dev_s *priv = (FAR struct pic32mx7mmb_dev_s *)dev;
|
||||
struct pic32mx7mmb_dev_s *priv = (struct pic32mx7mmb_dev_s *)dev;
|
||||
uint16_t data;
|
||||
|
||||
/* Make sure that the PMP is not busy from the last transaction.
|
||||
|
@ -340,9 +340,9 @@ static uint16_t pic32mx_read(FAR struct mio283qt2_lcd_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void pic32mx_write(FAR struct mio283qt2_lcd_s *dev, uint16_t data)
|
||||
static void pic32mx_write(struct mio283qt2_lcd_s *dev, uint16_t data)
|
||||
{
|
||||
FAR struct pic32mx7mmb_dev_s *priv = (FAR struct pic32mx7mmb_dev_s *)dev;
|
||||
struct pic32mx7mmb_dev_s *priv = (struct pic32mx7mmb_dev_s *)dev;
|
||||
|
||||
/* Make sure that the PMP is not busy from the last transaction */
|
||||
|
||||
|
@ -366,7 +366,7 @@ static void pic32mx_write(FAR struct mio283qt2_lcd_s *dev, uint16_t data)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void pic32mx_backlight(FAR struct mio283qt2_lcd_s *dev, int power)
|
||||
static void pic32mx_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.
|
||||
|
@ -469,7 +469,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_pic32mx7mmb_lcd.drvr;
|
||||
|
|
|
@ -119,7 +119,7 @@ void weak_function pic32mx_spidev_initialize(void)
|
|||
struct spi_dev_s;
|
||||
|
||||
#ifdef CONFIG_PIC32MX_SPI1
|
||||
void pic32mx_spi1select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mx_spi1select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n", (int)devid,
|
||||
|
@ -131,7 +131,7 @@ void pic32mx_spi1select(FAR struct spi_dev_s *dev, uint32_t devid,
|
|||
}
|
||||
}
|
||||
|
||||
uint8_t pic32mx_spi1status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
uint8_t pic32mx_spi1status(struct spi_dev_s *dev, uint32_t devid)
|
||||
{
|
||||
uint8_t ret = 0;
|
||||
|
||||
|
@ -157,7 +157,7 @@ uint8_t pic32mx_spi1status(FAR struct spi_dev_s *dev, uint32_t devid)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mx_spi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
int pic32mx_spi1cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
{
|
||||
#warning "Missing logic"
|
||||
return 0;
|
||||
|
@ -166,7 +166,7 @@ int pic32mx_spi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_PIC32MX_SPI2
|
||||
void pic31mx_spi2select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic31mx_spi2select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n", (int)devid,
|
||||
|
@ -174,7 +174,7 @@ void pic31mx_spi2select(FAR struct spi_dev_s *dev, uint32_t devid,
|
|||
#warning "Missing logic"
|
||||
}
|
||||
|
||||
uint8_t pic31mx_spi2status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
uint8_t pic31mx_spi2status(struct spi_dev_s *dev, uint32_t devid)
|
||||
{
|
||||
spiinfo("Returning nothing\n");
|
||||
#warning "Missing logic"
|
||||
|
@ -182,7 +182,7 @@ uint8_t pic31mx_spi2status(FAR struct spi_dev_s *dev, uint32_t devid)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic31mx_spi2cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
int pic31mx_spi2cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
{
|
||||
#warning "Missing logic"
|
||||
return 0;
|
||||
|
@ -191,7 +191,7 @@ int pic31mx_spi2cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_PIC32MX_SPI3
|
||||
void pic32mx_spi3select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mx_spi3select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n", (int)devid,
|
||||
|
@ -199,7 +199,7 @@ void pic32mx_spi3select(FAR struct spi_dev_s *dev, uint32_t devid,
|
|||
#warning "Missing logic"
|
||||
}
|
||||
|
||||
uint8_t pic32mx_spi3status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
uint8_t pic32mx_spi3status(struct spi_dev_s *dev, uint32_t devid)
|
||||
{
|
||||
spiinfo("Returning nothing\n");
|
||||
#warning "Missing logic"
|
||||
|
@ -207,7 +207,7 @@ uint8_t pic32mx_spi3status(FAR struct spi_dev_s *dev, uint32_t devid)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mx_spi3cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
int pic32mx_spi3cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
{
|
||||
#warning "Missing logic"
|
||||
return 0;
|
||||
|
@ -216,7 +216,7 @@ int pic32mx_spi3cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_PIC32MX_SPI4
|
||||
void pic32mx_spi4select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mx_spi4select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n", (int)devid,
|
||||
|
@ -224,7 +224,7 @@ void pic32mx_spi4select(FAR struct spi_dev_s *dev, uint32_t devid,
|
|||
#warning "Missing logic"
|
||||
}
|
||||
|
||||
uint8_t pic32mx_spi4status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
uint8_t pic32mx_spi4status(struct spi_dev_s *dev, uint32_t devid)
|
||||
{
|
||||
spiinfo("Returning nothing\n");
|
||||
#warning "Missing logic"
|
||||
|
@ -232,7 +232,7 @@ uint8_t pic32mx_spi4status(FAR struct spi_dev_s *dev, uint32_t devid)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mx_spi4cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
int pic32mx_spi4cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
{
|
||||
#warning "Missing logic"
|
||||
return 0;
|
||||
|
|
|
@ -218,20 +218,20 @@ static void tc_xplus_sample(void);
|
|||
static void tc_xminus_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
|
||||
|
@ -473,7 +473,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;
|
||||
|
||||
|
@ -516,8 +516,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;
|
||||
|
||||
|
@ -561,8 +561,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;
|
||||
|
||||
|
@ -619,9 +619,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;
|
||||
uint16_t value;
|
||||
uint16_t newx;
|
||||
|
@ -974,11 +974,11 @@ 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;
|
||||
struct inode *inode;
|
||||
struct tc_dev_s *priv;
|
||||
uint8_t tmp;
|
||||
int ret;
|
||||
|
||||
|
@ -986,7 +986,7 @@ static int tc_open(FAR struct file *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 */
|
||||
|
||||
|
@ -1027,18 +1027,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;
|
||||
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 */
|
||||
|
||||
|
@ -1067,11 +1067,11 @@ 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;
|
||||
|
||||
|
@ -1079,7 +1079,7 @@ static ssize_t tc_read(FAR struct file *filep, FAR char *buffer, size_t len)
|
|||
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.
|
||||
|
@ -1133,7 +1133,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;
|
||||
|
@ -1188,14 +1188,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);
|
||||
|
@ -1203,7 +1203,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 */
|
||||
|
||||
|
@ -1233,11 +1233,11 @@ 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;
|
||||
struct inode *inode;
|
||||
struct tc_dev_s *priv;
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
|
@ -1246,7 +1246,7 @@ static int tc_poll(FAR struct file *filep, FAR struct pollfd *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? */
|
||||
|
||||
|
@ -1342,7 +1342,7 @@ errout:
|
|||
|
||||
int pic32mx_tsc_setup(int minor)
|
||||
{
|
||||
FAR struct tc_dev_s *priv;
|
||||
struct tc_dev_s *priv;
|
||||
char devname[DEV_NAMELEN];
|
||||
int ret;
|
||||
|
||||
|
@ -1365,7 +1365,7 @@ int pic32mx_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));
|
||||
|
|
|
@ -130,7 +130,7 @@ void weak_function pic32mx_usbdevinitialize(void)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int pic32mx_usbpullup(FAR struct usbdev_s *dev, bool enable)
|
||||
int pic32mx_usbpullup(struct usbdev_s *dev, bool enable)
|
||||
{
|
||||
/* The Mikroelektronika PIC32MX7 MMB does not have a USB pull-up */
|
||||
|
||||
|
@ -149,7 +149,7 @@ int pic32mx_usbpullup(FAR struct usbdev_s *dev, bool enable)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void pic32mx_usbsuspend(FAR struct usbdev_s *dev, bool resume)
|
||||
void pic32mx_usbsuspend(struct usbdev_s *dev, bool resume)
|
||||
{
|
||||
/* Do nothing */
|
||||
}
|
||||
|
|
|
@ -209,7 +209,7 @@ static int nsh_waiter(int argc, char *argv[])
|
|||
#ifdef NSH_HAVE_MMCSD
|
||||
static int nsh_sdinitialize(void)
|
||||
{
|
||||
FAR struct spi_dev_s *spi;
|
||||
struct spi_dev_s *spi;
|
||||
int ret;
|
||||
|
||||
/* Get the SPI port */
|
||||
|
@ -315,7 +315,7 @@ static int nsh_usbhostinitialize(void)
|
|||
|
||||
ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
|
||||
CONFIG_USBHOST_STACKSIZE,
|
||||
(main_t)nsh_waiter, (FAR char * const *)NULL);
|
||||
(main_t)nsh_waiter, (char * const *)NULL);
|
||||
return ret < 0 ? -ENOEXEC : OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@ static const struct led_setting_s g_ledoffvalues[LED_NVALUES] =
|
|||
* Name: pic32mx_setleds
|
||||
****************************************************************************/
|
||||
|
||||
static void pic32mx_setleds(FAR const struct led_setting_s *setting)
|
||||
static void pic32mx_setleds(const struct led_setting_s *setting)
|
||||
{
|
||||
if (setting->usb != LED_NC)
|
||||
{
|
||||
|
|
|
@ -193,7 +193,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;
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@
|
|||
struct lcd_instream_s
|
||||
{
|
||||
struct lib_instream_s stream;
|
||||
FAR const char *buffer;
|
||||
const char *buffer;
|
||||
ssize_t nbytes;
|
||||
};
|
||||
|
||||
|
@ -145,9 +145,9 @@ struct lcd1602_2
|
|||
/* Debug */
|
||||
|
||||
#ifdef CONFIG_DEBUG_LCD_INFO
|
||||
static void lcd_dumpstate(FAR const char *msg);
|
||||
static void lcd_dumpstream(FAR const char *msg,
|
||||
FAR const struct lcd_instream_s *stream);
|
||||
static void lcd_dumpstate(const char *msg);
|
||||
static void lcd_dumpstream(const char *msg,
|
||||
const struct lcd_instream_s *stream);
|
||||
#else
|
||||
# define lcd_dumpstate(msg)
|
||||
# define lcd_dumpstream(msg, stream)
|
||||
|
@ -155,7 +155,7 @@ static void lcd_dumpstream(FAR const char *msg,
|
|||
|
||||
/* Internal functions */
|
||||
|
||||
static int lcd_getstream(FAR struct lib_instream_s *instream);
|
||||
static int lcd_getstream(struct lib_instream_s *instream);
|
||||
static void lcd_brightness(uint8_t brightness);
|
||||
static void lcd_shortdelay(int delay);
|
||||
static void lcd_wrcommand(uint8_t cmd);
|
||||
|
@ -170,10 +170,10 @@ static void lcd_action(enum slcdcode_e code, uint8_t count);
|
|||
|
||||
/* Character driver operations */
|
||||
|
||||
static ssize_t lcd_read(FAR struct file *, FAR char *, size_t);
|
||||
static ssize_t lcd_write(FAR struct file *, FAR const char *, size_t);
|
||||
static int lcd_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
|
||||
static int lcd_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||
static ssize_t lcd_read(struct file *, char *, size_t);
|
||||
static ssize_t lcd_write(struct file *, const char *, size_t);
|
||||
static int lcd_ioctl(struct file *filep, int cmd, unsigned long arg);
|
||||
static int lcd_poll(struct file *filep, struct pollfd *fds,
|
||||
bool setup);
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -209,7 +209,7 @@ static struct lcd1602_2 g_lcd1602;
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_DEBUG_LCD_INFO
|
||||
static void lcd_dumpstate(FAR const char *msg)
|
||||
static void lcd_dumpstate(const char *msg)
|
||||
{
|
||||
uint8_t buffer[LCD_NCOLUMNS];
|
||||
uint8_t ch;
|
||||
|
@ -244,8 +244,8 @@ static void lcd_dumpstate(FAR const char *msg)
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_DEBUG_LCD_INFO
|
||||
static void lcd_dumpstream(FAR const char *msg,
|
||||
FAR const struct lcd_instream_s *stream)
|
||||
static void lcd_dumpstream(const char *msg,
|
||||
const struct lcd_instream_s *stream)
|
||||
{
|
||||
lcdinfo("%s:\n", msg);
|
||||
lcdinfo(" nget: %d nbytes: %d\n",
|
||||
|
@ -262,10 +262,10 @@ static void lcd_dumpstream(FAR const char *msg,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int lcd_getstream(FAR struct lib_instream_s *instream)
|
||||
static int lcd_getstream(struct lib_instream_s *instream)
|
||||
{
|
||||
FAR struct lcd_instream_s *lcdstream =
|
||||
(FAR struct lcd_instream_s *)instream;
|
||||
struct lcd_instream_s *lcdstream =
|
||||
(struct lcd_instream_s *)instream;
|
||||
|
||||
DEBUGASSERT(lcdstream && lcdstream->buffer);
|
||||
if (lcdstream->nbytes > 0)
|
||||
|
@ -792,7 +792,7 @@ static void lcd_action(enum slcdcode_e code, uint8_t count)
|
|||
* Name: lcd_read
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t lcd_read(FAR struct file *filep, FAR char *buffer, size_t len)
|
||||
static ssize_t lcd_read(struct file *filep, char *buffer, size_t len)
|
||||
{
|
||||
uint8_t row;
|
||||
uint8_t column;
|
||||
|
@ -826,7 +826,7 @@ static ssize_t lcd_read(FAR struct file *filep, FAR char *buffer, size_t len)
|
|||
* Name: lcd_write
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t lcd_write(FAR struct file *filep, FAR const char *buffer,
|
||||
static ssize_t lcd_write(struct file *filep, const char *buffer,
|
||||
size_t len)
|
||||
{
|
||||
struct lcd_instream_s instream;
|
||||
|
@ -912,7 +912,7 @@ static ssize_t lcd_write(FAR struct file *filep, FAR const char *buffer,
|
|||
* Name: lcd_ioctl
|
||||
****************************************************************************/
|
||||
|
||||
static int lcd_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
static int lcd_ioctl(struct file *filep, int cmd, unsigned long arg)
|
||||
{
|
||||
switch (cmd)
|
||||
{
|
||||
|
@ -924,8 +924,8 @@ static int lcd_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
|||
|
||||
case SLCDIOC_GETATTRIBUTES:
|
||||
{
|
||||
FAR struct slcd_attributes_s *attr =
|
||||
(FAR struct slcd_attributes_s *)((uintptr_t)arg);
|
||||
struct slcd_attributes_s *attr =
|
||||
(struct slcd_attributes_s *)((uintptr_t)arg);
|
||||
|
||||
lcdinfo("SLCDIOC_GETATTRIBUTES:\n");
|
||||
|
||||
|
@ -950,8 +950,8 @@ static int lcd_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
|||
|
||||
case SLCDIOC_CURPOS:
|
||||
{
|
||||
FAR struct slcd_curpos_s *curpos =
|
||||
(FAR struct slcd_curpos_s *)((uintptr_t)arg);
|
||||
struct slcd_curpos_s *curpos =
|
||||
(struct slcd_curpos_s *)((uintptr_t)arg);
|
||||
|
||||
lcdinfo("SLCDIOC_CURPOS: row=%d column=%d\n",
|
||||
g_lcd1602.currow, g_lcd1602.curcol);
|
||||
|
@ -974,7 +974,7 @@ static int lcd_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
|||
|
||||
case SLCDIOC_GETBRIGHTNESS:
|
||||
{
|
||||
FAR int *brightness = (FAR int *)((uintptr_t)arg);
|
||||
int *brightness = (int *)((uintptr_t)arg);
|
||||
if (!brightness)
|
||||
{
|
||||
return -EINVAL;
|
||||
|
@ -1017,7 +1017,7 @@ static int lcd_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
|||
* Name: lcd_poll
|
||||
****************************************************************************/
|
||||
|
||||
static int lcd_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||
static int lcd_poll(struct file *filep, struct pollfd *fds,
|
||||
bool setup)
|
||||
{
|
||||
if (setup)
|
||||
|
|
|
@ -163,7 +163,7 @@ void weak_function pic32mx_spidev_initialize(void)
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PIC32MX_SPI2
|
||||
void pic32mx_spi2select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mx_spi2select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n",
|
||||
|
@ -186,7 +186,7 @@ void pic32mx_spi2select(FAR struct spi_dev_s *dev, uint32_t devid,
|
|||
#endif
|
||||
}
|
||||
|
||||
uint8_t pic32mx_spi2status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
uint8_t pic32mx_spi2status(struct spi_dev_s *dev, uint32_t devid)
|
||||
{
|
||||
uint8_t ret = 0;
|
||||
|
||||
|
|
|
@ -140,7 +140,7 @@ void weak_function pic32mx_usbdevinitialize(void)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int pic32mx_usbpullup(FAR struct usbdev_s *dev, bool enable)
|
||||
int pic32mx_usbpullup(struct usbdev_s *dev, bool enable)
|
||||
{
|
||||
/* The Sure PIC32MX does not have a USB pull-up */
|
||||
|
||||
|
@ -158,7 +158,7 @@ int pic32mx_usbpullup(FAR struct usbdev_s *dev, bool enable)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void pic32mx_usbsuspend(FAR struct usbdev_s *dev, bool resume)
|
||||
void pic32mx_usbsuspend(struct usbdev_s *dev, bool resume)
|
||||
{
|
||||
/* Do nothing */
|
||||
}
|
||||
|
|
|
@ -168,7 +168,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;
|
||||
|
||||
|
|
|
@ -145,7 +145,7 @@ static const uint16_t g_ledpincfg[PIC32MX_UBW32_NLEDS] =
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_ARCH_LEDS
|
||||
static void pic32mx_setleds(FAR const struct led_setting_s *setting)
|
||||
static void pic32mx_setleds(const struct led_setting_s *setting)
|
||||
{
|
||||
if (setting->led1 != LED_NC)
|
||||
{
|
||||
|
|
|
@ -111,7 +111,7 @@ void weak_function pic32mx_usbdevinitialize(void)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int pic32mx_usbpullup(FAR struct usbdev_s *dev, bool enable)
|
||||
int pic32mx_usbpullup(struct usbdev_s *dev, bool enable)
|
||||
{
|
||||
/* The UBW32 does not have a USB pull-up */
|
||||
|
||||
|
@ -129,7 +129,7 @@ int pic32mx_usbpullup(FAR struct usbdev_s *dev, bool enable)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void pic32mx_usbsuspend(FAR struct usbdev_s *dev, bool resume)
|
||||
void pic32mx_usbsuspend(struct usbdev_s *dev, bool resume)
|
||||
{
|
||||
/* Do nothing */
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
#ifdef CONFIG_PIC32MZ_GPIOIRQ_PORTA
|
||||
int ret = OK;
|
||||
|
|
|
@ -89,21 +89,21 @@ void weak_function pic32mz_spidev_initialize(void)
|
|||
struct spi_dev_s;
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI1
|
||||
void pic32mz_spi1select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mz_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 pic32mz_spi1status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
uint8_t pic32mz_spi1status(struct spi_dev_s *dev, uint32_t devid)
|
||||
{
|
||||
spiinfo("Returning nothing\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mz_spi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
int pic32mz_spi1cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -111,21 +111,21 @@ int pic32mz_spi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
|||
#endif /* CONFIG_PIC32MZ_SPI1 */
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI2
|
||||
void pic32mz_spi2select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mz_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 pic32mz_spi2status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
uint8_t pic32mz_spi2status(struct spi_dev_s *dev, uint32_t devid)
|
||||
{
|
||||
spiinfo("Returning nothing\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mz_spi2cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
int pic32mz_spi2cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -133,21 +133,21 @@ int pic32mz_spi2cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
|||
#endif /* CONFIG_PIC32MZ_SPI2 */
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI3
|
||||
void pic32mz_spi3select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mz_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 pic32mz_spi3status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
uint8_t pic32mz_spi3status(struct spi_dev_s *dev, uint32_t devid)
|
||||
{
|
||||
spiinfo("Returning nothing\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mz_spi3cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
int pic32mz_spi3cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -155,21 +155,21 @@ int pic32mz_spi3cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
|||
#endif /* CONFIG_PIC32MZ_SPI3 */
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI4
|
||||
void pic32mz_spi4select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mz_spi4select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n", (int)devid,
|
||||
selected ? "assert" : "de-assert");
|
||||
}
|
||||
|
||||
uint8_t pic32mz_spi4status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
uint8_t pic32mz_spi4status(struct spi_dev_s *dev, uint32_t devid)
|
||||
{
|
||||
spiinfo("Returning nothing\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mz_spi4cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
int pic32mz_spi4cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -177,14 +177,14 @@ int pic32mz_spi4cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
|||
#endif /* CONFIG_PIC32MZ_SPI4 */
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI5
|
||||
void pic32mz_spi5select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mz_spi5select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n", (int)devid,
|
||||
selected ? "assert" : "de-assert");
|
||||
}
|
||||
|
||||
uint8_t pic32mz_spi5status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
uint8_t pic32mz_spi5status(struct spi_dev_s *dev, uint32_t devid)
|
||||
{
|
||||
spiinfo("Returning nothing\n");
|
||||
#warning "Missing logic"
|
||||
|
@ -192,7 +192,7 @@ uint8_t pic32mz_spi5status(FAR struct spi_dev_s *dev, uint32_t devid)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mz_spi5cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
int pic32mz_spi5cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
{
|
||||
#warning "Missing logic"
|
||||
return 0;
|
||||
|
@ -201,7 +201,7 @@ int pic32mz_spi5cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
|||
#endif /* CONFIG_PIC32MZ_SPI5 */
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI6
|
||||
void pic32mz_spi6select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mz_spi6select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n", (int)devid,
|
||||
|
@ -209,7 +209,7 @@ void pic32mz_spi6select(FAR struct spi_dev_s *dev, uint32_t devid,
|
|||
#warning "Missing logic"
|
||||
}
|
||||
|
||||
uint8_t pic32mz_spi6status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
uint8_t pic32mz_spi6status(struct spi_dev_s *dev, uint32_t devid)
|
||||
{
|
||||
spiinfo("Returning nothing\n");
|
||||
#warning "Missing logic"
|
||||
|
@ -217,7 +217,7 @@ uint8_t pic32mz_spi6status(FAR struct spi_dev_s *dev, uint32_t devid)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mz_spi6cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
int pic32mz_spi6cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
{
|
||||
#warning "Missing logic"
|
||||
return 0;
|
||||
|
@ -247,8 +247,8 @@ int pic32mz_spi6cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
|||
|
||||
#ifdef CONFIG_SPI_CALLBACK
|
||||
#ifdef CONFIG_PIC32MZ_SPI1
|
||||
int pic32mz_spi1register(FAR struct spi_dev_s *dev,
|
||||
spi_mediachange_t callback, FAR void *arg)
|
||||
int pic32mz_spi1register(struct spi_dev_s *dev,
|
||||
spi_mediachange_t callback, void *arg)
|
||||
{
|
||||
#warning Missing logic
|
||||
return -ENOSYS;
|
||||
|
@ -256,8 +256,8 @@ int pic32mz_spi1register(FAR struct spi_dev_s *dev,
|
|||
#endif /* CONFIG_PIC32MZ_SPI1 */
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI2
|
||||
int pic32mz_spi2register(FAR struct spi_dev_s *dev,
|
||||
spi_mediachange_t callback, FAR void *arg)
|
||||
int pic32mz_spi2register(struct spi_dev_s *dev,
|
||||
spi_mediachange_t callback, void *arg)
|
||||
{
|
||||
#warning Missing logic
|
||||
return -ENOSYS;
|
||||
|
@ -265,8 +265,8 @@ int pic32mz_spi2register(FAR struct spi_dev_s *dev,
|
|||
#endif /* CONFIG_PIC32MZ_SPI2 */
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI3
|
||||
int pic32mz_spi3register(FAR struct spi_dev_s *dev,
|
||||
spi_mediachange_t callback, FAR void *arg)
|
||||
int pic32mz_spi3register(struct spi_dev_s *dev,
|
||||
spi_mediachange_t callback, void *arg)
|
||||
{
|
||||
#warning Missing logic
|
||||
return -ENOSYS;
|
||||
|
@ -274,8 +274,8 @@ int pic32mz_spi3register(FAR struct spi_dev_s *dev,
|
|||
#endif /* CONFIG_PIC32MZ_SPI3 */
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI4
|
||||
int pic32mz_spi4register(FAR struct spi_dev_s *dev,
|
||||
spi_mediachange_t callback, FAR void *arg)
|
||||
int pic32mz_spi4register(struct spi_dev_s *dev,
|
||||
spi_mediachange_t callback, void *arg)
|
||||
{
|
||||
#warning Missing logic
|
||||
return -ENOSYS;
|
||||
|
@ -283,8 +283,8 @@ int pic32mz_spi4register(FAR struct spi_dev_s *dev,
|
|||
#endif /* CONFIG_PIC32MZ_SPI4 */
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI5
|
||||
int pic32mz_spi5register(FAR struct spi_dev_s *dev,
|
||||
spi_mediachange_t callback, FAR void *arg)
|
||||
int pic32mz_spi5register(struct spi_dev_s *dev,
|
||||
spi_mediachange_t callback, void *arg)
|
||||
{
|
||||
#warning Missing logic
|
||||
return -ENOSYS;
|
||||
|
@ -292,8 +292,8 @@ int pic32mz_spi5register(FAR struct spi_dev_s *dev,
|
|||
#endif /* CONFIG_PIC32MZ_SPI5 */
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI6
|
||||
int pic32mz_spi6register(FAR struct spi_dev_s *dev,
|
||||
spi_mediachange_t callback, FAR void *arg)
|
||||
int pic32mz_spi6register(struct spi_dev_s *dev,
|
||||
spi_mediachange_t callback, void *arg)
|
||||
{
|
||||
#warning Missing logic
|
||||
return -ENOSYS;
|
||||
|
|
|
@ -269,7 +269,7 @@ int pic32mz_bringup(void);
|
|||
|
||||
#ifdef HAVE_SSD1306
|
||||
struct lcd_dev_s; /* Forward reference */
|
||||
FAR struct lcd_dev_s *pic32mz_graphics_setup(unsigned int devno);
|
||||
struct lcd_dev_s *pic32mz_graphics_setup(unsigned int devno);
|
||||
#endif
|
||||
|
||||
#undef EXTERN
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
#ifdef CONFIG_PIC32MZ_GPIOIRQ_PORTD
|
||||
int ret = OK;
|
||||
|
|
|
@ -96,7 +96,7 @@ void weak_function pic32mz_spidev_initialize(void)
|
|||
struct spi_dev_s;
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI1
|
||||
void pic32mz_spi1select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mz_spi1select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n", (int)devid,
|
||||
|
@ -115,14 +115,14 @@ void pic32mz_spi1select(FAR struct spi_dev_s *dev, uint32_t devid,
|
|||
#endif
|
||||
}
|
||||
|
||||
uint8_t pic32mz_spi1status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
uint8_t pic32mz_spi1status(struct spi_dev_s *dev, uint32_t devid)
|
||||
{
|
||||
spiinfo("Returning nothing\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mz_spi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
int pic32mz_spi1cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
{
|
||||
#if defined(CONFIG_FLIPNCLICK_PIC32MZ_SSD1306_MBC) || \
|
||||
defined(CONFIG_FLIPNCLICK_PIC32MZ_SSD1306_MBD)
|
||||
|
@ -142,7 +142,7 @@ int pic32mz_spi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
|||
#endif /* CONFIG_PIC32MZ_SPI1 */
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI2
|
||||
void pic32mz_spi2select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mz_spi2select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n", (int)devid,
|
||||
|
@ -161,14 +161,14 @@ void pic32mz_spi2select(FAR struct spi_dev_s *dev, uint32_t devid,
|
|||
#endif
|
||||
}
|
||||
|
||||
uint8_t pic32mz_spi2status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
uint8_t pic32mz_spi2status(struct spi_dev_s *dev, uint32_t devid)
|
||||
{
|
||||
spiinfo("Returning nothing\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mz_spi2cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
int pic32mz_spi2cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
{
|
||||
#if defined(CONFIG_FLIPNCLICK_PIC32MZ_SSD1306_MBA) || \
|
||||
defined(CONFIG_FLIPNCLICK_PIC32MZ_SSD1306_MBB)
|
||||
|
@ -188,21 +188,21 @@ int pic32mz_spi2cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
|||
#endif /* CONFIG_PIC32MZ_SPI2 */
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI3
|
||||
void pic32mz_spi3select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mz_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 pic32mz_spi3status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
uint8_t pic32mz_spi3status(struct spi_dev_s *dev, uint32_t devid)
|
||||
{
|
||||
spiinfo("Returning nothing\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mz_spi3cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
int pic32mz_spi3cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -210,21 +210,21 @@ int pic32mz_spi3cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
|||
#endif /* CONFIG_PIC32MZ_SPI3 */
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI4
|
||||
void pic32mz_spi4select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mz_spi4select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n", (int)devid,
|
||||
selected ? "assert" : "de-assert");
|
||||
}
|
||||
|
||||
uint8_t pic32mz_spi4status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
uint8_t pic32mz_spi4status(struct spi_dev_s *dev, uint32_t devid)
|
||||
{
|
||||
spiinfo("Returning nothing\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mz_spi4cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
int pic32mz_spi4cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -232,14 +232,14 @@ int pic32mz_spi4cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
|||
#endif /* CONFIG_PIC32MZ_SPI4 */
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI5
|
||||
void pic32mz_spi5select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mz_spi5select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n", (int)devid,
|
||||
selected ? "assert" : "de-assert");
|
||||
}
|
||||
|
||||
uint8_t pic32mz_spi5status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
uint8_t pic32mz_spi5status(struct spi_dev_s *dev, uint32_t devid)
|
||||
{
|
||||
spiinfo("Returning nothing\n");
|
||||
#warning "Missing logic"
|
||||
|
@ -247,7 +247,7 @@ uint8_t pic32mz_spi5status(FAR struct spi_dev_s *dev, uint32_t devid)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mz_spi5cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
int pic32mz_spi5cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
{
|
||||
#warning "Missing logic"
|
||||
return 0;
|
||||
|
@ -256,7 +256,7 @@ int pic32mz_spi5cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
|||
#endif /* CONFIG_PIC32MZ_SPI5 */
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI6
|
||||
void pic32mz_spi6select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mz_spi6select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n", (int)devid,
|
||||
|
@ -264,7 +264,7 @@ void pic32mz_spi6select(FAR struct spi_dev_s *dev, uint32_t devid,
|
|||
#warning "Missing logic"
|
||||
}
|
||||
|
||||
uint8_t pic32mz_spi6status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
uint8_t pic32mz_spi6status(struct spi_dev_s *dev, uint32_t devid)
|
||||
{
|
||||
spiinfo("Returning nothing\n");
|
||||
#warning "Missing logic"
|
||||
|
@ -272,7 +272,7 @@ uint8_t pic32mz_spi6status(FAR struct spi_dev_s *dev, uint32_t devid)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mz_spi6cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
int pic32mz_spi6cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
{
|
||||
#warning "Missing logic"
|
||||
return 0;
|
||||
|
@ -302,8 +302,8 @@ int pic32mz_spi6cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
|||
|
||||
#ifdef CONFIG_SPI_CALLBACK
|
||||
#ifdef CONFIG_PIC32MZ_SPI1
|
||||
int pic32mz_spi1register(FAR struct spi_dev_s *dev,
|
||||
spi_mediachange_t callback, FAR void *arg)
|
||||
int pic32mz_spi1register(struct spi_dev_s *dev,
|
||||
spi_mediachange_t callback, void *arg)
|
||||
{
|
||||
#warning Missing logic
|
||||
return -ENOSYS;
|
||||
|
@ -311,8 +311,8 @@ int pic32mz_spi1register(FAR struct spi_dev_s *dev,
|
|||
#endif /* CONFIG_PIC32MZ_SPI1 */
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI2
|
||||
int pic32mz_spi2register(FAR struct spi_dev_s *dev,
|
||||
spi_mediachange_t callback, FAR void *arg)
|
||||
int pic32mz_spi2register(struct spi_dev_s *dev,
|
||||
spi_mediachange_t callback, void *arg)
|
||||
{
|
||||
#warning Missing logic
|
||||
return -ENOSYS;
|
||||
|
@ -320,8 +320,8 @@ int pic32mz_spi2register(FAR struct spi_dev_s *dev,
|
|||
#endif /* CONFIG_PIC32MZ_SPI2 */
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI3
|
||||
int pic32mz_spi3register(FAR struct spi_dev_s *dev,
|
||||
spi_mediachange_t callback, FAR void *arg)
|
||||
int pic32mz_spi3register(struct spi_dev_s *dev,
|
||||
spi_mediachange_t callback, void *arg)
|
||||
{
|
||||
#warning Missing logic
|
||||
return -ENOSYS;
|
||||
|
@ -329,8 +329,8 @@ int pic32mz_spi3register(FAR struct spi_dev_s *dev,
|
|||
#endif /* CONFIG_PIC32MZ_SPI3 */
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI4
|
||||
int pic32mz_spi4register(FAR struct spi_dev_s *dev,
|
||||
spi_mediachange_t callback, FAR void *arg)
|
||||
int pic32mz_spi4register(struct spi_dev_s *dev,
|
||||
spi_mediachange_t callback, void *arg)
|
||||
{
|
||||
#warning Missing logic
|
||||
return -ENOSYS;
|
||||
|
@ -338,8 +338,8 @@ int pic32mz_spi4register(FAR struct spi_dev_s *dev,
|
|||
#endif /* CONFIG_PIC32MZ_SPI4 */
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI5
|
||||
int pic32mz_spi5register(FAR struct spi_dev_s *dev,
|
||||
spi_mediachange_t callback, FAR void *arg)
|
||||
int pic32mz_spi5register(struct spi_dev_s *dev,
|
||||
spi_mediachange_t callback, void *arg)
|
||||
{
|
||||
#warning Missing logic
|
||||
return -ENOSYS;
|
||||
|
@ -347,8 +347,8 @@ int pic32mz_spi5register(FAR struct spi_dev_s *dev,
|
|||
#endif /* CONFIG_PIC32MZ_SPI5 */
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI6
|
||||
int pic32mz_spi6register(FAR struct spi_dev_s *dev,
|
||||
spi_mediachange_t callback, FAR void *arg)
|
||||
int pic32mz_spi6register(struct spi_dev_s *dev,
|
||||
spi_mediachange_t callback, void *arg)
|
||||
{
|
||||
#warning Missing logic
|
||||
return -ENOSYS;
|
||||
|
|
|
@ -83,10 +83,10 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct lcd_dev_s *pic32mz_graphics_setup(unsigned int devno)
|
||||
struct lcd_dev_s *pic32mz_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.
|
||||
|
@ -149,7 +149,7 @@ FAR struct lcd_dev_s *pic32mz_graphics_setup(unsigned int devno)
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NXSTART_EXTERNINIT
|
||||
FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno)
|
||||
struct lcd_dev_s *board_graphics_setup(unsigned int devno)
|
||||
{
|
||||
return pic32mz_graphics_setup(devno);
|
||||
}
|
||||
|
|
|
@ -124,7 +124,7 @@ static const struct led_setting_s g_ledoffvalues[LED_NVALUES] =
|
|||
* Name: pic32mz_setleds
|
||||
****************************************************************************/
|
||||
|
||||
static void pic32mz_setleds(FAR const struct led_setting_s *setting)
|
||||
static void pic32mz_setleds(const struct led_setting_s *setting)
|
||||
{
|
||||
if (setting->led1 != LED_NC)
|
||||
{
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
#ifdef PIC32MZ_HAVE_MMCSD
|
||||
static int nsh_sdinitialize(void)
|
||||
{
|
||||
FAR struct spi_dev_s *spi;
|
||||
struct spi_dev_s *spi;
|
||||
int ret;
|
||||
|
||||
/* Get the SPI port */
|
||||
|
|
|
@ -139,7 +139,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)
|
||||
{
|
||||
#ifdef CONFIG_PIC32MZ_GPIOIRQ_PORTB
|
||||
int ret = OK;
|
||||
|
|
|
@ -90,7 +90,7 @@ void weak_function pic32mz_spidev_initialize(void)
|
|||
struct spi_dev_s;
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI1
|
||||
void pic32mz_spi1select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mz_spi1select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n",
|
||||
|
@ -98,7 +98,7 @@ void pic32mz_spi1select(FAR struct spi_dev_s *dev, uint32_t devid,
|
|||
#warning "Missing logic"
|
||||
}
|
||||
|
||||
uint8_t pic32mz_spi1status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
uint8_t pic32mz_spi1status(struct spi_dev_s *dev, uint32_t devid)
|
||||
{
|
||||
spiinfo("Returning nothing\n");
|
||||
#warning "Missing logic"
|
||||
|
@ -106,7 +106,7 @@ uint8_t pic32mz_spi1status(FAR struct spi_dev_s *dev, uint32_t devid)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mz_spi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
int pic32mz_spi1cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
{
|
||||
#warning "Missing logic"
|
||||
return 0;
|
||||
|
@ -115,7 +115,7 @@ int pic32mz_spi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI2
|
||||
void pic32mz_spi2select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mz_spi2select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n",
|
||||
|
@ -123,7 +123,7 @@ void pic32mz_spi2select(FAR struct spi_dev_s *dev, uint32_t devid,
|
|||
#warning "Missing logic"
|
||||
}
|
||||
|
||||
uint8_t pic32mz_spi2status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
uint8_t pic32mz_spi2status(struct spi_dev_s *dev, uint32_t devid)
|
||||
{
|
||||
spiinfo("Returning nothing\n");
|
||||
#warning "Missing logic"
|
||||
|
@ -131,7 +131,7 @@ uint8_t pic32mz_spi2status(FAR struct spi_dev_s *dev, uint32_t devid)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mz_spi2cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
int pic32mz_spi2cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
{
|
||||
#warning "Missing logic"
|
||||
return 0;
|
||||
|
@ -140,7 +140,7 @@ int pic32mz_spi2cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI3
|
||||
void pic32mz_spi3select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mz_spi3select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n",
|
||||
|
@ -148,7 +148,7 @@ void pic32mz_spi3select(FAR struct spi_dev_s *dev, uint32_t devid,
|
|||
#warning "Missing logic"
|
||||
}
|
||||
|
||||
uint8_t pic32mz_spi3status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
uint8_t pic32mz_spi3status(struct spi_dev_s *dev, uint32_t devid)
|
||||
{
|
||||
spiinfo("Returning nothing\n");
|
||||
#warning "Missing logic"
|
||||
|
@ -156,7 +156,7 @@ uint8_t pic32mz_spi3status(FAR struct spi_dev_s *dev, uint32_t devid)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mz_spi3cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
int pic32mz_spi3cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
{
|
||||
#warning "Missing logic"
|
||||
return 0;
|
||||
|
@ -165,7 +165,7 @@ int pic32mz_spi3cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI4
|
||||
void pic32mz_spi4select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mz_spi4select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n",
|
||||
|
@ -173,7 +173,7 @@ void pic32mz_spi4select(FAR struct spi_dev_s *dev, uint32_t devid,
|
|||
#warning "Missing logic"
|
||||
}
|
||||
|
||||
uint8_t pic32mz_spi4status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
uint8_t pic32mz_spi4status(struct spi_dev_s *dev, uint32_t devid)
|
||||
{
|
||||
spiinfo("Returning nothing\n");
|
||||
#warning "Missing logic"
|
||||
|
@ -181,7 +181,7 @@ uint8_t pic32mz_spi4status(FAR struct spi_dev_s *dev, uint32_t devid)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mz_spi4cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
int pic32mz_spi4cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
{
|
||||
#warning "Missing logic"
|
||||
return 0;
|
||||
|
@ -190,7 +190,7 @@ int pic32mz_spi4cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI5
|
||||
void pic32mz_spi5select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mz_spi5select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n",
|
||||
|
@ -198,7 +198,7 @@ void pic32mz_spi5select(FAR struct spi_dev_s *dev, uint32_t devid,
|
|||
#warning "Missing logic"
|
||||
}
|
||||
|
||||
uint8_t pic32mz_spi5status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
uint8_t pic32mz_spi5status(struct spi_dev_s *dev, uint32_t devid)
|
||||
{
|
||||
spiinfo("Returning nothing\n");
|
||||
#warning "Missing logic"
|
||||
|
@ -206,7 +206,7 @@ uint8_t pic32mz_spi5status(FAR struct spi_dev_s *dev, uint32_t devid)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mz_spi5cmddata(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
int pic32mz_spi5cmddata(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool cmd)
|
||||
{
|
||||
#warning "Missing logic"
|
||||
|
@ -216,7 +216,7 @@ int pic32mz_spi5cmddata(FAR struct spi_dev_s *dev, uint32_t devid,
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_PIC32MZ_SPI6
|
||||
void pic32mz_spi6select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
void pic32mz_spi6select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n", (int)devid,
|
||||
|
@ -224,7 +224,7 @@ void pic32mz_spi6select(FAR struct spi_dev_s *dev, uint32_t devid,
|
|||
#warning "Missing logic"
|
||||
}
|
||||
|
||||
uint8_t pic32mz_spi6status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
uint8_t pic32mz_spi6status(struct spi_dev_s *dev, uint32_t devid)
|
||||
{
|
||||
spiinfo("Returning nothing\n");
|
||||
#warning "Missing logic"
|
||||
|
@ -232,7 +232,7 @@ uint8_t pic32mz_spi6status(FAR struct spi_dev_s *dev, uint32_t devid)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int pic32mz_spi6cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
int pic32mz_spi6cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
{
|
||||
#warning "Missing logic"
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue