SAMA5D3 Xplained: A few fixes for the AJoystick driver (still not working)
This commit is contained in:
parent
0d4b40f5e2
commit
69fcd1c048
@ -2605,6 +2605,9 @@ Shields
|
|||||||
A1 Joystick X Output J17 pin 2 PD21 AD1 (function 1)
|
A1 Joystick X Output J17 pin 2 PD21 AD1 (function 1)
|
||||||
--------- ----------------- ---------- ----------------------
|
--------- ----------------- ---------- ----------------------
|
||||||
|
|
||||||
|
All buttons are pulled on the shield. A sensed low value indicates
|
||||||
|
when the button is pressed.
|
||||||
|
|
||||||
Possible conflicts:
|
Possible conflicts:
|
||||||
|
|
||||||
---- ----- --------------------------------------------------
|
---- ----- --------------------------------------------------
|
||||||
@ -2672,8 +2675,11 @@ Shields
|
|||||||
Library routines
|
Library routines
|
||||||
CONFIG_SCHED_WORKQUEUE=y : Work queue support is needed
|
CONFIG_SCHED_WORKQUEUE=y : Work queue support is needed
|
||||||
|
|
||||||
This enables the analog joystick example at apps/examples/ajoystick:
|
There is nothing in the configuration that currently uses the joystick.
|
||||||
|
For testing, you can add the following configuration options to enable the
|
||||||
|
analog joystick example at apps/examples/ajoystick:
|
||||||
|
|
||||||
|
CONFIG_NSH_ARCHINIT=y
|
||||||
CONFIG_EXAMPLES_AJOYSTICK=y
|
CONFIG_EXAMPLES_AJOYSTICK=y
|
||||||
CONFIG_EXAMPLES_AJOYSTICK_DEVNAME="/dev/ajoy0"
|
CONFIG_EXAMPLES_AJOYSTICK_DEVNAME="/dev/ajoy0"
|
||||||
CONFIG_EXAMPLES_AJOYSTICK_SIGNO=13
|
CONFIG_EXAMPLES_AJOYSTICK_SIGNO=13
|
||||||
|
@ -157,7 +157,7 @@ static FAR void *g_ajoyarg;
|
|||||||
* Name: ajoy_supported
|
* Name: ajoy_supported
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Return the set of buttons supported on the button joystick device
|
* Return the set of buttons supported on the button joystick device
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@ -260,22 +260,19 @@ static int ajoy_sample(FAR const struct ajoy_lowerhalf_s *lower,
|
|||||||
static ajoy_buttonset_t ajoy_buttons(FAR const struct ajoy_lowerhalf_s *lower)
|
static ajoy_buttonset_t ajoy_buttons(FAR const struct ajoy_lowerhalf_s *lower)
|
||||||
{
|
{
|
||||||
ajoy_buttonset_t ret = 0;
|
ajoy_buttonset_t ret = 0;
|
||||||
ajoy_buttonset_t bit;
|
|
||||||
bool released;
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* Read each joystick GPIO value */
|
/* Read each joystick GPIO value */
|
||||||
|
|
||||||
for (i = 0; i < AJOY_NGPIOS; i++)
|
for (i = 0; i < AJOY_NGPIOS; i++)
|
||||||
{
|
{
|
||||||
bit = (1 << i);
|
/* Button outputs are pulled high. So a sensed low level means that the
|
||||||
if ((bit & AJOY_SUPPORTED) != 0)
|
* button is pressed.
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!sam_pioread(g_joypio[i]))
|
||||||
{
|
{
|
||||||
released = sam_pioread(g_joypio[i]);
|
ret |= (1 << i);
|
||||||
if (!released)
|
|
||||||
{
|
|
||||||
ret |= bit;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -336,7 +333,7 @@ static void ajoy_enable(FAR const struct ajoy_lowerhalf_s *lower,
|
|||||||
* interrupts.
|
* interrupts.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
sam_pioirqenable(g_joypio[i]);
|
sam_pioirqenable(g_joyirq[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -506,6 +506,9 @@
|
|||||||
* A0 Joystick Y Output J17 pin 1 PC18 AD0 (function 4)
|
* A0 Joystick Y Output J17 pin 1 PC18 AD0 (function 4)
|
||||||
* A1 Joystick X Output J17 pin 2 PD21 AD1 (function 1)
|
* A1 Joystick X Output J17 pin 2 PD21 AD1 (function 1)
|
||||||
* --------- ----------------- ---------- ----------------------
|
* --------- ----------------- ---------- ----------------------
|
||||||
|
*
|
||||||
|
* All buttons are pulled on the shield. A sensed low value indicates
|
||||||
|
* when the button is pressed.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define ADC_XOUPUT 1 /* X output is on ADC channel 1 */
|
#define ADC_XOUPUT 1 /* X output is on ADC channel 1 */
|
||||||
@ -570,7 +573,6 @@
|
|||||||
#define PIO_JUMP PIO_BUTTON_3
|
#define PIO_JUMP PIO_BUTTON_3
|
||||||
#define IRQ_JUMP IRQ_BUTTON_3
|
#define IRQ_JUMP IRQ_BUTTON_3
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Public Types
|
* Public Types
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
@ -697,7 +699,7 @@ bool sam_writeprotected(int slotno);
|
|||||||
* Name: sam_usbinitialize
|
* Name: sam_usbinitialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called from sam_usbinitialize very early in inialization to setup USB-related
|
* Called from sam_usbinitialize very early in initialization to setup USB-related
|
||||||
* PIO pins for the SAMA5D3-Xplained board.
|
* PIO pins for the SAMA5D3-Xplained board.
|
||||||
*
|
*
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
Loading…
Reference in New Issue
Block a user