一般在DC值需要改变时,可以加一个延时,如下
void LCD_DriverWriteCmd(uint8_t cmd)
{
if(dc_value==DC_DATA)
{
cpu_delay(10); //for 24Mhz. mask this, lower speed ,need this
LCD_DC_CMD; //change DC value
dc_value = DC_CMD; //record current DC value.
}
ssp_put_byte_x(ssp1,cmd);
}
pupilcool
@pupilcool
Posts made by pupilcool
-
RE: SPI的DC与通讯速率有关
-
RE: 遥控器开发
遥控器开发,主要有广播内容,绑定加密,三个profile,device_info, battery,hid。 以及键盘扫描 ,如果有需要语音功能的话,需要知道机顶盒的语音压缩格式。
这里有一个基于8010H SDK的 示例, -
RE: gap_security_pairing_req
这个函数是向 从机发起绑定。 gap_security_pairing_req()调用后,会先进行绑定操作,绑定之后会进行加密操作,加密成功后,底层会上传GAP_SEC_EVT_MASTER_ENCRYPT 的回调事件。
如果要扫描对端的service,可以在上面的回调事件之后需要使用gatt_discovery_all_peer_svc()函数或gatt_discovery_peer_svc()来扫描对端的service。
-
RE: 请问LED2的电压可以调整么?
@zhouzhigang LED2相当于一个只能用于输出的GPIO,驱动能力有限,最大12mA。LDO脚可以当做VBAT 给其他设备供电。 驱动能力120mA
-
RE: pwm输出
这个可以的。801xH的芯片有两种pwm,一个是数字模块的pwm,精度是cpu的运行频率,12M,24M,48M。 如果是48M的cpu时钟的话,pwm的输出精度是48M HZ。 具体的参考代码如下:
system_set_port_mux(GPIO_PORT_D,GPIO_BIT_4,PORTD4_FUNC_PWM4);
system_set_port_mux(GPIO_PORT_D,GPIO_BIT_5,PORTD5_FUNC_PWM5);
pwm_init(PWM_CHANNEL_4,32768,50);
pwm_init(PWM_CHANNEL_5,32768,50);
pwm_start(PWM_CHANNEL_4);
pwm_start(PWM_CHANNEL_5);
数字模块的pwm,在启动sleep后,会停止运行。另一种是pmu的pwm模块,这个模块在启动sleep后,依然能运行,它的时钟精度是sleep低速时钟的精度,即最大32KHz。参考代码如下:
pmu_pwm_init();
pmu_set_pin_to_PMU(GPIO_PORT_D, BIT(4)|BIT(5));
pmu_set_pin_dir(GPIO_PORT_D, BIT(4)|BIT(5),GPIO_DIR_OUT);
pmu_set_port_mux(GPIO_PORT_D,GPIO_BIT_4,PMU_PORT_MUX_PWM);
pmu_set_port_mux(GPIO_PORT_D,GPIO_BIT_5,PMU_PORT_MUX_PWM);
pmu_pwm_set_param(GPIO_PORT_D,GPIO_BIT_4,1,1);
pmu_pwm_set_param(GPIO_PORT_D,GPIO_BIT_5,1,1);
pmu_pwm_start(GPIO_PORT_D,GPIO_BIT_4,true,0);
pmu_pwm_start(GPIO_PORT_D,GPIO_BIT_5,true,0);
两种pwm的示例代码都能在 driver_demos这个工程里的demo_pwm() 和demo_pmu_pwm() 找到。 -
RE: AES128解码有无对应API
有的,SDK的159的版本app.h会有appm_use_aes128_decryption函数可以进行aes128的解密。 demo_basci_function工程中user_proj_main()入口函数有示例代码。 如下:
void get_aes128_decryption(void *arg)
{
struct gapm_use_enc_block_ind *param = (struct gapm_use_enc_block_ind *)arg;
printf("get_aes128_decryption: ");
show_reg2(param->result,KEY_LEN,1);
printf("\r\n");
}
void get_aes128_rst(void *arg)
{
struct gapm_use_enc_block_ind *param = (struct gapm_use_enc_block_ind *)arg;
printf("aes128: ");
show_reg2(param->result,KEY_LEN,1);
printf("\r\n");uint8_t key[] = "0000000000000000"; appm_use_aes128_decryption(key,param->result,get_aes128_decryption);
}
void user_proj_main(void)
{
uint8_t plaintext[] = "0000000000000001";
uint8_t key[] = "0000000000000000";
appm_use_aes128_block(key,plaintext,get_aes128_rst);
} -
RE: Error: Flash Download failed - "Cortex-M3"
如果是运行的程序里面把PC6,PC7 配置为其他的用途了,非JlinK的用途,比如AT的bin文件就把PC6,PC7配置为GPIO了。 此时,jlink是失效的。把一个没有使用PC6,PC7bin文件下载进芯片,就又可以使用jlink调试功能了