arch/arm/src/tiva, include/nuttx/sensors: Reinstate TM4C qencoder driver and expand its ioctls.

arch/arm/src/tiva/Kconfig:
* Add TIVA_HAVE_QEI0, TIVA_HAVE_QEI1 as applicable to each ARCH_CHIP_TM4C12*.
* Add config TIVA_QEI, TIVA_HAVE_QEI0, TIVA_HAVE_QEI1.
* Add config TIVA_QEI0, config TIVA_QEI1.

arch/arm/src/tiva/common/tiva_qencoder.c:
* Rewrite tiva_qe_setup().
* Replace tiva_qe_ppr() with tiva_qe_resetatppr().
* Add tiva_qe_resetatmaxpos(), tiva_qe_resetatindex().

arch/arm/src/tiva/hardware/tiva_qencoder.h:
* Add missing definitions: SIGMODE_QUADRATURE, SIGMODE_CLK_AND_DIR, SWAP_NO_SWAP, SWAP_PHA_PHB.

arch/arm/src/tiva/tiva_qencoder.h:
* Rename TIVA QEI ioctl QEIOC_PPR to QEIOC_RESETATPPR.
* Add TIVA QEI ioctl identifiers QEIOC_RESETATMAXPOS, QEIOC_RESETATINDEX.

include/nuttx/sensors/qencoder.h:
* Increase QE_TIVA_NCMDS from 3 to 5.
This commit is contained in:
Nathan Hartman
2019-08-02 15:56:05 -06:00
committed by Gregory Nutt
parent 8e321aba84
commit a36d49e975
5 changed files with 206 additions and 56 deletions
+4 -1
View File
@@ -48,11 +48,13 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Configuration ************************************************************
* CONFIG_SENSORS_QENCODER - Enables support for the quadrature encoder upper half
*/
/* IOCTL Commands ***********************************************************/
/* The Quadrature Encode module uses a standard character driver framework.
* However, since the driver is a device control interface rather than a
* data transfer interface, the majority of the functionality is implemented
@@ -80,7 +82,7 @@
/* See arch/arm/src/tiva/tiva_qencoder.h (Not usable at that location) */
#define QE_TIVA_FIRST (QE_FIRST + QE_NCMDS)
#define QE_TIVA_NCMDS 3
#define QE_TIVA_NCMDS 5
/* See include/nuttx/sensors/as5048b.h */
@@ -90,6 +92,7 @@
/****************************************************************************
* Public Types
****************************************************************************/
/* This is the vtable that is used to by the upper half quadrature encoder
* to call back into the lower half quadrature encoder.
*/