![]() |
piSmasher Configuration Libraries
piSmasher peripheral device configuration libraries
|
Clocking Wizard Userspace I/O Driver FreeBSD. More...
#include <sys/mman.h>#include <sys/time.h>#include <stdio.h>#include <stdlib.h>#include <stdint.h>#include <stdbool.h>#include <string.h>#include <unistd.h>#include <fcntl.h>#include "clk_wiz.h"Data Structures | |
| struct | clk_cfg |
Macros | |
| #define | ERR_MODE_INVALID (0x0100U) |
| #define | ERR_NULL_PARAM (0x0101U) |
| #define | CWIZ_REG_SOFT_RESET (0x00000000U) |
| #define | CWIZ_REG_STATUS (0x00000004U) |
| #define | CWIZ_REG_MON_ERR (0x00000008U) |
| #define | CWIZ_REG_INT_STATUS (0x0000000CU) |
| #define | CWIZ_REG_INT_ENABLE (0x00000010U) |
| #define | CWIZ_REG_CLK_CONFIG (0x00000200U) |
| #define | CWIZ_REG_CLK_FBPHASE (0x00000204U) |
| #define | CWIZ_REG_CLKOUT0_DIVIDE (0x00000208U) |
| #define | CWIZ_REG_CLKOUT0_PHASE (0x0000020CU) |
| #define | CWIZ_REG_CLKOUT0_DUTY (0x00000210U) |
| #define | CWIZ_REG_CONFIG_LOAD (0x0000025CU) |
| #define | SOFT_RESET_VAL (0x0000000AU) |
| #define | STATUS_LOCKED (1 << 0) |
| #define | DIVCLK_DIVIDE_MASK (0x000000FFU) |
| #define | CLKFBOUT_MULT_MASK (0x0000FF00U) |
| #define | CLKFBOUT_FRAC_MASK (0x03FF0000U) |
| #define | CLKOUT_DIVIDE_MASK (0x000000FFU) |
| #define | CLKOUT_FRAC_SHIFT (8) |
| #define | CLKOUT_FRAC_MASK (0x0003FF00U) |
| #define | CONFIG_LOAD_SEN (1 << 0) |
| #define | CONFIG_SADDR (1 << 1) |
| #define | REG_READ(__BASE__, __OFFSET__) *((volatile uint32_t *)(((uint8_t *)(__BASE__)) + (__OFFSET__))) |
| #define | REG_WRITE(__BASE__, __OFFSET__, __DATA__) *((volatile uint32_t *)(((uint8_t *)(__BASE__)) + (__OFFSET__))) = (__DATA__) |
Functions | |
| int | clk_wiz_config (struct clk_wiz_dev *dev, enum clk_wiz_mode mode) |
| int | clk_wiz_init (struct clk_wiz_dev *dev, const char *devname) |
| Video Timing Controller Initialization. | |
Clocking Wizard Userspace I/O Driver FreeBSD.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project.
| #define CLKFBOUT_FRAC_MASK (0x03FF0000U) |
Multiplier fractional value
| #define CLKFBOUT_MULT_MASK (0x0000FF00U) |
Multiplier integer value
| #define CLKOUT_DIVIDE_MASK (0x000000FFU) |
Clock out integer divide value
| #define CLKOUT_FRAC_MASK (0x0003FF00U) |
Clock out fractional divide value
| #define CWIZ_REG_CLK_CONFIG (0x00000200U) |
Clock configuration
| #define CWIZ_REG_CLK_FBPHASE (0x00000204U) |
Clock phase
| #define CWIZ_REG_CLKOUT0_DIVIDE (0x00000208U) |
Clock out 0 divide
| #define CWIZ_REG_CLKOUT0_DUTY (0x00000210U) |
Clock out 0 duty cycle
| #define CWIZ_REG_CLKOUT0_PHASE (0x0000020CU) |
Clock out 0 phase
| #define CWIZ_REG_CONFIG_LOAD (0x0000025CU) |
Clock configuration register 23
| #define CWIZ_REG_INT_ENABLE (0x00000010U) |
Interrupt enable
| #define CWIZ_REG_INT_STATUS (0x0000000CU) |
Interrupt status
| #define CWIZ_REG_MON_ERR (0x00000008U) |
Clock monitor error status
| #define CWIZ_REG_SOFT_RESET (0x00000000U) |
Software reset
| #define CWIZ_REG_STATUS (0x00000004U) |
Status
| #define DIVCLK_DIVIDE_MASK (0x000000FFU) |
Divide value for all output clocks
| #define SOFT_RESET_VAL (0x0000000AU) |
Software reset value
| #define STATUS_LOCKED (1 << 0) |
MMCM/PLL locked status