2193 views|0 replies

424

Posts

8

Resources
The OP
 

[nRF52840 DK Review] Start lighting up [Copy link]

It seems to be the second week since I received the board. I am so ashamed that I have only started to light it up now. Of course, I have to light it up first after receiving the board. I will feel embarrassed if I don’t light it up (just kidding). In fact, if you just want to light up the board, the SDK package has already stored the functions in the boards file, which contains the related functions of LED and button. Just call them in main. Here are some functions of boardsvoid bsp_board_led_on(uint32_t led_idx)

Purpose: Set the LED of led_idx to bright Parameters: - led_idx: LED list number, the maximum is equal to LEDS_NUMBER-1 Return: None

void bsp_board_led_off(uint32_t led_idx) Purpose: Set led_idx to off Parameters: - led_idx: LED list number, the maximum is equal to LEDS_NUMBER-1 Return: None bool bsp_board_led_state_get(uint32_t led_idx) Purpose: Get the current status of the LED of led_idx Parameters: - led_idx: LED list number, the maximum is equal to LEDS_NUMBER-1 Return: - true (1): LED on - false (0): LED off void bsp_board_init(uint32_t init_flags) Purpose: Initialization parameters of LED or button: - init_flags Flags of the hardware to be initialized, the definition can be found in the h file Return: - None So I will list these few, for details, please refer to the comments in the boards file, which have instructions. The call of button is similar to this, so I will not write it here.
  1. int main(void) { bsp_board_init(BSP_INIT_LEDS); // Enter main loop. for (;;) { bsp_board_led_on(0); } }
复制代码
The function is very simple, just turn on the light, no fancy tricks.
This post is from RF/Wirelessly
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

快速回复 返回顶部 Return list