![]() |
RA Flexible Software Package Documentation
Release v5.9.0
|
|
Functions | |
fsp_err_t | R_USB_TYPEC_Open (usb_typec_ctrl_t *const p_ctrl, usb_typec_cfg_t const *const p_cfg) |
Initialize USB Type-C module and USB Type-C driver. Implements usb_typec_api_t::open. More... | |
fsp_err_t | R_USB_TYPEC_Close (usb_typec_ctrl_t *const p_ctrl) |
Uninitialize USB Type-C module and disable interrupts. Implements usb_typec_api_t::close. More... | |
fsp_err_t | R_USB_TYPEC_InfoGet (usb_typec_ctrl_t *const p_ctrl, usb_typec_info_t *p_info) |
Get USB Type-C connect Information. Implements usb_typec_api_t::infoGet. More... | |
fsp_err_t | R_USB_TYPEC_LowPowerModeSet (usb_typec_ctrl_t *const p_ctrl, usb_typec_ccs_status_t status) |
Set IRQ Mode for USB Type-C module by Low Power Mode. Implements usb_typec_api_t::lowPowerModeSet. More... | |
Driver for the USB_TYPEC peripheral on RA MCUs. This module implements the USB TYPEC Interface.
The r_usb_typec module is used in combination with r_usb_basic and other device class for USB communication and with the Type C module alone for Type-C charging.
The r_usb_typec module has the following key features:
The main functions of thie module are the following:
If the user is using an MCU that supports the USB Type-C module and all of the following conditions are satisfied, please add code to control the port connected to External Rd immediately after calling the R_USB_TYPEC_Open function. (Because it is necessary to control External Rd after Internal Rd is turned ON.)
Depending on the user board, the user may need code to debaunce the USB_VBUS pin.
The following is example code for USB Type-C.
Data Structures | |
struct | usb_typec_instance_ctrl_t |
struct usb_typec_instance_ctrl_t |
USB TYPE-C control block. DO NOT INITIALIZE. Initialization occurs when usb_typec_api_t::open is called.
Data Fields | |
uint32_t | open |
Used to determine if the channel is configured. | |
usb_typec_cfg_t * | p_cfg |
Pointer to initial configurations. | |
uint32_t | module_number |
USB module number (USB_IP0/USB_IP1) | |
IRQn_Type | irq_typec_cci |
USBCC_CCI interrupt number storage variable. | |
IRQn_Type | irq_typec_ccs |
USBCC_CCS interrupt number storage variable. | |
uint32_t | ipl_typec_cci |
Variable to store the interrupt priority of USBCC_CCI. | |
uint32_t | ipl_typec_ccs |
Variable to store the interrupt priority of USBCC_CCS. | |
fsp_err_t R_USB_TYPEC_Open | ( | usb_typec_ctrl_t *const | p_ctrl, |
usb_typec_cfg_t const *const | p_cfg | ||
) |
Initialize USB Type-C module and USB Type-C driver. Implements usb_typec_api_t::open.
FSP_SUCCESS | Channel opened successfully. |
FSP_ERR_NOT_OPEN | USB TYPEC module is not open. |
FSP_ERR_ALREADY_OPEN | Control block has already been opened or channel is being used by another instance. Call close() then open() to reconfigure. |
fsp_err_t R_USB_TYPEC_Close | ( | usb_typec_ctrl_t *const | p_ctrl | ) |
Uninitialize USB Type-C module and disable interrupts. Implements usb_typec_api_t::close.
FSP_SUCCESS | Channel successfully closed. |
FSP_ERR_NOT_OPEN | USB TYPEC module is not open. |
fsp_err_t R_USB_TYPEC_InfoGet | ( | usb_typec_ctrl_t *const | p_ctrl, |
usb_typec_info_t * | p_info | ||
) |
Get USB Type-C connect Information. Implements usb_typec_api_t::infoGet.
FSP_SUCCESS | Successful completion. |
FSP_ERR_NOT_OPEN | USB TYPEC module is not open. |
fsp_err_t R_USB_TYPEC_LowPowerModeSet | ( | usb_typec_ctrl_t *const | p_ctrl, |
usb_typec_ccs_status_t | status | ||
) |
Set IRQ Mode for USB Type-C module by Low Power Mode. Implements usb_typec_api_t::lowPowerModeSet.
FSP_SUCCESS | Successful completion. |
FSP_ERR_NOT_OPEN | USB TYPEC module is not open. |
FSP_ERR_USB_PARAMETER | Parameter error. |