Battery measurement, basic version
This commit is contained in:
30
firmware/libs/usb_mgmt/include/usb_mgmt.h
Normal file
30
firmware/libs/usb_mgmt/include/usb_mgmt.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#ifndef USB_MGMT_H
|
||||
#define USB_MGMT_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <zephyr/kernel.h>
|
||||
|
||||
#define USB_MGMT_VBUS_CONNECTED BIT(0)
|
||||
#define USB_MGMT_VBUS_DISCONNECTED BIT(1)
|
||||
|
||||
extern struct k_event usb_mgmt_events;
|
||||
|
||||
/**
|
||||
* @brief Wait until usb_mgmt has completed initialization.
|
||||
*
|
||||
* @param timeout Timeout for waiting.
|
||||
*
|
||||
* @retval true usb_mgmt is ready.
|
||||
* @retval false timeout occurred.
|
||||
*/
|
||||
bool usb_mgmt_wait_ready(k_timeout_t timeout);
|
||||
|
||||
/**
|
||||
* @brief Returns true when VBUS (USB 5 V) is present.
|
||||
*
|
||||
* Reads the USBREGSTATUS.VBUSDETECT bit in the nRF52840 POWER peripheral.
|
||||
* No USB stack needs to be enabled.
|
||||
*/
|
||||
bool usb_mgmt_is_vbus_present(void);
|
||||
|
||||
#endif /* USB_MGMT_H */
|
||||
Reference in New Issue
Block a user