tpl0501 base driver modules
More...
tpl0501 base driver modules
◆ tpl0501_handle_t
tpl0501 handle structure definition
◆ tpl0501_info_t
tpl0501 information structure definition
◆ tpl0501_deinit()
close the chip
- Parameters
-
| [in] | *handle | pointer to a tpl0501 handle structure |
- Returns
- status code
- 0 success
- 1 deinit failed
- 2 handle is NULL
- 3 handle is not initialized
- Note
- none
Definition at line 139 of file driver_tpl0501.c.
◆ tpl0501_info()
get chip's information
- Parameters
-
| [out] | *info | pointer to a tpl0501 info structure |
- Returns
- status code
- 0 success
- 2 handle is NULL
- Note
- none
Definition at line 298 of file driver_tpl0501.c.
◆ tpl0501_init()
initialize the chip
- Parameters
-
| [in] | *handle | pointer to a tpl0501 handle structure |
- Returns
- status code
- 0 success
- 1 spi initialization failed
- 2 handle is NULL
- 3 linked functions is NULL
- Note
- none
Definition at line 83 of file driver_tpl0501.c.
◆ tpl0501_percentage_convert_to_data()
| uint8_t tpl0501_percentage_convert_to_data |
( |
tpl0501_handle_t * | handle, |
|
|
uint8_t | reg, |
|
|
float * | percentage, |
|
|
float * | wl_ohm, |
|
|
float * | hw_ohm ) |
convert the register raw data to percentage
- Parameters
-
| [in] | *handle | pointer to a tpl0501 handle structure |
| [in] | reg | register raw data |
| [out] | *percentage | pointer to a percentage buffer |
| [out] | *wl_ohm | pointer to a wl ohm buffer |
| [out] | *hw_ohm | pointer to a hw ohm buffer |
- Returns
- status code
- 0 success
- 2 handle is NULL
- 3 handle is not initialized
- Note
- none
Definition at line 245 of file driver_tpl0501.c.
◆ tpl0501_percentage_convert_to_register()
| uint8_t tpl0501_percentage_convert_to_register |
( |
tpl0501_handle_t * | handle, |
|
|
float | percentage, |
|
|
uint8_t * | reg, |
|
|
float * | wl_ohm, |
|
|
float * | hw_ohm ) |
convert the percentage to the register raw data
- Parameters
-
| [in] | *handle | pointer to a tpl0501 handle structure |
| [in] | percentage | set percentage |
| [out] | *reg | pointer to a register raw buffer |
| [out] | *wl_ohm | pointer to a wl ohm buffer |
| [out] | *hw_ohm | pointer to a hw ohm buffer |
- Returns
- status code
- 0 success
- 2 handle is NULL
- 3 handle is not initialized
- Note
- none
Definition at line 212 of file driver_tpl0501.c.
◆ tpl0501_write()
write data
- Parameters
-
| [in] | *handle | pointer to a tpl0501 handle structure |
| [in] | raw | set data |
- Returns
- status code
- 0 success
- 1 write failed
- 2 handle is NULL
- 3 handle is not initialized
- Note
- none
Definition at line 175 of file driver_tpl0501.c.