Function | Sub-Function | APIs | Description | Update Status | |
---|---|---|---|---|---|
irq_handler() | none | interrupt handle function | 2019-1-10 | ||
main() | cpu_wakeup_init() | CPU initialization function [Mandatory] | |||
clock_init() | clock_init(SYS_CLK_24M_Crystal) | Clock initialization function, System Clock is 24M RC by default [optional] | |||
rf_drv_init() | rf_drv_init(RF_MODE_BLE_1M) | RF mode initialization [optional] | |||
gpio_init() | gpio_init(1) | GPIO initialization: set the initialization status of all GPIOs [optional] | |||
user_init() | usb_set_pin_en() | open the DP and DM of USB and enable 1.5k internal pull-up resistor | |||
usb_irq_init() | enable manual interrupt | ||||
irq_enable() | enable global interrupt | ||||
gpio_set_func() gpio_set_input_en() gpio_set_output_en() gpio_set_up_down_resistor() | gpio_set_func(GPIO_PD1, AS_GPIO) gpio_set_input_en(GPIO_PD1,1) gpio_set_output_en(GPIO_PD1,0) gpio_set_up_down_resistor(GPIO_PD1, PM_PIN_PULLUP_10K) | set pin for simulate pressing the left or right key of Mouse | |||
gpio_set_func(GPIO_PD2, AS_GPIO) gpio_set_input_en(GPIO_PD2,1) gpio_set_output_en(GPIO_PD2,0) gpio_set_up_down_resistor(GPIO_PD2, PM_PIN_PULLUP_10K) | set pin for simulate releasing the left or right key of Mouse | ||||
main_loop() | usb_handle_irq_process() | handle with USB interrupt | |||
refer to Driver Demo | check whether key is pressed | ||||
usb_mouse_hid_report() | usb_mouse_hid_report(mouse) | send key value of Mouse to USB host |
Function | Sub-Function | APIs | Description | Update Status | |
---|---|---|---|---|---|
irq_handler() | none | interrupt handle function | 2019-1-10 | ||
main() | cpu_wakeup_init() | CPU initialization function [Mandatory] | |||
clock_init() | clock_init(SYS_CLK_24M_Crystal) | Clock initialization function, System Clock is 24M RC by default [optional] | |||
rf_drv_init() | rf_drv_init(RF_MODE_BLE_1M) | RF mode initialization [optional] | |||
gpio_init() | gpio_init(1) | GPIO initialization: set the initialization status of all GPIOs [optional] | |||
user_init() | usb_set_pin_en() | open the DP and DM of USB and enable 1.5k internal pull-up resistor | |||
usb_irq_init() | enable manual interrupt | ||||
usbhw_data_ep_ack() | usbhw_data_ep_ack(USB_EDP_KEYBOARD_OUT) | set ep3 BUSY(BUSY same as ACK) bit as 1 means output endpoint buffer can receive data from USB host | |||
irq_enable() | enable global interrupt | ||||
gpio_set_func() gpio_set_input_en() gpio_set_output_en() gpio_set_up_down_resistor() | gpio_set_func(GPIO_PD1, AS_GPIO) gpio_set_input_en(GPIO_PD1,1) gpio_set_output_en(GPIO_PD1,0) gpio_set_up_down_resistor(GPIO_PD1, PM_PIN_PULLUP_10K) | set pin for simulate pressing the left or right key of Mouse | |||
gpio_set_func(GPIO_PD2, AS_GPIO) gpio_set_input_en(GPIO_PD2,1) gpio_set_output_en(GPIO_PD2,0) gpio_set_up_down_resistor(GPIO_PD2, PM_PIN_PULLUP_10K) | set pin for simulate releasing the left or right key of Mouse | ||||
main_loop() | usb_handle_irq_process() | handle with USB interrupt | |||
refer to Driver Demo | check whether key is pressed | ||||
usb_keyboard_hid_report() | usb_keyboard_hid_report(kb_data) | send key value of Keyboard to USB host |
Function | Sub-Function | APIs | Description | Update Status | |
---|---|---|---|---|---|
irq_handler() | none | interrupt handle function | 2019-1-10 | ||
main() | cpu_wakeup_init() | CPU initialization function [Mandatory] | |||
clock_init() | clock_init(SYS_CLK_24M_Crystal) | Clock initialization function, System Clock is 24M RC by default [optional] | |||
rf_drv_init() | rf_drv_init(RF_MODE_BLE_1M) | RF mode initialization [optional] | |||
gpio_init() | gpio_init(1) | GPIO initialization: set the initialization status of all GPIOs [optional] | |||
user_init() | usb_set_pin_en() | open the DP and DM of USB and enable 1.5k internal pull-up resistor | |||
usb_irq_init() | enable manual interrupt | ||||
usbhw_data_ep_ack() | usbhw_data_ep_ack(USB_EDP_CDC_OUT) | set ep5 BUSY(BUSY same as ACK) bit as 1 means output endpoint buffer can receive data from USB host | |||
irq_enable() | enable global interrupt | ||||
main_loop() | usb_handle_irq_process() | handle with USB interrupt | |||
refer to Driver Demo | check whether data is reveived | ||||
usb_cdc_tx_data_to_host() | usb_cdc_tx_data_to_host(usb_cdc_data,usb_cdc_data_len) | send data from USB host to USB host |
Date | Description | Author |
---|---|---|
2019-1-10 | initial release | SP/YY/LJW |