Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/stmicro/stm32/src/stm32f1xx/advanced_adc.zig
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ fn adc_to_temp(val: usize) f32 {

pub fn main() !void {
_ = try rcc.apply(.{
.ADCPresc = .RCC_ADCPCLK2_DIV2,
.ADCPresc = .Div2,
.flags = .{
.USE_ADC1 = true,
},
Expand Down
10 changes: 5 additions & 5 deletions examples/stmicro/stm32/src/stm32f1xx/gpio.zig
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ const time = stm32.time;

pub fn main() !void {
_ = try rcc.apply(.{
.SYSCLKSource = .RCC_SYSCLKSOURCE_PLLCLK,
.PLLSource = .RCC_PLLSOURCE_HSE,
.PLLMUL = .RCC_PLL_MUL9,
.APB1CLKDivider = .RCC_HCLK_DIV2,
.RTCClockSelection = .RCC_RTCCLKSOURCE_LSI,
.SYSCLKSource = .PLL1_P,
.PLLSourceVirtual = .HSE_Div_PREDIV,
.PLLMUL = .Mul9,
.APB1CLKDivider = .Div2,
.RTCClockSelection = .LSI,
.flags = .{
.RTCUsed_ForRCC = true,
.HSEOscillator = true,
Expand Down
12 changes: 6 additions & 6 deletions examples/stmicro/stm32/src/stm32f1xx/rcc.zig
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ pub const microzig_options = microzig.Options{
};

const clk_config = rcc.Config{
.PLLSource = .RCC_PLLSOURCE_HSE,
.HSEDivPLL = .RCC_HSE_PREDIV_DIV1,
.PLLMUL = .RCC_PLL_MUL2,
.SYSCLKSource = .RCC_SYSCLKSOURCE_PLLCLK,
.APB1CLKDivider = .RCC_HCLK_DIV2,
.RCC_MCOSource = .RCC_MCO1SOURCE_SYSCLK,
.PLLSourceVirtual = .HSE_Div_PREDIV,
.HSEDivPLL = .Div2,
.PLLMUL = .Mul2,
.SYSCLKSource = .PLL1_P,
.APB1CLKDivider = .Div2,
.RCC_MCOSource = .SYS,
.flags = .{
.HSEOscillator = true,
.MCOUsed_ForRCC = true,
Expand Down
2 changes: 1 addition & 1 deletion examples/stmicro/stm32/src/stm32f1xx/rtc.zig
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub fn main() !void {
//If it is not running, we will configure it and enable it.
if (fresh_start()) {
_ = try rcc.apply(.{
.RTCClockSelection = .RCC_RTCCLKSOURCE_LSE,
.RTCClockSelection = .LSI,
.flags = .{ .RTCUsed_ForRCC = true, .LSEOscillator = true },
});
rcc.enable_clock(.PWR);
Expand Down
2 changes: 1 addition & 1 deletion examples/stmicro/stm32/src/stm32f1xx/timer.zig
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub fn main() !void {

//use HSE as system clock source, more stable than HSI
_ = try rcc.apply(.{
.SYSCLKSource = .RCC_SYSCLKSOURCE_HSE,
.SYSCLKSource = .HSE,
.flags = .{ .HSEOscillator = true },
});

Expand Down
2 changes: 1 addition & 1 deletion examples/stmicro/stm32/src/stm32f1xx/timer_capture.zig
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ pub fn main() !void {

//use HSE as system clock source, more stable than HSI
_ = try rcc.apply(.{
.SYSCLKSource = .RCC_SYSCLKSOURCE_HSE,
.SYSCLKSource = .HSE,
.flags = .{ .HSEOscillator = true },
});

Expand Down
10 changes: 5 additions & 5 deletions examples/stmicro/stm32/src/stm32f1xx/usb_cdc.zig
Original file line number Diff line number Diff line change
Expand Up @@ -413,11 +413,11 @@ fn CDC_read(buf: []u8, timeout: ?Duration) ![]const u8 {

pub fn main() !void {
_ = try rcc.apply(.{
.PLLSource = .RCC_PLLSOURCE_HSE,
.PLLMUL = .RCC_PLL_MUL9,
.SYSCLKSource = .RCC_SYSCLKSOURCE_PLLCLK,
.APB1CLKDivider = .RCC_HCLK_DIV2,
.USBPrescaler = .RCC_USBCLKSOURCE_PLL_DIV1_5,
.PLLSourceVirtual = .HSE_Div_PREDIV,
.PLLMUL = .Mul9,
.SYSCLKSource = .PLL1_P,
.APB1CLKDivider = .Div2,
.USBPrescaler = .Div1_5,
.flags = .{
.HSEOscillator = true,
.USBUsed_ForRCC = true,
Expand Down
15 changes: 9 additions & 6 deletions examples/stmicro/stm32/src/stm32f1xx/usb_hid.zig
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,15 @@ fn report(keys: []const u8) void {

pub fn main() !void {
_ = try rcc.apply(.{
.PLLSource = .RCC_PLLSOURCE_HSE,
.PLLMUL = .RCC_PLL_MUL9,
.SYSCLKSource = .RCC_SYSCLKSOURCE_PLLCLK,
.APB1CLKDivider = .RCC_HCLK_DIV2,
.USBPrescaler = .RCC_USBCLKSOURCE_PLL_DIV1_5,
.flags = .{ .HSEOscillator = true, .USBUsed_ForRCC = true },
.PLLSourceVirtual = .HSE_Div_PREDIV,
.PLLMUL = .Mul9,
.SYSCLKSource = .PLL1_P,
.APB1CLKDivider = .Div2,
.USBPrescaler = .Div1_5,
.flags = .{
.HSEOscillator = true,
.USBUsed_ForRCC = true,
},
});

rcc.enable_clock(.GPIOA);
Expand Down
Loading
Loading