Skip to content

Commit

Permalink
Merge pull request #7252 from haukepetersen/opt_due_periphconf
Browse files Browse the repository at this point in the history
boards/arduino-due: style cleanup in periph_conf.h
  • Loading branch information
miri64 committed Jun 27, 2017
2 parents b0aaf8d + 9136de6 commit 8d819ae
Showing 1 changed file with 50 additions and 16 deletions.
66 changes: 50 additions & 16 deletions boards/arduino-due/include/periph_conf.h
Expand Up @@ -28,7 +28,7 @@ extern "C" {
#endif

/**
* @name Clock configuration
* @name Clock configuration
* @{
*/
/* targeted system core clock */
Expand All @@ -48,13 +48,12 @@ extern "C" {
/** @} */

/**
* @name Timer peripheral configuration
* @name Timer peripheral configuration
* @{
*/
static const timer_conf_t timer_config[] = {
/* dev, channel 0 ID */
{ TC0, ID_TC0 },
{ TC1, ID_TC3 },
{ .dev = TC0, .id_ch0 = ID_TC0 },
{ .dev = TC1, .id_ch0 = ID_TC3 }
};

#define TIMER_0_ISR isr_tc0
Expand All @@ -64,15 +63,50 @@ static const timer_conf_t timer_config[] = {
/** @} */

/**
* @name UART configuration
* @name UART configuration
* @{
*/
static const uart_conf_t uart_config[] = {
/* device, rx port, tx port, rx pin, tx pin, mux, PMC bit, IRGn line */
{(Uart *)UART, PIOA, PIOA, 8, 9, GPIO_MUX_A, ID_UART, UART_IRQn},
{(Uart *)USART0, PIOA, PIOA, 10, 11, GPIO_MUX_A, ID_USART0, USART0_IRQn},
{(Uart *)USART1, PIOA, PIOA, 12, 13, GPIO_MUX_A, ID_USART1, USART1_IRQn},
{(Uart *)USART3, PIOD, PIOD, 4, 5, GPIO_MUX_B, ID_USART3, USART3_IRQn}
{
.dev = (Uart *)UART,
.rx_port = PIOA,
.tx_port = PIOA,
.rx_pin = 8,
.tx_pin = 9,
.mux = GPIO_MUX_A,
.pmc_id = ID_UART,
.irqn = UART_IRQn
},
{
.dev = (Uart *)USART0,
.rx_port = PIOA,
.tx_port = PIOA,
.rx_pin = 10,
.tx_pin = 11,
.mux = GPIO_MUX_A,
.pmc_id = ID_USART0,
.irqn = USART0_IRQn
},
{
.dev = (Uart *)USART1,
.rx_port = PIOA,
.tx_port = PIOA,
.rx_pin = 12,
.tx_pin = 13,
.mux = GPIO_MUX_A,
.pmc_id = ID_USART1,
.irqn = USART1_IRQn
},
{
.dev = (Uart *)USART3,
.rx_port = PIOD,
.tx_port = PIOD,
.rx_pin = 4,
.tx_pin = 5,
.mux = GPIO_MUX_B,
.pmc_id = ID_USART3,
.irqn = USART3_IRQn
},
};

/* define interrupt vectors */
Expand All @@ -85,7 +119,7 @@ static const uart_conf_t uart_config[] = {
/** @} */

/**
* @name SPI configuration
* @name SPI configuration
* @{
*/
static const spi_conf_t spi_config[] = {
Expand All @@ -107,10 +141,10 @@ static const spi_conf_t spi_config[] = {
* @{
*/
static const pwm_chan_conf_t pwm_chan[] = {
{ .pin = GPIO_PIN(PC, 21), .hwchan = 4, },
{ .pin = GPIO_PIN(PC, 22), .hwchan = 5, },
{ .pin = GPIO_PIN(PC, 23), .hwchan = 6, },
{ .pin = GPIO_PIN(PC, 24), .hwchan = 7, }
{ .pin = GPIO_PIN(PC, 21), .hwchan = 4 },
{ .pin = GPIO_PIN(PC, 22), .hwchan = 5 },
{ .pin = GPIO_PIN(PC, 23), .hwchan = 6 },
{ .pin = GPIO_PIN(PC, 24), .hwchan = 7 }
};

#define PWM_NUMOF (1U)
Expand Down

0 comments on commit 8d819ae

Please sign in to comment.