Skip to content

Instantly share code, notes, and snippets.

let tag:NSData = ("com.prototechnical.Crytter.keys.user" as NSString).dataUsingEncoding(NSUTF8StringEncoding)!
let parameters: [String: AnyObject] = [
kSecAttrKeyType: kSecAttrKeyTypeRSA,
kSecAttrKeySizeInBits: 2048,
kSecAttrIsPermanent: true,
kSecAttrApplicationTag: tag
]
println(parameters as NSDictionary)
let tag = ("foobar" as NSString).dataUsingEncoding(NSUTF8StringEncoding)
let parameters: [String: AnyObject] = [
kSecAttrKeyType: kSecAttrKeyTypeRSA,
kSecAttrKeySizeInBits: 2048,
kSecAttrIsPermanent: true,
kSecAttrApplicationTag: tag
]
let parameters: [String: AnyObject] = [
kSecAttrKeyType: kSecAttrKeyTypeRSA,
kSecAttrKeySizeInBits: 2048,
kSecAttrIsPermanent: true,
kSecAttrApplicationTag: "foobar"
]
var publicKeyPtr, privateKeyPtr: Unmanaged<SecKey>?
let result = SecKeyGeneratePair(parameters, &publicKeyPtr, &privateKeyPtr)
IOBUF #(
.DRIVE(12), // Specify the output drive strength
.IBUF_DELAY_VALUE("0"), // Specify the amount of added input delay for the buffer, "0"-"16" (Spartan-3A only)
.IFD_DELAY_VALUE("AUTO"), // Specify the amount of added delay for input register, "AUTO", "0"-"8" (Spartan-3A only)
.IOSTANDARD("DEFAULT"), // Specify the I/O standard
.SLEW("SLOW") // Specify the output slew rate
) IOBUF_gpmc_ad[15:0] (
.O(gpmc_ad_in), // Buffer output
.IO(GPMC_AD), // Buffer inout port (connect directly to top-level port)
.I(gpmc_ad_out), // Buffer input
fragment@0 {
target = <&am33xx_pinmux>;
__overlay__ {
bb_gpmc_pins: pinmux_bb_gpmc_pins {
pinctrl-single,pins = <
/* clock */
0x08C 0x30 /* gpmc_clk, INPUT_PULLUP | MODE0 */
/* address/data muxed bus */
fragment@0 {
target = <&am33xx_pinmux>;
__overlay__ {
bb_gpmc_pins: pinmux_bb_gpmc_pins {
pinctrl-single,pins = <
0x000 0x20 /* gpmc_ad0, INPUT_PULLDOWN | MODE0 */
0x004 0x20 /* gpmc_ad1, INPUT_PULLDOWN | MODE0 */
0x008 0x20 /* gpmc_ad2, INPUT_PULLDOWN | MODE0 */
0x00c 0x20 /* gpmc_ad3, INPUT_PULLDOWN | MODE0 */
0x010 0x20 /* gpmc_ad4, INPUT_PULLDOWN | MODE0 */
@ianmcmahon
ianmcmahon / gist:5737796
Created June 9, 2013 05:55
CORRECTED SPI0_SPIDEV dts.
/*
* Copyright (C) 2013 Ian McMahon <[email protected]>
*
* Virtual cape enabling SPIDEV on SPI0 on connector pins P9.22 P9.21 P9.18 P9.17
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
/dts-v1/;
loadrt trivkins
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
loadrt hostmot2
loadrt hm2_pci config="num_stepgens=5 num_encoders=0"
addf hm2_5i25.0.read servo-thread
addf hm2_5i25.0.write servo-thread
addf motion-command-handler servo-thread
U-Boot 2013.04-rc1-14237-g90639fe-dirty (Apr 13 2013 - 13:57:11)
I2C: ready
DRAM: 512 MiB
WARNING: Caches not enabled
NAND: No NAND device found!!!
0 MiB
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
*** Warning - readenv() failed, using default environment
U-Boot 2013.04-rc1-14237-g90639fe-dirty (Apr 13 2013 - 13:57:11)
I2C: ready
DRAM: 512 MiB
WARNING: Caches not enabled
NAND: No NAND device found!!!
0 MiB
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
*** Warning - readenv() failed, using default environment