File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed
Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -20,11 +20,16 @@ package body RP.PWM is
2020 Initialized := True;
2121 end Initialize ;
2222
23+ function To_PWM
24+ (Pin : RP.GPIO.GPIO_Pin)
25+ return PWM_Point
26+ is ((Slice => PWM_Slice (Shift_Right (UInt32 (Pin), 1 ) and 2#111# ),
27+ Channel => PWM_Channel'Val (UInt32 (Pin) and 1 )));
28+
2329 function To_PWM
2430 (GPIO : RP.GPIO.GPIO_Point)
2531 return PWM_Point
26- is ((Slice => PWM_Slice (Shift_Right (UInt32 (GPIO.Pin), 1 ) and 2#111# ),
27- Channel => PWM_Channel'Val (UInt32 (GPIO.Pin) and 1 )));
32+ is (To_PWM (GPIO.Pin));
2833
2934 procedure Enable
3035 (Slice : PWM_Slice)
Original file line number Diff line number Diff line change 5050 (GPIO : RP.GPIO.GPIO_Point)
5151 return PWM_Point;
5252
53+ function To_PWM
54+ (Pin : RP.GPIO.GPIO_Pin)
55+ return PWM_Point;
56+
5357 procedure Set_Mode
5458 (Slice : PWM_Slice;
5559 Mode : PWM_Divider_Mode)
Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ with HAL; use HAL;
1212
1313package body I2CM_Tests is
1414
15- I2CM0_SDA : aliased RP.GPIO.GPIO_Point := (Pin => 0 );
16- I2CM0_SCL : aliased RP.GPIO.GPIO_Point := (Pin => 1 );
15+ I2CM0_SDA : constant RP.GPIO.GPIO_Point := (Pin => 0 );
16+ I2CM0_SCL : constant RP.GPIO.GPIO_Point := (Pin => 1 );
1717 I2CM0 : RP.I2C_Master.I2C_Master_Port renames RP.Device.I2CM_0;
1818
1919 Target_Addr : constant I2C_Address := 2#1010_0000# ; -- 24FC64F with A0,A1,A2=GND
You can’t perform that action at this time.
0 commit comments