39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
67#define USBMUX_PIN_STATE_LOW 0x00
68#define USBMUX_PIN_STATE_HIGH 0x01
74#define USBMUX_USB1_SELECT 0x00
75#define USBMUX_USB2_SELECT 0x01
93#define USBMUX_MAP_MIKROBUS( cfg, mikrobus ) \
94 cfg.oe = MIKROBUS( mikrobus, MIKROBUS_RST ); \
95 cfg.sel = MIKROBUS( mikrobus, MIKROBUS_PWM )
void usbmux_set_oe_pin(usbmux_t *ctx, uint8_t pin_state)
USB MUX set OE pin output function.
err_t usbmux_init(usbmux_t *ctx, usbmux_cfg_t *cfg)
USB MUX initialization function.
void usbmux_set_output(usbmux_t *ctx, uint8_t out_sel)
USB MUX select output function.
void usbmux_set_sel_pin(usbmux_t *ctx, uint8_t pin_state)
USB MUX set SEL pin output function.
void usbmux_default_cfg(usbmux_t *ctx)
USB MUX default configuration function.
void usbmux_cfg_setup(usbmux_cfg_t *cfg)
USB MUX configuration object setup function.
void usbmux_enable_output(usbmux_t *ctx)
USB MUX enable output function.
void usbmux_disable_output(usbmux_t *ctx)
USB MUX disable output function.
USB MUX Click configuration object.
Definition usbmux.h:116
pin_name_t oe
Definition usbmux.h:117
pin_name_t sel
Definition usbmux.h:118
USB MUX Click context object.
Definition usbmux.h:105
digital_out_t sel
Definition usbmux.h:107
digital_out_t oe
Definition usbmux.h:106
usbmux_return_value_t
USB MUX Click return value data.
Definition usbmux.h:127
@ USBMUX_ERROR
Definition usbmux.h:129
@ USBMUX_OK
Definition usbmux.h:128