mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
add bulk response chaining
IN descriptors now chain up to 512 bytes long OUT descriptors still need to be worked up However, there is an issue where the system is injecting the ZLP/CSW immediately after the bulk response is queued up, and this is getting sent before the bulk data is issued. Need to figure out this race condition.
This commit is contained in:
parent
10e605569f
commit
3d826ffbbe
14 changed files with 161 additions and 6067 deletions
|
|
@ -1,14 +1,39 @@
|
|||
pub struct BlockDevice{}
|
||||
use xous::MemoryRange;
|
||||
|
||||
pub struct BlockDevice{
|
||||
backing: MemoryRange,
|
||||
}
|
||||
impl BlockDevice {
|
||||
pub fn new() -> Self {
|
||||
let mut backing = xous::syscall::map_memory(
|
||||
None,
|
||||
None,
|
||||
256 * 1024,
|
||||
xous::MemoryFlags::R | xous::MemoryFlags::W,
|
||||
).unwrap();
|
||||
let backing_slice: &mut [u32] = backing.as_slice_mut();
|
||||
for (index, d) in backing_slice.iter_mut().enumerate() {
|
||||
*d = index as u32;
|
||||
}
|
||||
BlockDevice { backing }
|
||||
}
|
||||
}
|
||||
|
||||
impl usbd_scsi::BlockDevice for BlockDevice {
|
||||
const BLOCK_BYTES: usize = 512;
|
||||
|
||||
fn read_block(&self, lba: u32, block: &mut [u8]) -> Result<(), usbd_scsi::BlockDeviceError> {
|
||||
Err(usbd_scsi::BlockDeviceError::HardwareError)
|
||||
let backing_slice: &[u8] = self.backing.as_slice();
|
||||
block.copy_from_slice(
|
||||
&backing_slice[lba as usize * Self::BLOCK_BYTES..(lba as usize + 1) * Self::BLOCK_BYTES]
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn write_block(&mut self, lba: u32, block: &[u8]) -> Result<(), usbd_scsi::BlockDeviceError> {
|
||||
Err(usbd_scsi::BlockDeviceError::WriteError)
|
||||
let backing_slice: &mut [u8] = self.backing.as_slice_mut();
|
||||
backing_slice[lba as usize * Self::BLOCK_BYTES..(lba as usize + 1) * Self::BLOCK_BYTES].copy_from_slice(block);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn max_lba(&self) -> u32 {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ use usb_device::{class_prelude::*, Result, UsbDirection};
|
|||
use std::collections::BTreeMap;
|
||||
use std::convert::TryInto;
|
||||
|
||||
const WRITE_TIMEOUT_MS: u64 = 1000;
|
||||
const WRITE_TIMEOUT_MS: u64 = 10_000;
|
||||
|
||||
fn handle_usb(_irq_no: usize, arg: *mut usize) {
|
||||
let usb = unsafe { &mut *(arg as *mut SpinalUsbDevice) };
|
||||
|
|
@ -168,8 +168,8 @@ impl SpinalUsbMgmt {
|
|||
|
||||
struct AllocView {
|
||||
// tracks which endpoints have been allocated. ep0 is special. parameter is the maximum size buffer available.
|
||||
// parameter is (address, len)
|
||||
ep_allocs: [Option<(usize, usize)>; 16],
|
||||
// parameter is (address, len, chain_len); chain_len is the maximum number of `len`-length packets that could be chained
|
||||
ep_allocs: [Option<(usize, usize, usize)>; 16],
|
||||
// record a copy of the ep0 IN setup descriptor address - could extract from ep_allocs[0], but it's here for legacy reasons
|
||||
ep0in_head: u32,
|
||||
// structure to track space allocations within the memory space
|
||||
|
|
@ -359,6 +359,27 @@ impl SpinalUsbDevice {
|
|||
) as *mut u32}
|
||||
)
|
||||
}
|
||||
/// overhead of a spinal descriptor in bytes
|
||||
pub(crate) fn descriptor_overhead_bytes(&self) -> usize { 12 }
|
||||
/// create a descriptor from the head address + chain offset
|
||||
pub(crate) fn descriptor_from_head_and_chain(&self, head_offset: usize, chain_offset: usize, packet_len: usize) -> SpinalUdcDescriptor {
|
||||
SpinalUdcDescriptor::new(
|
||||
unsafe{ self.usb.as_mut_ptr().add(
|
||||
head_offset * 16
|
||||
// in the case that packet_len is exactly a multiple of 16 plus 4 bytes, it will waste 16 bytes: a 20-byte packet could fit in 32 bytes, but we ask for 48 instead
|
||||
// if changed, this also needs to be updated in alloc_ep()
|
||||
+ (((packet_len + self.descriptor_overhead_bytes()) / 16) + 1) * 16 * chain_offset
|
||||
) as *mut u32}
|
||||
)
|
||||
}
|
||||
/// compute the *next* address offset for the *current* chain and packet length. Field is pre-shifted so
|
||||
/// this is directly passed to `set_next_desc_and_len()`
|
||||
pub(crate) fn next_from_head_and_chain(&self, head_offset: usize, chain_offset: usize, packet_len: usize) -> usize {
|
||||
head_offset * 16
|
||||
// in the case that packet_len is exactly a multiple of 16 plus 4 bytes, it will waste 16 bytes: a 20-byte packet could fit in 32 bytes, but we ask for 48 instead
|
||||
// if changed, this also needs to be updated in alloc_ep()
|
||||
+ ((((packet_len + self.descriptor_overhead_bytes()) / 16) + 1) * 16 * (chain_offset + 1)) >> 4
|
||||
}
|
||||
/// A dedicated, fixed descriptor that represents EP0 acting as the 0-length OUT to accept the acknowledgement
|
||||
/// of IN data write complete. The location of this is at the very top of descriptor space.
|
||||
pub(crate) fn descriptor_ep0_out(&self) -> SpinalUdcDescriptor {
|
||||
|
|
@ -417,6 +438,7 @@ impl SpinalUsbDevice {
|
|||
}
|
||||
}
|
||||
|
||||
const CHAINED_BUF_LEN: usize = 512;
|
||||
impl UsbBus for SpinalUsbDevice {
|
||||
/// Allocates an endpoint and specified endpoint parameters. This method is called by the device
|
||||
/// and class implementations to allocate endpoints, and can only be called before
|
||||
|
|
@ -458,6 +480,15 @@ impl UsbBus for SpinalUsbDevice {
|
|||
}
|
||||
for index in ep_addr.map(|a| a.index()..a.index() + 1).unwrap_or(1..NUM_ENDPOINTS) {
|
||||
if self.view.ep_allocs[index].is_none() {
|
||||
let base_packet_size = max_packet_size;
|
||||
let max_packet_size = match ep_type {
|
||||
EndpointType::Bulk =>
|
||||
(CHAINED_BUF_LEN as u16 / base_packet_size)
|
||||
// in the case that packet_len is exactly a multiple of 16 plus 4 bytes, it will waste 16 bytes: a 20-byte packet could fit in 32 bytes, but we ask for 48 instead
|
||||
// if changed, this also needs to be updated in descriptor_from_status_and_chain()
|
||||
* (((base_packet_size + self.descriptor_overhead_bytes() as u16) / 16) + 1) * 16,
|
||||
_ => max_packet_size
|
||||
};
|
||||
// only if there is memory that can accommodate the max_packet_size
|
||||
if let Some(offset) = self.alloc_region(max_packet_size as _) {
|
||||
log::debug!("allocated offset {:x}({})", offset, max_packet_size);
|
||||
|
|
@ -519,7 +550,7 @@ impl UsbBus for SpinalUsbDevice {
|
|||
|
||||
// now commit the ep config
|
||||
self.status_write_volatile(index, ep_status);
|
||||
self.view.ep_allocs[index] = Some((offset as usize / 16, max_packet_size as usize));
|
||||
self.view.ep_allocs[index] = Some((offset as usize / 16, base_packet_size as usize, CHAINED_BUF_LEN / base_packet_size as usize));
|
||||
|
||||
core::sync::atomic::compiler_fence(core::sync::atomic::Ordering::SeqCst);
|
||||
log::info!("alloc ep{} type {:?} dir {:?}, @{:x}({})",
|
||||
|
|
@ -562,13 +593,13 @@ impl UsbBus for SpinalUsbDevice {
|
|||
self.address.store(0, Ordering::SeqCst);
|
||||
self.ep0_out_reset();
|
||||
for (index, &ep) in self.view.ep_allocs.iter().enumerate() {
|
||||
if let Some((head_offset, max_len)) = ep {
|
||||
if let Some((head_offset, packet_len, _max_chain)) = ep {
|
||||
if index == 0 {
|
||||
log::trace!("ep0 reset");
|
||||
// basically rewrite the whole EP0 setup from scratch.
|
||||
let mut ep0_status = self.status_read_volatile(0);
|
||||
ep0_status.set_head_offset(head_offset as u32);
|
||||
ep0_status.set_max_packet_size(max_len as u32);
|
||||
ep0_status.set_max_packet_size(packet_len as u32);
|
||||
let descriptor = self.descriptor_from_status(&ep0_status);
|
||||
ep0_status.set_head_offset(0); // reset the descriptor offset to 0, so the IN packet doesn't fire until prepared
|
||||
ep0_status.set_data_phase(true); // reset to data1
|
||||
|
|
@ -580,7 +611,7 @@ impl UsbBus for SpinalUsbDevice {
|
|||
} else {
|
||||
let mut ep_status = self.status_read_volatile(index);
|
||||
log::trace!("ep{} reset from {:?}", index, ep_status);
|
||||
ep_status.set_max_packet_size(max_len as u32);
|
||||
ep_status.set_max_packet_size(packet_len as u32);
|
||||
ep_status.set_head_offset(head_offset as u32);
|
||||
ep_status.set_data_phase(false); // reset to data0
|
||||
let descriptor = self.descriptor_from_status(&ep_status);
|
||||
|
|
@ -595,7 +626,7 @@ impl UsbBus for SpinalUsbDevice {
|
|||
if false {
|
||||
// Config confirmation for debug (change above to `true`)
|
||||
for (index, &ep) in self.view.ep_allocs.iter().enumerate() {
|
||||
if let Some((head_offset, _max_len)) = ep {
|
||||
if let Some((head_offset, _packet_len, _max_chain)) = ep {
|
||||
let mut ep_status = self.status_read_volatile(index);
|
||||
ep_status.set_head_offset(head_offset as u32);
|
||||
log::info!("ep{}_status: {:?}", index, ep_status);
|
||||
|
|
@ -638,19 +669,25 @@ impl UsbBus for SpinalUsbDevice {
|
|||
///
|
||||
/// Implementations may also return other errors if applicable.
|
||||
fn write(&self, ep_addr: EndpointAddress, buf: &[u8]) -> Result<usize> {
|
||||
if let Some((head_offset, max_len)) = self.view.ep_allocs[ep_addr.index()] {
|
||||
if buf.len() > max_len {
|
||||
if let Some((head_offset, packet_len, max_chain)) = self.view.ep_allocs[ep_addr.index()] {
|
||||
if buf.len() > max_chain * packet_len {
|
||||
Err(UsbError::BufferOverflow)
|
||||
} else {
|
||||
} else if buf.len() <= packet_len { // no-chain path
|
||||
#[cfg(feature="mjolnir")] // mjolnir is so powerful, one must halt the USB core entirely for it to be weilded
|
||||
if ep_addr.index() == 1 { self.udc_hard_halt(ep_addr.index()); }
|
||||
let mut ep_status = self.status_read_volatile(ep_addr.index());
|
||||
|
||||
if ep_addr.index() != 0 {
|
||||
let now = self.tt.elapsed_ms();
|
||||
let mut last_print = 10;
|
||||
while (self.tt.elapsed_ms() - now < WRITE_TIMEOUT_MS)
|
||||
&& ep_status.head_offset() != 0 {
|
||||
xous::yield_slice();
|
||||
let secs = (self.tt.elapsed_ms() - now) / 1_000;
|
||||
if secs != last_print {
|
||||
log::info!("write wait!");
|
||||
last_print = secs;
|
||||
}
|
||||
ep_status = self.status_read_volatile(ep_addr.index());
|
||||
}
|
||||
if ep_status.head_offset() != 0 {
|
||||
|
|
@ -695,7 +732,7 @@ impl UsbBus for SpinalUsbDevice {
|
|||
descriptor.write_data(buf.len() / 4, u32::from_le_bytes(remainder));
|
||||
}
|
||||
|
||||
ep_status.set_max_packet_size(max_len as _);
|
||||
ep_status.set_max_packet_size(packet_len as _);
|
||||
descriptor.set_next_desc_and_len(0, buf.len());
|
||||
if ep_addr.index() != 0 {
|
||||
descriptor.set_desc_flags(UsbDirection::In,
|
||||
|
|
@ -728,6 +765,59 @@ impl UsbBus for SpinalUsbDevice {
|
|||
// log::info!("WR POSTstatus{}: {:?}", ep_addr.index(), self.status_read_volatile(ep_addr.index()));
|
||||
//}
|
||||
Ok(buf.len())
|
||||
} else {
|
||||
let mut ep_status = self.status_read_volatile(ep_addr.index());
|
||||
|
||||
let now = self.tt.elapsed_ms();
|
||||
while (self.tt.elapsed_ms() - now < WRITE_TIMEOUT_MS)
|
||||
&& ep_status.head_offset() != 0 {
|
||||
xous::yield_slice();
|
||||
ep_status = self.status_read_volatile(ep_addr.index());
|
||||
}
|
||||
if ep_status.head_offset() != 0 {
|
||||
log::warn!("head offset is not 0 even after waiting");
|
||||
return Err(UsbError::WouldBlock);
|
||||
}
|
||||
|
||||
for (chain_offset, sub_buf) in buf.chunks(packet_len).enumerate() {
|
||||
let descriptor = self.descriptor_from_head_and_chain(head_offset, chain_offset, packet_len);
|
||||
descriptor.set_desc_flags(UsbDirection::In,
|
||||
false, true, false);
|
||||
for (index, src) in sub_buf.chunks_exact(4).enumerate() {
|
||||
let w = u32::from_le_bytes(src.try_into().unwrap());
|
||||
descriptor.write_data(index, w);
|
||||
}
|
||||
if sub_buf.len() % 4 != 0 { // handle the odd remainder case
|
||||
let mut remainder = [0u8; 4];
|
||||
for (index, &src) in sub_buf.chunks_exact(4).remainder().iter().enumerate() {
|
||||
remainder[index] = src;
|
||||
}
|
||||
descriptor.write_data(sub_buf.len() / 4, u32::from_le_bytes(remainder));
|
||||
}
|
||||
|
||||
if chain_offset == (max_chain - 1) || sub_buf.len() != packet_len {
|
||||
// on the very last packet (either by chain exhaustion, or buffer source exhaustion), set completion_on_full interrupt
|
||||
descriptor.set_next_desc_and_len(0, sub_buf.len());
|
||||
descriptor.set_desc_flags(UsbDirection::In,
|
||||
false, true, false);
|
||||
} else {
|
||||
// if not the last packet, setup the linked list pointer
|
||||
let next_addr = self.next_from_head_and_chain(head_offset, chain_offset, packet_len);
|
||||
descriptor.set_next_desc_and_len(next_addr, sub_buf.len());
|
||||
}
|
||||
descriptor.set_offset(0); // reset the write pointer to 0, also sets in_progress
|
||||
log::info!("bulk descriptor {} setup: {:x?}", chain_offset, descriptor);
|
||||
}
|
||||
|
||||
ep_status.set_max_packet_size(packet_len as _);
|
||||
// this is reset to 0 after every transaction by the hardware, so we must reset it
|
||||
ep_status.set_head_offset(head_offset as u32);
|
||||
|
||||
// this is required to commit the ep_status record once all the setup is done
|
||||
self.status_write_volatile(ep_addr.index(), ep_status);
|
||||
|
||||
core::sync::atomic::compiler_fence(core::sync::atomic::Ordering::SeqCst);
|
||||
Ok(buf.len())
|
||||
}
|
||||
} else {
|
||||
Err(UsbError::InvalidEndpoint)
|
||||
|
|
@ -754,7 +844,7 @@ impl UsbBus for SpinalUsbDevice {
|
|||
/// Implementations may also return other errors if applicable.
|
||||
fn read(&self, ep_addr: EndpointAddress, buf: &mut [u8]) -> Result<usize> {
|
||||
log::trace!("read ep{} into buf of len {}", ep_addr.index(), buf.len());
|
||||
if let Some((head_offset, max_len)) = self.view.ep_allocs[ep_addr.index()] {
|
||||
if let Some((head_offset, packet_len, max_chain)) = self.view.ep_allocs[ep_addr.index()] {
|
||||
if ep_addr.index() == 0 {
|
||||
if buf.len() == 0 {
|
||||
log::info!("STATUS dummy read");
|
||||
|
|
@ -851,7 +941,7 @@ impl UsbBus for SpinalUsbDevice {
|
|||
}
|
||||
|
||||
// setup for the next transaction
|
||||
ep_status.set_max_packet_size(max_len as _);
|
||||
ep_status.set_max_packet_size(packet_len as _);
|
||||
descriptor.set_next_desc_and_len(0, buf.len());
|
||||
descriptor.set_desc_flags(UsbDirection::Out,
|
||||
true, true, false);
|
||||
|
|
@ -980,7 +1070,7 @@ impl UsbBus for SpinalUsbDevice {
|
|||
// (but don't write it back, since we're not ready to send anything --
|
||||
// it will get written back on the next `write`)
|
||||
ep_status.set_head_offset(self.view.ep0in_head);
|
||||
} else if let Some((head_offset, _max_len)) = self.view.ep_allocs[bit] {
|
||||
} else if let Some((head_offset, _packet_len, _max_chain)) = self.view.ep_allocs[bit] {
|
||||
if ep_status.head_offset() != 0 {
|
||||
log::warn!("got INT on ep{} but head is not 0", bit);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ pub(crate) fn main_hw() -> ! {
|
|||
|
||||
let ums_alloc = UsbBusAllocator::new(ums_dev);
|
||||
|
||||
let bd = block_device::BlockDevice{};
|
||||
let bd = block_device::BlockDevice::new();
|
||||
|
||||
let mut ums = usbd_scsi::Scsi::new(
|
||||
&ums_alloc,
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ bitfield! {
|
|||
pub force_nack, set_force_nack: 2;
|
||||
// selects DATA0/DATA1; 0 => DATA0. Also set by the controller automatically
|
||||
pub data_phase, set_data_phase: 3;
|
||||
// specifies the offset of the endpoint's descriptor in RAM. 0 => empty, otherwise multply by 16 to get the address
|
||||
// specifies the offset of the endpoint's descriptor in RAM. 0 => empty, otherwise multiply by 16 to get the address
|
||||
pub head_offset, set_head_offset: 15, 4;
|
||||
pub isochronous, set_isochronous: 16;
|
||||
pub max_packet_size, set_max_packet_size: 31, 22;
|
||||
|
|
@ -318,7 +318,7 @@ impl SpinalUdcDescriptor {
|
|||
}
|
||||
impl fmt::Debug for SpinalUdcDescriptor {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "Desc({}){}: {} of {} -> 0x{:x} ({}{}{}) [{:x?},{:x?},..]",
|
||||
write!(f, "Desc({}){}: {} of {} -> 0x{:x} ({}{}{}) [{:x?},{:x?},..] @ {:x?}",
|
||||
if self.in_progress() {"<>"} else {"--"},
|
||||
match self.direction() {
|
||||
UsbDirection::In => "IN",
|
||||
|
|
@ -332,6 +332,7 @@ impl fmt::Debug for SpinalUdcDescriptor {
|
|||
if self.data1_on_completion() {"1"} else {"0"},
|
||||
self.read_data(0).to_le_bytes(),
|
||||
self.read_data(1).to_le_bytes(),
|
||||
self.base,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -188,6 +188,7 @@ impl<B: UsbBus> BulkOnlyTransport<'_, B> {
|
|||
}
|
||||
|
||||
pub fn read(&mut self) -> Result<(), Error> {
|
||||
log::info!("read state: {:?}", self.state);
|
||||
match self.state {
|
||||
State::WaitingForCommand => self.waiting_for_command(),
|
||||
State::ReceivingDataFromHost => self.receiving_data_from_host(),
|
||||
|
|
@ -196,6 +197,7 @@ impl<B: UsbBus> BulkOnlyTransport<'_, B> {
|
|||
}
|
||||
|
||||
pub fn write(&mut self) -> Result<(), Error> {
|
||||
log::info!("write state: {:?}", self.state);
|
||||
match self.state {
|
||||
State::SendingDataToHost => self.sending_data_to_host(),
|
||||
State::NeedZlp => self.send_zlp(),
|
||||
|
|
@ -381,7 +383,8 @@ impl<B: UsbBus> BulkOnlyTransport<'_, B> {
|
|||
}
|
||||
|
||||
fn flush(&mut self) -> Result<(), Error> {
|
||||
let packet_size = self.max_packet_size() as usize;
|
||||
// let packet_size = self.max_packet_size() as usize;
|
||||
let packet_size = 512; // TODO: link this to the buffer length constant if it the lower-level rework works
|
||||
let residue = self.command_status_wrapper.data_residue as usize;
|
||||
|
||||
let bytes = if self.data_i < self.buffer_i && residue > 0 {
|
||||
|
|
@ -474,7 +477,9 @@ impl<B: UsbBus> BulkOnlyTransport<'_, B> {
|
|||
if needs_zlp {
|
||||
trace_bot_zlp!("ZLP> required");
|
||||
self.change_state(State::NeedZlp);
|
||||
self.flush()?;
|
||||
self.send_zlp()?;
|
||||
self.flush()?;
|
||||
} else {
|
||||
trace_bot_zlp!("ZLP> not required");
|
||||
self.change_state(State::NeedToSendStatus);
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ pub use block_device::*;
|
|||
mod logging {
|
||||
pub use itm_logger::*;
|
||||
|
||||
/*
|
||||
#[cfg(feature = "trace-scsi-command")]
|
||||
pub use itm_logger::trace as trace_scsi_command;
|
||||
#[cfg(not(feature = "trace-scsi-command"))]
|
||||
|
|
@ -18,4 +19,8 @@ mod logging {
|
|||
pub use itm_logger::trace as trace_scsi_fs;
|
||||
#[cfg(not(feature = "trace-scsi-fs"))]
|
||||
pub use itm_logger::stub as trace_scsi_fs;
|
||||
*/
|
||||
|
||||
pub use log::info as trace_scsi_fs;
|
||||
pub use log::info as trace_scsi_command;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -279,9 +279,21 @@ impl<B: UsbBus, BD: BlockDevice> Scsi<'_, B, BD> {
|
|||
// Reset sense code to good
|
||||
self.request_sense_response.reset_status();
|
||||
},
|
||||
Ok(CommandState::Ongoing) => {
|
||||
log::info!("transfer_state: {:?}", self.inner.transfer_state());
|
||||
/*
|
||||
match self.inner.transfer_state() {
|
||||
TransferState::ReceivingDataFromHost { bytes_available: _, full: _, done: _ } => {
|
||||
self.inner.read()?;
|
||||
}
|
||||
TransferState::SendingDataToHost { bytes_remaining: _, empty: _ } => {
|
||||
self.inner.write()?;
|
||||
}
|
||||
_ => {}
|
||||
} */
|
||||
}
|
||||
// WouldBlock error is handled the same as ongoing (i.e. do nothing)
|
||||
Ok(CommandState::None) |
|
||||
Ok(CommandState::Ongoing) |
|
||||
Err(Error::BulkOnlyTransportError(
|
||||
BulkOnlyTransportError::UsbError(
|
||||
UsbError::WouldBlock))) => {
|
||||
|
|
|
|||
|
|
@ -1,28 +0,0 @@
|
|||
# For PCBs designed using KiCad: http://www.kicad-pcb.org/
|
||||
# Format documentation: http://kicad-pcb.org/help/file-formats/
|
||||
|
||||
# Temporary files
|
||||
*.000
|
||||
*.bak
|
||||
*.bck
|
||||
*.kicad_pcb-bak
|
||||
*.sch-bak
|
||||
*~
|
||||
_autosave-*
|
||||
*.tmp
|
||||
*-save.pro
|
||||
*-save.kicad_pcb
|
||||
fp-info-cache
|
||||
|
||||
# Netlist files (exported from Eeschema)
|
||||
*.net
|
||||
|
||||
# Autorouter files (exported from Pcbnew)
|
||||
*.dsn
|
||||
*.ses
|
||||
|
||||
# Exported BOM files
|
||||
*.xml
|
||||
*.csv
|
||||
|
||||
custom.dcm
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
(fp_lib_table
|
||||
(lib (name Custom)(type KiCad)(uri ${KIPRJMOD}/../kicad_custom/Custom.pretty)(options "")(descr ""))
|
||||
)
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
(sym_lib_table
|
||||
(lib (name custom)(type Legacy)(uri ${KIPRJMOD}/../kicad_custom/custom.lib)(options "")(descr ""))
|
||||
)
|
||||
|
|
@ -1,536 +0,0 @@
|
|||
EESchema-LIBRARY Version 2.4
|
||||
#encoding utf-8
|
||||
#
|
||||
# Connector_Generic_Conn_01x02
|
||||
#
|
||||
DEF Connector_Generic_Conn_01x02 J 0 40 Y N 1 F N
|
||||
F0 "J" 0 100 50 H V C CNN
|
||||
F1 "Connector_Generic_Conn_01x02" 0 -200 50 H V C CNN
|
||||
F2 "" 0 0 50 H I C CNN
|
||||
F3 "" 0 0 50 H I C CNN
|
||||
$FPLIST
|
||||
Connector*:*_1x??_*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
S -50 -95 0 -105 1 1 6 N
|
||||
S -50 5 0 -5 1 1 6 N
|
||||
S -50 50 50 -150 1 1 10 f
|
||||
X Pin_1 1 -200 0 150 R 50 50 1 1 P
|
||||
X Pin_2 2 -200 -100 150 R 50 50 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# Connector_Generic_Conn_01x12
|
||||
#
|
||||
DEF Connector_Generic_Conn_01x12 J 0 40 Y N 1 F N
|
||||
F0 "J" 0 600 50 H V C CNN
|
||||
F1 "Connector_Generic_Conn_01x12" 0 -700 50 H V C CNN
|
||||
F2 "" 0 0 50 H I C CNN
|
||||
F3 "" 0 0 50 H I C CNN
|
||||
$FPLIST
|
||||
Connector*:*_1x??_*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
S -50 -595 0 -605 1 1 6 N
|
||||
S -50 -495 0 -505 1 1 6 N
|
||||
S -50 -395 0 -405 1 1 6 N
|
||||
S -50 -295 0 -305 1 1 6 N
|
||||
S -50 -195 0 -205 1 1 6 N
|
||||
S -50 -95 0 -105 1 1 6 N
|
||||
S -50 5 0 -5 1 1 6 N
|
||||
S -50 105 0 95 1 1 6 N
|
||||
S -50 205 0 195 1 1 6 N
|
||||
S -50 305 0 295 1 1 6 N
|
||||
S -50 405 0 395 1 1 6 N
|
||||
S -50 505 0 495 1 1 6 N
|
||||
S -50 550 50 -650 1 1 10 f
|
||||
X Pin_1 1 -200 500 150 R 50 50 1 1 P
|
||||
X Pin_10 10 -200 -400 150 R 50 50 1 1 P
|
||||
X Pin_11 11 -200 -500 150 R 50 50 1 1 P
|
||||
X Pin_12 12 -200 -600 150 R 50 50 1 1 P
|
||||
X Pin_2 2 -200 400 150 R 50 50 1 1 P
|
||||
X Pin_3 3 -200 300 150 R 50 50 1 1 P
|
||||
X Pin_4 4 -200 200 150 R 50 50 1 1 P
|
||||
X Pin_5 5 -200 100 150 R 50 50 1 1 P
|
||||
X Pin_6 6 -200 0 150 R 50 50 1 1 P
|
||||
X Pin_7 7 -200 -100 150 R 50 50 1 1 P
|
||||
X Pin_8 8 -200 -200 150 R 50 50 1 1 P
|
||||
X Pin_9 9 -200 -300 150 R 50 50 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# Connector_USB_B_Micro
|
||||
#
|
||||
DEF Connector_USB_B_Micro J 0 40 Y Y 1 F N
|
||||
F0 "J" -200 450 50 H V L CNN
|
||||
F1 "Connector_USB_B_Micro" -200 350 50 H V L CNN
|
||||
F2 "" 150 -50 50 H I C CNN
|
||||
F3 "" 150 -50 50 H I C CNN
|
||||
ALIAS USB_B_Mini
|
||||
$FPLIST
|
||||
USB*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
C -150 85 25 0 1 10 F
|
||||
C -25 135 15 0 1 10 F
|
||||
S -200 -300 200 300 0 1 10 f
|
||||
S -5 -300 5 -270 0 1 0 N
|
||||
S 10 50 -20 20 0 1 10 F
|
||||
S 200 -205 170 -195 0 1 0 N
|
||||
S 200 -105 170 -95 0 1 0 N
|
||||
S 200 -5 170 5 0 1 0 N
|
||||
S 200 195 170 205 0 1 0 N
|
||||
P 2 0 1 10 -75 85 25 85 N
|
||||
P 4 0 1 10 -125 85 -100 85 -50 135 -25 135 N
|
||||
P 4 0 1 10 -100 85 -75 85 -50 35 0 35 N
|
||||
P 4 0 1 10 25 110 25 60 75 85 25 110 F
|
||||
P 5 0 1 0 -170 220 -70 220 -80 190 -160 190 -170 220 F
|
||||
P 9 0 1 0 -185 230 -185 220 -175 190 -175 180 -65 180 -65 190 -55 220 -55 230 -185 230 N
|
||||
X VBUS 1 300 200 100 L 50 50 1 1 w
|
||||
X D- 2 300 -100 100 L 50 50 1 1 P
|
||||
X D+ 3 300 0 100 L 50 50 1 1 P
|
||||
X ID 4 300 -200 100 L 50 50 1 1 P
|
||||
X GND 5 0 -400 100 U 50 50 1 1 w
|
||||
X Shield 6 -100 -400 100 U 50 50 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# Device_C
|
||||
#
|
||||
DEF Device_C C 0 10 N Y 1 F N
|
||||
F0 "C" 25 100 50 H V L CNN
|
||||
F1 "Device_C" 25 -100 50 H V L CNN
|
||||
F2 "" 38 -150 50 H I C CNN
|
||||
F3 "" 0 0 50 H I C CNN
|
||||
$FPLIST
|
||||
C_*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
P 2 0 1 20 -80 -30 80 -30 N
|
||||
P 2 0 1 20 -80 30 80 30 N
|
||||
X ~ 1 0 150 110 D 50 50 1 1 P
|
||||
X ~ 2 0 -150 110 U 50 50 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# Device_Crystal
|
||||
#
|
||||
DEF Device_Crystal Y 0 40 N N 1 F N
|
||||
F0 "Y" 0 150 50 H V C CNN
|
||||
F1 "Device_Crystal" 0 -150 50 H V C CNN
|
||||
F2 "" 0 0 50 H I C CNN
|
||||
F3 "" 0 0 50 H I C CNN
|
||||
$FPLIST
|
||||
Crystal*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
S -45 100 45 -100 0 1 12 N
|
||||
P 2 0 1 0 -100 0 -75 0 N
|
||||
P 2 0 1 20 -75 -50 -75 50 N
|
||||
P 2 0 1 20 75 -50 75 50 N
|
||||
P 2 0 1 0 100 0 75 0 N
|
||||
X 1 1 -150 0 50 R 50 50 1 1 P
|
||||
X 2 2 150 0 50 L 50 50 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# Device_D_ALT
|
||||
#
|
||||
DEF Device_D_ALT D 0 40 N N 1 F N
|
||||
F0 "D" 0 100 50 H V C CNN
|
||||
F1 "Device_D_ALT" 0 -100 50 H V C CNN
|
||||
F2 "" 0 0 50 H I C CNN
|
||||
F3 "" 0 0 50 H I C CNN
|
||||
$FPLIST
|
||||
TO-???*
|
||||
*_Diode_*
|
||||
*SingleDiode*
|
||||
D_*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
P 2 0 1 8 -50 50 -50 -50 N
|
||||
P 2 0 1 0 50 0 -50 0 N
|
||||
P 4 0 1 8 50 50 50 -50 -50 0 50 50 F
|
||||
X K 1 -150 0 100 R 50 50 1 1 P
|
||||
X A 2 150 0 100 L 50 50 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# Device_Ferrite_Bead
|
||||
#
|
||||
DEF Device_Ferrite_Bead FB 0 0 N Y 1 F N
|
||||
F0 "FB" -150 25 50 V V C CNN
|
||||
F1 "Device_Ferrite_Bead" 150 0 50 V V C CNN
|
||||
F2 "" -70 0 50 V I C CNN
|
||||
F3 "" 0 0 50 H I C CNN
|
||||
$FPLIST
|
||||
Inductor_*
|
||||
L_*
|
||||
*Ferrite*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
P 2 0 1 0 0 -50 0 -48 N
|
||||
P 2 0 1 0 0 50 0 51 N
|
||||
P 5 0 1 0 -109 16 -67 89 109 -12 66 -85 -109 16 N
|
||||
X ~ 1 0 150 100 D 50 50 1 1 P
|
||||
X ~ 2 0 -150 100 U 50 50 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# Device_LED_ALT
|
||||
#
|
||||
DEF Device_LED_ALT D 0 40 N N 1 F N
|
||||
F0 "D" 0 100 50 H V C CNN
|
||||
F1 "Device_LED_ALT" 0 -100 50 H V C CNN
|
||||
F2 "" 0 0 50 H I C CNN
|
||||
F3 "" 0 0 50 H I C CNN
|
||||
$FPLIST
|
||||
LED*
|
||||
LED_SMD:*
|
||||
LED_THT:*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
P 2 0 1 8 -50 -50 -50 50 N
|
||||
P 2 0 1 0 -50 0 50 0 N
|
||||
P 4 0 1 8 50 -50 50 50 -50 0 50 -50 F
|
||||
P 5 0 1 0 -120 -30 -180 -90 -150 -90 -180 -90 -180 -60 N
|
||||
P 5 0 1 0 -70 -30 -130 -90 -100 -90 -130 -90 -130 -60 N
|
||||
X K 1 -150 0 100 R 50 50 1 1 P
|
||||
X A 2 150 0 100 L 50 50 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# Device_R
|
||||
#
|
||||
DEF Device_R R 0 0 N Y 1 F N
|
||||
F0 "R" 80 0 50 V V C CNN
|
||||
F1 "Device_R" 0 0 50 V V C CNN
|
||||
F2 "" -70 0 50 V I C CNN
|
||||
F3 "" 0 0 50 H I C CNN
|
||||
$FPLIST
|
||||
R_*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
S -40 -100 40 100 0 1 10 N
|
||||
X ~ 1 0 150 50 D 50 50 1 1 P
|
||||
X ~ 2 0 -150 50 U 50 50 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# Interface_USB_FT231XS
|
||||
#
|
||||
DEF Interface_USB_FT231XS U 0 20 Y Y 1 F N
|
||||
F0 "U" -550 800 50 H V L CNN
|
||||
F1 "Interface_USB_FT231XS" 300 800 50 H V L CNN
|
||||
F2 "Package_SO:SSOP-20_3.9x8.7mm_P0.635mm" 1000 -800 50 H I C CNN
|
||||
F3 "" 0 0 50 H I C CNN
|
||||
$FPLIST
|
||||
*SSOP*3.9x8.7mm*P0.635mm*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
S -550 750 550 -750 0 1 10 f
|
||||
X ~DTR 1 700 200 150 L 50 50 1 1 O
|
||||
X CBUS2 10 700 -500 150 L 50 50 1 1 B
|
||||
X USBDP 11 -700 200 150 R 50 50 1 1 B
|
||||
X USBDM 12 -700 300 150 R 50 50 1 1 B
|
||||
X 3V3OUT 13 -700 600 150 R 50 50 1 1 w
|
||||
X ~RESET 14 -700 0 150 R 50 50 1 1 I
|
||||
X VCC 15 -100 900 150 D 50 50 1 1 W
|
||||
X GND 16 100 -900 150 U 50 50 1 1 W
|
||||
X CBUS1 17 700 -400 150 L 50 50 1 1 B
|
||||
X CBUS0 18 700 -300 150 L 50 50 1 1 B
|
||||
X CBUS3 19 700 -600 150 L 50 50 1 1 B
|
||||
X ~RTS 2 700 400 150 L 50 50 1 1 O
|
||||
X TXD 20 700 600 150 L 50 50 1 1 O
|
||||
X VCCIO 3 100 900 150 D 50 50 1 1 W
|
||||
X RXD 4 700 500 150 L 50 50 1 1 I
|
||||
X ~RI 5 700 -100 150 L 50 50 1 1 I
|
||||
X GND 6 -100 -900 150 U 50 50 1 1 W
|
||||
X ~DSR 7 700 100 150 L 50 50 1 1 I
|
||||
X ~DCD 8 700 0 150 L 50 50 1 1 I
|
||||
X ~CTS 9 700 300 150 L 50 50 1 1 I
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# MCU_ST_STM32F1_STM32F103RCTx
|
||||
#
|
||||
DEF MCU_ST_STM32F1_STM32F103RCTx U 0 20 Y Y 1 F N
|
||||
F0 "U" -600 1750 50 H V L CNN
|
||||
F1 "MCU_ST_STM32F1_STM32F103RCTx" 400 1750 50 H V L CNN
|
||||
F2 "Package_QFP:LQFP-64_10x10mm_P0.5mm" -600 -1700 50 H I R CNN
|
||||
F3 "" 0 0 50 H I C CNN
|
||||
ALIAS STM32F103RDTx STM32F103RETx
|
||||
$FPLIST
|
||||
LQFP*10x10mm*P0.5mm*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
S -600 -1700 600 1700 0 1 10 f
|
||||
X VBAT 1 -200 1800 100 D 50 50 1 1 W
|
||||
X PC2 10 -700 -300 100 R 50 50 1 1 B
|
||||
X PC3 11 -700 -400 100 R 50 50 1 1 B
|
||||
X VSSA 12 200 -1800 100 U 50 50 1 1 W
|
||||
X VDDA 13 300 1800 100 D 50 50 1 1 W
|
||||
X PA0 14 700 1600 100 L 50 50 1 1 B
|
||||
X PA1 15 700 1500 100 L 50 50 1 1 B
|
||||
X PA2 16 700 1400 100 L 50 50 1 1 B
|
||||
X PA3 17 700 1300 100 L 50 50 1 1 B
|
||||
X VSS 18 -200 -1800 100 U 50 50 1 1 W
|
||||
X VDD 19 -100 1800 100 D 50 50 1 1 W
|
||||
X PC13 2 -700 -1400 100 R 50 50 1 1 B
|
||||
X PA4 20 700 1200 100 L 50 50 1 1 B
|
||||
X PA5 21 700 1100 100 L 50 50 1 1 B
|
||||
X PA6 22 700 1000 100 L 50 50 1 1 B
|
||||
X PA7 23 700 900 100 L 50 50 1 1 B
|
||||
X PC4 24 -700 -500 100 R 50 50 1 1 B
|
||||
X PC5 25 -700 -600 100 R 50 50 1 1 B
|
||||
X PB0 26 700 -100 100 L 50 50 1 1 B
|
||||
X PB1 27 700 -200 100 L 50 50 1 1 B
|
||||
X PB2 28 700 -300 100 L 50 50 1 1 B
|
||||
X PB10 29 700 -1100 100 L 50 50 1 1 B
|
||||
X PC14 3 -700 -1500 100 R 50 50 1 1 B
|
||||
X PB11 30 700 -1200 100 L 50 50 1 1 B
|
||||
X VSS 31 -100 -1800 100 U 50 50 1 1 W
|
||||
X VDD 32 0 1800 100 D 50 50 1 1 W
|
||||
X PB12 33 700 -1300 100 L 50 50 1 1 B
|
||||
X PB13 34 700 -1400 100 L 50 50 1 1 B
|
||||
X PB14 35 700 -1500 100 L 50 50 1 1 B
|
||||
X PB15 36 700 -1600 100 L 50 50 1 1 B
|
||||
X PC6 37 -700 -700 100 R 50 50 1 1 B
|
||||
X PC7 38 -700 -800 100 R 50 50 1 1 B
|
||||
X PC8 39 -700 -900 100 R 50 50 1 1 B
|
||||
X PC15 4 -700 -1600 100 R 50 50 1 1 B
|
||||
X PC9 40 -700 -1000 100 R 50 50 1 1 B
|
||||
X PA8 41 700 800 100 L 50 50 1 1 B
|
||||
X PA9 42 700 700 100 L 50 50 1 1 B
|
||||
X PA10 43 700 600 100 L 50 50 1 1 B
|
||||
X PA11 44 700 500 100 L 50 50 1 1 B
|
||||
X PA12 45 700 400 100 L 50 50 1 1 B
|
||||
X PA13 46 700 300 100 L 50 50 1 1 B
|
||||
X VSS 47 0 -1800 100 U 50 50 1 1 W
|
||||
X VDD 48 100 1800 100 D 50 50 1 1 W
|
||||
X PA14 49 700 200 100 L 50 50 1 1 B
|
||||
X PD0 5 -700 300 100 R 50 50 1 1 I
|
||||
X PA15 50 700 100 100 L 50 50 1 1 B
|
||||
X PC10 51 -700 -1100 100 R 50 50 1 1 B
|
||||
X PC11 52 -700 -1200 100 R 50 50 1 1 B
|
||||
X PC12 53 -700 -1300 100 R 50 50 1 1 B
|
||||
X PD2 54 -700 100 100 R 50 50 1 1 B
|
||||
X PB3 55 700 -400 100 L 50 50 1 1 B
|
||||
X PB4 56 700 -500 100 L 50 50 1 1 B
|
||||
X PB5 57 700 -600 100 L 50 50 1 1 B
|
||||
X PB6 58 700 -700 100 L 50 50 1 1 B
|
||||
X PB7 59 700 -800 100 L 50 50 1 1 B
|
||||
X PD1 6 -700 200 100 R 50 50 1 1 I
|
||||
X BOOT0 60 -700 1400 100 R 50 50 1 1 I
|
||||
X PB8 61 700 -900 100 L 50 50 1 1 B
|
||||
X PB9 62 700 -1000 100 L 50 50 1 1 B
|
||||
X VSS 63 100 -1800 100 U 50 50 1 1 W
|
||||
X VDD 64 200 1800 100 D 50 50 1 1 W
|
||||
X NRST 7 -700 1600 100 R 50 50 1 1 I
|
||||
X PC0 8 -700 -100 100 R 50 50 1 1 B
|
||||
X PC1 9 -700 -200 100 R 50 50 1 1 B
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# Mechanical_MountingHole
|
||||
#
|
||||
DEF Mechanical_MountingHole H 0 40 Y Y 1 F N
|
||||
F0 "H" 0 200 50 H V C CNN
|
||||
F1 "Mechanical_MountingHole" 0 125 50 H V C CNN
|
||||
F2 "" 0 0 50 H I C CNN
|
||||
F3 "" 0 0 50 H I C CNN
|
||||
$FPLIST
|
||||
MountingHole*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
C 0 0 50 0 1 50 N
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# Power_Protection_USBLC6-2SC6
|
||||
#
|
||||
DEF Power_Protection_USBLC6-2SC6 U 0 0 Y Y 1 F N
|
||||
F0 "U" 200 350 50 H V C CNN
|
||||
F1 "Power_Protection_USBLC6-2SC6" 400 -400 50 H V C CNN
|
||||
F2 "Package_TO_SOT_SMD:SOT-23-6" -750 400 50 H I C CNN
|
||||
F3 "" 200 350 50 H I C CNN
|
||||
$FPLIST
|
||||
SOT?23*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
C -200 0 10 0 1 0 F
|
||||
C -100 0 10 0 1 0 F
|
||||
C 0 -250 10 0 1 0 F
|
||||
C 0 250 10 0 1 0 F
|
||||
C 100 0 10 0 1 0 F
|
||||
C 200 0 10 0 1 0 F
|
||||
S -300 -300 300 300 0 1 10 f
|
||||
S -100 250 100 -250 0 1 0 N
|
||||
P 2 0 1 0 -200 -100 -300 -100 N
|
||||
P 2 0 1 0 -200 0 -200 -100 N
|
||||
P 2 0 1 0 -200 100 -300 100 N
|
||||
P 2 0 1 0 -60 -110 -140 -110 N
|
||||
P 2 0 1 0 -60 190 -140 190 N
|
||||
P 2 0 1 0 0 -300 0 -250 N
|
||||
P 2 0 1 0 0 -250 0 50 N
|
||||
P 2 0 1 0 0 50 0 250 N
|
||||
P 2 0 1 0 0 250 0 300 N
|
||||
P 2 0 1 0 60 -110 140 -110 N
|
||||
P 2 0 1 0 60 190 140 190 N
|
||||
P 2 0 1 0 200 -100 300 -100 N
|
||||
P 2 0 1 0 200 0 200 -100 N
|
||||
P 2 0 1 0 200 100 300 100 N
|
||||
P 3 0 1 0 -100 0 -200 0 -200 100 N
|
||||
P 3 0 1 0 100 0 200 0 200 100 N
|
||||
P 4 0 1 0 -140 -190 -60 -190 -100 -110 -140 -190 N
|
||||
P 4 0 1 0 -140 110 -60 110 -100 190 -140 110 N
|
||||
P 4 0 1 0 -40 -40 40 -40 0 40 -40 -40 N
|
||||
P 4 0 1 0 40 40 30 40 -40 40 -40 20 N
|
||||
P 4 0 1 0 140 -190 60 -190 100 -110 140 -190 N
|
||||
P 4 0 1 0 140 110 60 110 100 190 140 110 N
|
||||
X IO1 1 -500 -100 200 R 50 50 1 1 P
|
||||
X GND 2 0 -500 200 U 50 50 1 1 P
|
||||
X IO2 3 500 -100 200 L 50 50 1 1 P
|
||||
X IO2 4 500 100 200 L 50 50 1 1 P
|
||||
X VBUS 5 0 500 200 D 50 50 1 1 P
|
||||
X IO1 6 -500 100 200 R 50 50 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# Regulator_Linear_AP2112K-3.3
|
||||
#
|
||||
DEF Regulator_Linear_AP2112K-3.3 U 0 10 Y Y 1 F N
|
||||
F0 "U" -200 225 50 H V L CNN
|
||||
F1 "Regulator_Linear_AP2112K-3.3" 0 225 50 H V L CNN
|
||||
F2 "Package_TO_SOT_SMD:SOT-23-5" 0 325 50 H I C CNN
|
||||
F3 "" 0 100 50 H I C CNN
|
||||
ALIAS AP2204K-1.8 AP2204K-2.5 AP2204K-2.8 AP2204K-3.0 AP2204K-3.3 AP2204K-5.0 AP2127K-1.0 AP2127K-1.2 AP2127K-1.5 AP2127K-1.8 AP2127K-2.5 AP2127K-2.8 AP2127K-3.0 AP2127K-3.3 AP2127K-4.2 AP2127K-4.75 AP2112K-1.2 AP2112K-1.8 AP2112K-2.5 AP2112K-2.6 AP2112K-3.3
|
||||
$FPLIST
|
||||
SOT?23?5*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
S -200 175 200 -200 0 1 10 f
|
||||
X VIN 1 -300 100 100 R 50 50 1 1 W
|
||||
X GND 2 0 -300 100 U 50 50 1 1 W
|
||||
X EN 3 -300 0 100 R 50 50 1 1 I
|
||||
X NC 4 300 0 100 L 50 50 1 1 N N
|
||||
X VOUT 5 300 100 100 L 50 50 1 1 w
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# Switch_SW_Push
|
||||
#
|
||||
DEF Switch_SW_Push SW 0 40 N N 1 F N
|
||||
F0 "SW" 50 100 50 H V L CNN
|
||||
F1 "Switch_SW_Push" 0 -60 50 H V C CNN
|
||||
F2 "" 0 200 50 H I C CNN
|
||||
F3 "" 0 200 50 H I C CNN
|
||||
DRAW
|
||||
C -80 0 20 0 1 0 N
|
||||
C 80 0 20 0 1 0 N
|
||||
P 2 0 1 0 0 50 0 120 N
|
||||
P 2 0 1 0 100 50 -100 50 N
|
||||
X 1 1 -200 0 100 R 50 50 0 1 P
|
||||
X 2 2 200 0 100 L 50 50 0 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# power_+5V
|
||||
#
|
||||
DEF power_+5V #PWR 0 0 Y Y 1 F P
|
||||
F0 "#PWR" 0 -150 50 H I C CNN
|
||||
F1 "power_+5V" 0 140 50 H V C CNN
|
||||
F2 "" 0 0 50 H I C CNN
|
||||
F3 "" 0 0 50 H I C CNN
|
||||
DRAW
|
||||
P 2 0 1 0 -30 50 0 100 N
|
||||
P 2 0 1 0 0 0 0 100 N
|
||||
P 2 0 1 0 0 100 30 50 N
|
||||
X +5V 1 0 0 0 U 50 50 1 1 W N
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# power_GND
|
||||
#
|
||||
DEF power_GND #PWR 0 0 Y Y 1 F P
|
||||
F0 "#PWR" 0 -250 50 H I C CNN
|
||||
F1 "power_GND" 0 -150 50 H V C CNN
|
||||
F2 "" 0 0 50 H I C CNN
|
||||
F3 "" 0 0 50 H I C CNN
|
||||
DRAW
|
||||
P 6 0 1 0 0 0 0 -50 50 -50 0 -100 -50 -50 0 -50 N
|
||||
X GND 1 0 0 0 D 50 50 1 1 W N
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# power_VCC
|
||||
#
|
||||
DEF power_VCC #PWR 0 0 Y Y 1 F P
|
||||
F0 "#PWR" 0 -150 50 H I C CNN
|
||||
F1 "power_VCC" 0 150 50 H V C CNN
|
||||
F2 "" 0 0 50 H I C CNN
|
||||
F3 "" 0 0 50 H I C CNN
|
||||
DRAW
|
||||
C 0 75 25 0 1 0 N
|
||||
P 2 0 1 0 0 0 0 50 N
|
||||
X VCC 1 0 0 0 U 50 50 1 1 W N
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# power_VDD
|
||||
#
|
||||
DEF power_VDD #PWR 0 0 Y Y 1 F P
|
||||
F0 "#PWR" 0 -150 50 H I C CNN
|
||||
F1 "power_VDD" 0 150 50 H V C CNN
|
||||
F2 "" 0 0 50 H I C CNN
|
||||
F3 "" 0 0 50 H I C CNN
|
||||
DRAW
|
||||
C 0 75 25 0 1 0 N
|
||||
P 2 0 1 0 0 0 0 50 N
|
||||
X VDD 1 0 0 0 U 50 50 1 1 W N
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# power_VDDA
|
||||
#
|
||||
DEF power_VDDA #PWR 0 0 Y Y 1 F P
|
||||
F0 "#PWR" 0 -150 50 H I C CNN
|
||||
F1 "power_VDDA" 0 150 50 H V C CNN
|
||||
F2 "" 0 0 50 H I C CNN
|
||||
F3 "" 0 0 50 H I C CNN
|
||||
DRAW
|
||||
C 0 75 25 0 1 0 N
|
||||
P 2 0 1 0 0 0 0 50 N
|
||||
X VDDA 1 0 0 0 U 50 50 1 1 W N
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# power_VSS
|
||||
#
|
||||
DEF power_VSS #PWR 0 0 Y Y 1 F P
|
||||
F0 "#PWR" 0 -150 50 H I C CNN
|
||||
F1 "power_VSS" 0 150 50 H V C CNN
|
||||
F2 "" 0 0 50 H I C CNN
|
||||
F3 "" 0 0 50 H I C CNN
|
||||
DRAW
|
||||
C 0 75 25 0 1 0 N
|
||||
P 2 0 1 0 0 0 0 50 N
|
||||
X VSS 1 0 0 0 U 50 50 1 1 W N
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# power_VSSA
|
||||
#
|
||||
DEF power_VSSA #PWR 0 0 Y Y 1 F P
|
||||
F0 "#PWR" 0 -150 50 H I C CNN
|
||||
F1 "power_VSSA" 0 150 50 H V C CNN
|
||||
F2 "" 0 0 50 H I C CNN
|
||||
F3 "" 0 0 50 H I C CNN
|
||||
DRAW
|
||||
C 0 75 25 0 1 0 N
|
||||
P 2 0 1 0 0 0 0 50 N
|
||||
X VSSA 1 0 0 0 U 50 50 1 1 W N
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
#End Library
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,242 +0,0 @@
|
|||
update=Fri 31 Jan 2020 17:38:06 GMT
|
||||
version=1
|
||||
last_client=kicad
|
||||
[general]
|
||||
version=1
|
||||
RootSch=
|
||||
BoardNm=
|
||||
[cvpcb]
|
||||
version=1
|
||||
NetIExt=net
|
||||
[eeschema]
|
||||
version=1
|
||||
LibDir=
|
||||
[eeschema/libraries]
|
||||
[pcbnew]
|
||||
version=1
|
||||
PageLayoutDescrFile=
|
||||
LastNetListRead=
|
||||
CopperLayerCount=2
|
||||
BoardThickness=1.6
|
||||
AllowMicroVias=0
|
||||
AllowBlindVias=0
|
||||
RequireCourtyardDefinitions=0
|
||||
ProhibitOverlappingCourtyards=1
|
||||
MinTrackWidth=0.127
|
||||
MinViaDiameter=0.45
|
||||
MinViaDrill=0.2
|
||||
MinMicroViaDiameter=0.2
|
||||
MinMicroViaDrill=0.09999999999999999
|
||||
MinHoleToHole=0.25
|
||||
TrackWidth1=0.127
|
||||
TrackWidth2=0.3
|
||||
TrackWidth3=0.4
|
||||
ViaDiameter1=0.6
|
||||
ViaDrill1=0.3
|
||||
ViaDiameter2=0.45
|
||||
ViaDrill2=0.2
|
||||
dPairWidth1=0.2
|
||||
dPairGap1=0.25
|
||||
dPairViaGap1=0.25
|
||||
SilkLineWidth=0.12
|
||||
SilkTextSizeV=1
|
||||
SilkTextSizeH=1
|
||||
SilkTextSizeThickness=0.15
|
||||
SilkTextItalic=0
|
||||
SilkTextUpright=1
|
||||
CopperLineWidth=0.2
|
||||
CopperTextSizeV=1.5
|
||||
CopperTextSizeH=1.5
|
||||
CopperTextThickness=0.3
|
||||
CopperTextItalic=0
|
||||
CopperTextUpright=1
|
||||
EdgeCutLineWidth=0.05
|
||||
CourtyardLineWidth=0.05
|
||||
OthersLineWidth=0.15
|
||||
OthersTextSizeV=1
|
||||
OthersTextSizeH=1
|
||||
OthersTextSizeThickness=0.15
|
||||
OthersTextItalic=0
|
||||
OthersTextUpright=1
|
||||
SolderMaskClearance=0.051
|
||||
SolderMaskMinWidth=0.09999999999999999
|
||||
SolderPasteClearance=0
|
||||
SolderPasteRatio=-0
|
||||
[pcbnew/Layer.F.Cu]
|
||||
Name=F.Cu
|
||||
Type=0
|
||||
Enabled=1
|
||||
[pcbnew/Layer.In1.Cu]
|
||||
Name=In1.Cu
|
||||
Type=0
|
||||
Enabled=0
|
||||
[pcbnew/Layer.In2.Cu]
|
||||
Name=In2.Cu
|
||||
Type=0
|
||||
Enabled=0
|
||||
[pcbnew/Layer.In3.Cu]
|
||||
Name=In3.Cu
|
||||
Type=0
|
||||
Enabled=0
|
||||
[pcbnew/Layer.In4.Cu]
|
||||
Name=In4.Cu
|
||||
Type=0
|
||||
Enabled=0
|
||||
[pcbnew/Layer.In5.Cu]
|
||||
Name=In5.Cu
|
||||
Type=0
|
||||
Enabled=0
|
||||
[pcbnew/Layer.In6.Cu]
|
||||
Name=In6.Cu
|
||||
Type=0
|
||||
Enabled=0
|
||||
[pcbnew/Layer.In7.Cu]
|
||||
Name=In7.Cu
|
||||
Type=0
|
||||
Enabled=0
|
||||
[pcbnew/Layer.In8.Cu]
|
||||
Name=In8.Cu
|
||||
Type=0
|
||||
Enabled=0
|
||||
[pcbnew/Layer.In9.Cu]
|
||||
Name=In9.Cu
|
||||
Type=0
|
||||
Enabled=0
|
||||
[pcbnew/Layer.In10.Cu]
|
||||
Name=In10.Cu
|
||||
Type=0
|
||||
Enabled=0
|
||||
[pcbnew/Layer.In11.Cu]
|
||||
Name=In11.Cu
|
||||
Type=0
|
||||
Enabled=0
|
||||
[pcbnew/Layer.In12.Cu]
|
||||
Name=In12.Cu
|
||||
Type=0
|
||||
Enabled=0
|
||||
[pcbnew/Layer.In13.Cu]
|
||||
Name=In13.Cu
|
||||
Type=0
|
||||
Enabled=0
|
||||
[pcbnew/Layer.In14.Cu]
|
||||
Name=In14.Cu
|
||||
Type=0
|
||||
Enabled=0
|
||||
[pcbnew/Layer.In15.Cu]
|
||||
Name=In15.Cu
|
||||
Type=0
|
||||
Enabled=0
|
||||
[pcbnew/Layer.In16.Cu]
|
||||
Name=In16.Cu
|
||||
Type=0
|
||||
Enabled=0
|
||||
[pcbnew/Layer.In17.Cu]
|
||||
Name=In17.Cu
|
||||
Type=0
|
||||
Enabled=0
|
||||
[pcbnew/Layer.In18.Cu]
|
||||
Name=In18.Cu
|
||||
Type=0
|
||||
Enabled=0
|
||||
[pcbnew/Layer.In19.Cu]
|
||||
Name=In19.Cu
|
||||
Type=0
|
||||
Enabled=0
|
||||
[pcbnew/Layer.In20.Cu]
|
||||
Name=In20.Cu
|
||||
Type=0
|
||||
Enabled=0
|
||||
[pcbnew/Layer.In21.Cu]
|
||||
Name=In21.Cu
|
||||
Type=0
|
||||
Enabled=0
|
||||
[pcbnew/Layer.In22.Cu]
|
||||
Name=In22.Cu
|
||||
Type=0
|
||||
Enabled=0
|
||||
[pcbnew/Layer.In23.Cu]
|
||||
Name=In23.Cu
|
||||
Type=0
|
||||
Enabled=0
|
||||
[pcbnew/Layer.In24.Cu]
|
||||
Name=In24.Cu
|
||||
Type=0
|
||||
Enabled=0
|
||||
[pcbnew/Layer.In25.Cu]
|
||||
Name=In25.Cu
|
||||
Type=0
|
||||
Enabled=0
|
||||
[pcbnew/Layer.In26.Cu]
|
||||
Name=In26.Cu
|
||||
Type=0
|
||||
Enabled=0
|
||||
[pcbnew/Layer.In27.Cu]
|
||||
Name=In27.Cu
|
||||
Type=0
|
||||
Enabled=0
|
||||
[pcbnew/Layer.In28.Cu]
|
||||
Name=In28.Cu
|
||||
Type=0
|
||||
Enabled=0
|
||||
[pcbnew/Layer.In29.Cu]
|
||||
Name=In29.Cu
|
||||
Type=0
|
||||
Enabled=0
|
||||
[pcbnew/Layer.In30.Cu]
|
||||
Name=In30.Cu
|
||||
Type=0
|
||||
Enabled=0
|
||||
[pcbnew/Layer.B.Cu]
|
||||
Name=B.Cu
|
||||
Type=0
|
||||
Enabled=1
|
||||
[pcbnew/Layer.B.Adhes]
|
||||
Enabled=1
|
||||
[pcbnew/Layer.F.Adhes]
|
||||
Enabled=1
|
||||
[pcbnew/Layer.B.Paste]
|
||||
Enabled=1
|
||||
[pcbnew/Layer.F.Paste]
|
||||
Enabled=1
|
||||
[pcbnew/Layer.B.SilkS]
|
||||
Enabled=1
|
||||
[pcbnew/Layer.F.SilkS]
|
||||
Enabled=1
|
||||
[pcbnew/Layer.B.Mask]
|
||||
Enabled=1
|
||||
[pcbnew/Layer.F.Mask]
|
||||
Enabled=1
|
||||
[pcbnew/Layer.Dwgs.User]
|
||||
Enabled=1
|
||||
[pcbnew/Layer.Cmts.User]
|
||||
Enabled=1
|
||||
[pcbnew/Layer.Eco1.User]
|
||||
Enabled=1
|
||||
[pcbnew/Layer.Eco2.User]
|
||||
Enabled=1
|
||||
[pcbnew/Layer.Edge.Cuts]
|
||||
Enabled=1
|
||||
[pcbnew/Layer.Margin]
|
||||
Enabled=1
|
||||
[pcbnew/Layer.B.CrtYd]
|
||||
Enabled=1
|
||||
[pcbnew/Layer.F.CrtYd]
|
||||
Enabled=1
|
||||
[pcbnew/Layer.B.Fab]
|
||||
Enabled=1
|
||||
[pcbnew/Layer.F.Fab]
|
||||
Enabled=1
|
||||
[pcbnew/Layer.Rescue]
|
||||
Enabled=0
|
||||
[pcbnew/Netclasses]
|
||||
[pcbnew/Netclasses/Default]
|
||||
Name=Default
|
||||
Clearance=0.127
|
||||
TrackWidth=0.127
|
||||
ViaDiameter=0.6
|
||||
ViaDrill=0.3
|
||||
uViaDiameter=0.3
|
||||
uViaDrill=0.1
|
||||
dPairWidth=0.2
|
||||
dPairGap=0.25
|
||||
dPairViaGap=0.25
|
||||
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue