Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

boards/common/nrf52: fix timer config #18948

Merged
merged 2 commits into from
Nov 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions boards/common/nrf52/include/cfg_timer_default.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ extern "C" {
static const timer_conf_t timer_config[] = {
{
.dev = NRF_TIMER1,
.channels = 4,
.channels = 3,
.bitmode = TIMER_BITMODE_BITMODE_32Bit,
.irqn = TIMER1_IRQn
},
Expand All @@ -50,7 +50,7 @@ static const timer_conf_t timer_config[] = {
* networking)!
*/
.dev = NRF_TIMER2,
.channels = 4,
.channels = 3,
.bitmode = TIMER_BITMODE_BITMODE_32Bit,
.irqn = TIMER2_IRQn
},
Expand All @@ -60,15 +60,15 @@ static const timer_conf_t timer_config[] = {
#ifdef NRF_TIMER3
{
.dev = NRF_TIMER3,
.channels = 6,
.channels = 5,
.bitmode = TIMER_BITMODE_BITMODE_32Bit,
.irqn = TIMER3_IRQn
},
#endif
#ifdef NRF_TIMER4
{
.dev = NRF_TIMER4,
.channels = 6,
.channels = 5,
.bitmode = TIMER_BITMODE_BITMODE_32Bit,
.irqn = TIMER4_IRQn
}
Expand Down
9 changes: 8 additions & 1 deletion cpu/nrf5x_common/include/periph_cpu_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,14 @@ typedef enum {
*/
typedef struct {
NRF_TIMER_Type *dev; /**< timer device */
uint8_t channels; /**< number of channels available */
/**
* @brief number of hardware channels ***minus one***
*
* The last hardware channels is implicitly used by timer_read() and not
* available to the user. This value, hence, is the number of channels
* available to the user.
*/
uint8_t channels;
uint8_t bitmode; /**< counter width */
uint8_t irqn; /**< IRQ number of the timer device */
} timer_conf_t;
Expand Down