File tree 2 files changed +41
-2
lines changed
2 files changed +41
-2
lines changed Original file line number Diff line number Diff line change 20
20
#include " board.h"
21
21
#include " mbed.h"
22
22
23
+ #if defined TARGET_PORTENTA_H7_M7
23
24
static void portenta_power_init () {
24
25
I2C i2c (BOARD_I2C_SDA, BOARD_I2C_SCL);
25
26
@@ -85,8 +86,46 @@ static void portenta_power_init() {
85
86
data[1 ]=0xF ;
86
87
i2c.write (8 << 1 , data, sizeof (data));
87
88
}
89
+ #endif
88
90
91
+ #if defined TARGET_NICLA_VISION
92
+ static void nicla_vision_power_init () {
93
+ I2C i2c (BOARD_I2C_SDA, BOARD_I2C_SCL);
94
+
95
+ char data[2 ];
96
+
97
+ data[0 ]=0x9C ;
98
+ data[1 ]=(1 << 7 );
99
+ i2c.write (8 << 1 , data, sizeof (data));
100
+
101
+ // Disable charger led
102
+ data[0 ]=0x9E ;
103
+ data[1 ]=(1 << 5 );
104
+ i2c.write (8 << 1 , data, sizeof (data));
105
+
106
+ HAL_Delay (10 );
107
+
108
+ // SW3: set 2A as current limit
109
+ // Helps keeping the rail up at wifi startup
110
+ data[0 ]=0x42 ;
111
+ data[1 ]=(2 );
112
+ i2c.write (8 << 1 , data, sizeof (data));
113
+
114
+ HAL_Delay (10 );
115
+
116
+ // Change VBUS INPUT CURRENT LIMIT to 1.5A
117
+ data[0 ]=0x94 ;
118
+ data[1 ]=(20 << 3 );
119
+ i2c.write (8 << 1 , data, sizeof (data));
120
+ }
121
+ #endif
89
122
90
123
void power_init () {
124
+ #if defined TARGET_PORTENTA_H7_M7
91
125
portenta_power_init ();
92
- }
126
+ #elif defined TARGET_NICLA_VISION
127
+ nicla_vision_power_init ();
128
+ #else
129
+
130
+ #endif
131
+ }
Original file line number Diff line number Diff line change 21
21
22
22
void power_init ();
23
23
24
- #endif //__POWER_H
24
+ #endif //__POWER_H
You can’t perform that action at this time.
0 commit comments