1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #18948 from maribu/boards/common/nrf52

boards/common/nrf52: fix timer config
This commit is contained in:
Marian Buschsieweke 2022-11-23 10:47:26 +01:00 committed by GitHub
commit 232c70ba53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 5 deletions

View File

@ -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
},
@ -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
},
@ -60,7 +60,7 @@ 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
},
@ -68,7 +68,7 @@ static const timer_conf_t timer_config[] = {
#ifdef NRF_TIMER4
{
.dev = NRF_TIMER4,
.channels = 6,
.channels = 5,
.bitmode = TIMER_BITMODE_BITMODE_32Bit,
.irqn = TIMER4_IRQn
}

View File

@ -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;