change(ldo): make ldo driver unit_id same as datasheet

Prior to this commit, we expect passing ldo_unit_t to esp_ldo driver
`ldo_unit` field. And ldo_unit_t will alias the LDO unit to values
starting from 0, e.g. LDO_UNIT_1 is actually value 0.

With this commit, esp_ldo driver `ldo_unit` field will start with 1,
which is aligned with the datasheet. So LDO_UNIT_1 is in value 1,
meanwhile setting 1 to `ldo_unit` will work as well.
This commit is contained in:
Armando
2024-01-08 10:52:01 +08:00
parent 86707a3af6
commit 1adea4ab66
6 changed files with 42 additions and 27 deletions
@@ -31,7 +31,7 @@ typedef struct {
* @brief LDO driver initial configurations
*/
typedef struct {
int unit_id; ///< LDO unit
int unit_id; ///< LDO ID, this is aligned with datasheet, e.g. you should set this to 1, if using LDO ID 1
esp_ldo_unit_cfg_t cfg; ///< LDO unit configuration
struct {
uint32_t enable_unit: 1; ///< Enable the LDO unit after it's initialised