mirror of
git://projects.qi-hardware.com/ben-blinkenlights.git
synced 2025-04-21 12:27:27 +03:00
libubb/mmcclk.c: helper functions for selecting and configuring the MMC bus clock
Experimental.
This commit is contained in:
36
libubb/include/ubb/mmcclk.h
Normal file
36
libubb/include/ubb/mmcclk.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* include/ubb/mmcclk.h - Calculate MMC bus clock speed
|
||||
*
|
||||
* Written 2013 by Werner Almesberger
|
||||
* Copyright 2013 Werner Almesberger
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*/
|
||||
|
||||
#ifndef UBB_MMCCLK_H
|
||||
#define UBB_MMCCLK_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
#define BEN_SYS_CLK_HZ 336000000
|
||||
|
||||
|
||||
struct mmcclk {
|
||||
int sys_clk_hz; /* system clock speed in Hz */
|
||||
double bus_clk_hz; /* MMC bus clock in Hz */
|
||||
uint32_t clkdiv; /* MSC controller clock */
|
||||
uint32_t clkrt; /* bus clock divider */
|
||||
};
|
||||
|
||||
|
||||
void mmcclk_first(struct mmcclk *dsc, int sys_clk_hz);
|
||||
int mmcclk_next(struct mmcclk *dsc);
|
||||
|
||||
void mmcclk_start(struct mmcclk *dsc);
|
||||
void mmcclk_stop(void);
|
||||
|
||||
#endif /* !UBB_MMCCLK_H */
|
||||
Reference in New Issue
Block a user