#include <stdint.h>
Macros | |
| #define | PERIPH_BASE 0x40000000 |
| #define | AHB1PERIPH_BASE (PERIPH_BASE + 0x00020000) |
| #define | APB1PERIPH_BASE (PERIPH_BASE + 0x00000000) |
| #define | RCC_BASE (AHB1PERIPH_BASE + 0x3800) |
| #define | GPIOA_BASE (AHB1PERIPH_BASE + 0x0000) |
| #define | TIM2_BASE (APB1PERIPH_BASE + 0x0000) |
| #define | RCC_AHB1ENR (*(volatile unsigned int *)(RCC_BASE + 0x30)) |
| #define | RCC_APB1ENR (*(volatile unsigned int *)(RCC_BASE + 0x40)) |
| #define | GPIOA_MODER (*(volatile unsigned int *)(GPIOA_BASE + 0x00)) |
| #define | GPIOA_AFRL (*(volatile unsigned int *)(GPIOA_BASE + 0x20)) |
| #define | TIM2_PSC (*(volatile unsigned int *)(TIM2_BASE + 0x28)) |
| #define | TIM2_ARR (*(volatile unsigned int *)(TIM2_BASE + 0x2C)) |
| #define | TIM2_CCR1 (*(volatile unsigned int *)(TIM2_BASE + 0x34)) |
| #define | TIM2_CCMR1 (*(volatile unsigned int *)(TIM2_BASE + 0x18)) |
| #define | TIM2_CCER (*(volatile unsigned int *)(TIM2_BASE + 0x20)) |
| #define | TIM2_CR1 (*(volatile unsigned int *)(TIM2_BASE + 0x00)) |
Functions | |
| void | pwm_pa5_init (uint32_t frequency, float duty_cycle_percent) |
| void | delay () |
| int | main (void) |
| #define AHB1PERIPH_BASE (PERIPH_BASE + 0x00020000) |
| #define APB1PERIPH_BASE (PERIPH_BASE + 0x00000000) |
| #define GPIOA_AFRL (*(volatile unsigned int *)(GPIOA_BASE + 0x20)) |
| #define GPIOA_BASE (AHB1PERIPH_BASE + 0x0000) |
| #define GPIOA_MODER (*(volatile unsigned int *)(GPIOA_BASE + 0x00)) |
| #define PERIPH_BASE 0x40000000 |
| #define RCC_AHB1ENR (*(volatile unsigned int *)(RCC_BASE + 0x30)) |
| #define RCC_APB1ENR (*(volatile unsigned int *)(RCC_BASE + 0x40)) |
| #define RCC_BASE (AHB1PERIPH_BASE + 0x3800) |
| #define TIM2_ARR (*(volatile unsigned int *)(TIM2_BASE + 0x2C)) |
| #define TIM2_BASE (APB1PERIPH_BASE + 0x0000) |
| #define TIM2_CCER (*(volatile unsigned int *)(TIM2_BASE + 0x20)) |
| #define TIM2_CCMR1 (*(volatile unsigned int *)(TIM2_BASE + 0x18)) |
| #define TIM2_CCR1 (*(volatile unsigned int *)(TIM2_BASE + 0x34)) |
| #define TIM2_CR1 (*(volatile unsigned int *)(TIM2_BASE + 0x00)) |
| #define TIM2_PSC (*(volatile unsigned int *)(TIM2_BASE + 0x28)) |
| void delay | ( | void | ) |
| int main | ( | void | ) |
| void pwm_pa5_init | ( | uint32_t | frequency, |
| float | duty_cycle_percent ) |