1 #include <system_def.h>
6 #include "appl_utils.h"
13 fprintf(stderr, "Application abnormal termination\n");
15 /* stop clock pin driving FPGA to ensure failase state */
16 rpi_gpio_direction_output(4, 0);
19 /***********************************/
20 int main(int argc, char *argv[])
22 appl_setup_environment(argv[0]);
24 /* initialize 50 Mhz clock output on gpio 4 */
25 if (rpi_peripheral_registers_map() < 0) {
26 fprintf(stderr, "%s: rpi_peripheral_registers_map failed\n", argv[0]);
30 if (rpi_gpclk_setup(0, RPI_GPCLK_PLLD_500_MHZ, 10, 0) < 0) {
31 fprintf(stderr, "%s: rpi_gpclk_setup failed\n", argv[0]);
35 if (rpi_gpio_alt_fnc(4 /*gpio*/, 0/*alt_fnc*/) < 0) {
36 fprintf(stderr, "%s: rpi_gpio_alt_fnc failed\n", argv[0]);