File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ int main(void)
7575 return 0 ;
7676}
7777
78- static void producer_func (void * unused1 , void * unused2 , void * unused3 )
78+ static void producer_func (void * unused1 , void * uPnused2 , void * unused3 )
7979{
8080 ARG_UNUSED (unused1 );
8181 ARG_UNUSED (unused2 );
Original file line number Diff line number Diff line change @@ -25,7 +25,8 @@ LOG_MODULE_REGISTER(Lesson4_Exercise1, LOG_LEVEL_INF);
2525int main (void )
2626{
2727 int err ;
28-
28+ LOG_INF ("Lesson 4 Exercise 1 started" );
29+
2930 /* STEP 3.3 - Check if the device is ready */
3031
3132
Original file line number Diff line number Diff line change 2020&pinctrl {
2121 pwm20_custom: pwm20_custom {
2222 group1 {
23- psels = <NRF_PSEL(PWM_OUT0, 1, 10)>;
23+ psels = <NRF_PSEL(PWM_OUT0, 1, 10)>,
24+ <NRF_PSEL(PWM_OUT1, 1, 11)>;
2425 nordic,invert;
2526 };
2627 };
2728
2829 pwm20_csleep: pwm20_csleep {
2930 group1 {
30- psels = <NRF_PSEL(PWM_OUT0, 1, 10)>;
31+ psels = <NRF_PSEL(PWM_OUT0, 1, 10)>
32+ <NRF_PSEL(PWM_OUT1, 1, 11)>;
3133 low-power-enable;
3234 };
3335 };
3436};
3537
36- /* NOTE: STEP 5 (servo on pwm21) is not supported on nRF54LS05 - pwm21 is not available */
38+ /* STEP 5.2 - Add the servo device */
39+ / {
40+ servo: servo {
41+ compatible = "pwm-servo";
42+ pwms = <&pwm20 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
43+ min-pulse = <PWM_USEC(1000)>;
44+ max-pulse = <PWM_USEC(2000)>;
45+ };
46+ };
Original file line number Diff line number Diff line change 1212
1313/* STEP 3.1 - Declare the struct to hold the configuration for the SAADC channel used to sample the battery voltage */
1414#if NRF_SAADC_HAS_AIN_AS_PIN
15- #if defined(CONFIG_SOC_NRF54L15 ) || defined(CONFIG_SOC_NRF54LM20A )
15+ #if defined(CONFIG_SOC_NRF54L15 ) || defined(CONFIG_SOC_NRF54LM20A ) || defined( CONFIG_SOC_NRF54LS05A ) || defined( CONFIG_SOC_NRF54LS05B )
1616#define SAADC_INPUT_PIN NRFX_ANALOG_EXTERNAL_AIN4
1717#else
1818BUILD_ASSERT (0 , "Unsupported device family" );
@@ -47,7 +47,7 @@ void battery_sample_timer_handler(struct k_timer *timer)
4747
4848 /* STEP 7.3 - Calculate and print voltage */
4949
50- #if defined(CONFIG_SOC_NRF54L15 ) || defined(CONFIG_SOC_NRF54LM20A )
50+ #if defined(CONFIG_SOC_NRF54L15 ) || defined(CONFIG_SOC_NRF54LM20A ) || defined( CONFIG_SOC_NRF54LS05A ) || defined( CONFIG_SOC_NRF54LS05B )
5151 int battery_voltage = ((900 * 4 ) * sample ) / ((1 <<12 ));
5252#else
5353 int battery_voltage = ((600 * 6 ) * sample ) / ((1 <<12 ));
@@ -74,7 +74,7 @@ static void configure_saadc(void)
7474 }
7575
7676 /* STEP 5.3 - Configure the SAADC channel */
77- #if defined(CONFIG_SOC_NRF54L15 ) || defined(CONFIG_SOC_NRF54LM20A )
77+ #if defined(CONFIG_SOC_NRF54L15 ) || defined(CONFIG_SOC_NRF54LM20A ) || defined( CONFIG_SOC_NRF54LS05A ) || defined( CONFIG_SOC_NRF54LS05B )
7878 channel .channel_config .gain = NRF_SAADC_GAIN1_4 ;
7979#else
8080 channel .channel_config .gain = NRF_SAADC_GAIN1_6 ;
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ LOG_MODULE_REGISTER(Lesson6_Exercise3, LOG_LEVEL_DBG);
2222
2323/* STEP 4.6 - Declare the struct to hold the configuration for the SAADC channel used to sample the battery voltage */
2424#if NRF_SAADC_HAS_AIN_AS_PIN
25- #if defined(CONFIG_SOC_NRF54L15 ) || defined(CONFIG_SOC_NRF54LM20A )
25+ #if defined(CONFIG_SOC_NRF54L15 ) || defined(CONFIG_SOC_NRF54LM20A ) || defined( CONFIG_SOC_NRF54LS05A ) || defined( CONFIG_SOC_NRF54LS05B )
2626#define SAADC_INPUT_PIN NRFX_ANALOG_EXTERNAL_AIN4
2727#else
2828BUILD_ASSERT (0 , "Unsupported device family" );
@@ -35,7 +35,7 @@ static nrfx_saadc_channel_t channel = NRFX_SAADC_DEFAULT_CHANNEL_SE(SAADC_INPUT_
3535
3636
3737/* STEP 3.2 - Declaring an instance of nrfx_timer for TIMER2. */
38- #if defined(CONFIG_SOC_NRF54L15 ) || defined(CONFIG_SOC_NRF54LM20A )
38+ #if defined(CONFIG_SOC_NRF54L15 ) || defined(CONFIG_SOC_NRF54LM20A ) || defined( CONFIG_SOC_NRF54LS05A ) || defined( CONFIG_SOC_NRF54LS05B )
3939#define TIMER_INSTANCE_NUMBER NRF_TIMER22
4040#else
4141#define TIMER_INSTANCE_NUMBER NRF_TIMER2
@@ -133,7 +133,7 @@ static void configure_saadc(void)
133133 }
134134
135135 /* STEP 4.7 - Change gain config in default config and apply channel configuration */
136- #if defined(CONFIG_SOC_NRF54L15 ) || defined(CONFIG_SOC_NRF54LM20A )
136+ #if defined(CONFIG_SOC_NRF54L15 ) || defined(CONFIG_SOC_NRF54LM20A ) || defined( CONFIG_SOC_NRF54LS05A ) || defined( CONFIG_SOC_NRF54LS05B )
137137 channel .channel_config .gain = NRF_SAADC_GAIN1_4 ;
138138#else
139139 channel .channel_config .gain = NRF_SAADC_GAIN1_6 ;
Original file line number Diff line number Diff line change @@ -24,15 +24,13 @@ tests:
2424 - nrf7002dk/nrf5340/cpuapp
2525 - nrf7002dk/nrf5340/cpuapp/ns
2626 - nrf54l15dk/nrf54l15/cpuapp
27- - nrf54ls05dk/nrf54ls05b/cpuapp
2827 - nrf54l15dk/nrf54l15/cpuapp/ns
2928 - nrf54lm20dk/nrf54lm20a/cpuapp
3029 platform_allow :
3130 - nrf9160dk/nrf9160/ns
3231 - nrf7002dk/nrf5340/cpuapp
3332 - nrf7002dk/nrf5340/cpuapp/ns
3433 - nrf54l15dk/nrf54l15/cpuapp
35- - nrf54ls05dk/nrf54ls05b/cpuapp
3634 - nrf54l15dk/nrf54l15/cpuapp/ns
3735 - nrf54lm20dk/nrf54lm20a/cpuapp
3836 extra_dtc_overlay_files :
You can’t perform that action at this time.
0 commit comments