Skip to content

Commit

Permalink
Merge pull request #18948 from maribu/boards/common/nrf52
Browse files Browse the repository at this point in the history
boards/common/nrf52: fix timer config
  • Loading branch information
maribu authored Nov 23, 2022
2 parents 97bc825 + b533fcf commit 232c70b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
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

0 comments on commit 232c70b

Please sign in to comment.