SLAA476B February 2011 – July 2019 BQ2040 , BQ2040 , BQ2060A , BQ2060A , BQ2063 , BQ2063 , BQ2083-V1P3 , BQ2083-V1P3 , BQ2084-V143 , BQ2084-V143 , BQ2084-V150 , BQ2084-V150 , BQ2085-V1P3 , BQ2085-V1P3 , BQ20Z40-R1 , BQ20Z40-R1 , BQ20Z70-V160 , BQ20Z70-V160 , BQ20Z80A-V110 , BQ20Z80A-V110 , BQ28400 , BQ28400 , BQ78PL114 , BQ78PL114 , BQ78PL116 , BQ78PL116 , LM5145 , LM5145 , MSP430F5500 , MSP430F5500 , MSP430F5501 , MSP430F5501 , MSP430F5502 , MSP430F5502 , MSP430F5503 , MSP430F5503 , MSP430F5504 , MSP430F5504 , MSP430F5505 , MSP430F5505 , MSP430F5506 , MSP430F5506 , MSP430F5507 , MSP430F5507 , MSP430F5508 , MSP430F5508 , MSP430F5509 , MSP430F5509 , MSP430F5510 , MSP430F5510 , TPS40057 , TPS40057 , TPS40170 , TPS40170
This function provides control of the LEDs on the board. Call the LED_Init() function to initialize the LED ports to output direction before making calls to this function.
Function Definition
void LED_Control (unsigned char led_num, unsigned char led_mode, unsigned char led_blink_rate) {...}
Inputs
Name | Type | Description | Example Value |
---|---|---|---|
led_num | unsigned char | Number designated to the LED on the hardware | LED_NUM_0, LED_NUM_1, ..., LED_NUM_7 |
led_mode | unsigned char | Configures the LED to stay in either a steady on/off state or blink periodically. | LED_MODE_ON, LED_MODE_OFF, LED_MODE_BLINK |
led_blink_rate | unsigned char | Configures the blink rate of the LED, if it has been programmed to blink. Value has no effect when LED is set to a steady on or off state. | LED_BLINK_RATE_SLOW, LED_BLINK_RATE_MEDIUM, LED_BLINK_RATE_FAST |
Return
None
Example Function Call
To make LED0 blink at a medium rate:
LED_Control(LED_NUM_0, LED_MODE_BLINK, LED_BLINK_RATE_MEDIUM);
To turn LED1 off:
LED_Control(LED_NUM_1, LED_MODE_OFF, LED_BLINK_RATE_SLOW);