-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
143 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
# IS31FL3236 STM32 HAL Driver | ||
NOTE: This repository is still in the beta phase, so some parts are not finished yet. | ||
|
||
This project is a driver for the IS31FL3236 IC from ISSI for use with the STM32 and the HAL library from ST. The whole driver is designed to work with the HAL / Cube(MX) library of ST, but can be portet to other hardwares. | ||
|
||
## Implementation | ||
This driver can be implemented in to any STM32 project built upon the HAL library of ST. More information on the implementation can be found on the GitHub wiki of this repository. | ||
|
||
This driver can be implemented in to any STM32 project built upon the HAL library of ST. More information on the implementation can be found on the [GitHub-Wiki](https://github.com/berndoJ/IS31FL3236_STM32_HAL_Driver/wiki) of this repository. | ||
|
||
## Contributors | ||
|
||
This driver was created by Johannes Berndorfer (berndoJ) in April 2019. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
### Declaration | ||
|
||
```c | ||
void IS31FL3236_SetSoftwareShutdown(IS31FL3236_HandleTypeDef* handle, uint8_t software_shutdown_mode); | ||
``` | ||
### Parameters | ||
- **handle** [`IS31FL3236_HandleTypeDef*`]: The handle instance of the IS31FL3236 chip. | ||
- **software_shutdown_mode** [`uint8_t`]: The new software shutdown mode the chip should enter. Use the | ||
definitions `IS31FL3236_SOFTWARE_SHUTDOWN_ENABLED` and `IS31FL3236_SOFTWARE_SHUTDOWN_DISABLED` to specify | ||
the shutdown mode. | ||
### Description | ||
This function sets the IS31FL3236 chip into the given software shutdown mode. For further | ||
information about shutdown modes refer to the datasheet. ([Link to IS31FL3236 Datasheet](http://www.issi.com/WW/pdf/31FL3236.pdf) | ||
### Example | ||
```c | ||
// Set the chip into software enabled mode (disable shutdown mode) | ||
IS31FL3236_SetSoftwareShutdown(p_hIS31FL3236, IS31FL3236_SOFTWARE_SHUTDOWN_DISABLED); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
### Declaration | ||
|
||
```c | ||
void IS31FL3236_WriteGlobalLEDControl(IS31FL3236_HandleTypeDef* handle, uint8_t led_current_setting, uint8_t led_state); | ||
``` | ||
### Parameters | ||
- **handle** [`IS31FL3236_HandleTypeDef*`]: The handle instance of the IS31FL3236 chip. | ||
- **led_current_setting** [`uint8_t`]: The new LED current setting of all channels. Use the definitions `IS31FL3236_LED_CURRENT_MAX`, `IS31FL3236_LED_CURRENT_MAX_DIV_2`, `IS31FL3236_LED_CURRENT_MAX_DIV_3`, `IS31FL3236_LED_CURRENT_MAX_DIV_4` to specify the current mode. | ||
- **led_state** [`uint8_t`]: The new LED state of all channels. Use the definitions `IS31FL3236_LED_STATE_OFF` and `IS31FL3236_LED_STATE_ON` to specify the LED mode. | ||
### Description | ||
This function is identical to the `IS31FL3236_WriteLEDControl` function, but insted of changing | ||
the LED current control and state of one channel, it changes these values globally. This function | ||
uses a special harware command (see datasheet), thus it is faster than looping over all channels | ||
and changing the values seperately. | ||
### Example | ||
```c | ||
// Set the basic global LED current mode and state settings. (Turn on all channels to the max. current) | ||
IS31FL3236_WriteGlobalLEDControl(p_hIS31FL3236, IS31FL3236_LED_CURRENT_MAX, IS31FL3236_LED_STATE_ON); | ||
// Send an update command to the chip. | ||
IS31FL3236_Update(p_hIS31FL3236); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
### Declaration | ||
|
||
```c | ||
void IS31FL3236_WriteLEDControl(IS31FL3236_HandleTypeDef* handle, uint8_t channel, uint8_t led_current_setting, uint8_t led_state); | ||
``` | ||
### Parameters | ||
- **handle** [`IS31FL3236_HandleTypeDef*`]: The handle instance of the IS31FL3236 chip. | ||
- **channel** [`uint8_t`]: The channel number (0 - 35) to change the PWM value of. | ||
- **led_current_setting** [`uint8_t`]: The new LED current setting of the specified channel. Use the definitions `IS31FL3236_LED_CURRENT_MAX`, `IS31FL3236_LED_CURRENT_MAX_DIV_2`, `IS31FL3236_LED_CURRENT_MAX_DIV_3`, `IS31FL3236_LED_CURRENT_MAX_DIV_4` to specify the current mode of the channel. | ||
- **led_state** [`uint8_t`]: The new LED state of the specified channel. Use the definitions `IS31FL3236_LED_STATE_OFF` and `IS31FL3236_LED_STATE_ON` to specify the LED mode. | ||
### Description | ||
This function sets the LED current mode and state of a specified channel. Further | ||
information about the LED current mode and state can be found in the manufacturer's | ||
datasheet of the IS31FL3236 IC. ([Link to IS31FL3236 Datasheet](http://www.issi.com/WW/pdf/31FL3236.pdf) | ||
### Example | ||
```c | ||
// Set the LED current mode and state. | ||
IS31FL3236_WriteLEDControl(p_hIS31FL3236, 3, IS31FL3236_LED_CURRENT_MAX_DIV_2, IS31FL3236_LED_STATE_ON); | ||
// Send the chip and update command. | ||
IS31FL3236_Update(p_hIS31FL3236); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
### Declaration | ||
|
||
```c | ||
void IS31FL3236_WriteRegister(IS31FL3236_HandleTypeDef* handle, uint8_t register_address, uint8_t value); | ||
``` | ||
### Parameters | ||
- **handle** [`IS31FL3236_HandleTypeDef*`]: The handle instance of the IS31FL3236 chip. | ||
- **register_address** [`uint8_t`]: The address of the register on the IS31FL3236 chip to write to. The register addresses can be looked up in the datasheet of the IS31FL3236 or can be retrieved by using the included definitions (see Register Address Definitions). | ||
### Description | ||
This function can be used to manually write to an internal register on the IS31FL3236 chip. | ||
### Register Address Definitions | ||
This library contains a collection of definitions that can be used to retrieve the addresses of the IS31FL3236's internal registers. The following list contains all available register address definitions. | ||
- `IS31FL3236_REGISTER_SHUTDOWN` - Shutdown Register - `0x00` | ||
- `IS31FL3236_REGISTER_PWM` - First PWM value register - `0x01` | ||
- `IS31FL3236_REGISTER_LED_CTRL` - First LED control register - `0x26` | ||
- `IS31FL3236_REGISTER_UPDATE` - Update initiation register - `0x25` | ||
- `IS31FL3236_REGISTER_GLOBAL_CTRL` - Global LED control register - `0x4a` | ||
- `IS31FL3236_REGISTER_RESET` - Reset initiation register - `0x4f` | ||
### Example | ||
```c | ||
// Write 0x00 to the update register - similar to IS31FL3236_Update function. | ||
IS31FL3236_WriteRegister(p_hIS31FL3236, IS31FL3236_REGISTER_UPDATE, 0x00); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.