mb525: Fix coding-style and comments.
This commit is contained in:
parent
905badef24
commit
793bd23851
@ -6,5 +6,5 @@ This is a blink example program using libopencm3.
|
|||||||
|
|
||||||
It's intended for the ST STM32-based MB525 eval board (see
|
It's intended for the ST STM32-based MB525 eval board (see
|
||||||
http://www.st.com/stonline/products/literature/um/13472.htm for details).
|
http://www.st.com/stonline/products/literature/um/13472.htm for details).
|
||||||
It should blink the LED on the board.
|
It should blink the LEDs on the board.
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ void clock_setup(void)
|
|||||||
|
|
||||||
void gpio_setup(void)
|
void gpio_setup(void)
|
||||||
{
|
{
|
||||||
/* Set GPIO6 (in GPIO port C) to 'output push-pull'. */
|
/* Set GPIO6/7/8/9 (in GPIO port C) to 'output push-pull'. */
|
||||||
gpio_set_mode(GPIOC, GPIO_MODE_OUTPUT_50_MHZ,
|
gpio_set_mode(GPIOC, GPIO_MODE_OUTPUT_50_MHZ,
|
||||||
GPIO_CNF_OUTPUT_PUSHPULL, GPIO6 | GPIO7 | GPIO8 | GPIO9);
|
GPIO_CNF_OUTPUT_PUSHPULL, GPIO6 | GPIO7 | GPIO8 | GPIO9);
|
||||||
}
|
}
|
||||||
@ -43,7 +43,7 @@ int main(void)
|
|||||||
clock_setup();
|
clock_setup();
|
||||||
gpio_setup();
|
gpio_setup();
|
||||||
|
|
||||||
/* Blink the LED (PC12) on the board. */
|
/* Blink the LEDs on the board. */
|
||||||
gpio_set(GPIOC, GPIO6);
|
gpio_set(GPIOC, GPIO6);
|
||||||
while (1) {
|
while (1) {
|
||||||
gpio_toggle(GPIOC, GPIO6); /* LED on/off */
|
gpio_toggle(GPIOC, GPIO6); /* LED on/off */
|
||||||
|
@ -6,5 +6,4 @@ This is a PWM based LED fading example using libopencm3.
|
|||||||
|
|
||||||
It's intended for the ST STM32-based MB525 eval board (see
|
It's intended for the ST STM32-based MB525 eval board (see
|
||||||
http://www.st.com/stonline/products/literature/um/13472.htm for details).
|
http://www.st.com/stonline/products/literature/um/13472.htm for details).
|
||||||
It should blink the LED on the board.
|
|
||||||
|
|
||||||
|
@ -156,7 +156,7 @@ static const u16 gamma_table_2_2[] = {
|
|||||||
49275, 49761, 50249, 50739, 51232, 51728, 52226, 52727,
|
49275, 49761, 50249, 50739, 51232, 51728, 52226, 52727,
|
||||||
53230, 53736, 54245, 54756, 55270, 55787, 56306, 56828,
|
53230, 53736, 54245, 54756, 55270, 55787, 56306, 56828,
|
||||||
57352, 57879, 58409, 58941, 59476, 60014, 60554, 61097,
|
57352, 57879, 58409, 58941, 59476, 60014, 60554, 61097,
|
||||||
61642, 62190, 62741, 63295, 63851, 64410, 64971, 65535
|
61642, 62190, 62741, 63295, 63851, 64410, 64971, 65535,
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -251,17 +251,16 @@ void clock_setup(void)
|
|||||||
void gpio_setup(void)
|
void gpio_setup(void)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Set GPIO6 (in GPIO port C) to
|
* Set GPIO_TIM1_CH1/2/3/4 (in GPIO port A) to
|
||||||
* 'output alternate function push-pull'.
|
* 'output alternate function push-pull'.
|
||||||
*/
|
*/
|
||||||
gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_50_MHZ,
|
gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_50_MHZ,
|
||||||
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL,
|
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL,
|
||||||
GPIO_TIM1_CH1 |
|
GPIO_TIM1_CH1 | GPIO_TIM1_CH2 |
|
||||||
GPIO_TIM1_CH2 |
|
GPIO_TIM1_CH3 | GPIO_TIM1_CH4);
|
||||||
GPIO_TIM1_CH3 |
|
|
||||||
GPIO_TIM1_CH4);
|
|
||||||
|
|
||||||
/* Remap TIM1:
|
/*
|
||||||
|
* Remap TIM1:
|
||||||
* CH1 -> PC6
|
* CH1 -> PC6
|
||||||
* CH2 -> PC7
|
* CH2 -> PC7
|
||||||
* CH3 -> PC8
|
* CH3 -> PC8
|
||||||
@ -269,11 +268,13 @@ void gpio_setup(void)
|
|||||||
*/
|
*/
|
||||||
// AFIO_MAPR |= AFIO_MAPR_TIM3_REMAP_FULL_REMAP;
|
// AFIO_MAPR |= AFIO_MAPR_TIM3_REMAP_FULL_REMAP;
|
||||||
}
|
}
|
||||||
|
|
||||||
void tim_setup(void)
|
void tim_setup(void)
|
||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
TIM1_CR1 = TIM_CR1_CMS_CENTER_1 | TIM_CR1_ARPE;
|
TIM1_CR1 = TIM_CR1_CMS_CENTER_1 | TIM_CR1_ARPE;
|
||||||
TIM1_CCMR1 = TIM_CCMR1_OC1M_PWM1 | TIM_CCMR1_OC1PE | TIM_CCMR1_OC2M_PWM1 | TIM_CCMR1_OC2PE;
|
TIM1_CCMR1 = TIM_CCMR1_OC1M_PWM1 | TIM_CCMR1_OC1PE |
|
||||||
|
TIM_CCMR1_OC2M_PWM1 | TIM_CCMR1_OC2PE;
|
||||||
TIM1_CCMR2 = TIM_CCMR2_OC3M_PWM1 | TIM_CCMR2_OC3PE;
|
TIM1_CCMR2 = TIM_CCMR2_OC3M_PWM1 | TIM_CCMR2_OC3PE;
|
||||||
|
|
||||||
TIM1_CCER &= ~TIM_CCER_CC1P;
|
TIM1_CCER &= ~TIM_CCER_CC1P;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user