nxphlite-v3:Use ADC reading for VBUS

On this HW the VBUS detection is on the ADC. The ADC module
   reads the value and sets a global flag as well as publishing
   the value via uOrb.
This commit is contained in:
David Sidrane
2017-09-29 10:13:51 -04:00
committed by Daniel Agar
parent 57892805e2
commit 58a6e57452
3 changed files with 21 additions and 6 deletions
@@ -416,7 +416,7 @@ __BEGIN_DECLS
* this board support the ADC system_power interface, and therefore
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED board_read_VBUS_state()
#define BOARD_ADC_USB_CONNECTED ADC_USB_VBUS_VALID /* VBUS valid is read on an ADC pin */
#define BOARD_ADC_BRICK_VALID (1)
#define BOARD_ADC_SERVO_VALID (1)
#define BOARD_ADC_PERIPH_5V_OC (0)
@@ -115,6 +115,7 @@ __BEGIN_DECLS
extern void led_init(void);
extern void led_on(int led);
extern void led_off(int led);
extern bool g_board_usb_connected;
__END_DECLS
/****************************************************************************
@@ -139,7 +140,7 @@ __END_DECLS
int board_read_VBUS_state(void)
{
// read * 36 ADC0_SE21 USB_VBUS_VALID
return 0;
return g_board_usb_connected ? 0 : 1;
}
/************************************************************************************