2016年4月20日 星期三

Ultrasound Study

1. How Ultrasound Works (1:40)
    https://www.youtube.com/watch?v=I1Bdp2tMFsY

2. Ultrasound Podcast - Physics Basics
    https://www.youtube.com/watch?v=HcQ3SHPgHbY&ebc=ANyPxKqhti7EgbbtYiC8SfKoZ4AFq6268OdidcYp070sGkHf0uPApYcU4qXerblF4t85DHlAN0Jciy8X0R86piQegNDaYjpeLA

3. Basics of ultrasound machine
https://www.youtube.com/watch?v=JqVGgq5bE-Y

2016年4月19日 星期二

power generator - Chinese

http://www.materialsnet.com.tw/DocPrint.aspx?id=7338

【主要技术参数】
(一)电气参数:(灯来后摇动一分钟)
1.
充电电池规格镍氢3.6V40mAh
2.
线圈最高输出电压56V
3.
最高贮存电压4.5V
4.
最大工作电流:20-30mA
5.
最高亮度:≥45000~60000MCD
6.
光亮时间:≥30分钟;(单灯30分;三灯约20分钟)
from http://www.wjw.cn/product/mbr060918193230163980/pro070302133723118655.xhtml
mechanically powered flashlight. This uses a linear generator and is charged by shaking along its long axis.

2016年4月7日 星期四

General USB Device Classes


IAR and CCS are both available in free, code-size-limited versions (8K and 16K, respectively, of object code). Simple applications having no MSC interface can be run on both free versions. Applications having an MSC interface (and thus a larger application to implement the storage volume) generally don’t fit under 8K; for this reason, the free IAR Kickstart won’t build them. Instead, the free version of CCS can be used, or a licensed version of either environment.

The API is the foundation of the MSP430 USB Developers Package. It supports three of the most common USB device classes: • Communications Device Class (CDC): (ACM class) Results in a virtual COM port on the host • Human Interface Device class (HID): The MSP430 USB Developers Package defines four subtypes: – Datapipe (an unformatted general-purpose interface resembling CDC) – Mouse – Keyboard – Custom • Mass Storage Class (MSC): When the host sees an MSC interface, it begins mounting a storage volume from it.
  • ...The MSP430 MSC device, when attached to a USB host, displays as a storage volume on the operating system. The MSC protocol receives and executes SCSI commands from the host and uses the SCSI transparent command set for its use. All handling of SCSI commands is performed automatically by the MSP430 USB API stack with some support by the application.
  • A primary purpose of the MSC protocol is to receive and execute SCSI commands from the host. SCSI (Small Computer System Interface, pronounced “scuzzy”) is a set of specifications covering various levels of protocol, including a physical cable interface. One of the SCSI command sets – the SCSI transparent command set – has been adopted for use with the MSC protocol. This is the command set supported by this API.
  • When the host sends a SCSI command over the MSC protocol, it designates the LUN for which the command is intended. If the command reads/writes data, it also includes the LBA being accessed and the number of sequential blocks requested. Since the API must rely on the application to make the file system access calls when a SCSI read or write command is received, the API makes the SCSI command’s LUN, initial LBA, and number of requested blocks available to the application. Only one SCSI command at a time can be handled by an MSC interface. This means that if a command is received for LUN 0, it must be handled in full before a command can be received for LUN 1. For this reason, only a single interchange buffer is needed for the interface (or two, if double-buffering is used). (The current API version only supports single-buffering.) 
  • The MSC API automatically handles all SCSI commands required to function with the target host operating systems, based on information it receives from the application. The list of SCSI commands includes: • INQUIRY • REQUEST SENSE • TEST UNIT READY • READ • WRITE • READ CAPACITY • MODE SENSE • REPORT LUNS 
  • http://uglyduck.ath.cx/PDF/TexasInstruments/MSP430/usblib430/Programmers_Guide_MSP430_USB_API.pdf
  • Every USB application with an MSC interface must call this function regularly to check for any SCSI commands received from the host. The USB MSC interface is essentially a carrier for the same SCSI commands used with many non-USB storage devices that are commonly used with computers. In other words, the interface is essentially "SCSI-over-USB".
  • http://datasheet.octopart.com/MSP-EXP430F5529LP-Texas-Instruments-datasheet-17794772.pdf
  • SCSI

    Hard drives, flash drives, and other USB mass-storage devices support commands in the SCSI Primary Command (SPC) Set and SCSI Block Command (SBC) Set fromwww.t10.org (INCITS Technical Committee T10).
  •  http://pollos-blog.blogspot.tw/2014/10/usb-mass-storage-class.html --> Command structure

2016年3月28日 星期一

2016年3月15日 星期二

BLE UUID 128-bit and 16-bit

Use 128-bit UUID to find service

// BLE Base 128-bit UUID: 0000XXXX-0000-1000-8000-00805F9B34FB
// TI Base 128-bit UUID: F000XXXX-0451-4000-B000-000000000000
#define BLE_BASE_UUID_128( uuid )  0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00, 0x80, \
                                  0x00, 0x10, 0x00, 0x00, LO_UINT16( uuid ), HI_UINT16( uuid ), 0x00, 0x00

uint8 uuid[ATT_UUID_SIZE] = { BLE_BASE_UUID_128( CURRENT_TIME_SERV_UUID ) };

        GATT_DiscPrimaryServiceByUUID( timeAppConnHandle, uuid,
                                       ATT_UUID_SIZE, timeAppTaskId );

reference:
CC2541连接ANCS服务
http://yangchong89.lofter.com/tag/cc2541


https://github.com/oroce/BLE-CC254x-1.4.0/blob/master/Projects/ble/OADManager/Source/oad_mgr_app.c

* @fn oadManagerSvcDiscovery
*
* @brief OAD Service discovery.
*
* @return none
*/
static void oadManagerSvcDiscovery(void)
{
uint8 oadServUUID[ATT_UUID_SIZE] = { TI_BASE_UUID_128( OAD_SERVICE_UUID ) };
// Initialize service discovery variables
oadSvcStartHdl = oadSvcEndHdl = 0;
if (GATT_DiscPrimaryServiceByUUID(oadManagerConnHandle, oadServUUID,
ATT_UUID_SIZE, oadManagerTaskId) != SUCCESS)
{
(void)osal_set_event(oadManagerTaskId, SVC_DISCOVERY_EVT);
}
}


/** * @brief This sub-procedure is used by a client to discover a specific * primary service on a server when only the Service UUID is * known. The primary specific service may exist multiple times * on a server. The primary service being discovered is identified * by the service UUID. * * The ATT Find By Type Value Request is used with the Attribute * Type parameter set to the UUID for "Primary Service" and the * Attribute Value set to the 16-bit Bluetooth UUID or 128-bit * UUID for the specific primary service. The Starting Handle shall * be set to 0x0001 and the Ending Handle shall be set to 0xFFFF. * * If the return status from this function is SUCCESS, the calling * application task will receive multiple OSAL GATT_MSG_EVENT messages. * The type of the messages will be either ATT_FIND_BY_TYPE_VALUE_RSP * or ATT_ERROR_RSP (if an error occurred on the server). * * Note: This sub-procedure is complete when either ATT_FIND_BY_TYPE_VALUE_RSP * (with bleProcedureComplete or bleTimeout status) or ATT_ERROR_RSP * (with SUCCESS status) is received by the calling application task. * * @param connHandle - connection to use * @param pUUID - pointer to service UUID to look for * @param len - length of value * @param taskId - task to be notified of response * * @return SUCCESS: Request was sent successfully.<BR> * INVALIDPARAMETER: Invalid connection handle or request field.<BR> * MSG_BUFFER_NOT_AVAIL: No HCI buffer is available.<BR> * bleNotConnected: Connection is down.<BR> * blePending: A response is pending with this server.<BR> * bleMemAllocError: Memory allocation error occurred.<BR> * bleTimeout: Previous transaction timed out.<BR> */ extern bStatus_t GATT_DiscPrimaryServiceByUUID( uint16 connHandle, uint8 *pUUID, uint8 len, uint8 taskId );

2016年2月17日 星期三

photocap

PhotoCap是一個影像處理軟體,由台灣程式設計師王俊昌所開發。這個軟體原先的開發動機單純只是要在數位相片上加上日期標記。演變至今已經變成一個非常好用的小型數位影像編修軟體。
個人、家庭或學校教育單位等非商業營利用途免費,商業用途每套一次收費新台幣500至2000元不等。
from wikipedia

最近剛好需要用到批次加日期於照片的功能, 下載之前就用過台灣人開發的軟體, 推薦給大家使用;

2015年12月23日 星期三